htt.h 635 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152
  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. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. */
  201. #define HTT_CURRENT_VERSION_MAJOR 3
  202. #define HTT_CURRENT_VERSION_MINOR 82
  203. #define HTT_NUM_TX_FRAG_DESC 1024
  204. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  205. #define HTT_CHECK_SET_VAL(field, val) \
  206. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  207. /* macros to assist in sign-extending fields from HTT messages */
  208. #define HTT_SIGN_BIT_MASK(field) \
  209. ((field ## _M + (1 << field ## _S)) >> 1)
  210. #define HTT_SIGN_BIT(_val, field) \
  211. (_val & HTT_SIGN_BIT_MASK(field))
  212. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  213. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  214. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  215. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  216. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  217. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  218. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  219. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  220. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  221. /*
  222. * TEMPORARY:
  223. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  224. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  225. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  226. * updated.
  227. */
  228. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  229. /*
  230. * TEMPORARY:
  231. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  232. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  233. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  234. * updated.
  235. */
  236. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  237. /* HTT Access Category values */
  238. enum HTT_AC_WMM {
  239. /* WMM Access Categories */
  240. HTT_AC_WMM_BE = 0x0,
  241. HTT_AC_WMM_BK = 0x1,
  242. HTT_AC_WMM_VI = 0x2,
  243. HTT_AC_WMM_VO = 0x3,
  244. HTT_NUM_AC_WMM = 0x4,
  245. /* extension Access Categories */
  246. HTT_AC_EXT_NON_QOS = 0x4,
  247. HTT_AC_EXT_UCAST_MGMT = 0x5,
  248. HTT_AC_EXT_MCAST_DATA = 0x6,
  249. HTT_AC_EXT_MCAST_MGMT = 0x7,
  250. };
  251. enum HTT_AC_WMM_MASK {
  252. /* WMM Access Categories */
  253. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  254. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  255. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  256. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  257. /* extension Access Categories */
  258. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  259. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  260. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  261. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  262. };
  263. #define HTT_AC_MASK_WMM \
  264. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  265. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  266. #define HTT_AC_MASK_EXT \
  267. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  268. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  269. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  270. /*
  271. * htt_dbg_stats_type -
  272. * bit positions for each stats type within a stats type bitmask
  273. * The bitmask contains 24 bits.
  274. */
  275. enum htt_dbg_stats_type {
  276. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  277. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  278. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  279. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  280. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  281. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  282. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  283. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  284. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  285. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  286. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  287. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  288. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  289. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  290. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  291. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  292. /* bits 16-23 currently reserved */
  293. /* keep this last */
  294. HTT_DBG_NUM_STATS
  295. };
  296. /*=== HTT option selection TLVs ===
  297. * Certain HTT messages have alternatives or options.
  298. * For such cases, the host and target need to agree on which option to use.
  299. * Option specification TLVs can be appended to the VERSION_REQ and
  300. * VERSION_CONF messages to select options other than the default.
  301. * These TLVs are entirely optional - if they are not provided, there is a
  302. * well-defined default for each option. If they are provided, they can be
  303. * provided in any order. Each TLV can be present or absent independent of
  304. * the presence / absence of other TLVs.
  305. *
  306. * The HTT option selection TLVs use the following format:
  307. * |31 16|15 8|7 0|
  308. * |---------------------------------+----------------+----------------|
  309. * | value (payload) | length | tag |
  310. * |-------------------------------------------------------------------|
  311. * The value portion need not be only 2 bytes; it can be extended by any
  312. * integer number of 4-byte units. The total length of the TLV, including
  313. * the tag and length fields, must be a multiple of 4 bytes. The length
  314. * field specifies the total TLV size in 4-byte units. Thus, the typical
  315. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  316. * field, would store 0x1 in its length field, to show that the TLV occupies
  317. * a single 4-byte unit.
  318. */
  319. /*--- TLV header format - applies to all HTT option TLVs ---*/
  320. enum HTT_OPTION_TLV_TAGS {
  321. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  322. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  323. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  324. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  325. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  326. };
  327. PREPACK struct htt_option_tlv_header_t {
  328. A_UINT8 tag;
  329. A_UINT8 length;
  330. } POSTPACK;
  331. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  332. #define HTT_OPTION_TLV_TAG_S 0
  333. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  334. #define HTT_OPTION_TLV_LENGTH_S 8
  335. /*
  336. * value0 - 16 bit value field stored in word0
  337. * The TLV's value field may be longer than 2 bytes, in which case
  338. * the remainder of the value is stored in word1, word2, etc.
  339. */
  340. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  341. #define HTT_OPTION_TLV_VALUE0_S 16
  342. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_TAG_GET(word) \
  348. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  349. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  355. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  356. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  362. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  363. /*--- format of specific HTT option TLVs ---*/
  364. /*
  365. * HTT option TLV for specifying LL bus address size
  366. * Some chips require bus addresses used by the target to access buffers
  367. * within the host's memory to be 32 bits; others require bus addresses
  368. * used by the target to access buffers within the host's memory to be
  369. * 64 bits.
  370. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  371. * a suffix to the VERSION_CONF message to specify which bus address format
  372. * the target requires.
  373. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  374. * default to providing bus addresses to the target in 32-bit format.
  375. */
  376. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying whether HL systems should indicate
  386. * over-the-air tx completion for individual frames, or should instead
  387. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  388. * requests an OTA tx completion for a particular tx frame.
  389. * This option does not apply to LL systems, where the TX_COMPL_IND
  390. * is mandatory.
  391. * This option is primarily intended for HL systems in which the tx frame
  392. * downloads over the host --> target bus are as slow as or slower than
  393. * the transmissions over the WLAN PHY. For cases where the bus is faster
  394. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  395. * and consquently will send one TX_COMPL_IND message that covers several
  396. * tx frames. For cases where the WLAN PHY is faster than the bus,
  397. * the target will end up transmitting very short A-MPDUs, and consequently
  398. * sending many TX_COMPL_IND messages, which each cover a very small number
  399. * of tx frames.
  400. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  401. * a suffix to the VERSION_REQ message to request whether the host desires to
  402. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  403. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  404. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  405. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  406. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  407. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  408. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  409. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  410. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  411. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  412. * TLV.
  413. */
  414. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  415. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  416. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  417. };
  418. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying how many tx queue groups the target
  424. * may establish.
  425. * This TLV specifies the maximum value the target may send in the
  426. * txq_group_id field of any TXQ_GROUP information elements sent by
  427. * the target to the host. This allows the host to pre-allocate an
  428. * appropriate number of tx queue group structs.
  429. *
  430. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  431. * a suffix to the VERSION_REQ message to specify whether the host supports
  432. * tx queue groups at all, and if so if there is any limit on the number of
  433. * tx queue groups that the host supports.
  434. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  435. * a suffix to the VERSION_CONF message. If the host has specified in the
  436. * VER_REQ message a limit on the number of tx queue groups the host can
  437. * supprt, the target shall limit its specification of the maximum tx groups
  438. * to be no larger than this host-specified limit.
  439. *
  440. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  441. * shall preallocate 4 tx queue group structs, and the target shall not
  442. * specify a txq_group_id larger than 3.
  443. */
  444. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  446. /*
  447. * values 1 through N specify the max number of tx queue groups
  448. * the sender supports
  449. */
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  451. };
  452. /* TEMPORARY backwards-compatibility alias for a typo fix -
  453. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  454. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  455. * to support the old name (with the typo) until all references to the
  456. * old name are replaced with the new name.
  457. */
  458. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  459. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  462. } POSTPACK;
  463. /*
  464. * HTT option TLV for specifying whether the target supports an extended
  465. * version of the HTT tx descriptor. If the target provides this TLV
  466. * and specifies in the TLV that the target supports an extended version
  467. * of the HTT tx descriptor, the target must check the "extension" bit in
  468. * the HTT tx descriptor, and if the extension bit is set, to expect a
  469. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  470. * descriptor. Furthermore, the target must provide room for the HTT
  471. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  472. * This option is intended for systems where the host needs to explicitly
  473. * control the transmission parameters such as tx power for individual
  474. * tx frames.
  475. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  476. * as a suffix to the VERSION_CONF message to explicitly specify whether
  477. * the target supports the HTT tx MSDU extension descriptor.
  478. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  479. * by the host as lack of target support for the HTT tx MSDU extension
  480. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  481. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  482. * the HTT tx MSDU extension descriptor.
  483. * The host is not required to provide the HTT tx MSDU extension descriptor
  484. * just because the target supports it; the target must check the
  485. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  486. * extension descriptor is present.
  487. */
  488. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  491. };
  492. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  493. struct htt_option_tlv_header_t hdr;
  494. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  495. } POSTPACK;
  496. /*=== host -> target messages ===============================================*/
  497. enum htt_h2t_msg_type {
  498. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  499. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  500. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  501. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  502. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  503. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  504. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  505. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  506. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  507. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  508. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  509. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  510. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  511. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  512. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  513. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  514. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  515. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  516. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  517. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  518. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  519. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  520. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  521. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  522. /* keep this last */
  523. HTT_H2T_NUM_MSGS
  524. };
  525. /*
  526. * HTT host to target message type -
  527. * stored in bits 7:0 of the first word of the message
  528. */
  529. #define HTT_H2T_MSG_TYPE_M 0xff
  530. #define HTT_H2T_MSG_TYPE_S 0
  531. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  532. do { \
  533. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  534. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  535. } while (0)
  536. #define HTT_H2T_MSG_TYPE_GET(word) \
  537. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  538. /**
  539. * @brief host -> target version number request message definition
  540. *
  541. * |31 24|23 16|15 8|7 0|
  542. * |----------------+----------------+----------------+----------------|
  543. * | reserved | msg type |
  544. * |-------------------------------------------------------------------|
  545. * : option request TLV (optional) |
  546. * :...................................................................:
  547. *
  548. * The VER_REQ message may consist of a single 4-byte word, or may be
  549. * extended with TLVs that specify which HTT options the host is requesting
  550. * from the target.
  551. * The following option TLVs may be appended to the VER_REQ message:
  552. * - HL_SUPPRESS_TX_COMPL_IND
  553. * - HL_MAX_TX_QUEUE_GROUPS
  554. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  555. * may be appended to the VER_REQ message (but only one TLV of each type).
  556. *
  557. * Header fields:
  558. * - MSG_TYPE
  559. * Bits 7:0
  560. * Purpose: identifies this as a version number request message
  561. * Value: 0x0
  562. */
  563. #define HTT_VER_REQ_BYTES 4
  564. /* TBDXXX: figure out a reasonable number */
  565. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  566. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  567. /**
  568. * @brief HTT tx MSDU descriptor
  569. *
  570. * @details
  571. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  572. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  573. * the target firmware needs for the FW's tx processing, particularly
  574. * for creating the HW msdu descriptor.
  575. * The same HTT tx descriptor is used for HL and LL systems, though
  576. * a few fields within the tx descriptor are used only by LL or
  577. * only by HL.
  578. * The HTT tx descriptor is defined in two manners: by a struct with
  579. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  580. * definitions.
  581. * The target should use the struct def, for simplicitly and clarity,
  582. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  583. * neutral. Specifically, the host shall use the get/set macros built
  584. * around the mask + shift defs.
  585. */
  586. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  587. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  588. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  589. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  590. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  591. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  592. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  593. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  594. #define HTT_TX_VDEV_ID_WORD 0
  595. #define HTT_TX_VDEV_ID_MASK 0x3f
  596. #define HTT_TX_VDEV_ID_SHIFT 16
  597. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  598. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  599. #define HTT_TX_MSDU_LEN_DWORD 1
  600. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  601. /*
  602. * HTT_VAR_PADDR macros
  603. * Allow physical / bus addresses to be either a single 32-bit value,
  604. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  605. */
  606. #define HTT_VAR_PADDR32(var_name) \
  607. A_UINT32 var_name
  608. #define HTT_VAR_PADDR64_LE(var_name) \
  609. struct { \
  610. /* little-endian: lo precedes hi */ \
  611. A_UINT32 lo; \
  612. A_UINT32 hi; \
  613. } var_name
  614. /*
  615. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  616. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  617. * addresses are stored in a XXX-bit field.
  618. * This macro is used to define both htt_tx_msdu_desc32_t and
  619. * htt_tx_msdu_desc64_t structs.
  620. */
  621. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  622. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  623. { \
  624. /* DWORD 0: flags and meta-data */ \
  625. A_UINT32 \
  626. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  627. \
  628. /* pkt_subtype - \
  629. * Detailed specification of the tx frame contents, extending the \
  630. * general specification provided by pkt_type. \
  631. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  632. * pkt_type | pkt_subtype \
  633. * ============================================================== \
  634. * 802.3 | bit 0:3 - Reserved \
  635. * | bit 4: 0x0 - Copy-Engine Classification Results \
  636. * | not appended to the HTT message \
  637. * | 0x1 - Copy-Engine Classification Results \
  638. * | appended to the HTT message in the \
  639. * | format: \
  640. * | [HTT tx desc, frame header, \
  641. * | CE classification results] \
  642. * | The CE classification results begin \
  643. * | at the next 4-byte boundary after \
  644. * | the frame header. \
  645. * ------------+------------------------------------------------- \
  646. * Eth2 | 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. * native WiFi | bit 0:3 - Reserved \
  655. * | bit 4: 0x0 - Copy-Engine Classification Results \
  656. * | not appended to the HTT message \
  657. * | 0x1 - Copy-Engine Classification Results \
  658. * | appended to the HTT message. \
  659. * | See the above specification of the \
  660. * | CE classification results location. \
  661. * ------------+------------------------------------------------- \
  662. * mgmt | 0x0 - 802.11 MAC header absent \
  663. * | 0x1 - 802.11 MAC header present \
  664. * ------------+------------------------------------------------- \
  665. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  666. * | 0x1 - 802.11 MAC header present \
  667. * | bit 1: 0x0 - allow aggregation \
  668. * | 0x1 - don't allow aggregation \
  669. * | bit 2: 0x0 - perform encryption \
  670. * | 0x1 - don't perform encryption \
  671. * | bit 3: 0x0 - perform tx classification / queuing \
  672. * | 0x1 - don't perform tx classification; \
  673. * | insert the frame into the "misc" \
  674. * | tx queue \
  675. * | bit 4: 0x0 - Copy-Engine Classification Results \
  676. * | not appended to the HTT message \
  677. * | 0x1 - Copy-Engine Classification Results \
  678. * | appended to the HTT message. \
  679. * | See the above specification of the \
  680. * | CE classification results location. \
  681. */ \
  682. pkt_subtype: 5, \
  683. \
  684. /* pkt_type - \
  685. * General specification of the tx frame contents. \
  686. * The htt_pkt_type enum should be used to specify and check the \
  687. * value of this field. \
  688. */ \
  689. pkt_type: 3, \
  690. \
  691. /* vdev_id - \
  692. * ID for the vdev that is sending this tx frame. \
  693. * For certain non-standard packet types, e.g. pkt_type == raw \
  694. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  695. * This field is used primarily for determining where to queue \
  696. * broadcast and multicast frames. \
  697. */ \
  698. vdev_id: 6, \
  699. /* ext_tid - \
  700. * The extended traffic ID. \
  701. * If the TID is unknown, the extended TID is set to \
  702. * HTT_TX_EXT_TID_INVALID. \
  703. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  704. * value of the QoS TID. \
  705. * If the tx frame is non-QoS data, then the extended TID is set to \
  706. * HTT_TX_EXT_TID_NON_QOS. \
  707. * If the tx frame is multicast or broadcast, then the extended TID \
  708. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  709. */ \
  710. ext_tid: 5, \
  711. \
  712. /* postponed - \
  713. * This flag indicates whether the tx frame has been downloaded to \
  714. * the target before but discarded by the target, and now is being \
  715. * downloaded again; or if this is a new frame that is being \
  716. * downloaded for the first time. \
  717. * This flag allows the target to determine the correct order for \
  718. * transmitting new vs. old frames. \
  719. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  720. * This flag only applies to HL systems, since in LL systems, \
  721. * the tx flow control is handled entirely within the target. \
  722. */ \
  723. postponed: 1, \
  724. \
  725. /* extension - \
  726. * This flag indicates whether a HTT tx MSDU extension descriptor \
  727. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  728. * \
  729. * 0x0 - no extension MSDU descriptor is present \
  730. * 0x1 - an extension MSDU descriptor immediately follows the \
  731. * regular MSDU descriptor \
  732. */ \
  733. extension: 1, \
  734. \
  735. /* cksum_offload - \
  736. * This flag indicates whether checksum offload is enabled or not \
  737. * for this frame. Target FW use this flag to turn on HW checksumming \
  738. * 0x0 - No checksum offload \
  739. * 0x1 - L3 header checksum only \
  740. * 0x2 - L4 checksum only \
  741. * 0x3 - L3 header checksum + L4 checksum \
  742. */ \
  743. cksum_offload: 2, \
  744. \
  745. /* tx_comp_req - \
  746. * This flag indicates whether Tx Completion \
  747. * from fw is required or not. \
  748. * This flag is only relevant if tx completion is not \
  749. * universally enabled. \
  750. * For all LL systems, tx completion is mandatory, \
  751. * so this flag will be irrelevant. \
  752. * For HL systems tx completion is optional, but HL systems in which \
  753. * the bus throughput exceeds the WLAN throughput will \
  754. * probably want to always use tx completion, and thus \
  755. * would not check this flag. \
  756. * This flag is required when tx completions are not used universally, \
  757. * but are still required for certain tx frames for which \
  758. * an OTA delivery acknowledgment is needed by the host. \
  759. * In practice, this would be for HL systems in which the \
  760. * bus throughput is less than the WLAN throughput. \
  761. * \
  762. * 0x0 - Tx Completion Indication from Fw not required \
  763. * 0x1 - Tx Completion Indication from Fw is required \
  764. */ \
  765. tx_compl_req: 1; \
  766. \
  767. \
  768. /* DWORD 1: MSDU length and ID */ \
  769. A_UINT32 \
  770. len: 16, /* MSDU length, in bytes */ \
  771. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  772. * and this id is used to calculate fragmentation \
  773. * descriptor pointer inside the target based on \
  774. * the base address, configured inside the target. \
  775. */ \
  776. \
  777. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  778. /* frags_desc_ptr - \
  779. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  780. * where the tx frame's fragments reside in memory. \
  781. * This field only applies to LL systems, since in HL systems the \
  782. * (degenerate single-fragment) fragmentation descriptor is created \
  783. * within the target. \
  784. */ \
  785. _paddr__frags_desc_ptr_; \
  786. \
  787. /* DWORD 3 (or 4): peerid, chanfreq */ \
  788. /* \
  789. * Peer ID : Target can use this value to know which peer-id packet \
  790. * destined to. \
  791. * It's intended to be specified by host in case of NAWDS. \
  792. */ \
  793. A_UINT16 peerid; \
  794. \
  795. /* \
  796. * Channel frequency: This identifies the desired channel \
  797. * frequency (in mhz) for tx frames. This is used by FW to help \
  798. * determine when it is safe to transmit or drop frames for \
  799. * off-channel operation. \
  800. * The default value of zero indicates to FW that the corresponding \
  801. * VDEV's home channel (if there is one) is the desired channel \
  802. * frequency. \
  803. */ \
  804. A_UINT16 chanfreq; \
  805. \
  806. /* Reason reserved is commented is increasing the htt structure size \
  807. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  808. * A_UINT32 reserved_dword3_bits0_31; \
  809. */ \
  810. } POSTPACK
  811. /* define a htt_tx_msdu_desc32_t type */
  812. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  813. /* define a htt_tx_msdu_desc64_t type */
  814. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  815. /*
  816. * Make htt_tx_msdu_desc_t be an alias for either
  817. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  818. */
  819. #if HTT_PADDR64
  820. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  821. #else
  822. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  823. #endif
  824. /* decriptor information for Management frame*/
  825. /*
  826. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  827. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  828. */
  829. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  830. extern A_UINT32 mgmt_hdr_len;
  831. PREPACK struct htt_mgmt_tx_desc_t {
  832. A_UINT32 msg_type;
  833. #if HTT_PADDR64
  834. A_UINT64 frag_paddr; /* DMAble address of the data */
  835. #else
  836. A_UINT32 frag_paddr; /* DMAble address of the data */
  837. #endif
  838. A_UINT32 desc_id; /* returned to host during completion
  839. * to free the meory*/
  840. A_UINT32 len; /* Fragment length */
  841. A_UINT32 vdev_id; /* virtual device ID*/
  842. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  843. } POSTPACK;
  844. PREPACK struct htt_mgmt_tx_compl_ind {
  845. A_UINT32 desc_id;
  846. A_UINT32 status;
  847. } POSTPACK;
  848. /*
  849. * This SDU header size comes from the summation of the following:
  850. * 1. Max of:
  851. * a. Native WiFi header, for native WiFi frames: 24 bytes
  852. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  853. * b. 802.11 header, for raw frames: 36 bytes
  854. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  855. * QoS header, HT header)
  856. * c. 802.3 header, for ethernet frames: 14 bytes
  857. * (destination address, source address, ethertype / length)
  858. * 2. Max of:
  859. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  860. * b. IPv6 header, up through the Traffic Class: 2 bytes
  861. * 3. 802.1Q VLAN header: 4 bytes
  862. * 4. LLC/SNAP header: 8 bytes
  863. */
  864. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  865. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  866. #define HTT_TX_HDR_SIZE_ETHERNET 14
  867. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  868. A_COMPILE_TIME_ASSERT(
  869. htt_encap_hdr_size_max_check_nwifi,
  870. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  871. A_COMPILE_TIME_ASSERT(
  872. htt_encap_hdr_size_max_check_enet,
  873. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  874. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  875. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  876. #define HTT_TX_HDR_SIZE_802_1Q 4
  877. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  878. #define HTT_COMMON_TX_FRM_HDR_LEN \
  879. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  880. HTT_TX_HDR_SIZE_802_1Q + \
  881. HTT_TX_HDR_SIZE_LLC_SNAP)
  882. #define HTT_HL_TX_FRM_HDR_LEN \
  883. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  884. #define HTT_LL_TX_FRM_HDR_LEN \
  885. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  886. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  887. /* dword 0 */
  888. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  891. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  892. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  893. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  895. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  896. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  897. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  898. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  899. #define HTT_TX_DESC_PKT_TYPE_S 13
  900. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  901. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  902. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  903. #define HTT_TX_DESC_VDEV_ID_S 16
  904. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  905. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  906. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  907. #define HTT_TX_DESC_EXT_TID_S 22
  908. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  909. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  910. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  911. #define HTT_TX_DESC_POSTPONED_S 27
  912. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  913. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  914. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  915. #define HTT_TX_DESC_EXTENSION_S 28
  916. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  917. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  918. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  919. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  920. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  921. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  922. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  923. #define HTT_TX_DESC_TX_COMP_S 31
  924. /* dword 1 */
  925. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  926. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  927. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  928. #define HTT_TX_DESC_FRM_LEN_S 0
  929. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  930. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  931. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  932. #define HTT_TX_DESC_FRM_ID_S 16
  933. /* dword 2 */
  934. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  935. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  936. /* for systems using 64-bit format for bus addresses */
  937. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  938. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  939. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  940. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  941. /* for systems using 32-bit format for bus addresses */
  942. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  943. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  944. /* dword 3 */
  945. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  946. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  947. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  948. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  949. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  950. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  951. #if HTT_PADDR64
  952. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  953. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  954. #else
  955. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  956. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  957. #endif
  958. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  959. #define HTT_TX_DESC_PEER_ID_S 0
  960. /*
  961. * TEMPORARY:
  962. * The original definitions for the PEER_ID fields contained typos
  963. * (with _DESC_PADDR appended to this PEER_ID field name).
  964. * Retain deprecated original names for PEER_ID fields until all code that
  965. * refers to them has been updated.
  966. */
  967. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  968. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  969. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  970. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  971. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  972. HTT_TX_DESC_PEER_ID_M
  973. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  974. HTT_TX_DESC_PEER_ID_S
  975. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  976. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  977. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  978. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  979. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  980. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  981. #if HTT_PADDR64
  982. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  983. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  984. #else
  985. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  986. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  987. #endif
  988. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  989. #define HTT_TX_DESC_CHAN_FREQ_S 16
  990. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  991. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  992. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  993. do { \
  994. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  995. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  996. } while (0)
  997. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  998. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  999. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1000. do { \
  1001. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1002. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1003. } while (0)
  1004. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1005. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1006. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1007. do { \
  1008. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1009. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1010. } while (0)
  1011. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1012. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1013. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1014. do { \
  1015. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1016. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1017. } while (0)
  1018. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1019. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1020. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1021. do { \
  1022. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1023. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1024. } while (0)
  1025. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1026. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1027. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1028. do { \
  1029. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1030. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1031. } while (0)
  1032. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1033. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1034. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1035. do { \
  1036. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1037. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1038. } while (0)
  1039. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1040. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1041. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1042. do { \
  1043. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1044. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1045. } while (0)
  1046. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1047. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1048. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1049. do { \
  1050. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1051. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1052. } while (0)
  1053. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1054. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1055. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1056. do { \
  1057. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1058. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1059. } while (0)
  1060. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1061. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1062. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1063. do { \
  1064. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1065. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1066. } while (0)
  1067. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1068. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1069. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1070. do { \
  1071. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1072. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1073. } while (0)
  1074. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1075. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1076. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1077. do { \
  1078. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1079. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1080. } while (0)
  1081. /* enums used in the HTT tx MSDU extension descriptor */
  1082. enum {
  1083. htt_tx_guard_interval_regular = 0,
  1084. htt_tx_guard_interval_short = 1,
  1085. };
  1086. enum {
  1087. htt_tx_preamble_type_ofdm = 0,
  1088. htt_tx_preamble_type_cck = 1,
  1089. htt_tx_preamble_type_ht = 2,
  1090. htt_tx_preamble_type_vht = 3,
  1091. };
  1092. enum {
  1093. htt_tx_bandwidth_5MHz = 0,
  1094. htt_tx_bandwidth_10MHz = 1,
  1095. htt_tx_bandwidth_20MHz = 2,
  1096. htt_tx_bandwidth_40MHz = 3,
  1097. htt_tx_bandwidth_80MHz = 4,
  1098. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1099. };
  1100. /**
  1101. * @brief HTT tx MSDU extension descriptor
  1102. * @details
  1103. * If the target supports HTT tx MSDU extension descriptors, the host has
  1104. * the option of appending the following struct following the regular
  1105. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1106. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1107. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1108. * tx specs for each frame.
  1109. */
  1110. PREPACK struct htt_tx_msdu_desc_ext_t {
  1111. /* DWORD 0: flags */
  1112. A_UINT32
  1113. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1114. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1115. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1116. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1117. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1118. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1119. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1120. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1121. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1122. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1123. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1124. /* DWORD 1: tx power, tx rate, tx BW */
  1125. A_UINT32
  1126. /* pwr -
  1127. * Specify what power the tx frame needs to be transmitted at.
  1128. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1129. * The value needs to be appropriately sign-extended when extracting
  1130. * the value from the message and storing it in a variable that is
  1131. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1132. * automatically handles this sign-extension.)
  1133. * If the transmission uses multiple tx chains, this power spec is
  1134. * the total transmit power, assuming incoherent combination of
  1135. * per-chain power to produce the total power.
  1136. */
  1137. pwr: 8,
  1138. /* mcs_mask -
  1139. * Specify the allowable values for MCS index (modulation and coding)
  1140. * to use for transmitting the frame.
  1141. *
  1142. * For HT / VHT preamble types, this mask directly corresponds to
  1143. * the HT or VHT MCS indices that are allowed. For each bit N set
  1144. * within the mask, MCS index N is allowed for transmitting the frame.
  1145. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1146. * rates versus OFDM rates, so the host has the option of specifying
  1147. * that the target must transmit the frame with CCK or OFDM rates
  1148. * (not HT or VHT), but leaving the decision to the target whether
  1149. * to use CCK or OFDM.
  1150. *
  1151. * For CCK and OFDM, the bits within this mask are interpreted as
  1152. * follows:
  1153. * bit 0 -> CCK 1 Mbps rate is allowed
  1154. * bit 1 -> CCK 2 Mbps rate is allowed
  1155. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1156. * bit 3 -> CCK 11 Mbps rate is allowed
  1157. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1158. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1159. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1160. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1161. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1162. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1163. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1164. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1165. *
  1166. * The MCS index specification needs to be compatible with the
  1167. * bandwidth mask specification. For example, a MCS index == 9
  1168. * specification is inconsistent with a preamble type == VHT,
  1169. * Nss == 1, and channel bandwidth == 20 MHz.
  1170. *
  1171. * Furthermore, the host has only a limited ability to specify to
  1172. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1173. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1174. */
  1175. mcs_mask: 12,
  1176. /* nss_mask -
  1177. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1178. * Each bit in this mask corresponds to a Nss value:
  1179. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1180. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1181. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1182. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1183. * The values in the Nss mask must be suitable for the recipient, e.g.
  1184. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1185. * recipient which only supports 2x2 MIMO.
  1186. */
  1187. nss_mask: 4,
  1188. /* guard_interval -
  1189. * Specify a htt_tx_guard_interval enum value to indicate whether
  1190. * the transmission should use a regular guard interval or a
  1191. * short guard interval.
  1192. */
  1193. guard_interval: 1,
  1194. /* preamble_type_mask -
  1195. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1196. * may choose from for transmitting this frame.
  1197. * The bits in this mask correspond to the values in the
  1198. * htt_tx_preamble_type enum. For example, to allow the target
  1199. * to transmit the frame as either CCK or OFDM, this field would
  1200. * be set to
  1201. * (1 << htt_tx_preamble_type_ofdm) |
  1202. * (1 << htt_tx_preamble_type_cck)
  1203. */
  1204. preamble_type_mask: 4,
  1205. reserved1_31_29: 3; /* unused, set to 0x0 */
  1206. /* DWORD 2: tx chain mask, tx retries */
  1207. A_UINT32
  1208. /* chain_mask - specify which chains to transmit from */
  1209. chain_mask: 4,
  1210. /* retry_limit -
  1211. * Specify the maximum number of transmissions, including the
  1212. * initial transmission, to attempt before giving up if no ack
  1213. * is received.
  1214. * If the tx rate is specified, then all retries shall use the
  1215. * same rate as the initial transmission.
  1216. * If no tx rate is specified, the target can choose whether to
  1217. * retain the original rate during the retransmissions, or to
  1218. * fall back to a more robust rate.
  1219. */
  1220. retry_limit: 4,
  1221. /* bandwidth_mask -
  1222. * Specify what channel widths may be used for the transmission.
  1223. * A value of zero indicates "don't care" - the target may choose
  1224. * the transmission bandwidth.
  1225. * The bits within this mask correspond to the htt_tx_bandwidth
  1226. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1227. * The bandwidth_mask must be consistent with the preamble_type_mask
  1228. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1229. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1230. */
  1231. bandwidth_mask: 6,
  1232. reserved2_31_14: 18; /* unused, set to 0x0 */
  1233. /* DWORD 3: tx expiry time (TSF) LSBs */
  1234. A_UINT32 expire_tsf_lo;
  1235. /* DWORD 4: tx expiry time (TSF) MSBs */
  1236. A_UINT32 expire_tsf_hi;
  1237. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1238. } POSTPACK;
  1239. /* DWORD 0 */
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1260. /* DWORD 1 */
  1261. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1262. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1263. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1264. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1265. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1266. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1267. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1268. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1269. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1270. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1271. /* DWORD 2 */
  1272. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1273. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1274. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1275. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1276. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1277. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1278. /* DWORD 0 */
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL( \
  1301. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1302. ((_var) |= ((_val) \
  1303. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL( \
  1311. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1312. ((_var) |= ((_val) \
  1313. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1314. } while (0)
  1315. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1322. } while (0)
  1323. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1330. } while (0)
  1331. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1354. } while (0)
  1355. /* DWORD 1 */
  1356. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1360. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1361. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1362. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1363. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1364. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1365. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1366. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1367. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1368. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1372. } while (0)
  1373. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1380. } while (0)
  1381. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1382. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1383. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1384. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1388. } while (0)
  1389. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1390. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1391. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1392. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1393. do { \
  1394. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1395. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1396. } while (0)
  1397. /* DWORD 2 */
  1398. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1399. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1400. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1401. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1402. do { \
  1403. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1404. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1405. } while (0)
  1406. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1407. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1408. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1409. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1410. do { \
  1411. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1412. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1413. } while (0)
  1414. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1415. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1416. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1417. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1418. do { \
  1419. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1420. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1421. } while (0)
  1422. typedef enum {
  1423. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1424. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1425. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1426. } htt_11ax_ltf_subtype_t;
  1427. typedef enum {
  1428. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1429. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1430. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1431. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1432. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1433. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1434. } htt_tx_ext2_preamble_type_t;
  1435. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1436. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1437. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1438. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1439. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1440. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1441. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1442. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1443. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1444. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1445. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1446. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1447. /**
  1448. * @brief HTT tx MSDU extension descriptor v2
  1449. * @details
  1450. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1451. * is received as tcl_exit_base->host_meta_info in firmware.
  1452. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1453. * are already part of tcl_exit_base.
  1454. */
  1455. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1456. /* DWORD 0: flags */
  1457. A_UINT32
  1458. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1459. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1460. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1461. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1462. valid_retries : 1, /* if set, tx retries spec is valid */
  1463. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1464. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1465. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1466. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1467. valid_key_flags : 1, /* if set, key flags is valid */
  1468. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1469. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1470. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1471. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1472. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1473. 1 = ENCRYPT,
  1474. 2 ~ 3 - Reserved */
  1475. /* retry_limit -
  1476. * Specify the maximum number of transmissions, including the
  1477. * initial transmission, to attempt before giving up if no ack
  1478. * is received.
  1479. * If the tx rate is specified, then all retries shall use the
  1480. * same rate as the initial transmission.
  1481. * If no tx rate is specified, the target can choose whether to
  1482. * retain the original rate during the retransmissions, or to
  1483. * fall back to a more robust rate.
  1484. */
  1485. retry_limit : 4,
  1486. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1487. * Valid only for 11ax preamble types HE_SU
  1488. * and HE_EXT_SU
  1489. */
  1490. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1491. * Valid only for 11ax preamble types HE_SU
  1492. * and HE_EXT_SU
  1493. */
  1494. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1495. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1496. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1497. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1498. */
  1499. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1500. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1501. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1502. * Use cases:
  1503. * Any time firmware uses TQM-BYPASS for Data
  1504. * TID, firmware expect host to set this bit.
  1505. */
  1506. /* DWORD 1: tx power, tx rate */
  1507. A_UINT32
  1508. power : 8, /* unit of the power field is 0.5 dbm
  1509. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1510. * signed value ranging from -64dbm to 63.5 dbm
  1511. */
  1512. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1513. * Setting more than one MCS isn't currently
  1514. * supported by the target (but is supported
  1515. * in the interface in case in the future
  1516. * the target supports specifications of
  1517. * a limited set of MCS values.
  1518. */
  1519. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1520. * Setting more than one Nss isn't currently
  1521. * supported by the target (but is supported
  1522. * in the interface in case in the future
  1523. * the target supports specifications of
  1524. * a limited set of Nss values.
  1525. */
  1526. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1527. update_peer_cache : 1; /* When set these custom values will be
  1528. * used for all packets, until the next
  1529. * update via this ext header.
  1530. * This is to make sure not all packets
  1531. * need to include this header.
  1532. */
  1533. /* DWORD 2: tx chain mask, tx retries */
  1534. A_UINT32
  1535. /* chain_mask - specify which chains to transmit from */
  1536. chain_mask : 8,
  1537. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1538. * TODO: Update Enum values for key_flags
  1539. */
  1540. /*
  1541. * Channel frequency: This identifies the desired channel
  1542. * frequency (in MHz) for tx frames. This is used by FW to help
  1543. * determine when it is safe to transmit or drop frames for
  1544. * off-channel operation.
  1545. * The default value of zero indicates to FW that the corresponding
  1546. * VDEV's home channel (if there is one) is the desired channel
  1547. * frequency.
  1548. */
  1549. chanfreq : 16;
  1550. /* DWORD 3: tx expiry time (TSF) LSBs */
  1551. A_UINT32 expire_tsf_lo;
  1552. /* DWORD 4: tx expiry time (TSF) MSBs */
  1553. A_UINT32 expire_tsf_hi;
  1554. /* DWORD 5: flags to control routing / processing of the MSDU */
  1555. A_UINT32
  1556. /* learning_frame
  1557. * When this flag is set, this frame will be dropped by FW
  1558. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1559. */
  1560. learning_frame : 1,
  1561. /* send_as_standalone
  1562. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1563. * i.e. with no A-MSDU or A-MPDU aggregation.
  1564. * The scope is extended to other use-cases.
  1565. */
  1566. send_as_standalone : 1,
  1567. /* is_host_opaque_valid
  1568. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1569. * with valid information.
  1570. */
  1571. is_host_opaque_valid : 1,
  1572. rsvd0 : 29;
  1573. /* DWORD 6 : Host opaque cookie for special frames */
  1574. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1575. rsvd1 : 16;
  1576. /*
  1577. * This structure can be expanded further up to 40 bytes
  1578. * by adding further DWORDs as needed.
  1579. */
  1580. } POSTPACK;
  1581. /* DWORD 0 */
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1608. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1609. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1610. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1611. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1612. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1613. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1614. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1615. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1616. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1617. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1618. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1619. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1620. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1621. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1622. /* DWORD 1 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1624. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1625. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1626. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1627. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1628. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1629. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1630. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1631. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1632. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1633. /* DWORD 2 */
  1634. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1635. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1636. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1637. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1638. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1639. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1640. /* DWORD 5 */
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1647. /* DWORD 6 */
  1648. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1649. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1650. /* DWORD 0 */
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL( \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1682. ((_var) |= ((_val) \
  1683. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL( \
  1707. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1708. ((_var) |= ((_val) \
  1709. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1750. } while (0)
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1755. do { \
  1756. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1757. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1758. } while (0)
  1759. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1760. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1761. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1762. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1763. do { \
  1764. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1765. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1766. } while (0)
  1767. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1768. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1769. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1770. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1771. do { \
  1772. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1773. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1774. } while (0)
  1775. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1776. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1777. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1778. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1779. do { \
  1780. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1781. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1782. } while (0)
  1783. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1784. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1785. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1786. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1787. do { \
  1788. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1789. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1790. } while (0)
  1791. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1797. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1798. } while (0)
  1799. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1806. } while (0)
  1807. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1814. } while (0)
  1815. /* DWORD 1 */
  1816. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1820. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1821. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1822. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1823. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1824. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1825. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1848. } while (0)
  1849. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1850. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1851. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1852. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1855. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1856. } while (0)
  1857. /* DWORD 2 */
  1858. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1865. } while (0)
  1866. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1867. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1868. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1869. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1872. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1873. } while (0)
  1874. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1875. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1876. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1877. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1878. do { \
  1879. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1880. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1881. } while (0)
  1882. /* DWORD 5 */
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1890. } while (0)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1892. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1893. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1897. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1898. } while (0)
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1900. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1901. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1903. do { \
  1904. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1905. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1906. } while (0)
  1907. /* DWORD 6 */
  1908. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1909. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1910. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1911. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1912. do { \
  1913. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1914. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1915. } while (0)
  1916. typedef enum {
  1917. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1918. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1919. } htt_tcl_metadata_type;
  1920. /**
  1921. * @brief HTT TCL command number format
  1922. * @details
  1923. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1924. * available to firmware as tcl_exit_base->tcl_status_number.
  1925. * For regular / multicast packets host will send vdev and mac id and for
  1926. * NAWDS packets, host will send peer id.
  1927. * A_UINT32 is used to avoid endianness conversion problems.
  1928. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1929. */
  1930. typedef struct {
  1931. A_UINT32
  1932. type: 1, /* vdev_id based or peer_id based */
  1933. rsvd: 31;
  1934. } htt_tx_tcl_vdev_or_peer_t;
  1935. typedef struct {
  1936. A_UINT32
  1937. type: 1, /* vdev_id based or peer_id based */
  1938. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1939. vdev_id: 8,
  1940. pdev_id: 2,
  1941. host_inspected:1,
  1942. rsvd: 19;
  1943. } htt_tx_tcl_vdev_metadata;
  1944. typedef struct {
  1945. A_UINT32
  1946. type: 1, /* vdev_id based or peer_id based */
  1947. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1948. peer_id: 14,
  1949. rsvd: 16;
  1950. } htt_tx_tcl_peer_metadata;
  1951. PREPACK struct htt_tx_tcl_metadata {
  1952. union {
  1953. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1954. htt_tx_tcl_vdev_metadata vdev_meta;
  1955. htt_tx_tcl_peer_metadata peer_meta;
  1956. };
  1957. } POSTPACK;
  1958. /* DWORD 0 */
  1959. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1960. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1961. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1962. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1963. /* VDEV metadata */
  1964. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1965. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1966. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1967. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1968. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1969. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1970. /* PEER metadata */
  1971. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1972. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1973. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1974. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1975. HTT_TX_TCL_METADATA_TYPE_S)
  1976. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1980. } while (0)
  1981. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1982. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1983. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1984. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1988. } while (0)
  1989. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1990. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1991. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1992. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1996. } while (0)
  1997. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1998. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1999. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2000. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2004. } while (0)
  2005. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2006. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2007. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2008. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2012. } while (0)
  2013. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2014. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2015. HTT_TX_TCL_METADATA_PEER_ID_S)
  2016. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2020. } while (0)
  2021. typedef enum {
  2022. HTT_TX_FW2WBM_TX_STATUS_OK,
  2023. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2024. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2025. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2026. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2027. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2028. HTT_TX_FW2WBM_TX_STATUS_MAX
  2029. } htt_tx_fw2wbm_tx_status_t;
  2030. typedef enum {
  2031. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2032. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2033. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2034. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2035. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2036. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2037. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2038. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2039. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2040. } htt_tx_fw2wbm_reinject_reason_t;
  2041. /**
  2042. * @brief HTT TX WBM Completion from firmware to host
  2043. * @details
  2044. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2045. * DWORD 3 and 4 for software based completions (Exception frames and
  2046. * TQM bypass frames)
  2047. * For software based completions, wbm_release_ring->release_source_module will
  2048. * be set to release_source_fw
  2049. */
  2050. PREPACK struct htt_tx_wbm_completion {
  2051. A_UINT32
  2052. sch_cmd_id: 24,
  2053. exception_frame: 1, /* If set, this packet was queued via exception path */
  2054. rsvd0_31_25: 7;
  2055. A_UINT32
  2056. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2057. * reception of an ACK or BA, this field indicates
  2058. * the RSSI of the received ACK or BA frame.
  2059. * When the frame is removed as result of a direct
  2060. * remove command from the SW, this field is set
  2061. * to 0x0 (which is never a valid value when real
  2062. * RSSI is available).
  2063. * Units: dB w.r.t noise floor
  2064. */
  2065. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2066. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2067. rsvd1_31_16: 16;
  2068. } POSTPACK;
  2069. /* DWORD 0 */
  2070. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2071. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2072. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2073. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2074. /* DWORD 1 */
  2075. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2076. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2077. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2078. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2079. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2080. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2081. /* DWORD 0 */
  2082. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2083. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2084. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2085. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2089. } while (0)
  2090. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2091. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2092. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2093. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2097. } while (0)
  2098. /* DWORD 1 */
  2099. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2100. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2101. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2102. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2106. } while (0)
  2107. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2108. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2109. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2110. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2114. } while (0)
  2115. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2116. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2117. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2118. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2119. do { \
  2120. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2121. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2122. } while (0)
  2123. /**
  2124. * @brief HTT TX WBM Completion from firmware to host
  2125. * @details
  2126. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2127. * (WBM) offload HW.
  2128. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2129. * For software based completions, release_source_module will
  2130. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2131. * struct wbm_release_ring and then switch to this after looking at
  2132. * release_source_module.
  2133. */
  2134. PREPACK struct htt_tx_wbm_completion_v2 {
  2135. A_UINT32
  2136. used_by_hw0; /* Refer to struct wbm_release_ring */
  2137. A_UINT32
  2138. used_by_hw1; /* Refer to struct wbm_release_ring */
  2139. A_UINT32
  2140. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2141. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2142. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2143. exception_frame: 1,
  2144. rsvd0: 12, /* For future use */
  2145. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2146. rsvd1: 1; /* For future use */
  2147. A_UINT32
  2148. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2149. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2150. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2151. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2152. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2153. */
  2154. A_UINT32
  2155. data1: 32;
  2156. A_UINT32
  2157. data2: 32;
  2158. A_UINT32
  2159. used_by_hw3; /* Refer to struct wbm_release_ring */
  2160. } POSTPACK;
  2161. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2162. /* DWORD 3 */
  2163. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2164. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2165. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2166. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2167. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2168. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2169. /* DWORD 3 */
  2170. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2171. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2172. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2173. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2177. } while (0)
  2178. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2179. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2180. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2181. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2182. do { \
  2183. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2184. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2185. } while (0)
  2186. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2187. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2188. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2189. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2190. do { \
  2191. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2192. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2193. } while (0)
  2194. /**
  2195. * @brief HTT TX WBM transmit status from firmware to host
  2196. * @details
  2197. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2198. * (WBM) offload HW.
  2199. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2200. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2201. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2202. */
  2203. PREPACK struct htt_tx_wbm_transmit_status {
  2204. A_UINT32
  2205. sch_cmd_id: 24,
  2206. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2207. * reception of an ACK or BA, this field indicates
  2208. * the RSSI of the received ACK or BA frame.
  2209. * When the frame is removed as result of a direct
  2210. * remove command from the SW, this field is set
  2211. * to 0x0 (which is never a valid value when real
  2212. * RSSI is available).
  2213. * Units: dB w.r.t noise floor
  2214. */
  2215. A_UINT32
  2216. sw_peer_id: 16,
  2217. tid_num: 5,
  2218. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2219. * and tid_num fields contain valid data.
  2220. * If this "valid" flag is not set, the
  2221. * sw_peer_id and tid_num fields must be ignored.
  2222. */
  2223. mcast: 1,
  2224. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2225. * contains valid data.
  2226. */
  2227. reserved0: 8;
  2228. A_UINT32
  2229. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2230. * packets in the wbm completion path
  2231. */
  2232. } POSTPACK;
  2233. /* DWORD 4 */
  2234. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2235. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2236. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2237. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2238. /* DWORD 5 */
  2239. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2240. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2241. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2242. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2243. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2244. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2245. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2246. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2247. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2248. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2249. /* DWORD 4 */
  2250. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2252. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2253. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2257. } while (0)
  2258. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2259. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2260. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2261. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2265. } while (0)
  2266. /* DWORD 5 */
  2267. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2268. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2269. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2270. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2274. } while (0)
  2275. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2276. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2277. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2278. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2282. } while (0)
  2283. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2284. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2285. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2286. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2290. } while (0)
  2291. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2292. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2293. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2294. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2298. } while (0)
  2299. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2300. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2301. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2302. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2303. do { \
  2304. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2305. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2306. } while (0)
  2307. /**
  2308. * @brief HTT TX WBM reinject status from firmware to host
  2309. * @details
  2310. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2311. * (WBM) offload HW.
  2312. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2313. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2314. */
  2315. PREPACK struct htt_tx_wbm_reinject_status {
  2316. A_UINT32
  2317. reserved0: 32;
  2318. A_UINT32
  2319. reserved1: 32;
  2320. A_UINT32
  2321. reserved2: 32;
  2322. } POSTPACK;
  2323. /**
  2324. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2325. * @details
  2326. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2327. * (WBM) offload HW.
  2328. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2329. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2330. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2331. * STA side.
  2332. */
  2333. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2334. A_UINT32
  2335. mec_sa_addr_31_0;
  2336. A_UINT32
  2337. mec_sa_addr_47_32: 16,
  2338. sa_ast_index: 16;
  2339. A_UINT32
  2340. vdev_id: 8,
  2341. reserved0: 24;
  2342. } POSTPACK;
  2343. /* DWORD 4 - mec_sa_addr_31_0 */
  2344. /* DWORD 5 */
  2345. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2346. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2347. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2348. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2349. /* DWORD 6 */
  2350. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2351. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2352. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2353. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2354. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2355. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2359. } while (0)
  2360. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2361. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2362. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2363. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2367. } while (0)
  2368. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2369. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2370. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2371. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2372. do { \
  2373. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2374. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2375. } while (0)
  2376. typedef enum {
  2377. TX_FLOW_PRIORITY_BE,
  2378. TX_FLOW_PRIORITY_HIGH,
  2379. TX_FLOW_PRIORITY_LOW,
  2380. } htt_tx_flow_priority_t;
  2381. typedef enum {
  2382. TX_FLOW_LATENCY_SENSITIVE,
  2383. TX_FLOW_LATENCY_INSENSITIVE,
  2384. } htt_tx_flow_latency_t;
  2385. typedef enum {
  2386. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2387. TX_FLOW_INTERACTIVE_TRAFFIC,
  2388. TX_FLOW_PERIODIC_TRAFFIC,
  2389. TX_FLOW_BURSTY_TRAFFIC,
  2390. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2391. } htt_tx_flow_traffic_pattern_t;
  2392. /**
  2393. * @brief HTT TX Flow search metadata format
  2394. * @details
  2395. * Host will set this metadata in flow table's flow search entry along with
  2396. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2397. * firmware and TQM ring if the flow search entry wins.
  2398. * This metadata is available to firmware in that first MSDU's
  2399. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2400. * to one of the available flows for specific tid and returns the tqm flow
  2401. * pointer as part of htt_tx_map_flow_info message.
  2402. */
  2403. PREPACK struct htt_tx_flow_metadata {
  2404. A_UINT32
  2405. rsvd0_1_0: 2,
  2406. tid: 4,
  2407. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2408. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2409. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2410. * Else choose final tid based on latency, priority.
  2411. */
  2412. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2413. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2414. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2415. } POSTPACK;
  2416. /* DWORD 0 */
  2417. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2418. #define HTT_TX_FLOW_METADATA_TID_S 2
  2419. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2420. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2421. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2422. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2423. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2424. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2425. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2426. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2427. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2428. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2429. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2430. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2431. /* DWORD 0 */
  2432. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2433. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2434. HTT_TX_FLOW_METADATA_TID_S)
  2435. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2439. } while (0)
  2440. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2441. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2442. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2443. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2447. } while (0)
  2448. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2449. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2450. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2451. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2455. } while (0)
  2456. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2457. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2458. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2459. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2463. } while (0)
  2464. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2465. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2466. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2467. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2471. } while (0)
  2472. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2473. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2474. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2475. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2476. do { \
  2477. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2478. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2479. } while (0)
  2480. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2481. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2482. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2483. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2486. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2487. } while (0)
  2488. /**
  2489. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2490. *
  2491. * @details
  2492. * HTT wds entry from source port learning
  2493. * Host will learn wds entries from rx and send this message to firmware
  2494. * to enable firmware to configure/delete AST entries for wds clients.
  2495. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2496. * and when SA's entry is deleted, firmware removes this AST entry
  2497. *
  2498. * The message would appear as follows:
  2499. *
  2500. * |31 30|29 |17 16|15 8|7 0|
  2501. * |----------------+----------------+----------------+----------------|
  2502. * | rsvd0 |PDVID| vdev_id | msg_type |
  2503. * |-------------------------------------------------------------------|
  2504. * | sa_addr_31_0 |
  2505. * |-------------------------------------------------------------------|
  2506. * | | ta_peer_id | sa_addr_47_32 |
  2507. * |-------------------------------------------------------------------|
  2508. * Where PDVID = pdev_id
  2509. *
  2510. * The message is interpreted as follows:
  2511. *
  2512. * dword0 - b'0:7 - msg_type: This will be set to
  2513. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2514. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2515. *
  2516. * dword0 - b'8:15 - vdev_id
  2517. *
  2518. * dword0 - b'16:17 - pdev_id
  2519. *
  2520. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2521. *
  2522. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2523. *
  2524. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2525. *
  2526. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2527. */
  2528. PREPACK struct htt_wds_entry {
  2529. A_UINT32
  2530. msg_type: 8,
  2531. vdev_id: 8,
  2532. pdev_id: 2,
  2533. rsvd0: 14;
  2534. A_UINT32 sa_addr_31_0;
  2535. A_UINT32
  2536. sa_addr_47_32: 16,
  2537. ta_peer_id: 14,
  2538. rsvd2: 2;
  2539. } POSTPACK;
  2540. /* DWORD 0 */
  2541. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2542. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2543. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2544. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2545. /* DWORD 2 */
  2546. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2547. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2548. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2549. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2550. /* DWORD 0 */
  2551. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2552. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2553. HTT_WDS_ENTRY_VDEV_ID_S)
  2554. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2555. do { \
  2556. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2557. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2558. } while (0)
  2559. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2560. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2561. HTT_WDS_ENTRY_PDEV_ID_S)
  2562. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2563. do { \
  2564. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2565. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2566. } while (0)
  2567. /* DWORD 2 */
  2568. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2569. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2570. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2571. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2574. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2575. } while (0)
  2576. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2577. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2578. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2579. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2580. do { \
  2581. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2582. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2583. } while (0)
  2584. /**
  2585. * @brief MAC DMA rx ring setup specification
  2586. * @details
  2587. * To allow for dynamic rx ring reconfiguration and to avoid race
  2588. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2589. * it uses. Instead, it sends this message to the target, indicating how
  2590. * the rx ring used by the host should be set up and maintained.
  2591. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2592. * specifications.
  2593. *
  2594. * |31 16|15 8|7 0|
  2595. * |---------------------------------------------------------------|
  2596. * header: | reserved | num rings | msg type |
  2597. * |---------------------------------------------------------------|
  2598. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2599. #if HTT_PADDR64
  2600. * | FW_IDX shadow register physical address (bits 63:32) |
  2601. #endif
  2602. * |---------------------------------------------------------------|
  2603. * | rx ring base physical address (bits 31:0) |
  2604. #if HTT_PADDR64
  2605. * | rx ring base physical address (bits 63:32) |
  2606. #endif
  2607. * |---------------------------------------------------------------|
  2608. * | rx ring buffer size | rx ring length |
  2609. * |---------------------------------------------------------------|
  2610. * | FW_IDX initial value | enabled flags |
  2611. * |---------------------------------------------------------------|
  2612. * | MSDU payload offset | 802.11 header offset |
  2613. * |---------------------------------------------------------------|
  2614. * | PPDU end offset | PPDU start offset |
  2615. * |---------------------------------------------------------------|
  2616. * | MPDU end offset | MPDU start offset |
  2617. * |---------------------------------------------------------------|
  2618. * | MSDU end offset | MSDU start offset |
  2619. * |---------------------------------------------------------------|
  2620. * | frag info offset | rx attention offset |
  2621. * |---------------------------------------------------------------|
  2622. * payload 2, if present, has the same format as payload 1
  2623. * Header fields:
  2624. * - MSG_TYPE
  2625. * Bits 7:0
  2626. * Purpose: identifies this as an rx ring configuration message
  2627. * Value: 0x2
  2628. * - NUM_RINGS
  2629. * Bits 15:8
  2630. * Purpose: indicates whether the host is setting up one rx ring or two
  2631. * Value: 1 or 2
  2632. * Payload:
  2633. * for systems using 64-bit format for bus addresses:
  2634. * - IDX_SHADOW_REG_PADDR_LO
  2635. * Bits 31:0
  2636. * Value: lower 4 bytes of physical address of the host's
  2637. * FW_IDX shadow register
  2638. * - IDX_SHADOW_REG_PADDR_HI
  2639. * Bits 31:0
  2640. * Value: upper 4 bytes of physical address of the host's
  2641. * FW_IDX shadow register
  2642. * - RING_BASE_PADDR_LO
  2643. * Bits 31:0
  2644. * Value: lower 4 bytes of physical address of the host's rx ring
  2645. * - RING_BASE_PADDR_HI
  2646. * Bits 31:0
  2647. * Value: uppper 4 bytes of physical address of the host's rx ring
  2648. * for systems using 32-bit format for bus addresses:
  2649. * - IDX_SHADOW_REG_PADDR
  2650. * Bits 31:0
  2651. * Value: physical address of the host's FW_IDX shadow register
  2652. * - RING_BASE_PADDR
  2653. * Bits 31:0
  2654. * Value: physical address of the host's rx ring
  2655. * - RING_LEN
  2656. * Bits 15:0
  2657. * Value: number of elements in the rx ring
  2658. * - RING_BUF_SZ
  2659. * Bits 31:16
  2660. * Value: size of the buffers referenced by the rx ring, in byte units
  2661. * - ENABLED_FLAGS
  2662. * Bits 15:0
  2663. * Value: 1-bit flags to show whether different rx fields are enabled
  2664. * bit 0: 802.11 header enabled (1) or disabled (0)
  2665. * bit 1: MSDU payload enabled (1) or disabled (0)
  2666. * bit 2: PPDU start enabled (1) or disabled (0)
  2667. * bit 3: PPDU end enabled (1) or disabled (0)
  2668. * bit 4: MPDU start enabled (1) or disabled (0)
  2669. * bit 5: MPDU end enabled (1) or disabled (0)
  2670. * bit 6: MSDU start enabled (1) or disabled (0)
  2671. * bit 7: MSDU end enabled (1) or disabled (0)
  2672. * bit 8: rx attention enabled (1) or disabled (0)
  2673. * bit 9: frag info enabled (1) or disabled (0)
  2674. * bit 10: unicast rx enabled (1) or disabled (0)
  2675. * bit 11: multicast rx enabled (1) or disabled (0)
  2676. * bit 12: ctrl rx enabled (1) or disabled (0)
  2677. * bit 13: mgmt rx enabled (1) or disabled (0)
  2678. * bit 14: null rx enabled (1) or disabled (0)
  2679. * bit 15: phy data rx enabled (1) or disabled (0)
  2680. * - IDX_INIT_VAL
  2681. * Bits 31:16
  2682. * Purpose: Specify the initial value for the FW_IDX.
  2683. * Value: the number of buffers initially present in the host's rx ring
  2684. * - OFFSET_802_11_HDR
  2685. * Bits 15:0
  2686. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2687. * - OFFSET_MSDU_PAYLOAD
  2688. * Bits 31:16
  2689. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2690. * - OFFSET_PPDU_START
  2691. * Bits 15:0
  2692. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2693. * - OFFSET_PPDU_END
  2694. * Bits 31:16
  2695. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2696. * - OFFSET_MPDU_START
  2697. * Bits 15:0
  2698. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2699. * - OFFSET_MPDU_END
  2700. * Bits 31:16
  2701. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2702. * - OFFSET_MSDU_START
  2703. * Bits 15:0
  2704. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2705. * - OFFSET_MSDU_END
  2706. * Bits 31:16
  2707. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2708. * - OFFSET_RX_ATTN
  2709. * Bits 15:0
  2710. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2711. * - OFFSET_FRAG_INFO
  2712. * Bits 31:16
  2713. * Value: offset in QUAD-bytes of frag info table
  2714. */
  2715. /* header fields */
  2716. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2717. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2718. /* payload fields */
  2719. /* for systems using a 64-bit format for bus addresses */
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2724. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2725. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2726. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2727. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2728. /* for systems using a 32-bit format for bus addresses */
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2730. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2731. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2733. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2734. #define HTT_RX_RING_CFG_LEN_S 0
  2735. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2736. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2737. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2738. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2741. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2742. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2743. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2744. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2745. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2746. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2747. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2748. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2749. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2750. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2751. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2752. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2753. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2754. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2755. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2756. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2757. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2758. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2759. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2760. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2761. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2762. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2763. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2764. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2765. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2766. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2767. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2768. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2769. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2770. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2771. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2772. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2775. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2776. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2777. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2778. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2779. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2780. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2781. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2782. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2783. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2784. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2785. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2786. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2787. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2788. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2789. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2790. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2791. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2792. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2793. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2794. #if HTT_PADDR64
  2795. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2796. #else
  2797. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2798. #endif
  2799. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2800. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2801. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2802. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2803. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2804. do { \
  2805. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2806. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2807. } while (0)
  2808. /* degenerate case for 32-bit fields */
  2809. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2810. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2811. ((_var) = (_val))
  2812. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2813. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2814. ((_var) = (_val))
  2815. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2816. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2817. ((_var) = (_val))
  2818. /* degenerate case for 32-bit fields */
  2819. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2820. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2821. ((_var) = (_val))
  2822. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2823. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2824. ((_var) = (_val))
  2825. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2826. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2827. ((_var) = (_val))
  2828. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2829. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2830. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2837. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2840. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2841. } while (0)
  2842. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2843. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2844. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2845. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2846. do { \
  2847. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2848. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2849. } while (0)
  2850. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2851. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2852. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2853. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2854. do { \
  2855. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2856. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2857. } while (0)
  2858. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2859. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2860. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2861. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2862. do { \
  2863. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2864. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2865. } while (0)
  2866. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2867. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2868. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2869. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2872. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2873. } while (0)
  2874. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2875. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2876. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2877. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2880. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2881. } while (0)
  2882. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2883. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2884. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2885. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2886. do { \
  2887. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2888. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2889. } while (0)
  2890. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2891. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2892. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2893. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2894. do { \
  2895. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2896. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2897. } while (0)
  2898. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2899. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2900. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2901. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2902. do { \
  2903. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2904. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2905. } while (0)
  2906. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2907. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2908. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2909. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2910. do { \
  2911. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2912. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2913. } while (0)
  2914. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2915. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2916. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2917. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2918. do { \
  2919. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2920. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2921. } while (0)
  2922. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2923. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2924. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2925. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2926. do { \
  2927. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2928. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2929. } while (0)
  2930. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2931. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2932. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2933. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2936. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2937. } while (0)
  2938. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2939. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2940. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2941. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2944. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2945. } while (0)
  2946. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2947. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2948. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2949. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2952. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2953. } while (0)
  2954. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2955. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2956. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2957. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2960. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2961. } while (0)
  2962. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2963. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2964. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2965. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2968. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2969. } while (0)
  2970. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2971. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2972. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2973. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2976. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2977. } while (0)
  2978. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2979. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2980. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2981. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2982. do { \
  2983. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2984. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2985. } while (0)
  2986. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2987. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2988. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2989. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2990. do { \
  2991. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2992. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2993. } while (0)
  2994. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2995. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2996. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2997. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3000. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3001. } while (0)
  3002. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3003. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3004. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3005. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3008. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3009. } while (0)
  3010. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3011. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3012. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3013. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3014. do { \
  3015. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3016. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3017. } while (0)
  3018. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3019. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3020. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3021. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3024. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3025. } while (0)
  3026. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3027. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3028. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3029. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3032. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3033. } while (0)
  3034. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3035. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3036. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3037. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3040. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3041. } while (0)
  3042. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3043. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3044. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3045. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3048. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3049. } while (0)
  3050. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3051. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3052. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3053. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3054. do { \
  3055. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3056. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3057. } while (0)
  3058. /**
  3059. * @brief host -> target FW statistics retrieve
  3060. *
  3061. * @details
  3062. * The following field definitions describe the format of the HTT host
  3063. * to target FW stats retrieve message. The message specifies the type of
  3064. * stats host wants to retrieve.
  3065. *
  3066. * |31 24|23 16|15 8|7 0|
  3067. * |-----------------------------------------------------------|
  3068. * | stats types request bitmask | msg type |
  3069. * |-----------------------------------------------------------|
  3070. * | stats types reset bitmask | reserved |
  3071. * |-----------------------------------------------------------|
  3072. * | stats type | config value |
  3073. * |-----------------------------------------------------------|
  3074. * | cookie LSBs |
  3075. * |-----------------------------------------------------------|
  3076. * | cookie MSBs |
  3077. * |-----------------------------------------------------------|
  3078. * Header fields:
  3079. * - MSG_TYPE
  3080. * Bits 7:0
  3081. * Purpose: identifies this is a stats upload request message
  3082. * Value: 0x3
  3083. * - UPLOAD_TYPES
  3084. * Bits 31:8
  3085. * Purpose: identifies which types of FW statistics to upload
  3086. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3087. * - RESET_TYPES
  3088. * Bits 31:8
  3089. * Purpose: identifies which types of FW statistics to reset
  3090. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3091. * - CFG_VAL
  3092. * Bits 23:0
  3093. * Purpose: give an opaque configuration value to the specified stats type
  3094. * Value: stats-type specific configuration value
  3095. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3096. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3097. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3098. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3099. * - CFG_STAT_TYPE
  3100. * Bits 31:24
  3101. * Purpose: specify which stats type (if any) the config value applies to
  3102. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3103. * a valid configuration specification
  3104. * - COOKIE_LSBS
  3105. * Bits 31:0
  3106. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3107. * message with its preceding host->target stats request message.
  3108. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3109. * - COOKIE_MSBS
  3110. * Bits 31:0
  3111. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3112. * message with its preceding host->target stats request message.
  3113. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3114. */
  3115. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3116. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3117. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3118. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3119. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3120. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3121. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3122. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3123. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3125. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3126. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3127. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3128. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3131. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3132. } while (0)
  3133. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3134. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3135. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3136. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3139. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3140. } while (0)
  3141. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3142. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3143. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3144. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3145. do { \
  3146. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3147. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3148. } while (0)
  3149. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3150. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3151. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3152. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3153. do { \
  3154. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3155. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3156. } while (0)
  3157. /**
  3158. * @brief host -> target HTT out-of-band sync request
  3159. *
  3160. * @details
  3161. * The HTT SYNC tells the target to suspend processing of subsequent
  3162. * HTT host-to-target messages until some other target agent locally
  3163. * informs the target HTT FW that the current sync counter is equal to
  3164. * or greater than (in a modulo sense) the sync counter specified in
  3165. * the SYNC message.
  3166. * This allows other host-target components to synchronize their operation
  3167. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3168. * security key has been downloaded to and activated by the target.
  3169. * In the absence of any explicit synchronization counter value
  3170. * specification, the target HTT FW will use zero as the default current
  3171. * sync value.
  3172. *
  3173. * |31 24|23 16|15 8|7 0|
  3174. * |-----------------------------------------------------------|
  3175. * | reserved | sync count | msg type |
  3176. * |-----------------------------------------------------------|
  3177. * Header fields:
  3178. * - MSG_TYPE
  3179. * Bits 7:0
  3180. * Purpose: identifies this as a sync message
  3181. * Value: 0x4
  3182. * - SYNC_COUNT
  3183. * Bits 15:8
  3184. * Purpose: specifies what sync value the HTT FW will wait for from
  3185. * an out-of-band specification to resume its operation
  3186. * Value: in-band sync counter value to compare against the out-of-band
  3187. * counter spec.
  3188. * The HTT target FW will suspend its host->target message processing
  3189. * as long as
  3190. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3191. */
  3192. #define HTT_H2T_SYNC_MSG_SZ 4
  3193. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3194. #define HTT_H2T_SYNC_COUNT_S 8
  3195. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3196. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3197. HTT_H2T_SYNC_COUNT_S)
  3198. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3199. do { \
  3200. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3201. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3202. } while (0)
  3203. /**
  3204. * @brief HTT aggregation configuration
  3205. */
  3206. #define HTT_AGGR_CFG_MSG_SZ 4
  3207. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3208. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3211. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3212. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3213. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3214. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3215. do { \
  3216. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3217. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3218. } while (0)
  3219. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3220. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3221. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3222. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3223. do { \
  3224. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3225. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3226. } while (0)
  3227. /**
  3228. * @brief host -> target HTT configure max amsdu info per vdev
  3229. *
  3230. * @details
  3231. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3232. *
  3233. * |31 21|20 16|15 8|7 0|
  3234. * |-----------------------------------------------------------|
  3235. * | reserved | vdev id | max amsdu | msg type |
  3236. * |-----------------------------------------------------------|
  3237. * Header fields:
  3238. * - MSG_TYPE
  3239. * Bits 7:0
  3240. * Purpose: identifies this as a aggr cfg ex message
  3241. * Value: 0xa
  3242. * - MAX_NUM_AMSDU_SUBFRM
  3243. * Bits 15:8
  3244. * Purpose: max MSDUs per A-MSDU
  3245. * - VDEV_ID
  3246. * Bits 20:16
  3247. * Purpose: ID of the vdev to which this limit is applied
  3248. */
  3249. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3250. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3251. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3252. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3253. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3254. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3255. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3256. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3257. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3258. do { \
  3259. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3260. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3261. } while (0)
  3262. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3263. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3264. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3265. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3266. do { \
  3267. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3268. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3269. } while (0)
  3270. /**
  3271. * @brief HTT WDI_IPA Config Message
  3272. *
  3273. * @details
  3274. * The HTT WDI_IPA config message is created/sent by host at driver
  3275. * init time. It contains information about data structures used on
  3276. * WDI_IPA TX and RX path.
  3277. * TX CE ring is used for pushing packet metadata from IPA uC
  3278. * to WLAN FW
  3279. * TX Completion ring is used for generating TX completions from
  3280. * WLAN FW to IPA uC
  3281. * RX Indication ring is used for indicating RX packets from FW
  3282. * to IPA uC
  3283. * RX Ring2 is used as either completion ring or as second
  3284. * indication ring. when Ring2 is used as completion ring, IPA uC
  3285. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3286. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3287. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3288. * indicated in RX Indication ring. Please see WDI_IPA specification
  3289. * for more details.
  3290. * |31 24|23 16|15 8|7 0|
  3291. * |----------------+----------------+----------------+----------------|
  3292. * | tx pkt pool size | Rsvd | msg_type |
  3293. * |-------------------------------------------------------------------|
  3294. * | tx comp ring base (bits 31:0) |
  3295. #if HTT_PADDR64
  3296. * | tx comp ring base (bits 63:32) |
  3297. #endif
  3298. * |-------------------------------------------------------------------|
  3299. * | tx comp ring size |
  3300. * |-------------------------------------------------------------------|
  3301. * | tx comp WR_IDX physical address (bits 31:0) |
  3302. #if HTT_PADDR64
  3303. * | tx comp WR_IDX physical address (bits 63:32) |
  3304. #endif
  3305. * |-------------------------------------------------------------------|
  3306. * | tx CE WR_IDX physical address (bits 31:0) |
  3307. #if HTT_PADDR64
  3308. * | tx CE WR_IDX physical address (bits 63:32) |
  3309. #endif
  3310. * |-------------------------------------------------------------------|
  3311. * | rx indication ring base (bits 31:0) |
  3312. #if HTT_PADDR64
  3313. * | rx indication ring base (bits 63:32) |
  3314. #endif
  3315. * |-------------------------------------------------------------------|
  3316. * | rx indication ring size |
  3317. * |-------------------------------------------------------------------|
  3318. * | rx ind RD_IDX physical address (bits 31:0) |
  3319. #if HTT_PADDR64
  3320. * | rx ind RD_IDX physical address (bits 63:32) |
  3321. #endif
  3322. * |-------------------------------------------------------------------|
  3323. * | rx ind WR_IDX physical address (bits 31:0) |
  3324. #if HTT_PADDR64
  3325. * | rx ind WR_IDX physical address (bits 63:32) |
  3326. #endif
  3327. * |-------------------------------------------------------------------|
  3328. * |-------------------------------------------------------------------|
  3329. * | rx ring2 base (bits 31:0) |
  3330. #if HTT_PADDR64
  3331. * | rx ring2 base (bits 63:32) |
  3332. #endif
  3333. * |-------------------------------------------------------------------|
  3334. * | rx ring2 size |
  3335. * |-------------------------------------------------------------------|
  3336. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3337. #if HTT_PADDR64
  3338. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3339. #endif
  3340. * |-------------------------------------------------------------------|
  3341. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3342. #if HTT_PADDR64
  3343. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3344. #endif
  3345. * |-------------------------------------------------------------------|
  3346. *
  3347. * Header fields:
  3348. * Header fields:
  3349. * - MSG_TYPE
  3350. * Bits 7:0
  3351. * Purpose: Identifies this as WDI_IPA config message
  3352. * value: = 0x8
  3353. * - TX_PKT_POOL_SIZE
  3354. * Bits 15:0
  3355. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3356. * WDI_IPA TX path
  3357. * For systems using 32-bit format for bus addresses:
  3358. * - TX_COMP_RING_BASE_ADDR
  3359. * Bits 31:0
  3360. * Purpose: TX Completion Ring base address in DDR
  3361. * - TX_COMP_RING_SIZE
  3362. * Bits 31:0
  3363. * Purpose: TX Completion Ring size (must be power of 2)
  3364. * - TX_COMP_WR_IDX_ADDR
  3365. * Bits 31:0
  3366. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3367. * updates the Write Index for WDI_IPA TX completion ring
  3368. * - TX_CE_WR_IDX_ADDR
  3369. * Bits 31:0
  3370. * Purpose: DDR address where IPA uC
  3371. * updates the WR Index for TX CE ring
  3372. * (needed for fusion platforms)
  3373. * - RX_IND_RING_BASE_ADDR
  3374. * Bits 31:0
  3375. * Purpose: RX Indication Ring base address in DDR
  3376. * - RX_IND_RING_SIZE
  3377. * Bits 31:0
  3378. * Purpose: RX Indication Ring size
  3379. * - RX_IND_RD_IDX_ADDR
  3380. * Bits 31:0
  3381. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3382. * RX indication ring
  3383. * - RX_IND_WR_IDX_ADDR
  3384. * Bits 31:0
  3385. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3386. * updates the Write Index for WDI_IPA RX indication ring
  3387. * - RX_RING2_BASE_ADDR
  3388. * Bits 31:0
  3389. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3390. * - RX_RING2_SIZE
  3391. * Bits 31:0
  3392. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3393. * - RX_RING2_RD_IDX_ADDR
  3394. * Bits 31:0
  3395. * Purpose: If Second RX ring is Indication ring, DDR address where
  3396. * IPA uC updates the Read Index for Ring2.
  3397. * If Second RX ring is completion ring, this is NOT used
  3398. * - RX_RING2_WR_IDX_ADDR
  3399. * Bits 31:0
  3400. * Purpose: If Second RX ring is Indication ring, DDR address where
  3401. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3402. * If second RX ring is completion ring, DDR address where
  3403. * IPA uC updates the Write Index for Ring 2.
  3404. * For systems using 64-bit format for bus addresses:
  3405. * - TX_COMP_RING_BASE_ADDR_LO
  3406. * Bits 31:0
  3407. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3408. * - TX_COMP_RING_BASE_ADDR_HI
  3409. * Bits 31:0
  3410. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3411. * - TX_COMP_RING_SIZE
  3412. * Bits 31:0
  3413. * Purpose: TX Completion Ring size (must be power of 2)
  3414. * - TX_COMP_WR_IDX_ADDR_LO
  3415. * Bits 31:0
  3416. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3417. * Lower 4 bytes of DDR address where WIFI FW
  3418. * updates the Write Index for WDI_IPA TX completion ring
  3419. * - TX_COMP_WR_IDX_ADDR_HI
  3420. * Bits 31:0
  3421. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3422. * Higher 4 bytes of DDR address where WIFI FW
  3423. * updates the Write Index for WDI_IPA TX completion ring
  3424. * - TX_CE_WR_IDX_ADDR_LO
  3425. * Bits 31:0
  3426. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3427. * updates the WR Index for TX CE ring
  3428. * (needed for fusion platforms)
  3429. * - TX_CE_WR_IDX_ADDR_HI
  3430. * Bits 31:0
  3431. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3432. * updates the WR Index for TX CE ring
  3433. * (needed for fusion platforms)
  3434. * - RX_IND_RING_BASE_ADDR_LO
  3435. * Bits 31:0
  3436. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3437. * - RX_IND_RING_BASE_ADDR_HI
  3438. * Bits 31:0
  3439. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3440. * - RX_IND_RING_SIZE
  3441. * Bits 31:0
  3442. * Purpose: RX Indication Ring size
  3443. * - RX_IND_RD_IDX_ADDR_LO
  3444. * Bits 31:0
  3445. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3446. * for WDI_IPA RX indication ring
  3447. * - RX_IND_RD_IDX_ADDR_HI
  3448. * Bits 31:0
  3449. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3450. * for WDI_IPA RX indication ring
  3451. * - RX_IND_WR_IDX_ADDR_LO
  3452. * Bits 31:0
  3453. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3454. * Lower 4 bytes of DDR address where WIFI FW
  3455. * updates the Write Index for WDI_IPA RX indication ring
  3456. * - RX_IND_WR_IDX_ADDR_HI
  3457. * Bits 31:0
  3458. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3459. * Higher 4 bytes of DDR address where WIFI FW
  3460. * updates the Write Index for WDI_IPA RX indication ring
  3461. * - RX_RING2_BASE_ADDR_LO
  3462. * Bits 31:0
  3463. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3464. * - RX_RING2_BASE_ADDR_HI
  3465. * Bits 31:0
  3466. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3467. * - RX_RING2_SIZE
  3468. * Bits 31:0
  3469. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3470. * - RX_RING2_RD_IDX_ADDR_LO
  3471. * Bits 31:0
  3472. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3473. * DDR address where IPA uC updates the Read Index for Ring2.
  3474. * If Second RX ring is completion ring, this is NOT used
  3475. * - RX_RING2_RD_IDX_ADDR_HI
  3476. * Bits 31:0
  3477. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3478. * DDR address where IPA uC updates the Read Index for Ring2.
  3479. * If Second RX ring is completion ring, this is NOT used
  3480. * - RX_RING2_WR_IDX_ADDR_LO
  3481. * Bits 31:0
  3482. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3483. * DDR address where WIFI FW updates the Write Index
  3484. * for WDI_IPA RX ring2
  3485. * If second RX ring is completion ring, lower 4 bytes of
  3486. * DDR address where IPA uC updates the Write Index for Ring 2.
  3487. * - RX_RING2_WR_IDX_ADDR_HI
  3488. * Bits 31:0
  3489. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3490. * DDR address where WIFI FW updates the Write Index
  3491. * for WDI_IPA RX ring2
  3492. * If second RX ring is completion ring, higher 4 bytes of
  3493. * DDR address where IPA uC updates the Write Index for Ring 2.
  3494. */
  3495. #if HTT_PADDR64
  3496. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3497. #else
  3498. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3499. #endif
  3500. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3501. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3562. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3564. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3568. } while (0)
  3569. /* for systems using 32-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3584. } while (0)
  3585. /* for systems using 64-bit format for bus addr */
  3586. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3592. } while (0)
  3593. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3594. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3595. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3598. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3599. } while (0)
  3600. /* for systems using 32-bit format for bus addr */
  3601. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3602. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3603. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3604. do { \
  3605. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3606. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3607. } while (0)
  3608. /* for systems using 64-bit format for bus addr */
  3609. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3611. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3614. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3615. } while (0)
  3616. /* for systems using 64-bit format for bus addr */
  3617. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3618. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3619. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3622. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3623. } while (0)
  3624. /* for systems using 32-bit format for bus addr */
  3625. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3626. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3627. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3630. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3631. } while (0)
  3632. /* for systems using 64-bit format for bus addr */
  3633. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3634. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3635. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3639. } while (0)
  3640. /* for systems using 64-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3643. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3647. } while (0)
  3648. /* for systems using 32-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3663. } while (0)
  3664. /* for systems using 64-bit format for bus addr */
  3665. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3666. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3670. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3671. } while (0)
  3672. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3673. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3674. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3677. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3678. } while (0)
  3679. /* for systems using 32-bit format for bus addr */
  3680. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3681. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3682. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3685. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3686. } while (0)
  3687. /* for systems using 64-bit format for bus addr */
  3688. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3689. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3690. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3693. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3694. } while (0)
  3695. /* for systems using 64-bit format for bus addr */
  3696. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3697. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3698. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3701. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3702. } while (0)
  3703. /* for systems using 32-bit format for bus addr */
  3704. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3705. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3706. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3707. do { \
  3708. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3709. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3710. } while (0)
  3711. /* for systems using 64-bit format for bus addr */
  3712. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3713. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3714. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3715. do { \
  3716. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3717. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3718. } while (0)
  3719. /* for systems using 64-bit format for bus addr */
  3720. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3721. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3723. do { \
  3724. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3725. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3726. } while (0)
  3727. /* for systems using 32-bit format for bus addr */
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3729. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3731. do { \
  3732. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3733. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3734. } while (0)
  3735. /* for systems using 64-bit format for bus addr */
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3737. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3739. do { \
  3740. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3741. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3742. } while (0)
  3743. /* for systems using 64-bit format for bus addr */
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3745. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3749. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3750. } while (0)
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3752. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3756. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3757. } while (0)
  3758. /* for systems using 32-bit format for bus addr */
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3760. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3764. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3765. } while (0)
  3766. /* for systems using 64-bit format for bus addr */
  3767. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3768. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3769. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3770. do { \
  3771. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3772. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3773. } while (0)
  3774. /* for systems using 64-bit format for bus addr */
  3775. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3776. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3777. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3778. do { \
  3779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3780. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3781. } while (0)
  3782. /* for systems using 32-bit format for bus addr */
  3783. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3784. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3785. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3788. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3789. } while (0)
  3790. /* for systems using 64-bit format for bus addr */
  3791. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3793. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3797. } while (0)
  3798. /* for systems using 64-bit format for bus addr */
  3799. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3800. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3801. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3804. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3805. } while (0)
  3806. /*
  3807. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3808. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3809. * addresses are stored in a XXX-bit field.
  3810. * This macro is used to define both htt_wdi_ipa_config32_t and
  3811. * htt_wdi_ipa_config64_t structs.
  3812. */
  3813. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3814. _paddr__tx_comp_ring_base_addr_, \
  3815. _paddr__tx_comp_wr_idx_addr_, \
  3816. _paddr__tx_ce_wr_idx_addr_, \
  3817. _paddr__rx_ind_ring_base_addr_, \
  3818. _paddr__rx_ind_rd_idx_addr_, \
  3819. _paddr__rx_ind_wr_idx_addr_, \
  3820. _paddr__rx_ring2_base_addr_,\
  3821. _paddr__rx_ring2_rd_idx_addr_,\
  3822. _paddr__rx_ring2_wr_idx_addr_) \
  3823. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3824. { \
  3825. /* DWORD 0: flags and meta-data */ \
  3826. A_UINT32 \
  3827. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3828. reserved: 8, \
  3829. tx_pkt_pool_size: 16;\
  3830. /* DWORD 1 */\
  3831. _paddr__tx_comp_ring_base_addr_;\
  3832. /* DWORD 2 (or 3)*/\
  3833. A_UINT32 tx_comp_ring_size;\
  3834. /* DWORD 3 (or 4)*/\
  3835. _paddr__tx_comp_wr_idx_addr_;\
  3836. /* DWORD 4 (or 6)*/\
  3837. _paddr__tx_ce_wr_idx_addr_;\
  3838. /* DWORD 5 (or 8)*/\
  3839. _paddr__rx_ind_ring_base_addr_;\
  3840. /* DWORD 6 (or 10)*/\
  3841. A_UINT32 rx_ind_ring_size;\
  3842. /* DWORD 7 (or 11)*/\
  3843. _paddr__rx_ind_rd_idx_addr_;\
  3844. /* DWORD 8 (or 13)*/\
  3845. _paddr__rx_ind_wr_idx_addr_;\
  3846. /* DWORD 9 (or 15)*/\
  3847. _paddr__rx_ring2_base_addr_;\
  3848. /* DWORD 10 (or 17) */\
  3849. A_UINT32 rx_ring2_size;\
  3850. /* DWORD 11 (or 18) */\
  3851. _paddr__rx_ring2_rd_idx_addr_;\
  3852. /* DWORD 12 (or 20) */\
  3853. _paddr__rx_ring2_wr_idx_addr_;\
  3854. } POSTPACK
  3855. /* define a htt_wdi_ipa_config32_t type */
  3856. 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));
  3857. /* define a htt_wdi_ipa_config64_t type */
  3858. 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));
  3859. #if HTT_PADDR64
  3860. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3861. #else
  3862. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3863. #endif
  3864. enum htt_wdi_ipa_op_code {
  3865. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3866. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3867. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3868. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3869. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3870. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3871. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3872. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3873. /* keep this last */
  3874. HTT_WDI_IPA_OPCODE_MAX
  3875. };
  3876. /**
  3877. * @brief HTT WDI_IPA Operation Request Message
  3878. *
  3879. * @details
  3880. * HTT WDI_IPA Operation Request message is sent by host
  3881. * to either suspend or resume WDI_IPA TX or RX path.
  3882. * |31 24|23 16|15 8|7 0|
  3883. * |----------------+----------------+----------------+----------------|
  3884. * | op_code | Rsvd | msg_type |
  3885. * |-------------------------------------------------------------------|
  3886. *
  3887. * Header fields:
  3888. * - MSG_TYPE
  3889. * Bits 7:0
  3890. * Purpose: Identifies this as WDI_IPA Operation Request message
  3891. * value: = 0x9
  3892. * - OP_CODE
  3893. * Bits 31:16
  3894. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3895. * value: = enum htt_wdi_ipa_op_code
  3896. */
  3897. PREPACK struct htt_wdi_ipa_op_request_t
  3898. {
  3899. /* DWORD 0: flags and meta-data */
  3900. A_UINT32
  3901. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3902. reserved: 8,
  3903. op_code: 16;
  3904. } POSTPACK;
  3905. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3906. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3907. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3908. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3909. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3910. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3911. do { \
  3912. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3913. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3914. } while (0)
  3915. /*
  3916. * @brief host -> target HTT_SRING_SETUP message
  3917. *
  3918. * @details
  3919. * After target is booted up, Host can send SRING setup message for
  3920. * each host facing LMAC SRING. Target setups up HW registers based
  3921. * on setup message and confirms back to Host if response_required is set.
  3922. * Host should wait for confirmation message before sending new SRING
  3923. * setup message
  3924. *
  3925. * The message would appear as follows:
  3926. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3927. * |--------------- +-----------------+-----------------+-----------------|
  3928. * | ring_type | ring_id | pdev_id | msg_type |
  3929. * |----------------------------------------------------------------------|
  3930. * | ring_base_addr_lo |
  3931. * |----------------------------------------------------------------------|
  3932. * | ring_base_addr_hi |
  3933. * |----------------------------------------------------------------------|
  3934. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3935. * |----------------------------------------------------------------------|
  3936. * | ring_head_offset32_remote_addr_lo |
  3937. * |----------------------------------------------------------------------|
  3938. * | ring_head_offset32_remote_addr_hi |
  3939. * |----------------------------------------------------------------------|
  3940. * | ring_tail_offset32_remote_addr_lo |
  3941. * |----------------------------------------------------------------------|
  3942. * | ring_tail_offset32_remote_addr_hi |
  3943. * |----------------------------------------------------------------------|
  3944. * | ring_msi_addr_lo |
  3945. * |----------------------------------------------------------------------|
  3946. * | ring_msi_addr_hi |
  3947. * |----------------------------------------------------------------------|
  3948. * | ring_msi_data |
  3949. * |----------------------------------------------------------------------|
  3950. * | intr_timer_th |IM| intr_batch_counter_th |
  3951. * |----------------------------------------------------------------------|
  3952. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3953. * |----------------------------------------------------------------------|
  3954. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3955. * |----------------------------------------------------------------------|
  3956. * Where
  3957. * IM = sw_intr_mode
  3958. * RR = response_required
  3959. * PTCF = prefetch_timer_cfg
  3960. * IP = IPA drop flag
  3961. *
  3962. * The message is interpreted as follows:
  3963. * dword0 - b'0:7 - msg_type: This will be set to
  3964. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3965. * b'8:15 - pdev_id:
  3966. * 0 (for rings at SOC/UMAC level),
  3967. * 1/2/3 mac id (for rings at LMAC level)
  3968. * b'16:23 - ring_id: identify which ring is to setup,
  3969. * more details can be got from enum htt_srng_ring_id
  3970. * b'24:31 - ring_type: identify type of host rings,
  3971. * more details can be got from enum htt_srng_ring_type
  3972. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3973. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3974. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3975. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3976. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3977. * SW_TO_HW_RING.
  3978. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3979. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3980. * Lower 32 bits of memory address of the remote variable
  3981. * storing the 4-byte word offset that identifies the head
  3982. * element within the ring.
  3983. * (The head offset variable has type A_UINT32.)
  3984. * Valid for HW_TO_SW and SW_TO_SW rings.
  3985. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3986. * Upper 32 bits of memory address of the remote variable
  3987. * storing the 4-byte word offset that identifies the head
  3988. * element within the ring.
  3989. * (The head offset variable has type A_UINT32.)
  3990. * Valid for HW_TO_SW and SW_TO_SW rings.
  3991. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3992. * Lower 32 bits of memory address of the remote variable
  3993. * storing the 4-byte word offset that identifies the tail
  3994. * element within the ring.
  3995. * (The tail offset variable has type A_UINT32.)
  3996. * Valid for HW_TO_SW and SW_TO_SW rings.
  3997. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3998. * Upper 32 bits of memory address of the remote variable
  3999. * storing the 4-byte word offset that identifies the tail
  4000. * element within the ring.
  4001. * (The tail offset variable has type A_UINT32.)
  4002. * Valid for HW_TO_SW and SW_TO_SW rings.
  4003. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4004. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4005. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4006. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4007. * dword10 - b'0:31 - ring_msi_data: MSI data
  4008. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4009. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4010. * dword11 - b'0:14 - intr_batch_counter_th:
  4011. * batch counter threshold is in units of 4-byte words.
  4012. * HW internally maintains and increments batch count.
  4013. * (see SRING spec for detail description).
  4014. * When batch count reaches threshold value, an interrupt
  4015. * is generated by HW.
  4016. * b'15 - sw_intr_mode:
  4017. * This configuration shall be static.
  4018. * Only programmed at power up.
  4019. * 0: generate pulse style sw interrupts
  4020. * 1: generate level style sw interrupts
  4021. * b'16:31 - intr_timer_th:
  4022. * The timer init value when timer is idle or is
  4023. * initialized to start downcounting.
  4024. * In 8us units (to cover a range of 0 to 524 ms)
  4025. * dword12 - b'0:15 - intr_low_threshold:
  4026. * Used only by Consumer ring to generate ring_sw_int_p.
  4027. * Ring entries low threshold water mark, that is used
  4028. * in combination with the interrupt timer as well as
  4029. * the the clearing of the level interrupt.
  4030. * b'16:18 - prefetch_timer_cfg:
  4031. * Used only by Consumer ring to set timer mode to
  4032. * support Application prefetch handling.
  4033. * The external tail offset/pointer will be updated
  4034. * at following intervals:
  4035. * 3'b000: (Prefetch feature disabled; used only for debug)
  4036. * 3'b001: 1 usec
  4037. * 3'b010: 4 usec
  4038. * 3'b011: 8 usec (default)
  4039. * 3'b100: 16 usec
  4040. * Others: Reserverd
  4041. * b'19 - response_required:
  4042. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4043. * b'20 - ipa_drop_flag:
  4044. Indicates that host will config ipa drop threshold percentage
  4045. * b'21:31 - reserved: reserved for future use
  4046. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4047. * b'8:15 - ipa drop high threshold percentage:
  4048. * b'16:31 - Reserved
  4049. */
  4050. PREPACK struct htt_sring_setup_t {
  4051. A_UINT32 msg_type: 8,
  4052. pdev_id: 8,
  4053. ring_id: 8,
  4054. ring_type: 8;
  4055. A_UINT32 ring_base_addr_lo;
  4056. A_UINT32 ring_base_addr_hi;
  4057. A_UINT32 ring_size: 16,
  4058. ring_entry_size: 8,
  4059. ring_misc_cfg_flag: 8;
  4060. A_UINT32 ring_head_offset32_remote_addr_lo;
  4061. A_UINT32 ring_head_offset32_remote_addr_hi;
  4062. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4063. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4064. A_UINT32 ring_msi_addr_lo;
  4065. A_UINT32 ring_msi_addr_hi;
  4066. A_UINT32 ring_msi_data;
  4067. A_UINT32 intr_batch_counter_th: 15,
  4068. sw_intr_mode: 1,
  4069. intr_timer_th: 16;
  4070. A_UINT32 intr_low_threshold: 16,
  4071. prefetch_timer_cfg: 3,
  4072. response_required: 1,
  4073. ipa_drop_flag: 1,
  4074. reserved1: 11;
  4075. A_UINT32 ipa_drop_low_threshold: 8,
  4076. ipa_drop_high_threshold: 8,
  4077. reserved: 16;
  4078. } POSTPACK;
  4079. enum htt_srng_ring_type {
  4080. HTT_HW_TO_SW_RING = 0,
  4081. HTT_SW_TO_HW_RING,
  4082. HTT_SW_TO_SW_RING,
  4083. /* Insert new ring types above this line */
  4084. };
  4085. enum htt_srng_ring_id {
  4086. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4087. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4088. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4089. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4090. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4091. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4092. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4093. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4094. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4095. /* Add Other SRING which can't be directly configured by host software above this line */
  4096. };
  4097. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4098. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4099. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4100. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4101. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4102. HTT_SRING_SETUP_PDEV_ID_S)
  4103. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4106. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4107. } while (0)
  4108. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4109. #define HTT_SRING_SETUP_RING_ID_S 16
  4110. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4111. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4112. HTT_SRING_SETUP_RING_ID_S)
  4113. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4116. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4117. } while (0)
  4118. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4119. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4120. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4121. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4122. HTT_SRING_SETUP_RING_TYPE_S)
  4123. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4126. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4127. } while (0)
  4128. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4129. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4131. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4132. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4133. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4136. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4137. } while (0)
  4138. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4139. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4140. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4141. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4142. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4143. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4146. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4147. } while (0)
  4148. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4149. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4150. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4151. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4152. HTT_SRING_SETUP_RING_SIZE_S)
  4153. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4156. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4157. } while (0)
  4158. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4159. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4160. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4161. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4162. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4163. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4164. do { \
  4165. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4166. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4167. } while (0)
  4168. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4169. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4170. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4171. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4172. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4173. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4176. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4177. } while (0)
  4178. /* This control bit is applicable to only Producer, which updates Ring ID field
  4179. * of each descriptor before pushing into the ring.
  4180. * 0: updates ring_id(default)
  4181. * 1: ring_id updating disabled */
  4182. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4185. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4186. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4190. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4191. } while (0)
  4192. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4193. * of each descriptor before pushing into the ring.
  4194. * 0: updates Loopcnt(default)
  4195. * 1: Loopcnt updating disabled */
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4198. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4199. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4200. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4204. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4205. } while (0)
  4206. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4207. * into security_id port of GXI/AXI. */
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4210. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4211. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4212. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4216. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4217. } while (0)
  4218. /* During MSI write operation, SRNG drives value of this register bit into
  4219. * swap bit of GXI/AXI. */
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4223. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4224. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4228. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4229. } while (0)
  4230. /* During Pointer write operation, SRNG drives value of this register bit into
  4231. * swap bit of GXI/AXI. */
  4232. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4235. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4236. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4237. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4240. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4241. } while (0)
  4242. /* During any data or TLV write operation, SRNG drives value of this register
  4243. * bit into swap bit of GXI/AXI. */
  4244. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4245. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4246. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4247. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4248. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4249. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4252. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4253. } while (0)
  4254. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4255. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4256. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4257. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4259. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4260. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4261. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4264. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4265. } while (0)
  4266. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4267. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4268. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4269. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4270. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4271. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4274. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4275. } while (0)
  4276. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4277. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4279. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4280. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4281. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4282. do { \
  4283. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4284. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4285. } while (0)
  4286. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4287. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4288. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4289. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4290. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4291. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4294. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4295. } while (0)
  4296. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4297. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4299. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4300. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4301. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4304. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4305. } while (0)
  4306. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4307. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4308. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4309. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4310. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4311. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4314. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4315. } while (0)
  4316. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4317. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4318. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4319. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4320. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4321. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4324. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4325. } while (0)
  4326. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4327. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4328. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4329. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4330. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4331. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4334. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4335. } while (0)
  4336. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4337. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4338. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4339. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4340. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4341. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4342. do { \
  4343. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4344. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4345. } while (0)
  4346. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4347. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4348. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4349. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4350. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4351. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4352. do { \
  4353. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4354. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4355. } while (0)
  4356. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4357. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4358. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4359. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4360. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4361. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4362. do { \
  4363. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4364. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4365. } while (0)
  4366. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4367. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4368. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4369. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4370. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4371. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4372. do { \
  4373. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4374. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4375. } while (0)
  4376. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4377. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4378. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4379. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4380. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4381. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4382. do { \
  4383. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4384. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4385. } while (0)
  4386. /**
  4387. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4388. *
  4389. * @details
  4390. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4391. * configure RXDMA rings.
  4392. * The configuration is per ring based and includes both packet subtypes
  4393. * and PPDU/MPDU TLVs.
  4394. *
  4395. * The message would appear as follows:
  4396. *
  4397. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4398. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4399. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4400. * |-------------------------------------------------------------------|
  4401. * | rsvd2 | ring_buffer_size |
  4402. * |-------------------------------------------------------------------|
  4403. * | packet_type_enable_flags_0 |
  4404. * |-------------------------------------------------------------------|
  4405. * | packet_type_enable_flags_1 |
  4406. * |-------------------------------------------------------------------|
  4407. * | packet_type_enable_flags_2 |
  4408. * |-------------------------------------------------------------------|
  4409. * | packet_type_enable_flags_3 |
  4410. * |-------------------------------------------------------------------|
  4411. * | tlv_filter_in_flags |
  4412. * |-------------------------------------------------------------------|
  4413. * | rx_header_offset | rx_packet_offset |
  4414. * |-------------------------------------------------------------------|
  4415. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4416. * |-------------------------------------------------------------------|
  4417. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4418. * |-------------------------------------------------------------------|
  4419. * | rsvd3 | rx_attention_offset |
  4420. * |-------------------------------------------------------------------|
  4421. * | rsvd4 | mo| fp| rx_drop_threshold |
  4422. * | |ndp|ndp| |
  4423. * |-------------------------------------------------------------------|
  4424. * Where:
  4425. * PS = pkt_swap
  4426. * SS = status_swap
  4427. * OV = rx_offsets_valid
  4428. * DT = drop_thresh_valid
  4429. * The message is interpreted as follows:
  4430. * dword0 - b'0:7 - msg_type: This will be set to
  4431. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4432. * b'8:15 - pdev_id:
  4433. * 0 (for rings at SOC/UMAC level),
  4434. * 1/2/3 mac id (for rings at LMAC level)
  4435. * b'16:23 - ring_id : Identify the ring to configure.
  4436. * More details can be got from enum htt_srng_ring_id
  4437. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4438. * BUF_RING_CFG_0 defs within HW .h files,
  4439. * e.g. wmac_top_reg_seq_hwioreg.h
  4440. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4441. * BUF_RING_CFG_0 defs within HW .h files,
  4442. * e.g. wmac_top_reg_seq_hwioreg.h
  4443. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4444. * configuration fields are valid
  4445. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4446. * rx_drop_threshold field is valid
  4447. * b'28:31 - rsvd1: reserved for future use
  4448. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4449. * in byte units.
  4450. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4451. * - b'16:31 - rsvd2: Reserved for future use
  4452. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4453. * Enable MGMT packet from 0b0000 to 0b1001
  4454. * bits from low to high: FP, MD, MO - 3 bits
  4455. * FP: Filter_Pass
  4456. * MD: Monitor_Direct
  4457. * MO: Monitor_Other
  4458. * 10 mgmt subtypes * 3 bits -> 30 bits
  4459. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4460. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4461. * Enable MGMT packet from 0b1010 to 0b1111
  4462. * bits from low to high: FP, MD, MO - 3 bits
  4463. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4464. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4465. * Enable CTRL packet from 0b0000 to 0b1001
  4466. * bits from low to high: FP, MD, MO - 3 bits
  4467. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4468. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4469. * Enable CTRL packet from 0b1010 to 0b1111,
  4470. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4471. * bits from low to high: FP, MD, MO - 3 bits
  4472. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4473. * dword6 - b'0:31 - tlv_filter_in_flags:
  4474. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4475. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4476. * dword7 - b'0:15 - rx_packet_offset: rx_packet_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_1 defs within HW .h files,
  4480. * e.g. wmac_top_reg_seq_hwioreg.h
  4481. * - b'16:31 - rx_header_offset: rx_header_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_1 defs within HW .h files,
  4485. * e.g. wmac_top_reg_seq_hwioreg.h
  4486. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_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_2 defs within HW .h files,
  4490. * e.g. wmac_top_reg_seq_hwioreg.h
  4491. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_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_2 defs within HW .h files,
  4495. * e.g. wmac_top_reg_seq_hwioreg.h
  4496. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_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_3 defs within HW .h files,
  4500. * e.g. wmac_top_reg_seq_hwioreg.h
  4501. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4502. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4503. * A value of 0 will be considered as ignore this config.
  4504. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4505. * e.g. wmac_top_reg_seq_hwioreg.h
  4506. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4507. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4508. * A value of 0 will be considered as ignore this config.
  4509. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4510. * e.g. wmac_top_reg_seq_hwioreg.h
  4511. * - b'16:31 - rsvd3 for future use
  4512. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4513. * to source rings. Consumer drops packets if the available
  4514. * words in the ring falls below the configured threshold
  4515. * value.
  4516. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4517. * by host. 1 -> subscribed
  4518. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4519. * by host. 1 -> subscribed
  4520. */
  4521. PREPACK struct htt_rx_ring_selection_cfg_t {
  4522. A_UINT32 msg_type: 8,
  4523. pdev_id: 8,
  4524. ring_id: 8,
  4525. status_swap: 1,
  4526. pkt_swap: 1,
  4527. rx_offsets_valid: 1,
  4528. drop_thresh_valid: 1,
  4529. rsvd1: 4;
  4530. A_UINT32 ring_buffer_size: 16,
  4531. rsvd2: 16;
  4532. A_UINT32 packet_type_enable_flags_0;
  4533. A_UINT32 packet_type_enable_flags_1;
  4534. A_UINT32 packet_type_enable_flags_2;
  4535. A_UINT32 packet_type_enable_flags_3;
  4536. A_UINT32 tlv_filter_in_flags;
  4537. A_UINT32 rx_packet_offset: 16,
  4538. rx_header_offset: 16;
  4539. A_UINT32 rx_mpdu_end_offset: 16,
  4540. rx_mpdu_start_offset: 16;
  4541. A_UINT32 rx_msdu_end_offset: 16,
  4542. rx_msdu_start_offset: 16;
  4543. A_UINT32 rx_attn_offset: 16,
  4544. rsvd3: 16;
  4545. A_UINT32 rx_drop_threshold: 10,
  4546. fp_ndp: 1,
  4547. mo_ndp: 1,
  4548. rsvd4: 20;
  4549. } POSTPACK;
  4550. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4551. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4552. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4553. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4554. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4555. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4556. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4557. do { \
  4558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4560. } while (0)
  4561. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4562. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4563. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4564. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4565. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4566. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4570. } while (0)
  4571. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4572. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4573. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4574. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4575. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4576. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4580. } while (0)
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4584. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4585. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4587. do { \
  4588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4590. } while (0)
  4591. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4592. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4593. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4594. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4595. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4596. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4597. do { \
  4598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4600. } while (0)
  4601. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4602. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4603. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4604. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4605. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4606. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4607. do { \
  4608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4610. } while (0)
  4611. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4612. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4613. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4614. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4615. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4616. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4617. do { \
  4618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4620. } while (0)
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4624. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4625. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4627. do { \
  4628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4630. } while (0)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4634. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4635. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4650. } while (0)
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4654. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4655. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4657. do { \
  4658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4660. } while (0)
  4661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4664. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4665. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4667. do { \
  4668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4670. } while (0)
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4672. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4674. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4675. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4677. do { \
  4678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4680. } while (0)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4684. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4685. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4687. do { \
  4688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4690. } while (0)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4695. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4697. do { \
  4698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4700. } while (0)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4705. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4707. do { \
  4708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4710. } while (0)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4714. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4715. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4720. } while (0)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4724. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4725. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4726. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4730. } while (0)
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4734. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4735. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4736. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4739. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4740. } while (0)
  4741. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4742. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4743. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4744. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4745. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4746. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4747. do { \
  4748. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4749. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4750. } while (0)
  4751. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4752. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4753. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4754. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4755. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4756. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4759. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4760. } while (0)
  4761. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4762. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4763. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4764. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4765. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4766. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4769. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4770. } while (0)
  4771. /*
  4772. * Subtype based MGMT frames enable bits.
  4773. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4774. */
  4775. /* association request */
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4782. /* association response */
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4789. /* Reassociation request */
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4796. /* Reassociation response */
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4803. /* Probe request */
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4810. /* Probe response */
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4817. /* Timing Advertisement */
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4824. /* Reserved */
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4831. /* Beacon */
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4838. /* ATIM */
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4845. /* Disassociation */
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4852. /* Authentication */
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4859. /* Deauthentication */
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4866. /* Action */
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4873. /* Action No Ack */
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4880. /* Reserved */
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4887. /*
  4888. * Subtype based CTRL frames enable bits.
  4889. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4890. */
  4891. /* Reserved */
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4898. /* Reserved */
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4905. /* Reserved */
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4912. /* Reserved */
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4919. /* Reserved */
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4926. /* Reserved */
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4933. /* Reserved */
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4940. /* Control Wrapper */
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4947. /* Block Ack Request */
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4954. /* Block Ack*/
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4961. /* PS-POLL */
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4968. /* RTS */
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4975. /* CTS */
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4982. /* ACK */
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4989. /* CF-END */
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4996. /* CF-END + CF-ACK */
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5003. /* Multicast data */
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5010. /* Unicast data */
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5017. /* NULL data */
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(httsym, value); \
  5027. (word) |= (value) << httsym##_S; \
  5028. } while (0)
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5030. (((word) & httsym##_M) >> httsym##_S)
  5031. #define htt_rx_ring_pkt_enable_subtype_set( \
  5032. word, flag, mode, type, subtype, val) \
  5033. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5034. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5035. #define htt_rx_ring_pkt_enable_subtype_get( \
  5036. word, flag, mode, type, subtype) \
  5037. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5038. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5039. /* Definition to filter in TLVs */
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5066. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5067. do { \
  5068. HTT_CHECK_SET_VAL(httsym, enable); \
  5069. (word) |= (enable) << httsym##_S; \
  5070. } while (0)
  5071. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5072. (((word) & httsym##_M) >> httsym##_S)
  5073. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5074. HTT_RX_RING_TLV_ENABLE_SET( \
  5075. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5076. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5077. HTT_RX_RING_TLV_ENABLE_GET( \
  5078. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5079. /**
  5080. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5081. * host --> target Receive Flow Steering configuration message definition.
  5082. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5083. * The reason for this is we want RFS to be configured and ready before MAC
  5084. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5085. *
  5086. * |31 24|23 16|15 9|8|7 0|
  5087. * |----------------+----------------+----------------+----------------|
  5088. * | reserved |E| msg type |
  5089. * |-------------------------------------------------------------------|
  5090. * Where E = RFS enable flag
  5091. *
  5092. * The RFS_CONFIG message consists of a single 4-byte word.
  5093. *
  5094. * Header fields:
  5095. * - MSG_TYPE
  5096. * Bits 7:0
  5097. * Purpose: identifies this as a RFS config msg
  5098. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5099. * - RFS_CONFIG
  5100. * Bit 8
  5101. * Purpose: Tells target whether to enable (1) or disable (0)
  5102. * flow steering feature when sending rx indication messages to host
  5103. */
  5104. #define HTT_H2T_RFS_CONFIG_M 0x100
  5105. #define HTT_H2T_RFS_CONFIG_S 8
  5106. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5107. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5108. HTT_H2T_RFS_CONFIG_S)
  5109. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5110. do { \
  5111. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5112. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5113. } while (0)
  5114. #define HTT_RFS_CFG_REQ_BYTES 4
  5115. /**
  5116. * @brief host -> target FW extended statistics retrieve
  5117. *
  5118. * @details
  5119. * The following field definitions describe the format of the HTT host
  5120. * to target FW extended stats retrieve message.
  5121. * The message specifies the type of stats the host wants to retrieve.
  5122. *
  5123. * |31 24|23 16|15 8|7 0|
  5124. * |-----------------------------------------------------------|
  5125. * | reserved | stats type | pdev_mask | msg type |
  5126. * |-----------------------------------------------------------|
  5127. * | config param [0] |
  5128. * |-----------------------------------------------------------|
  5129. * | config param [1] |
  5130. * |-----------------------------------------------------------|
  5131. * | config param [2] |
  5132. * |-----------------------------------------------------------|
  5133. * | config param [3] |
  5134. * |-----------------------------------------------------------|
  5135. * | reserved |
  5136. * |-----------------------------------------------------------|
  5137. * | cookie LSBs |
  5138. * |-----------------------------------------------------------|
  5139. * | cookie MSBs |
  5140. * |-----------------------------------------------------------|
  5141. * Header fields:
  5142. * - MSG_TYPE
  5143. * Bits 7:0
  5144. * Purpose: identifies this is a extended stats upload request message
  5145. * Value: 0x10
  5146. * - PDEV_MASK
  5147. * Bits 8:15
  5148. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5149. * Value: This is a overloaded field, refer to usage and interpretation of
  5150. * PDEV in interface document.
  5151. * Bit 8 : Reserved for SOC stats
  5152. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5153. * Indicates MACID_MASK in DBS
  5154. * - STATS_TYPE
  5155. * Bits 23:16
  5156. * Purpose: identifies which FW statistics to upload
  5157. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5158. * - Reserved
  5159. * Bits 31:24
  5160. * - CONFIG_PARAM [0]
  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 [1]
  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. * - CONFIG_PARAM [2]
  5171. * Bits 31:0
  5172. * Purpose: give an opaque configuration value to the specified stats type
  5173. * Value: stats-type specific configuration value
  5174. * Refer to htt_stats.h for interpretation for each stats sub_type
  5175. * - CONFIG_PARAM [3]
  5176. * Bits 31:0
  5177. * Purpose: give an opaque configuration value to the specified stats type
  5178. * Value: stats-type specific configuration value
  5179. * Refer to htt_stats.h for interpretation for each stats sub_type
  5180. * - Reserved [31:0] for future use.
  5181. * - COOKIE_LSBS
  5182. * Bits 31:0
  5183. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5184. * message with its preceding host->target stats request message.
  5185. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5186. * - COOKIE_MSBS
  5187. * Bits 31:0
  5188. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5189. * message with its preceding host->target stats request message.
  5190. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5191. */
  5192. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5193. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5194. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5195. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5196. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5197. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5198. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5199. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5200. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5201. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5202. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5203. do { \
  5204. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5205. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5206. } while (0)
  5207. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5208. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5209. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5210. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5211. do { \
  5212. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5213. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5214. } while (0)
  5215. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5216. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5217. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5218. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5219. do { \
  5220. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5221. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5222. } while (0)
  5223. /**
  5224. * @brief host -> target FW PPDU_STATS request message
  5225. *
  5226. * @details
  5227. * The following field definitions describe the format of the HTT host
  5228. * to target FW for PPDU_STATS_CFG msg.
  5229. * The message allows the host to configure the PPDU_STATS_IND messages
  5230. * produced by the target.
  5231. *
  5232. * |31 24|23 16|15 8|7 0|
  5233. * |-----------------------------------------------------------|
  5234. * | REQ bit mask | pdev_mask | msg type |
  5235. * |-----------------------------------------------------------|
  5236. * Header fields:
  5237. * - MSG_TYPE
  5238. * Bits 7:0
  5239. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5240. * Value: 0x11
  5241. * - PDEV_MASK
  5242. * Bits 8:15
  5243. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5244. * Value: This is a overloaded field, refer to usage and interpretation of
  5245. * PDEV in interface document.
  5246. * Bit 8 : Reserved for SOC stats
  5247. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5248. * Indicates MACID_MASK in DBS
  5249. * - REQ_TLV_BIT_MASK
  5250. * Bits 16:31
  5251. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5252. * needs to be included in the target's PPDU_STATS_IND messages.
  5253. * Value: refer htt_ppdu_stats_tlv_tag_t
  5254. *
  5255. */
  5256. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5257. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5258. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5259. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5260. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5261. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5262. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5263. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5264. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5265. do { \
  5266. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5267. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5268. } while (0)
  5269. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5270. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5271. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5272. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5273. do { \
  5274. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5275. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5276. } while (0)
  5277. /**
  5278. * @brief Host-->target HTT RX FSE setup message
  5279. * @details
  5280. * Through this message, the host will provide details of the flow tables
  5281. * in host DDR along with hash keys.
  5282. * This message can be sent per SOC or per PDEV, which is differentiated
  5283. * by pdev id values.
  5284. * The host will allocate flow search table and sends table size,
  5285. * physical DMA address of flow table, and hash keys to firmware to
  5286. * program into the RXOLE FSE HW block.
  5287. *
  5288. * The following field definitions describe the format of the RX FSE setup
  5289. * message sent from the host to target
  5290. *
  5291. * Header fields:
  5292. * dword0 - b'7:0 - msg_type: This will be set to
  5293. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5294. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5295. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5296. * pdev's LMAC ring.
  5297. * b'31:16 - reserved : Reserved for future use
  5298. * dword1 - b'19:0 - number of records: This field indicates the number of
  5299. * entries in the flow table. For example: 8k number of
  5300. * records is equivalent to
  5301. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5302. * b'27:20 - max search: This field specifies the skid length to FSE
  5303. * parser HW module whenever match is not found at the
  5304. * exact index pointed by hash.
  5305. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5306. * Refer htt_ip_da_sa_prefix below for more details.
  5307. * b'31:30 - reserved: Reserved for future use
  5308. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5309. * table allocated by host in DDR
  5310. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5311. * table allocated by host in DDR
  5312. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5313. * entry hashing
  5314. *
  5315. *
  5316. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5317. * |---------------------------------------------------------------|
  5318. * | reserved | pdev_id | MSG_TYPE |
  5319. * |---------------------------------------------------------------|
  5320. * |resvd|IPDSA| max_search | Number of records |
  5321. * |---------------------------------------------------------------|
  5322. * | base address lo |
  5323. * |---------------------------------------------------------------|
  5324. * | base address high |
  5325. * |---------------------------------------------------------------|
  5326. * | toeplitz key 31_0 |
  5327. * |---------------------------------------------------------------|
  5328. * | toeplitz key 63_32 |
  5329. * |---------------------------------------------------------------|
  5330. * | toeplitz key 95_64 |
  5331. * |---------------------------------------------------------------|
  5332. * | toeplitz key 127_96 |
  5333. * |---------------------------------------------------------------|
  5334. * | toeplitz key 159_128 |
  5335. * |---------------------------------------------------------------|
  5336. * | toeplitz key 191_160 |
  5337. * |---------------------------------------------------------------|
  5338. * | toeplitz key 223_192 |
  5339. * |---------------------------------------------------------------|
  5340. * | toeplitz key 255_224 |
  5341. * |---------------------------------------------------------------|
  5342. * | toeplitz key 287_256 |
  5343. * |---------------------------------------------------------------|
  5344. * | reserved | toeplitz key 314_288(26:0 bits) |
  5345. * |---------------------------------------------------------------|
  5346. * where:
  5347. * IPDSA = ip_da_sa
  5348. */
  5349. /**
  5350. * @brief: htt_ip_da_sa_prefix
  5351. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5352. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5353. * documentation per RFC3849
  5354. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5355. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5356. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5357. */
  5358. enum htt_ip_da_sa_prefix {
  5359. HTT_RX_IPV6_20010db8,
  5360. HTT_RX_IPV4_MAPPED_IPV6,
  5361. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5362. HTT_RX_IPV6_64FF9B,
  5363. };
  5364. /**
  5365. * @brief Host-->target HTT RX FISA configure and enable
  5366. * @details
  5367. * The host will send this command down to configure and enable the FISA
  5368. * operational params.
  5369. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5370. * register.
  5371. * Should configure both the MACs.
  5372. *
  5373. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5374. *
  5375. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5376. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5377. * pdev's LMAC ring.
  5378. * b'31:16 - reserved : Reserved for future use
  5379. *
  5380. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5381. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5382. * packets. 1 flow search will be skipped
  5383. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5384. * tcp,udp packets
  5385. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5386. * calculation
  5387. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5388. * calculation
  5389. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5390. * calculation
  5391. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5392. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5393. * length
  5394. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5395. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5396. * length
  5397. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5398. * num jump
  5399. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5400. * num jump
  5401. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5402. * data type switch has happend for MPDU Sequence num jump
  5403. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5404. * for MPDU Sequence num jump
  5405. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5406. * for decrypt errors
  5407. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5408. * while aggregating a msdu
  5409. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5410. * The aggregation is done until (number of MSDUs aggregated
  5411. * < LIMIT + 1)
  5412. * b'31:18 - Reserved
  5413. *
  5414. * fisa_control_value - 32bit value FW can write to register
  5415. *
  5416. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5417. * Threshold value for FISA timeout (units are microseconds).
  5418. * When the global timestamp exceeds this threshold, FISA
  5419. * aggregation will be restarted.
  5420. * A value of 0 means timeout is disabled.
  5421. * Compare the threshold register with timestamp field in
  5422. * flow entry to generate timeout for the flow.
  5423. *
  5424. * |31 18 |17 16|15 8|7 0|
  5425. * |-------------------------------------------------------------|
  5426. * | reserved | pdev_mask | msg type |
  5427. * |-------------------------------------------------------------|
  5428. * | reserved | FISA_CTRL |
  5429. * |-------------------------------------------------------------|
  5430. * | FISA_TIMEOUT_THRESH |
  5431. * |-------------------------------------------------------------|
  5432. */
  5433. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5434. A_UINT32 msg_type:8,
  5435. pdev_id:8,
  5436. reserved0:16;
  5437. /**
  5438. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5439. * [17:0]
  5440. */
  5441. union {
  5442. struct {
  5443. A_UINT32 fisa_enable: 1,
  5444. ipsec_skip_search: 1,
  5445. nontcp_skip_search: 1,
  5446. add_ipv4_fixed_hdr_len: 1,
  5447. add_ipv6_fixed_hdr_len: 1,
  5448. add_tcp_fixed_hdr_len: 1,
  5449. add_udp_hdr_len: 1,
  5450. chksum_cum_ip_len_en: 1,
  5451. disable_tid_check: 1,
  5452. disable_ta_check: 1,
  5453. disable_qos_check: 1,
  5454. disable_raw_check: 1,
  5455. disable_decrypt_err_check: 1,
  5456. disable_msdu_drop_check: 1,
  5457. fisa_aggr_limit: 4,
  5458. reserved: 14;
  5459. } fisa_control_bits;
  5460. A_UINT32 fisa_control_value;
  5461. } u_fisa_control;
  5462. /**
  5463. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5464. * timeout threshold for aggregation. Unit in usec.
  5465. * [31:0]
  5466. */
  5467. A_UINT32 fisa_timeout_threshold;
  5468. } POSTPACK;
  5469. /* DWord 0: pdev-ID */
  5470. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5471. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5472. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5473. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5474. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5475. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5476. do { \
  5477. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5478. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5479. } while (0)
  5480. /* Dword 1: fisa_control_value fisa config */
  5481. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5482. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5483. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5484. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5485. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5486. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5489. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5490. } while (0)
  5491. /* Dword 1: fisa_control_value ipsec_skip_search */
  5492. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5493. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5494. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5495. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5496. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5497. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5498. do { \
  5499. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5500. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5501. } while (0)
  5502. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5503. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5504. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5505. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5506. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5507. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5508. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5512. } while (0)
  5513. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5514. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5515. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5516. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5517. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5518. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5519. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5523. } while (0)
  5524. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5525. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5526. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5527. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5528. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5529. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5530. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5531. do { \
  5532. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5533. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5534. } while (0)
  5535. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5536. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5537. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5538. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5539. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5540. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5541. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5545. } while (0)
  5546. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5547. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5548. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5549. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5550. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5551. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5552. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5553. do { \
  5554. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5555. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5556. } while (0)
  5557. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5558. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5559. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5560. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5561. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5562. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5563. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5567. } while (0)
  5568. /* Dword 1: fisa_control_value disable_tid_check */
  5569. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5570. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5571. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5572. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5573. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5574. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5577. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5578. } while (0)
  5579. /* Dword 1: fisa_control_value disable_ta_check */
  5580. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5581. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5582. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5583. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5584. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5586. do { \
  5587. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5588. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5589. } while (0)
  5590. /* Dword 1: fisa_control_value disable_qos_check */
  5591. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5592. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5593. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5594. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5595. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5597. do { \
  5598. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5599. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5600. } while (0)
  5601. /* Dword 1: fisa_control_value disable_raw_check */
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5604. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5605. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5606. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5608. do { \
  5609. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5610. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5611. } while (0)
  5612. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5615. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5616. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5617. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5618. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5622. } while (0)
  5623. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5624. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5625. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5626. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5627. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5628. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5629. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5633. } while (0)
  5634. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5635. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5636. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5637. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5638. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5639. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5640. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5641. do { \
  5642. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5643. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5644. } while (0)
  5645. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5646. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5647. pdev_id:8,
  5648. reserved0:16;
  5649. A_UINT32 num_records:20,
  5650. max_search:8,
  5651. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5652. reserved1:2;
  5653. A_UINT32 base_addr_lo;
  5654. A_UINT32 base_addr_hi;
  5655. A_UINT32 toeplitz31_0;
  5656. A_UINT32 toeplitz63_32;
  5657. A_UINT32 toeplitz95_64;
  5658. A_UINT32 toeplitz127_96;
  5659. A_UINT32 toeplitz159_128;
  5660. A_UINT32 toeplitz191_160;
  5661. A_UINT32 toeplitz223_192;
  5662. A_UINT32 toeplitz255_224;
  5663. A_UINT32 toeplitz287_256;
  5664. A_UINT32 toeplitz314_288:27,
  5665. reserved2:5;
  5666. } POSTPACK;
  5667. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5668. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5669. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5670. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5671. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5672. /* DWORD 0: Pdev ID */
  5673. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5674. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5675. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5676. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5677. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5678. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5679. do { \
  5680. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5681. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5682. } while (0)
  5683. /* DWORD 1:num of records */
  5684. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5685. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5686. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5687. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5688. HTT_RX_FSE_SETUP_NUM_REC_S)
  5689. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5692. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5693. } while (0)
  5694. /* DWORD 1:max_search */
  5695. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5696. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5697. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5698. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5699. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5700. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5701. do { \
  5702. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5703. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5704. } while (0)
  5705. /* DWORD 1:ip_da_sa prefix */
  5706. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5707. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5708. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5709. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5710. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5711. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5714. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5715. } while (0)
  5716. /* DWORD 2: Base Address LO */
  5717. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5718. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5719. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5720. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5721. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5722. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5725. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5726. } while (0)
  5727. /* DWORD 3: Base Address High */
  5728. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5729. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5730. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5731. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5732. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5733. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5736. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5737. } while (0)
  5738. /* DWORD 4-12: Hash Value */
  5739. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5740. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5741. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5742. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5743. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5744. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5747. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5748. } while (0)
  5749. /* DWORD 13: Hash Value 314:288 bits */
  5750. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5751. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5752. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5753. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5754. do { \
  5755. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5756. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5757. } while (0)
  5758. /**
  5759. * @brief Host-->target HTT RX FSE operation message
  5760. * @details
  5761. * The host will send this Flow Search Engine (FSE) operation message for
  5762. * every flow add/delete operation.
  5763. * The FSE operation includes FSE full cache invalidation or individual entry
  5764. * invalidation.
  5765. * This message can be sent per SOC or per PDEV which is differentiated
  5766. * by pdev id values.
  5767. *
  5768. * |31 16|15 8|7 1|0|
  5769. * |-------------------------------------------------------------|
  5770. * | reserved | pdev_id | MSG_TYPE |
  5771. * |-------------------------------------------------------------|
  5772. * | reserved | operation |I|
  5773. * |-------------------------------------------------------------|
  5774. * | ip_src_addr_31_0 |
  5775. * |-------------------------------------------------------------|
  5776. * | ip_src_addr_63_32 |
  5777. * |-------------------------------------------------------------|
  5778. * | ip_src_addr_95_64 |
  5779. * |-------------------------------------------------------------|
  5780. * | ip_src_addr_127_96 |
  5781. * |-------------------------------------------------------------|
  5782. * | ip_dst_addr_31_0 |
  5783. * |-------------------------------------------------------------|
  5784. * | ip_dst_addr_63_32 |
  5785. * |-------------------------------------------------------------|
  5786. * | ip_dst_addr_95_64 |
  5787. * |-------------------------------------------------------------|
  5788. * | ip_dst_addr_127_96 |
  5789. * |-------------------------------------------------------------|
  5790. * | l4_dst_port | l4_src_port |
  5791. * | (32-bit SPI incase of IPsec) |
  5792. * |-------------------------------------------------------------|
  5793. * | reserved | l4_proto |
  5794. * |-------------------------------------------------------------|
  5795. *
  5796. * where I is 1-bit ipsec_valid.
  5797. *
  5798. * The following field definitions describe the format of the RX FSE operation
  5799. * message sent from the host to target for every add/delete flow entry to flow
  5800. * table.
  5801. *
  5802. * Header fields:
  5803. * dword0 - b'7:0 - msg_type: This will be set to
  5804. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5805. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5806. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5807. * specified pdev's LMAC ring.
  5808. * b'31:16 - reserved : Reserved for future use
  5809. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5810. * (Internet Protocol Security).
  5811. * IPsec describes the framework for providing security at
  5812. * IP layer. IPsec is defined for both versions of IP:
  5813. * IPV4 and IPV6.
  5814. * Please refer to htt_rx_flow_proto enumeration below for
  5815. * more info.
  5816. * ipsec_valid = 1 for IPSEC packets
  5817. * ipsec_valid = 0 for IP Packets
  5818. * b'7:1 - operation: This indicates types of FSE operation.
  5819. * Refer to htt_rx_fse_operation enumeration:
  5820. * 0 - No Cache Invalidation required
  5821. * 1 - Cache invalidate only one entry given by IP
  5822. * src/dest address at DWORD[2:9]
  5823. * 2 - Complete FSE Cache Invalidation
  5824. * 3 - FSE Disable
  5825. * 4 - FSE Enable
  5826. * b'31:8 - reserved: Reserved for future use
  5827. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5828. * for per flow addition/deletion
  5829. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5830. * and the subsequent 3 A_UINT32 will be padding bytes.
  5831. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5832. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5833. * from 0 to 65535 but only 0 to 1023 are designated as
  5834. * well-known ports. Refer to [RFC1700] for more details.
  5835. * This field is valid only if
  5836. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5837. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5838. * range from 0 to 65535 but only 0 to 1023 are designated
  5839. * as well-known ports. Refer to [RFC1700] for more details.
  5840. * This field is valid only if
  5841. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5842. * - SPI (31:0): Security Parameters Index is an
  5843. * identification tag added to the header while using IPsec
  5844. * for tunneling the IP traffici.
  5845. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5846. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5847. * Assigned Internet Protocol Numbers.
  5848. * l4_proto numbers for standard protocol like UDP/TCP
  5849. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5850. * l4_proto = 17 for UDP etc.
  5851. * b'31:8 - reserved: Reserved for future use.
  5852. *
  5853. */
  5854. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5855. A_UINT32 msg_type:8,
  5856. pdev_id:8,
  5857. reserved0:16;
  5858. A_UINT32 ipsec_valid:1,
  5859. operation:7,
  5860. reserved1:24;
  5861. A_UINT32 ip_src_addr_31_0;
  5862. A_UINT32 ip_src_addr_63_32;
  5863. A_UINT32 ip_src_addr_95_64;
  5864. A_UINT32 ip_src_addr_127_96;
  5865. A_UINT32 ip_dest_addr_31_0;
  5866. A_UINT32 ip_dest_addr_63_32;
  5867. A_UINT32 ip_dest_addr_95_64;
  5868. A_UINT32 ip_dest_addr_127_96;
  5869. union {
  5870. A_UINT32 spi;
  5871. struct {
  5872. A_UINT32 l4_src_port:16,
  5873. l4_dest_port:16;
  5874. } ip;
  5875. } u;
  5876. A_UINT32 l4_proto:8,
  5877. reserved:24;
  5878. } POSTPACK;
  5879. /**
  5880. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5881. * @details
  5882. * The host will send this Full monitor mode register configuration message.
  5883. * This message can be sent per SOC or per PDEV which is differentiated
  5884. * by pdev id values.
  5885. *
  5886. * |31 16|15 11|10 8|7 3|2|1|0|
  5887. * |-------------------------------------------------------------|
  5888. * | reserved | pdev_id | MSG_TYPE |
  5889. * |-------------------------------------------------------------|
  5890. * | reserved |Release Ring |N|Z|E|
  5891. * |-------------------------------------------------------------|
  5892. *
  5893. * where E is 1-bit full monitor mode enable/disable.
  5894. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5895. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5896. *
  5897. * The following field definitions describe the format of the full monitor
  5898. * mode configuration message sent from the host to target for each pdev.
  5899. *
  5900. * Header fields:
  5901. * dword0 - b'7:0 - msg_type: This will be set to
  5902. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5903. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5904. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5905. * specified pdev's LMAC ring.
  5906. * b'31:16 - reserved : Reserved for future use.
  5907. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5908. * monitor mode rxdma register is to be enabled or disabled.
  5909. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5910. * additional descriptors at ppdu end for zero mpdus
  5911. * enabled or disabled.
  5912. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5913. * additional descriptors at ppdu end for non zero mpdus
  5914. * enabled or disabled.
  5915. * b'10:3 - release_ring: This indicates the destination ring
  5916. * selection for the descriptor at the end of PPDU
  5917. * 0 - REO ring select
  5918. * 1 - FW ring select
  5919. * 2 - SW ring select
  5920. * 3 - Release ring select
  5921. * Refer to htt_rx_full_mon_release_ring.
  5922. * b'31:11 - reserved for future use
  5923. */
  5924. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5925. A_UINT32 msg_type:8,
  5926. pdev_id:8,
  5927. reserved0:16;
  5928. A_UINT32 full_monitor_mode_enable:1,
  5929. addnl_descs_zero_mpdus_end:1,
  5930. addnl_descs_non_zero_mpdus_end:1,
  5931. release_ring:8,
  5932. reserved1:21;
  5933. } POSTPACK;
  5934. /**
  5935. * Enumeration for full monitor mode destination ring select
  5936. * 0 - REO destination ring select
  5937. * 1 - FW destination ring select
  5938. * 2 - SW destination ring select
  5939. * 3 - Release destination ring select
  5940. */
  5941. enum htt_rx_full_mon_release_ring {
  5942. HTT_RX_MON_RING_REO,
  5943. HTT_RX_MON_RING_FW,
  5944. HTT_RX_MON_RING_SW,
  5945. HTT_RX_MON_RING_RELEASE,
  5946. };
  5947. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5948. /* DWORD 0: Pdev ID */
  5949. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5950. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5951. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5952. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5953. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5954. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5955. do { \
  5956. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5957. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5958. } while (0)
  5959. /* DWORD 1:ENABLE */
  5960. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5961. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5962. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5963. do { \
  5964. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5965. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5966. } while (0)
  5967. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5968. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5969. /* DWORD 1:ZERO_MPDU */
  5970. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5971. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5972. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5973. do { \
  5974. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5975. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5976. } while (0)
  5977. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5978. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5979. /* DWORD 1:NON_ZERO_MPDU */
  5980. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5981. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5982. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5985. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5986. } while (0)
  5987. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5988. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5989. /* DWORD 1:RELEASE_RINGS */
  5990. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5991. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5992. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5993. do { \
  5994. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  5995. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  5996. } while (0)
  5997. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  5998. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  5999. /**
  6000. * Enumeration for IP Protocol or IPSEC Protocol
  6001. * IPsec describes the framework for providing security at IP layer.
  6002. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6003. */
  6004. enum htt_rx_flow_proto {
  6005. HTT_RX_FLOW_IP_PROTO,
  6006. HTT_RX_FLOW_IPSEC_PROTO,
  6007. };
  6008. /**
  6009. * Enumeration for FSE Cache Invalidation
  6010. * 0 - No Cache Invalidation required
  6011. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6012. * 2 - Complete FSE Cache Invalidation
  6013. * 3 - FSE Disable
  6014. * 4 - FSE Enable
  6015. */
  6016. enum htt_rx_fse_operation {
  6017. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6018. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6019. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6020. HTT_RX_FSE_DISABLE,
  6021. HTT_RX_FSE_ENABLE,
  6022. };
  6023. /* DWORD 0: Pdev ID */
  6024. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6025. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6026. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6027. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6028. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6029. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6030. do { \
  6031. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6032. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6033. } while (0)
  6034. /* DWORD 1:IP PROTO or IPSEC */
  6035. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6036. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6037. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6038. do { \
  6039. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6040. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6041. } while (0)
  6042. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6043. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6044. /* DWORD 1:FSE Operation */
  6045. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6046. #define HTT_RX_FSE_OPERATION_S 1
  6047. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6048. do { \
  6049. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6050. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6051. } while (0)
  6052. #define HTT_RX_FSE_OPERATION_GET(word) \
  6053. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6054. /* DWORD 2-9:IP Address */
  6055. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6056. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6057. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6058. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6059. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6060. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6061. do { \
  6062. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6063. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6064. } while (0)
  6065. /* DWORD 10:Source Port Number */
  6066. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6067. #define HTT_RX_FSE_SOURCEPORT_S 0
  6068. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6069. do { \
  6070. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6071. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6072. } while (0)
  6073. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6074. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6075. /* DWORD 11:Destination Port Number */
  6076. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6077. #define HTT_RX_FSE_DESTPORT_S 16
  6078. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6081. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6082. } while (0)
  6083. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6084. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6085. /* DWORD 10-11:SPI (In case of IPSEC) */
  6086. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6087. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6088. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6089. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6090. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6091. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6092. do { \
  6093. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6094. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6095. } while (0)
  6096. /* DWORD 12:L4 PROTO */
  6097. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6098. #define HTT_RX_FSE_L4_PROTO_S 0
  6099. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6100. do { \
  6101. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6102. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6103. } while (0)
  6104. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6105. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6106. /**
  6107. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6108. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6109. *
  6110. * |31 24|23 |15 8|7 2|1|0|
  6111. * |----------------+----------------+----------------+----------------|
  6112. * | reserved | pdev_id | msg_type |
  6113. * |---------------------------------+----------------+----------------|
  6114. * | reserved |E|F|
  6115. * |---------------------------------+----------------+----------------|
  6116. * Where E = Configure the target to provide the 3-tuple hash value in
  6117. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6118. * F = Configure the target to provide the 3-tuple hash value in
  6119. * flow_id_toeplitz field of rx_msdu_start tlv
  6120. *
  6121. * The following field definitions describe the format of the 3 tuple hash value
  6122. * message sent from the host to target as part of initialization sequence.
  6123. *
  6124. * Header fields:
  6125. * dword0 - b'7:0 - msg_type: This will be set to
  6126. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6127. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6128. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6129. * specified pdev's LMAC ring.
  6130. * b'31:16 - reserved : Reserved for future use
  6131. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6132. * b'1 - toeplitz_hash_2_or_4_field_enable
  6133. * b'31:2 - reserved : Reserved for future use
  6134. * ---------+------+----------------------------------------------------------
  6135. * bit1 | bit0 | Functionality
  6136. * ---------+------+----------------------------------------------------------
  6137. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6138. * | | in flow_id_toeplitz field
  6139. * ---------+------+----------------------------------------------------------
  6140. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6141. * | | in toeplitz_hash_2_or_4 field
  6142. * ---------+------+----------------------------------------------------------
  6143. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6144. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6145. * ---------+------+----------------------------------------------------------
  6146. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6147. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6148. * | | toeplitz_hash_2_or_4 field
  6149. *----------------------------------------------------------------------------
  6150. */
  6151. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6152. A_UINT32 msg_type :8,
  6153. pdev_id :8,
  6154. reserved0 :16;
  6155. A_UINT32 flow_id_toeplitz_field_enable :1,
  6156. toeplitz_hash_2_or_4_field_enable :1,
  6157. reserved1 :30;
  6158. } POSTPACK;
  6159. /* DWORD0 : pdev_id configuration Macros */
  6160. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6161. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6162. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6163. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6164. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6165. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6166. do { \
  6167. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6168. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6169. } while (0)
  6170. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6171. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6172. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6173. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6174. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6175. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6176. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6177. do { \
  6178. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6179. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6180. } while (0)
  6181. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6182. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6183. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6184. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6185. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6186. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6187. do { \
  6188. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6189. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6190. } while (0)
  6191. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6192. /*=== target -> host messages ===============================================*/
  6193. enum htt_t2h_msg_type {
  6194. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6195. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6196. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6197. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6198. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6199. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6200. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6201. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6202. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6203. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6204. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6205. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6206. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6207. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6208. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6209. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6210. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6211. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6212. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6213. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6214. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6215. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6216. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6217. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6218. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6219. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6220. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6221. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6222. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6223. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6224. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6225. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6226. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6227. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6228. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6229. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6230. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6231. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6232. /* TX_OFFLOAD_DELIVER_IND:
  6233. * Forward the target's locally-generated packets to the host,
  6234. * to provide to the monitor mode interface.
  6235. */
  6236. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6237. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6238. HTT_T2H_MSG_TYPE_TEST,
  6239. /* keep this last */
  6240. HTT_T2H_NUM_MSGS
  6241. };
  6242. /*
  6243. * HTT target to host message type -
  6244. * stored in bits 7:0 of the first word of the message
  6245. */
  6246. #define HTT_T2H_MSG_TYPE_M 0xff
  6247. #define HTT_T2H_MSG_TYPE_S 0
  6248. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6249. do { \
  6250. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6251. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6252. } while (0)
  6253. #define HTT_T2H_MSG_TYPE_GET(word) \
  6254. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6255. /**
  6256. * @brief target -> host version number confirmation message definition
  6257. *
  6258. * |31 24|23 16|15 8|7 0|
  6259. * |----------------+----------------+----------------+----------------|
  6260. * | reserved | major number | minor number | msg type |
  6261. * |-------------------------------------------------------------------|
  6262. * : option request TLV (optional) |
  6263. * :...................................................................:
  6264. *
  6265. * The VER_CONF message may consist of a single 4-byte word, or may be
  6266. * extended with TLVs that specify HTT options selected by the target.
  6267. * The following option TLVs may be appended to the VER_CONF message:
  6268. * - LL_BUS_ADDR_SIZE
  6269. * - HL_SUPPRESS_TX_COMPL_IND
  6270. * - MAX_TX_QUEUE_GROUPS
  6271. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6272. * may be appended to the VER_CONF message (but only one TLV of each type).
  6273. *
  6274. * Header fields:
  6275. * - MSG_TYPE
  6276. * Bits 7:0
  6277. * Purpose: identifies this as a version number confirmation message
  6278. * Value: 0x0
  6279. * - VER_MINOR
  6280. * Bits 15:8
  6281. * Purpose: Specify the minor number of the HTT message library version
  6282. * in use by the target firmware.
  6283. * The minor number specifies the specific revision within a range
  6284. * of fundamentally compatible HTT message definition revisions.
  6285. * Compatible revisions involve adding new messages or perhaps
  6286. * adding new fields to existing messages, in a backwards-compatible
  6287. * manner.
  6288. * Incompatible revisions involve changing the message type values,
  6289. * or redefining existing messages.
  6290. * Value: minor number
  6291. * - VER_MAJOR
  6292. * Bits 15:8
  6293. * Purpose: Specify the major number of the HTT message library version
  6294. * in use by the target firmware.
  6295. * The major number specifies the family of minor revisions that are
  6296. * fundamentally compatible with each other, but not with prior or
  6297. * later families.
  6298. * Value: major number
  6299. */
  6300. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6301. #define HTT_VER_CONF_MINOR_S 8
  6302. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6303. #define HTT_VER_CONF_MAJOR_S 16
  6304. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6307. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6308. } while (0)
  6309. #define HTT_VER_CONF_MINOR_GET(word) \
  6310. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6311. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6314. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6315. } while (0)
  6316. #define HTT_VER_CONF_MAJOR_GET(word) \
  6317. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6318. #define HTT_VER_CONF_BYTES 4
  6319. /**
  6320. * @brief - target -> host HTT Rx In order indication message
  6321. *
  6322. * @details
  6323. *
  6324. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6325. * |----------------+-------------------+---------------------+---------------|
  6326. * | peer ID | P| F| O| ext TID | msg type |
  6327. * |--------------------------------------------------------------------------|
  6328. * | MSDU count | Reserved | vdev id |
  6329. * |--------------------------------------------------------------------------|
  6330. * | MSDU 0 bus address (bits 31:0) |
  6331. #if HTT_PADDR64
  6332. * | MSDU 0 bus address (bits 63:32) |
  6333. #endif
  6334. * |--------------------------------------------------------------------------|
  6335. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6336. * |--------------------------------------------------------------------------|
  6337. * | MSDU 1 bus address (bits 31:0) |
  6338. #if HTT_PADDR64
  6339. * | MSDU 1 bus address (bits 63:32) |
  6340. #endif
  6341. * |--------------------------------------------------------------------------|
  6342. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6343. * |--------------------------------------------------------------------------|
  6344. */
  6345. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6346. *
  6347. * @details
  6348. * bits
  6349. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6350. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6351. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6352. * | | frag | | | | fail |chksum fail|
  6353. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6354. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6355. */
  6356. struct htt_rx_in_ord_paddr_ind_hdr_t
  6357. {
  6358. A_UINT32 /* word 0 */
  6359. msg_type: 8,
  6360. ext_tid: 5,
  6361. offload: 1,
  6362. frag: 1,
  6363. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6364. peer_id: 16;
  6365. A_UINT32 /* word 1 */
  6366. vap_id: 8,
  6367. /* NOTE:
  6368. * This reserved_1 field is not truly reserved - certain targets use
  6369. * this field internally to store debug information, and do not zero
  6370. * out the contents of the field before uploading the message to the
  6371. * host. Thus, any host-target communication supported by this field
  6372. * is limited to using values that are never used by the debug
  6373. * information stored by certain targets in the reserved_1 field.
  6374. * In particular, the targets in question don't use the value 0x3
  6375. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6376. * so this previously-unused value within these bits is available to
  6377. * use as the host / target PKT_CAPTURE_MODE flag.
  6378. */
  6379. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6380. /* if pkt_capture_mode == 0x3, host should
  6381. * send rx frames to monitor mode interface
  6382. */
  6383. msdu_cnt: 16;
  6384. };
  6385. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6386. {
  6387. A_UINT32 dma_addr;
  6388. A_UINT32
  6389. length: 16,
  6390. fw_desc: 8,
  6391. msdu_info:8;
  6392. };
  6393. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6394. {
  6395. A_UINT32 dma_addr_lo;
  6396. A_UINT32 dma_addr_hi;
  6397. A_UINT32
  6398. length: 16,
  6399. fw_desc: 8,
  6400. msdu_info:8;
  6401. };
  6402. #if HTT_PADDR64
  6403. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6404. #else
  6405. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6406. #endif
  6407. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6408. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6409. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6410. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6411. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6412. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6413. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6414. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6415. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6416. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6417. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6418. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6419. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6420. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6421. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6422. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6423. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6424. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6425. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6426. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6427. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6428. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6429. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6430. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6431. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6432. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6433. /* for systems using 64-bit format for bus addresses */
  6434. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6435. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6436. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6437. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6438. /* for systems using 32-bit format for bus addresses */
  6439. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6440. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6441. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6443. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6444. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6445. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6447. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6448. do { \
  6449. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6450. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6451. } while (0)
  6452. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6453. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6454. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6457. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6458. } while (0)
  6459. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6460. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6461. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6462. do { \
  6463. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6464. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6465. } while (0)
  6466. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6467. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6468. /*
  6469. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6470. * deliver the rx frames to the monitor mode interface.
  6471. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6472. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6473. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6474. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6475. */
  6476. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6477. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6478. do { \
  6479. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6480. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6481. } while (0)
  6482. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6483. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6484. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6485. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6488. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6489. } while (0)
  6490. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6491. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6492. /* for systems using 64-bit format for bus addresses */
  6493. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6496. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6497. } while (0)
  6498. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6499. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6500. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6503. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6504. } while (0)
  6505. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6506. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6507. /* for systems using 32-bit format for bus addresses */
  6508. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6511. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6512. } while (0)
  6513. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6514. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6515. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6518. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6519. } while (0)
  6520. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6521. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6522. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6525. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6526. } while (0)
  6527. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6528. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6529. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6532. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6533. } while (0)
  6534. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6535. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6536. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6539. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6540. } while (0)
  6541. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6542. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6543. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6546. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6547. } while (0)
  6548. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6549. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6550. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6553. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6554. } while (0)
  6555. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6556. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6557. /* definitions used within target -> host rx indication message */
  6558. PREPACK struct htt_rx_ind_hdr_prefix_t
  6559. {
  6560. A_UINT32 /* word 0 */
  6561. msg_type: 8,
  6562. ext_tid: 5,
  6563. release_valid: 1,
  6564. flush_valid: 1,
  6565. reserved0: 1,
  6566. peer_id: 16;
  6567. A_UINT32 /* word 1 */
  6568. flush_start_seq_num: 6,
  6569. flush_end_seq_num: 6,
  6570. release_start_seq_num: 6,
  6571. release_end_seq_num: 6,
  6572. num_mpdu_ranges: 8;
  6573. } POSTPACK;
  6574. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6575. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6576. #define HTT_TGT_RSSI_INVALID 0x80
  6577. PREPACK struct htt_rx_ppdu_desc_t
  6578. {
  6579. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6580. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6581. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6582. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6583. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6584. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6585. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6586. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6587. A_UINT32 /* word 0 */
  6588. rssi_cmb: 8,
  6589. timestamp_submicrosec: 8,
  6590. phy_err_code: 8,
  6591. phy_err: 1,
  6592. legacy_rate: 4,
  6593. legacy_rate_sel: 1,
  6594. end_valid: 1,
  6595. start_valid: 1;
  6596. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6597. union {
  6598. A_UINT32 /* word 1 */
  6599. rssi0_pri20: 8,
  6600. rssi0_ext20: 8,
  6601. rssi0_ext40: 8,
  6602. rssi0_ext80: 8;
  6603. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6604. } u0;
  6605. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6606. union {
  6607. A_UINT32 /* word 2 */
  6608. rssi1_pri20: 8,
  6609. rssi1_ext20: 8,
  6610. rssi1_ext40: 8,
  6611. rssi1_ext80: 8;
  6612. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6613. } u1;
  6614. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6615. union {
  6616. A_UINT32 /* word 3 */
  6617. rssi2_pri20: 8,
  6618. rssi2_ext20: 8,
  6619. rssi2_ext40: 8,
  6620. rssi2_ext80: 8;
  6621. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6622. } u2;
  6623. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6624. union {
  6625. A_UINT32 /* word 4 */
  6626. rssi3_pri20: 8,
  6627. rssi3_ext20: 8,
  6628. rssi3_ext40: 8,
  6629. rssi3_ext80: 8;
  6630. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6631. } u3;
  6632. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6633. A_UINT32 tsf32; /* word 5 */
  6634. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6635. A_UINT32 timestamp_microsec; /* word 6 */
  6636. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6637. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6638. A_UINT32 /* word 7 */
  6639. vht_sig_a1: 24,
  6640. preamble_type: 8;
  6641. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6642. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6643. A_UINT32 /* word 8 */
  6644. vht_sig_a2: 24,
  6645. /* sa_ant_matrix
  6646. * For cases where a single rx chain has options to be connected to
  6647. * different rx antennas, show which rx antennas were in use during
  6648. * receipt of a given PPDU.
  6649. * This sa_ant_matrix provides a bitmask of the antennas used while
  6650. * receiving this frame.
  6651. */
  6652. sa_ant_matrix: 8;
  6653. } POSTPACK;
  6654. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6655. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6656. PREPACK struct htt_rx_ind_hdr_suffix_t
  6657. {
  6658. A_UINT32 /* word 0 */
  6659. fw_rx_desc_bytes: 16,
  6660. reserved0: 16;
  6661. } POSTPACK;
  6662. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6663. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6664. PREPACK struct htt_rx_ind_hdr_t
  6665. {
  6666. struct htt_rx_ind_hdr_prefix_t prefix;
  6667. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6668. struct htt_rx_ind_hdr_suffix_t suffix;
  6669. } POSTPACK;
  6670. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6671. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6672. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6673. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6674. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6675. /*
  6676. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6677. * the offset into the HTT rx indication message at which the
  6678. * FW rx PPDU descriptor resides
  6679. */
  6680. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6681. /*
  6682. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6683. * the offset into the HTT rx indication message at which the
  6684. * header suffix (FW rx MSDU byte count) resides
  6685. */
  6686. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6687. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6688. /*
  6689. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6690. * the offset into the HTT rx indication message at which the per-MSDU
  6691. * information starts
  6692. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6693. * per-MSDU information portion of the message. The per-MSDU info itself
  6694. * starts at byte 12.
  6695. */
  6696. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6697. /**
  6698. * @brief target -> host rx indication message definition
  6699. *
  6700. * @details
  6701. * The following field definitions describe the format of the rx indication
  6702. * message sent from the target to the host.
  6703. * The message consists of three major sections:
  6704. * 1. a fixed-length header
  6705. * 2. a variable-length list of firmware rx MSDU descriptors
  6706. * 3. one or more 4-octet MPDU range information elements
  6707. * The fixed length header itself has two sub-sections
  6708. * 1. the message meta-information, including identification of the
  6709. * sender and type of the received data, and a 4-octet flush/release IE
  6710. * 2. the firmware rx PPDU descriptor
  6711. *
  6712. * The format of the message is depicted below.
  6713. * in this depiction, the following abbreviations are used for information
  6714. * elements within the message:
  6715. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6716. * elements associated with the PPDU start are valid.
  6717. * Specifically, the following fields are valid only if SV is set:
  6718. * RSSI (all variants), L, legacy rate, preamble type, service,
  6719. * VHT-SIG-A
  6720. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6721. * elements associated with the PPDU end are valid.
  6722. * Specifically, the following fields are valid only if EV is set:
  6723. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6724. * - L - Legacy rate selector - if legacy rates are used, this flag
  6725. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6726. * (L == 0) PHY.
  6727. * - P - PHY error flag - boolean indication of whether the rx frame had
  6728. * a PHY error
  6729. *
  6730. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6731. * |----------------+-------------------+---------------------+---------------|
  6732. * | peer ID | |RV|FV| ext TID | msg type |
  6733. * |--------------------------------------------------------------------------|
  6734. * | num | release | release | flush | flush |
  6735. * | MPDU | end | start | end | start |
  6736. * | ranges | seq num | seq num | seq num | seq num |
  6737. * |==========================================================================|
  6738. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6739. * |V|V| | rate | | | timestamp | RSSI |
  6740. * |--------------------------------------------------------------------------|
  6741. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6742. * |--------------------------------------------------------------------------|
  6743. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6744. * |--------------------------------------------------------------------------|
  6745. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6746. * |--------------------------------------------------------------------------|
  6747. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6748. * |--------------------------------------------------------------------------|
  6749. * | TSF LSBs |
  6750. * |--------------------------------------------------------------------------|
  6751. * | microsec timestamp |
  6752. * |--------------------------------------------------------------------------|
  6753. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6754. * |--------------------------------------------------------------------------|
  6755. * | service | HT-SIG / VHT-SIG-A2 |
  6756. * |==========================================================================|
  6757. * | reserved | FW rx desc bytes |
  6758. * |--------------------------------------------------------------------------|
  6759. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6760. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6761. * |--------------------------------------------------------------------------|
  6762. * : : :
  6763. * |--------------------------------------------------------------------------|
  6764. * | alignment | MSDU Rx |
  6765. * | padding | desc Bn |
  6766. * |--------------------------------------------------------------------------|
  6767. * | reserved | MPDU range status | MPDU count |
  6768. * |--------------------------------------------------------------------------|
  6769. * : reserved : MPDU range status : MPDU count :
  6770. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6771. *
  6772. * Header fields:
  6773. * - MSG_TYPE
  6774. * Bits 7:0
  6775. * Purpose: identifies this as an rx indication message
  6776. * Value: 0x1
  6777. * - EXT_TID
  6778. * Bits 12:8
  6779. * Purpose: identify the traffic ID of the rx data, including
  6780. * special "extended" TID values for multicast, broadcast, and
  6781. * non-QoS data frames
  6782. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6783. * - FLUSH_VALID (FV)
  6784. * Bit 13
  6785. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6786. * is valid
  6787. * Value:
  6788. * 1 -> flush IE is valid and needs to be processed
  6789. * 0 -> flush IE is not valid and should be ignored
  6790. * - REL_VALID (RV)
  6791. * Bit 13
  6792. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6793. * is valid
  6794. * Value:
  6795. * 1 -> release IE is valid and needs to be processed
  6796. * 0 -> release IE is not valid and should be ignored
  6797. * - PEER_ID
  6798. * Bits 31:16
  6799. * Purpose: Identify, by ID, which peer sent the rx data
  6800. * Value: ID of the peer who sent the rx data
  6801. * - FLUSH_SEQ_NUM_START
  6802. * Bits 5:0
  6803. * Purpose: Indicate the start of a series of MPDUs to flush
  6804. * Not all MPDUs within this series are necessarily valid - the host
  6805. * must check each sequence number within this range to see if the
  6806. * corresponding MPDU is actually present.
  6807. * This field is only valid if the FV bit is set.
  6808. * Value:
  6809. * The sequence number for the first MPDUs to check to flush.
  6810. * The sequence number is masked by 0x3f.
  6811. * - FLUSH_SEQ_NUM_END
  6812. * Bits 11:6
  6813. * Purpose: Indicate the end of a series of MPDUs to flush
  6814. * Value:
  6815. * The sequence number one larger than the sequence number of the
  6816. * last MPDU to check to flush.
  6817. * The sequence number is masked by 0x3f.
  6818. * Not all MPDUs within this series are necessarily valid - the host
  6819. * must check each sequence number within this range to see if the
  6820. * corresponding MPDU is actually present.
  6821. * This field is only valid if the FV bit is set.
  6822. * - REL_SEQ_NUM_START
  6823. * Bits 17:12
  6824. * Purpose: Indicate the start of a series of MPDUs to release.
  6825. * All MPDUs within this series are present and valid - the host
  6826. * need not check each sequence number within this range to see if
  6827. * the corresponding MPDU is actually present.
  6828. * This field is only valid if the RV bit is set.
  6829. * Value:
  6830. * The sequence number for the first MPDUs to check to release.
  6831. * The sequence number is masked by 0x3f.
  6832. * - REL_SEQ_NUM_END
  6833. * Bits 23:18
  6834. * Purpose: Indicate the end of a series of MPDUs to release.
  6835. * Value:
  6836. * The sequence number one larger than the sequence number of the
  6837. * last MPDU to check to release.
  6838. * The sequence number is masked by 0x3f.
  6839. * All MPDUs within this series are present and valid - the host
  6840. * need not check each sequence number within this range to see if
  6841. * the corresponding MPDU is actually present.
  6842. * This field is only valid if the RV bit is set.
  6843. * - NUM_MPDU_RANGES
  6844. * Bits 31:24
  6845. * Purpose: Indicate how many ranges of MPDUs are present.
  6846. * Each MPDU range consists of a series of contiguous MPDUs within the
  6847. * rx frame sequence which all have the same MPDU status.
  6848. * Value: 1-63 (typically a small number, like 1-3)
  6849. *
  6850. * Rx PPDU descriptor fields:
  6851. * - RSSI_CMB
  6852. * Bits 7:0
  6853. * Purpose: Combined RSSI from all active rx chains, across the active
  6854. * bandwidth.
  6855. * Value: RSSI dB units w.r.t. noise floor
  6856. * - TIMESTAMP_SUBMICROSEC
  6857. * Bits 15:8
  6858. * Purpose: high-resolution timestamp
  6859. * Value:
  6860. * Sub-microsecond time of PPDU reception.
  6861. * This timestamp ranges from [0,MAC clock MHz).
  6862. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6863. * to form a high-resolution, large range rx timestamp.
  6864. * - PHY_ERR_CODE
  6865. * Bits 23:16
  6866. * Purpose:
  6867. * If the rx frame processing resulted in a PHY error, indicate what
  6868. * type of rx PHY error occurred.
  6869. * Value:
  6870. * This field is valid if the "P" (PHY_ERR) flag is set.
  6871. * TBD: document/specify the values for this field
  6872. * - PHY_ERR
  6873. * Bit 24
  6874. * Purpose: indicate whether the rx PPDU had a PHY error
  6875. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6876. * - LEGACY_RATE
  6877. * Bits 28:25
  6878. * Purpose:
  6879. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6880. * specify which rate was used.
  6881. * Value:
  6882. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6883. * flag.
  6884. * If LEGACY_RATE_SEL is 0:
  6885. * 0x8: OFDM 48 Mbps
  6886. * 0x9: OFDM 24 Mbps
  6887. * 0xA: OFDM 12 Mbps
  6888. * 0xB: OFDM 6 Mbps
  6889. * 0xC: OFDM 54 Mbps
  6890. * 0xD: OFDM 36 Mbps
  6891. * 0xE: OFDM 18 Mbps
  6892. * 0xF: OFDM 9 Mbps
  6893. * If LEGACY_RATE_SEL is 1:
  6894. * 0x8: CCK 11 Mbps long preamble
  6895. * 0x9: CCK 5.5 Mbps long preamble
  6896. * 0xA: CCK 2 Mbps long preamble
  6897. * 0xB: CCK 1 Mbps long preamble
  6898. * 0xC: CCK 11 Mbps short preamble
  6899. * 0xD: CCK 5.5 Mbps short preamble
  6900. * 0xE: CCK 2 Mbps short preamble
  6901. * - LEGACY_RATE_SEL
  6902. * Bit 29
  6903. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6904. * Value:
  6905. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6906. * used a legacy rate.
  6907. * 0 -> OFDM, 1 -> CCK
  6908. * - END_VALID
  6909. * Bit 30
  6910. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6911. * the start of the PPDU are valid. Specifically, the following
  6912. * fields are only valid if END_VALID is set:
  6913. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6914. * TIMESTAMP_SUBMICROSEC
  6915. * Value:
  6916. * 0 -> rx PPDU desc end fields are not valid
  6917. * 1 -> rx PPDU desc end fields are valid
  6918. * - START_VALID
  6919. * Bit 31
  6920. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6921. * the end of the PPDU are valid. Specifically, the following
  6922. * fields are only valid if START_VALID is set:
  6923. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6924. * VHT-SIG-A
  6925. * Value:
  6926. * 0 -> rx PPDU desc start fields are not valid
  6927. * 1 -> rx PPDU desc start fields are valid
  6928. * - RSSI0_PRI20
  6929. * Bits 7:0
  6930. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6931. * Value: RSSI dB units w.r.t. noise floor
  6932. *
  6933. * - RSSI0_EXT20
  6934. * Bits 7:0
  6935. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6936. * (if the rx bandwidth was >= 40 MHz)
  6937. * Value: RSSI dB units w.r.t. noise floor
  6938. * - RSSI0_EXT40
  6939. * Bits 7:0
  6940. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6941. * (if the rx bandwidth was >= 80 MHz)
  6942. * Value: RSSI dB units w.r.t. noise floor
  6943. * - RSSI0_EXT80
  6944. * Bits 7:0
  6945. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6946. * (if the rx bandwidth was >= 160 MHz)
  6947. * Value: RSSI dB units w.r.t. noise floor
  6948. *
  6949. * - RSSI1_PRI20
  6950. * Bits 7:0
  6951. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6952. * Value: RSSI dB units w.r.t. noise floor
  6953. * - RSSI1_EXT20
  6954. * Bits 7:0
  6955. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6956. * (if the rx bandwidth was >= 40 MHz)
  6957. * Value: RSSI dB units w.r.t. noise floor
  6958. * - RSSI1_EXT40
  6959. * Bits 7:0
  6960. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6961. * (if the rx bandwidth was >= 80 MHz)
  6962. * Value: RSSI dB units w.r.t. noise floor
  6963. * - RSSI1_EXT80
  6964. * Bits 7:0
  6965. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6966. * (if the rx bandwidth was >= 160 MHz)
  6967. * Value: RSSI dB units w.r.t. noise floor
  6968. *
  6969. * - RSSI2_PRI20
  6970. * Bits 7:0
  6971. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6972. * Value: RSSI dB units w.r.t. noise floor
  6973. * - RSSI2_EXT20
  6974. * Bits 7:0
  6975. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6976. * (if the rx bandwidth was >= 40 MHz)
  6977. * Value: RSSI dB units w.r.t. noise floor
  6978. * - RSSI2_EXT40
  6979. * Bits 7:0
  6980. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6981. * (if the rx bandwidth was >= 80 MHz)
  6982. * Value: RSSI dB units w.r.t. noise floor
  6983. * - RSSI2_EXT80
  6984. * Bits 7:0
  6985. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6986. * (if the rx bandwidth was >= 160 MHz)
  6987. * Value: RSSI dB units w.r.t. noise floor
  6988. *
  6989. * - RSSI3_PRI20
  6990. * Bits 7:0
  6991. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6992. * Value: RSSI dB units w.r.t. noise floor
  6993. * - RSSI3_EXT20
  6994. * Bits 7:0
  6995. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6996. * (if the rx bandwidth was >= 40 MHz)
  6997. * Value: RSSI dB units w.r.t. noise floor
  6998. * - RSSI3_EXT40
  6999. * Bits 7:0
  7000. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7001. * (if the rx bandwidth was >= 80 MHz)
  7002. * Value: RSSI dB units w.r.t. noise floor
  7003. * - RSSI3_EXT80
  7004. * Bits 7:0
  7005. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7006. * (if the rx bandwidth was >= 160 MHz)
  7007. * Value: RSSI dB units w.r.t. noise floor
  7008. *
  7009. * - TSF32
  7010. * Bits 31:0
  7011. * Purpose: specify the time the rx PPDU was received, in TSF units
  7012. * Value: 32 LSBs of the TSF
  7013. * - TIMESTAMP_MICROSEC
  7014. * Bits 31:0
  7015. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7016. * Value: PPDU rx time, in microseconds
  7017. * - VHT_SIG_A1
  7018. * Bits 23:0
  7019. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7020. * from the rx PPDU
  7021. * Value:
  7022. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7023. * VHT-SIG-A1 data.
  7024. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7025. * first 24 bits of the HT-SIG data.
  7026. * Otherwise, this field is invalid.
  7027. * Refer to the the 802.11 protocol for the definition of the
  7028. * HT-SIG and VHT-SIG-A1 fields
  7029. * - VHT_SIG_A2
  7030. * Bits 23:0
  7031. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7032. * from the rx PPDU
  7033. * Value:
  7034. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7035. * VHT-SIG-A2 data.
  7036. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7037. * last 24 bits of the HT-SIG data.
  7038. * Otherwise, this field is invalid.
  7039. * Refer to the the 802.11 protocol for the definition of the
  7040. * HT-SIG and VHT-SIG-A2 fields
  7041. * - PREAMBLE_TYPE
  7042. * Bits 31:24
  7043. * Purpose: indicate the PHY format of the received burst
  7044. * Value:
  7045. * 0x4: Legacy (OFDM/CCK)
  7046. * 0x8: HT
  7047. * 0x9: HT with TxBF
  7048. * 0xC: VHT
  7049. * 0xD: VHT with TxBF
  7050. * - SERVICE
  7051. * Bits 31:24
  7052. * Purpose: TBD
  7053. * Value: TBD
  7054. *
  7055. * Rx MSDU descriptor fields:
  7056. * - FW_RX_DESC_BYTES
  7057. * Bits 15:0
  7058. * Purpose: Indicate how many bytes in the Rx indication are used for
  7059. * FW Rx descriptors
  7060. *
  7061. * Payload fields:
  7062. * - MPDU_COUNT
  7063. * Bits 7:0
  7064. * Purpose: Indicate how many sequential MPDUs share the same status.
  7065. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7066. * - MPDU_STATUS
  7067. * Bits 15:8
  7068. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7069. * received successfully.
  7070. * Value:
  7071. * 0x1: success
  7072. * 0x2: FCS error
  7073. * 0x3: duplicate error
  7074. * 0x4: replay error
  7075. * 0x5: invalid peer
  7076. */
  7077. /* header fields */
  7078. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7079. #define HTT_RX_IND_EXT_TID_S 8
  7080. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7081. #define HTT_RX_IND_FLUSH_VALID_S 13
  7082. #define HTT_RX_IND_REL_VALID_M 0x4000
  7083. #define HTT_RX_IND_REL_VALID_S 14
  7084. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7085. #define HTT_RX_IND_PEER_ID_S 16
  7086. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7087. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7088. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7089. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7090. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7091. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7092. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7093. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7094. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7095. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7096. /* rx PPDU descriptor fields */
  7097. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7098. #define HTT_RX_IND_RSSI_CMB_S 0
  7099. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7100. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7101. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7102. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7103. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7104. #define HTT_RX_IND_PHY_ERR_S 24
  7105. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7106. #define HTT_RX_IND_LEGACY_RATE_S 25
  7107. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7108. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7109. #define HTT_RX_IND_END_VALID_M 0x40000000
  7110. #define HTT_RX_IND_END_VALID_S 30
  7111. #define HTT_RX_IND_START_VALID_M 0x80000000
  7112. #define HTT_RX_IND_START_VALID_S 31
  7113. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7114. #define HTT_RX_IND_RSSI_PRI20_S 0
  7115. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7116. #define HTT_RX_IND_RSSI_EXT20_S 8
  7117. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7118. #define HTT_RX_IND_RSSI_EXT40_S 16
  7119. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7120. #define HTT_RX_IND_RSSI_EXT80_S 24
  7121. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7122. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7123. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7124. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7125. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7126. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7127. #define HTT_RX_IND_SERVICE_M 0xff000000
  7128. #define HTT_RX_IND_SERVICE_S 24
  7129. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7130. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7131. /* rx MSDU descriptor fields */
  7132. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7133. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7134. /* payload fields */
  7135. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7136. #define HTT_RX_IND_MPDU_COUNT_S 0
  7137. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7138. #define HTT_RX_IND_MPDU_STATUS_S 8
  7139. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7140. do { \
  7141. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7142. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7143. } while (0)
  7144. #define HTT_RX_IND_EXT_TID_GET(word) \
  7145. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7146. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7147. do { \
  7148. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7149. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7150. } while (0)
  7151. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7152. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7153. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7154. do { \
  7155. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7156. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7157. } while (0)
  7158. #define HTT_RX_IND_REL_VALID_GET(word) \
  7159. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7160. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7161. do { \
  7162. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7163. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7164. } while (0)
  7165. #define HTT_RX_IND_PEER_ID_GET(word) \
  7166. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7167. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7168. do { \
  7169. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7170. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7171. } while (0)
  7172. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7173. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7174. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7177. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7178. } while (0)
  7179. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7180. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7181. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7182. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7183. do { \
  7184. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7185. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7186. } while (0)
  7187. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7188. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7189. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7190. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7191. do { \
  7192. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7193. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7194. } while (0)
  7195. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7196. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7197. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7198. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7199. do { \
  7200. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7201. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7202. } while (0)
  7203. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7204. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7205. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7206. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7207. do { \
  7208. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7209. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7210. } while (0)
  7211. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7212. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7213. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7214. /* FW rx PPDU descriptor fields */
  7215. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7218. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7219. } while (0)
  7220. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7221. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7222. HTT_RX_IND_RSSI_CMB_S)
  7223. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7224. do { \
  7225. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7226. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7227. } while (0)
  7228. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7229. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7230. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7231. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7232. do { \
  7233. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7234. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7235. } while (0)
  7236. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7237. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7238. HTT_RX_IND_PHY_ERR_CODE_S)
  7239. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7240. do { \
  7241. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7242. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7243. } while (0)
  7244. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7245. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7246. HTT_RX_IND_PHY_ERR_S)
  7247. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7248. do { \
  7249. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7250. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7251. } while (0)
  7252. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7253. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7254. HTT_RX_IND_LEGACY_RATE_S)
  7255. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7256. do { \
  7257. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7258. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7259. } while (0)
  7260. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7261. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7262. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7263. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7264. do { \
  7265. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7266. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7267. } while (0)
  7268. #define HTT_RX_IND_END_VALID_GET(word) \
  7269. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7270. HTT_RX_IND_END_VALID_S)
  7271. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7272. do { \
  7273. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7274. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7275. } while (0)
  7276. #define HTT_RX_IND_START_VALID_GET(word) \
  7277. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7278. HTT_RX_IND_START_VALID_S)
  7279. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7280. do { \
  7281. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7282. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7283. } while (0)
  7284. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7285. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7286. HTT_RX_IND_RSSI_PRI20_S)
  7287. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7288. do { \
  7289. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7290. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7291. } while (0)
  7292. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7293. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7294. HTT_RX_IND_RSSI_EXT20_S)
  7295. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7296. do { \
  7297. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7298. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7299. } while (0)
  7300. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7301. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7302. HTT_RX_IND_RSSI_EXT40_S)
  7303. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7304. do { \
  7305. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7306. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7307. } while (0)
  7308. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7309. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7310. HTT_RX_IND_RSSI_EXT80_S)
  7311. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7312. do { \
  7313. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7314. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7315. } while (0)
  7316. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7317. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7318. HTT_RX_IND_VHT_SIG_A1_S)
  7319. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7322. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7323. } while (0)
  7324. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7325. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7326. HTT_RX_IND_VHT_SIG_A2_S)
  7327. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7328. do { \
  7329. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7330. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7331. } while (0)
  7332. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7333. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7334. HTT_RX_IND_PREAMBLE_TYPE_S)
  7335. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7336. do { \
  7337. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7338. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7339. } while (0)
  7340. #define HTT_RX_IND_SERVICE_GET(word) \
  7341. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7342. HTT_RX_IND_SERVICE_S)
  7343. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7346. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7347. } while (0)
  7348. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7349. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7350. HTT_RX_IND_SA_ANT_MATRIX_S)
  7351. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7354. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7355. } while (0)
  7356. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7357. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7358. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7359. do { \
  7360. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7361. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7362. } while (0)
  7363. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7364. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7365. #define HTT_RX_IND_HL_BYTES \
  7366. (HTT_RX_IND_HDR_BYTES + \
  7367. 4 /* single FW rx MSDU descriptor */ + \
  7368. 4 /* single MPDU range information element */)
  7369. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7370. /* Could we use one macro entry? */
  7371. #define HTT_WORD_SET(word, field, value) \
  7372. do { \
  7373. HTT_CHECK_SET_VAL(field, value); \
  7374. (word) |= ((value) << field ## _S); \
  7375. } while (0)
  7376. #define HTT_WORD_GET(word, field) \
  7377. (((word) & field ## _M) >> field ## _S)
  7378. PREPACK struct hl_htt_rx_ind_base {
  7379. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7380. } POSTPACK;
  7381. /*
  7382. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7383. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7384. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7385. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7386. * htt_rx_ind_hl_rx_desc_t.
  7387. */
  7388. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7389. struct htt_rx_ind_hl_rx_desc_t {
  7390. A_UINT8 ver;
  7391. A_UINT8 len;
  7392. struct {
  7393. A_UINT8
  7394. first_msdu: 1,
  7395. last_msdu: 1,
  7396. c3_failed: 1,
  7397. c4_failed: 1,
  7398. ipv6: 1,
  7399. tcp: 1,
  7400. udp: 1,
  7401. reserved: 1;
  7402. } flags;
  7403. /* NOTE: no reserved space - don't append any new fields here */
  7404. };
  7405. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7406. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7407. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7408. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7409. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7410. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7411. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7412. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7413. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7414. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7415. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7416. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7417. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7418. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7419. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7420. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7421. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7422. /* This structure is used in HL, the basic descriptor information
  7423. * used by host. the structure is translated by FW from HW desc
  7424. * or generated by FW. But in HL monitor mode, the host would use
  7425. * the same structure with LL.
  7426. */
  7427. PREPACK struct hl_htt_rx_desc_base {
  7428. A_UINT32
  7429. seq_num:12,
  7430. encrypted:1,
  7431. chan_info_present:1,
  7432. resv0:2,
  7433. mcast_bcast:1,
  7434. fragment:1,
  7435. key_id_oct:8,
  7436. resv1:6;
  7437. A_UINT32
  7438. pn_31_0;
  7439. union {
  7440. struct {
  7441. A_UINT16 pn_47_32;
  7442. A_UINT16 pn_63_48;
  7443. } pn16;
  7444. A_UINT32 pn_63_32;
  7445. } u0;
  7446. A_UINT32
  7447. pn_95_64;
  7448. A_UINT32
  7449. pn_127_96;
  7450. } POSTPACK;
  7451. /*
  7452. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7453. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7454. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7455. * Please see htt_chan_change_t for description of the fields.
  7456. */
  7457. PREPACK struct htt_chan_info_t
  7458. {
  7459. A_UINT32 primary_chan_center_freq_mhz: 16,
  7460. contig_chan1_center_freq_mhz: 16;
  7461. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7462. phy_mode: 8,
  7463. reserved: 8;
  7464. } POSTPACK;
  7465. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7466. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7467. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7468. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7469. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7470. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7471. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7472. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7473. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7474. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7475. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7476. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7477. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7478. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7479. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7480. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7481. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7482. /* Channel information */
  7483. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7484. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7485. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7486. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7487. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7488. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7489. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7490. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7491. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7492. do { \
  7493. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7494. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7495. } while (0)
  7496. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7497. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7498. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7499. do { \
  7500. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7501. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7502. } while (0)
  7503. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7504. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7505. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7508. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7509. } while (0)
  7510. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7511. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7512. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7513. do { \
  7514. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7515. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7516. } while (0)
  7517. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7518. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7519. /*
  7520. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7521. * @brief target -> host message definition for FW offloaded pkts
  7522. *
  7523. * @details
  7524. * The following field definitions describe the format of the firmware
  7525. * offload deliver message sent from the target to the host.
  7526. *
  7527. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7528. *
  7529. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7530. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7531. * | reserved_1 | msg type |
  7532. * |--------------------------------------------------------------------------|
  7533. * | phy_timestamp_l32 |
  7534. * |--------------------------------------------------------------------------|
  7535. * | WORD2 (see below) |
  7536. * |--------------------------------------------------------------------------|
  7537. * | seqno | framectrl |
  7538. * |--------------------------------------------------------------------------|
  7539. * | reserved_3 | vdev_id | tid_num|
  7540. * |--------------------------------------------------------------------------|
  7541. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7542. * |--------------------------------------------------------------------------|
  7543. *
  7544. * where:
  7545. * STAT = status
  7546. * F = format (802.3 vs. 802.11)
  7547. *
  7548. * definition for word 2
  7549. *
  7550. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7551. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7552. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7553. * |--------------------------------------------------------------------------|
  7554. *
  7555. * where:
  7556. * PR = preamble
  7557. * BF = beamformed
  7558. */
  7559. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7560. {
  7561. A_UINT32 /* word 0 */
  7562. msg_type:8, /* [ 7: 0] */
  7563. reserved_1:24; /* [31: 8] */
  7564. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7565. A_UINT32 /* word 2 */
  7566. /* preamble:
  7567. * 0-OFDM,
  7568. * 1-CCk,
  7569. * 2-HT,
  7570. * 3-VHT
  7571. */
  7572. preamble: 2, /* [1:0] */
  7573. /* mcs:
  7574. * In case of HT preamble interpret
  7575. * MCS along with NSS.
  7576. * Valid values for HT are 0 to 7.
  7577. * HT mcs 0 with NSS 2 is mcs 8.
  7578. * Valid values for VHT are 0 to 9.
  7579. */
  7580. mcs: 4, /* [5:2] */
  7581. /* rate:
  7582. * This is applicable only for
  7583. * CCK and OFDM preamble type
  7584. * rate 0: OFDM 48 Mbps,
  7585. * 1: OFDM 24 Mbps,
  7586. * 2: OFDM 12 Mbps
  7587. * 3: OFDM 6 Mbps
  7588. * 4: OFDM 54 Mbps
  7589. * 5: OFDM 36 Mbps
  7590. * 6: OFDM 18 Mbps
  7591. * 7: OFDM 9 Mbps
  7592. * rate 0: CCK 11 Mbps Long
  7593. * 1: CCK 5.5 Mbps Long
  7594. * 2: CCK 2 Mbps Long
  7595. * 3: CCK 1 Mbps Long
  7596. * 4: CCK 11 Mbps Short
  7597. * 5: CCK 5.5 Mbps Short
  7598. * 6: CCK 2 Mbps Short
  7599. */
  7600. rate : 3, /* [ 8: 6] */
  7601. rssi : 8, /* [16: 9] units=dBm */
  7602. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7603. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7604. stbc : 1, /* [22] */
  7605. sgi : 1, /* [23] */
  7606. ldpc : 1, /* [24] */
  7607. beamformed: 1, /* [25] */
  7608. reserved_2: 6; /* [31:26] */
  7609. A_UINT32 /* word 3 */
  7610. framectrl:16, /* [15: 0] */
  7611. seqno:16; /* [31:16] */
  7612. A_UINT32 /* word 4 */
  7613. tid_num:5, /* [ 4: 0] actual TID number */
  7614. vdev_id:8, /* [12: 5] */
  7615. reserved_3:19; /* [31:13] */
  7616. A_UINT32 /* word 5 */
  7617. /* status:
  7618. * 0: tx_ok
  7619. * 1: retry
  7620. * 2: drop
  7621. * 3: filtered
  7622. * 4: abort
  7623. * 5: tid delete
  7624. * 6: sw abort
  7625. * 7: dropped by peer migration
  7626. */
  7627. status:3, /* [2:0] */
  7628. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7629. tx_mpdu_bytes:16, /* [19:4] */
  7630. /* Indicates retry count of offloaded/local generated Data tx frames */
  7631. tx_retry_cnt:6, /* [25:20] */
  7632. reserved_4:6; /* [31:26] */
  7633. } POSTPACK;
  7634. /* FW offload deliver ind message header fields */
  7635. /* DWORD one */
  7636. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7637. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7638. /* DWORD two */
  7639. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7640. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7641. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7642. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7643. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7644. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7645. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7646. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7647. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7648. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7649. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7650. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7651. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7652. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7653. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7654. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7655. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7656. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7657. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7658. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7659. /* DWORD three*/
  7660. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7661. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7662. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7663. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7664. /* DWORD four */
  7665. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7666. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7667. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7668. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7669. /* DWORD five */
  7670. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7671. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7672. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7673. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7674. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7675. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7676. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7677. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7678. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7679. do { \
  7680. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7681. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7682. } while (0)
  7683. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7684. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7685. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7686. do { \
  7687. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7688. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7689. } while (0)
  7690. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7691. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7692. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7695. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7696. } while (0)
  7697. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7698. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7699. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7702. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7703. } while (0)
  7704. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7705. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7706. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7709. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7710. } while (0)
  7711. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7712. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7713. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7714. do { \
  7715. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7716. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7717. } while (0)
  7718. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7719. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7720. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7721. do { \
  7722. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7723. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7724. } while (0)
  7725. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7726. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7727. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7728. do { \
  7729. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7730. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7731. } while (0)
  7732. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7733. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7734. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7737. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7738. } while (0)
  7739. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7740. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7741. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7742. do { \
  7743. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7744. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7745. } while (0)
  7746. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7747. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7748. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7749. do { \
  7750. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7751. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7752. } while (0)
  7753. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7754. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7755. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7756. do { \
  7757. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7758. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7759. } while (0)
  7760. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7761. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7762. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7763. do { \
  7764. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7765. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7766. } while (0)
  7767. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7768. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7769. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7770. do { \
  7771. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7772. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7773. } while (0)
  7774. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7775. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7776. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7777. do { \
  7778. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7779. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7780. } while (0)
  7781. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7782. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7783. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7784. do { \
  7785. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7786. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7787. } while (0)
  7788. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7789. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7790. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7791. do { \
  7792. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7793. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7794. } while (0)
  7795. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7796. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7797. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7798. do { \
  7799. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7800. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7801. } while (0)
  7802. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7803. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7804. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7805. do { \
  7806. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7807. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7808. } while (0)
  7809. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7810. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7811. /*
  7812. * @brief target -> host rx reorder flush message definition
  7813. *
  7814. * @details
  7815. * The following field definitions describe the format of the rx flush
  7816. * message sent from the target to the host.
  7817. * The message consists of a 4-octet header, followed by one or more
  7818. * 4-octet payload information elements.
  7819. *
  7820. * |31 24|23 8|7 0|
  7821. * |--------------------------------------------------------------|
  7822. * | TID | peer ID | msg type |
  7823. * |--------------------------------------------------------------|
  7824. * | seq num end | seq num start | MPDU status | reserved |
  7825. * |--------------------------------------------------------------|
  7826. * First DWORD:
  7827. * - MSG_TYPE
  7828. * Bits 7:0
  7829. * Purpose: identifies this as an rx flush message
  7830. * Value: 0x2
  7831. * - PEER_ID
  7832. * Bits 23:8 (only bits 18:8 actually used)
  7833. * Purpose: identify which peer's rx data is being flushed
  7834. * Value: (rx) peer ID
  7835. * - TID
  7836. * Bits 31:24 (only bits 27:24 actually used)
  7837. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7838. * Value: traffic identifier
  7839. * Second DWORD:
  7840. * - MPDU_STATUS
  7841. * Bits 15:8
  7842. * Purpose:
  7843. * Indicate whether the flushed MPDUs should be discarded or processed.
  7844. * Value:
  7845. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7846. * stages of rx processing
  7847. * other: discard the MPDUs
  7848. * It is anticipated that flush messages will always have
  7849. * MPDU status == 1, but the status flag is included for
  7850. * flexibility.
  7851. * - SEQ_NUM_START
  7852. * Bits 23:16
  7853. * Purpose:
  7854. * Indicate the start of a series of consecutive MPDUs being flushed.
  7855. * Not all MPDUs within this range are necessarily valid - the host
  7856. * must check each sequence number within this range to see if the
  7857. * corresponding MPDU is actually present.
  7858. * Value:
  7859. * The sequence number for the first MPDU in the sequence.
  7860. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7861. * - SEQ_NUM_END
  7862. * Bits 30:24
  7863. * Purpose:
  7864. * Indicate the end of a series of consecutive MPDUs being flushed.
  7865. * Value:
  7866. * The sequence number one larger than the sequence number of the
  7867. * last MPDU being flushed.
  7868. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7869. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7870. * are to be released for further rx processing.
  7871. * Not all MPDUs within this range are necessarily valid - the host
  7872. * must check each sequence number within this range to see if the
  7873. * corresponding MPDU is actually present.
  7874. */
  7875. /* first DWORD */
  7876. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7877. #define HTT_RX_FLUSH_PEER_ID_S 8
  7878. #define HTT_RX_FLUSH_TID_M 0xff000000
  7879. #define HTT_RX_FLUSH_TID_S 24
  7880. /* second DWORD */
  7881. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7882. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7883. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7884. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7885. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7886. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7887. #define HTT_RX_FLUSH_BYTES 8
  7888. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7889. do { \
  7890. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7891. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7892. } while (0)
  7893. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7894. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7895. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7896. do { \
  7897. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7898. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7899. } while (0)
  7900. #define HTT_RX_FLUSH_TID_GET(word) \
  7901. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7902. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7903. do { \
  7904. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7905. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7906. } while (0)
  7907. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7908. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7909. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7910. do { \
  7911. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7912. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7913. } while (0)
  7914. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7915. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7916. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7917. do { \
  7918. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7919. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7920. } while (0)
  7921. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7922. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7923. /*
  7924. * @brief target -> host rx pn check indication message
  7925. *
  7926. * @details
  7927. * The following field definitions describe the format of the Rx PN check
  7928. * indication message sent from the target to the host.
  7929. * The message consists of a 4-octet header, followed by the start and
  7930. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7931. * IE is one octet containing the sequence number that failed the PN
  7932. * check.
  7933. *
  7934. * |31 24|23 8|7 0|
  7935. * |--------------------------------------------------------------|
  7936. * | TID | peer ID | msg type |
  7937. * |--------------------------------------------------------------|
  7938. * | Reserved | PN IE count | seq num end | seq num start|
  7939. * |--------------------------------------------------------------|
  7940. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7941. * |--------------------------------------------------------------|
  7942. * First DWORD:
  7943. * - MSG_TYPE
  7944. * Bits 7:0
  7945. * Purpose: Identifies this as an rx pn check indication message
  7946. * Value: 0x2
  7947. * - PEER_ID
  7948. * Bits 23:8 (only bits 18:8 actually used)
  7949. * Purpose: identify which peer
  7950. * Value: (rx) peer ID
  7951. * - TID
  7952. * Bits 31:24 (only bits 27:24 actually used)
  7953. * Purpose: identify traffic identifier
  7954. * Value: traffic identifier
  7955. * Second DWORD:
  7956. * - SEQ_NUM_START
  7957. * Bits 7:0
  7958. * Purpose:
  7959. * Indicates the starting sequence number of the MPDU in this
  7960. * series of MPDUs that went though PN check.
  7961. * Value:
  7962. * The sequence number for the first MPDU in the sequence.
  7963. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7964. * - SEQ_NUM_END
  7965. * Bits 15:8
  7966. * Purpose:
  7967. * Indicates the ending sequence number of the MPDU in this
  7968. * series of MPDUs that went though PN check.
  7969. * Value:
  7970. * The sequence number one larger then the sequence number of the last
  7971. * MPDU being flushed.
  7972. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7973. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7974. * for invalid PN numbers and are ready to be released for further processing.
  7975. * Not all MPDUs within this range are necessarily valid - the host
  7976. * must check each sequence number within this range to see if the
  7977. * corresponding MPDU is actually present.
  7978. * - PN_IE_COUNT
  7979. * Bits 23:16
  7980. * Purpose:
  7981. * Used to determine the variable number of PN information elements in this
  7982. * message
  7983. *
  7984. * PN information elements:
  7985. * - PN_IE_x-
  7986. * Purpose:
  7987. * Each PN information element contains the sequence number of the MPDU that
  7988. * has failed the target PN check.
  7989. * Value:
  7990. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7991. * that failed the PN check.
  7992. */
  7993. /* first DWORD */
  7994. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7995. #define HTT_RX_PN_IND_PEER_ID_S 8
  7996. #define HTT_RX_PN_IND_TID_M 0xff000000
  7997. #define HTT_RX_PN_IND_TID_S 24
  7998. /* second DWORD */
  7999. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8000. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8001. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8002. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8003. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8004. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8005. #define HTT_RX_PN_IND_BYTES 8
  8006. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8007. do { \
  8008. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8009. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8010. } while (0)
  8011. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8012. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8013. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8014. do { \
  8015. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8016. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8017. } while (0)
  8018. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8019. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8020. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8021. do { \
  8022. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8023. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8024. } while (0)
  8025. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8026. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8027. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8030. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8031. } while (0)
  8032. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8033. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8034. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8035. do { \
  8036. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8037. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8038. } while (0)
  8039. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8040. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8041. /*
  8042. * @brief target -> host rx offload deliver message for LL system
  8043. *
  8044. * @details
  8045. * In a low latency system this message is sent whenever the offload
  8046. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8047. * The DMA of the actual packets into host memory is done before sending out
  8048. * this message. This message indicates only how many MSDUs to reap. The
  8049. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8050. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8051. * DMA'd by the MAC directly into host memory these packets do not contain
  8052. * the MAC descriptors in the header portion of the packet. Instead they contain
  8053. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8054. * message, the packets are delivered directly to the NW stack without going
  8055. * through the regular reorder buffering and PN checking path since it has
  8056. * already been done in target.
  8057. *
  8058. * |31 24|23 16|15 8|7 0|
  8059. * |-----------------------------------------------------------------------|
  8060. * | Total MSDU count | reserved | msg type |
  8061. * |-----------------------------------------------------------------------|
  8062. *
  8063. * @brief target -> host rx offload deliver message for HL system
  8064. *
  8065. * @details
  8066. * In a high latency system this message is sent whenever the offload manager
  8067. * flushes out the packets it has coalesced in its coalescing buffer. The
  8068. * actual packets are also carried along with this message. When the host
  8069. * receives this message, it is expected to deliver these packets to the NW
  8070. * stack directly instead of routing them through the reorder buffering and
  8071. * PN checking path since it has already been done in target.
  8072. *
  8073. * |31 24|23 16|15 8|7 0|
  8074. * |-----------------------------------------------------------------------|
  8075. * | Total MSDU count | reserved | msg type |
  8076. * |-----------------------------------------------------------------------|
  8077. * | peer ID | MSDU length |
  8078. * |-----------------------------------------------------------------------|
  8079. * | MSDU payload | FW Desc | tid | vdev ID |
  8080. * |-----------------------------------------------------------------------|
  8081. * | MSDU payload contd. |
  8082. * |-----------------------------------------------------------------------|
  8083. * | peer ID | MSDU length |
  8084. * |-----------------------------------------------------------------------|
  8085. * | MSDU payload | FW Desc | tid | vdev ID |
  8086. * |-----------------------------------------------------------------------|
  8087. * | MSDU payload contd. |
  8088. * |-----------------------------------------------------------------------|
  8089. *
  8090. */
  8091. /* first DWORD */
  8092. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8093. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8094. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8095. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8096. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8097. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8098. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8099. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8101. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8102. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8103. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8104. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8105. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8106. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8107. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8108. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8109. do { \
  8110. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8111. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8112. } while (0)
  8113. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8114. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8115. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8116. do { \
  8117. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8118. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8119. } while (0)
  8120. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8121. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8122. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8123. do { \
  8124. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8125. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8126. } while (0)
  8127. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8128. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8130. do { \
  8131. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8132. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8133. } while (0)
  8134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8135. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8137. do { \
  8138. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8139. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8140. } while (0)
  8141. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8142. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8143. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8144. do { \
  8145. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8146. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8147. } while (0)
  8148. /**
  8149. * @brief target -> host rx peer map/unmap message definition
  8150. *
  8151. * @details
  8152. * The following diagram shows the format of the rx peer map message sent
  8153. * from the target to the host. This layout assumes the target operates
  8154. * as little-endian.
  8155. *
  8156. * This message always contains a SW peer ID. The main purpose of the
  8157. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8158. * with, so that the host can use that peer ID to determine which peer
  8159. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8160. * other purposes, such as identifying during tx completions which peer
  8161. * the tx frames in question were transmitted to.
  8162. *
  8163. * In certain generations of chips, the peer map message also contains
  8164. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8165. * to identify which peer the frame needs to be forwarded to (i.e. the
  8166. * peer assocated with the Destination MAC Address within the packet),
  8167. * and particularly which vdev needs to transmit the frame (for cases
  8168. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8169. * meaning as AST_INDEX_0.
  8170. * This DA-based peer ID that is provided for certain rx frames
  8171. * (the rx frames that need to be re-transmitted as tx frames)
  8172. * is the ID that the HW uses for referring to the peer in question,
  8173. * rather than the peer ID that the SW+FW use to refer to the peer.
  8174. *
  8175. *
  8176. * |31 24|23 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. *
  8185. *
  8186. * The following diagram shows the format of the rx peer unmap message sent
  8187. * from the target to the host.
  8188. *
  8189. * |31 24|23 16|15 8|7 0|
  8190. * |-----------------------------------------------------------------------|
  8191. * | SW peer ID | VDEV ID | msg type |
  8192. * |-----------------------------------------------------------------------|
  8193. *
  8194. * The following field definitions describe the format of the rx peer map
  8195. * and peer unmap messages sent from the target to the host.
  8196. * - MSG_TYPE
  8197. * Bits 7:0
  8198. * Purpose: identifies this as an rx peer map or peer unmap message
  8199. * Value: peer map -> 0x3, peer unmap -> 0x4
  8200. * - VDEV_ID
  8201. * Bits 15:8
  8202. * Purpose: Indicates which virtual device the peer is associated
  8203. * with.
  8204. * Value: vdev ID (used in the host to look up the vdev object)
  8205. * - PEER_ID (a.k.a. SW_PEER_ID)
  8206. * Bits 31:16
  8207. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8208. * freeing (unmap)
  8209. * Value: (rx) peer ID
  8210. * - MAC_ADDR_L32 (peer map only)
  8211. * Bits 31:0
  8212. * Purpose: Identifies which peer node the peer ID is for.
  8213. * Value: lower 4 bytes of peer node's MAC address
  8214. * - MAC_ADDR_U16 (peer map only)
  8215. * Bits 15:0
  8216. * Purpose: Identifies which peer node the peer ID is for.
  8217. * Value: upper 2 bytes of peer node's MAC address
  8218. * - HW_PEER_ID
  8219. * Bits 31:16
  8220. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8221. * address, so for rx frames marked for rx --> tx forwarding, the
  8222. * host can determine from the HW peer ID provided as meta-data with
  8223. * the rx frame which peer the frame is supposed to be forwarded to.
  8224. * Value: ID used by the MAC HW to identify the peer
  8225. */
  8226. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8227. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8228. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8229. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8230. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8231. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8232. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8233. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8234. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8235. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8236. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8237. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8238. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8239. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8242. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8243. } while (0)
  8244. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8245. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8246. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8247. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8248. do { \
  8249. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8250. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8251. } while (0)
  8252. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8253. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8254. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8255. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8256. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8257. do { \
  8258. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8259. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8260. } while (0)
  8261. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8262. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8263. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8264. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8265. #define HTT_RX_PEER_MAP_BYTES 12
  8266. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8267. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8268. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8269. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8270. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8271. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8272. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8273. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8274. #define HTT_RX_PEER_UNMAP_BYTES 4
  8275. /**
  8276. * @brief target -> host rx peer map V2 message definition
  8277. *
  8278. * @details
  8279. * The following diagram shows the format of the rx peer map v2 message sent
  8280. * from the target to the host. This layout assumes the target operates
  8281. * as little-endian.
  8282. *
  8283. * This message always contains a SW peer ID. The main purpose of the
  8284. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8285. * with, so that the host can use that peer ID to determine which peer
  8286. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8287. * other purposes, such as identifying during tx completions which peer
  8288. * the tx frames in question were transmitted to.
  8289. *
  8290. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8291. * is used during rx --> tx frame forwarding to identify which peer the
  8292. * frame needs to be forwarded to (i.e. the peer assocated with the
  8293. * Destination MAC Address within the packet), and particularly which vdev
  8294. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8295. * This DA-based peer ID that is provided for certain rx frames
  8296. * (the rx frames that need to be re-transmitted as tx frames)
  8297. * is the ID that the HW uses for referring to the peer in question,
  8298. * rather than the peer ID that the SW+FW use to refer to the peer.
  8299. *
  8300. * The HW peer id here is the same meaning as AST_INDEX_0.
  8301. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8302. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8303. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8304. * AST is valid.
  8305. *
  8306. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8307. * |-----------------------------------------------------------------------|
  8308. * | SW peer ID | VDEV ID | msg type |
  8309. * |-----------------------------------------------------------------------|
  8310. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8311. * |-----------------------------------------------------------------------|
  8312. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8313. * |-----------------------------------------------------------------------|
  8314. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8315. * |-----------------------------------------------------------------------|
  8316. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8317. * |-----------------------------------------------------------------------|
  8318. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8319. * |-----------------------------------------------------------------------|
  8320. * | Reserved_1 | AST index 3 |
  8321. * |-----------------------------------------------------------------------|
  8322. * | Reserved_2 |
  8323. * |-----------------------------------------------------------------------|
  8324. * Where:
  8325. * NH = Next Hop
  8326. * ASTVM = AST valid mask
  8327. * ASTFM = AST flow mask
  8328. *
  8329. * The following field definitions describe the format of the rx peer map v2
  8330. * messages sent from the target to the host.
  8331. * - MSG_TYPE
  8332. * Bits 7:0
  8333. * Purpose: identifies this as an rx peer map v2 message
  8334. * Value: peer map v2 -> 0x1e
  8335. * - VDEV_ID
  8336. * Bits 15:8
  8337. * Purpose: Indicates which virtual device the peer is associated with.
  8338. * Value: vdev ID (used in the host to look up the vdev object)
  8339. * - SW_PEER_ID
  8340. * Bits 31:16
  8341. * Purpose: The peer ID (index) that WAL is allocating
  8342. * Value: (rx) peer ID
  8343. * - MAC_ADDR_L32
  8344. * Bits 31:0
  8345. * Purpose: Identifies which peer node the peer ID is for.
  8346. * Value: lower 4 bytes of peer node's MAC address
  8347. * - MAC_ADDR_U16
  8348. * Bits 15:0
  8349. * Purpose: Identifies which peer node the peer ID is for.
  8350. * Value: upper 2 bytes of peer node's MAC address
  8351. * - HW_PEER_ID / AST_INDEX_0
  8352. * Bits 31:16
  8353. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8354. * address, so for rx frames marked for rx --> tx forwarding, the
  8355. * host can determine from the HW peer ID provided as meta-data with
  8356. * the rx frame which peer the frame is supposed to be forwarded to.
  8357. * Value: ID used by the MAC HW to identify the peer
  8358. * - AST_HASH_VALUE
  8359. * Bits 15:0
  8360. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8361. * override feature.
  8362. * - NEXT_HOP
  8363. * Bit 16
  8364. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8365. * (Wireless Distribution System).
  8366. * - AST_VALID_MASK
  8367. * Bits 19:17
  8368. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8369. * - AST_INDEX_1
  8370. * Bits 15:0
  8371. * Purpose: indicate the second AST index for this peer
  8372. * - AST_0_FLOW_MASK
  8373. * Bits 19:16
  8374. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8375. * - AST_1_FLOW_MASK
  8376. * Bits 23:20
  8377. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8378. * - AST_2_FLOW_MASK
  8379. * Bits 27:24
  8380. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8381. * - AST_3_FLOW_MASK
  8382. * Bits 31:28
  8383. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8384. * - AST_INDEX_2
  8385. * Bits 15:0
  8386. * Purpose: indicate the third AST index for this peer
  8387. * - TID_VALID_HI_PRI
  8388. * Bits 23:16
  8389. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8390. * - TID_VALID_LOW_PRI
  8391. * Bits 31:24
  8392. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8393. * - AST_INDEX_3
  8394. * Bits 15:0
  8395. * Purpose: indicate the fourth AST index for this peer
  8396. */
  8397. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8398. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8399. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8400. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8401. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8402. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8403. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8404. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8405. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8406. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8407. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8408. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8409. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8410. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8411. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8412. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8413. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8414. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8415. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8416. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8417. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8418. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8419. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8420. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8421. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8422. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8423. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8424. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8425. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8426. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8427. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8428. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8429. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8430. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8431. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8432. do { \
  8433. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8434. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8435. } while (0)
  8436. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8437. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8438. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8439. do { \
  8440. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8441. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8442. } while (0)
  8443. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8444. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8445. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8446. do { \
  8447. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8448. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8449. } while (0)
  8450. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8451. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8452. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8453. do { \
  8454. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8455. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8456. } while (0)
  8457. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8458. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8459. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8462. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8463. } while (0)
  8464. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8465. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8466. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8467. do { \
  8468. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8469. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8470. } while (0)
  8471. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8472. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8473. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8474. do { \
  8475. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8476. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8477. } while (0)
  8478. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8479. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8480. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8481. do { \
  8482. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8483. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8484. } while (0)
  8485. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8486. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8487. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8488. do { \
  8489. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8490. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8491. } while (0)
  8492. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8493. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8494. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8495. do { \
  8496. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8497. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8498. } while (0)
  8499. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8500. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8501. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8504. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8505. } while (0)
  8506. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8507. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8508. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8511. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8512. } while (0)
  8513. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8514. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8515. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8516. do { \
  8517. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8518. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8519. } while (0)
  8520. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8521. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8522. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8523. do { \
  8524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8525. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8526. } while (0)
  8527. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8528. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8529. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8530. do { \
  8531. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8532. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8533. } while (0)
  8534. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8535. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8536. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8537. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8538. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8539. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8540. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8541. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8542. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8543. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8544. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8545. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8546. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8547. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8548. /**
  8549. * @brief target -> host rx peer unmap V2 message definition
  8550. *
  8551. *
  8552. * The following diagram shows the format of the rx peer unmap message sent
  8553. * from the target to the host.
  8554. *
  8555. * |31 24|23 16|15 8|7 0|
  8556. * |-----------------------------------------------------------------------|
  8557. * | SW peer ID | VDEV ID | msg type |
  8558. * |-----------------------------------------------------------------------|
  8559. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8560. * |-----------------------------------------------------------------------|
  8561. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8562. * |-----------------------------------------------------------------------|
  8563. * | Peer Delete Duration |
  8564. * |-----------------------------------------------------------------------|
  8565. * | Reserved_0 | WDS Free Count |
  8566. * |-----------------------------------------------------------------------|
  8567. * | Reserved_1 |
  8568. * |-----------------------------------------------------------------------|
  8569. * | Reserved_2 |
  8570. * |-----------------------------------------------------------------------|
  8571. *
  8572. *
  8573. * The following field definitions describe the format of the rx peer unmap
  8574. * messages sent from the target to the host.
  8575. * - MSG_TYPE
  8576. * Bits 7:0
  8577. * Purpose: identifies this as an rx peer unmap v2 message
  8578. * Value: peer unmap v2 -> 0x1f
  8579. * - VDEV_ID
  8580. * Bits 15:8
  8581. * Purpose: Indicates which virtual device the peer is associated
  8582. * with.
  8583. * Value: vdev ID (used in the host to look up the vdev object)
  8584. * - SW_PEER_ID
  8585. * Bits 31:16
  8586. * Purpose: The peer ID (index) that WAL is freeing
  8587. * Value: (rx) peer ID
  8588. * - MAC_ADDR_L32
  8589. * Bits 31:0
  8590. * Purpose: Identifies which peer node the peer ID is for.
  8591. * Value: lower 4 bytes of peer node's MAC address
  8592. * - MAC_ADDR_U16
  8593. * Bits 15:0
  8594. * Purpose: Identifies which peer node the peer ID is for.
  8595. * Value: upper 2 bytes of peer node's MAC address
  8596. * - NEXT_HOP
  8597. * Bits 16
  8598. * Purpose: Bit indicates next_hop AST entry used for WDS
  8599. * (Wireless Distribution System).
  8600. * - PEER_DELETE_DURATION
  8601. * Bits 31:0
  8602. * Purpose: Time taken to delete peer, in msec,
  8603. * Used for monitoring / debugging PEER delete response delay
  8604. * - PEER_WDS_FREE_COUNT
  8605. * Bits 15:0
  8606. * Purpose: Count of WDS entries deleted associated to peer deleted
  8607. */
  8608. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8609. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8610. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8611. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8612. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8613. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8614. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8615. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8616. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8617. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8618. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8619. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8620. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8621. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8622. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8623. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8624. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8625. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8626. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8627. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8628. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8631. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8632. } while (0)
  8633. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8634. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8635. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8638. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8639. } while (0)
  8640. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8641. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8642. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8643. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8644. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8645. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8646. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8647. /**
  8648. * @brief target -> host message specifying security parameters
  8649. *
  8650. * @details
  8651. * The following diagram shows the format of the security specification
  8652. * message sent from the target to the host.
  8653. * This security specification message tells the host whether a PN check is
  8654. * necessary on rx data frames, and if so, how large the PN counter is.
  8655. * This message also tells the host about the security processing to apply
  8656. * to defragmented rx frames - specifically, whether a Message Integrity
  8657. * Check is required, and the Michael key to use.
  8658. *
  8659. * |31 24|23 16|15|14 8|7 0|
  8660. * |-----------------------------------------------------------------------|
  8661. * | peer ID | U| security type | msg type |
  8662. * |-----------------------------------------------------------------------|
  8663. * | Michael Key K0 |
  8664. * |-----------------------------------------------------------------------|
  8665. * | Michael Key K1 |
  8666. * |-----------------------------------------------------------------------|
  8667. * | WAPI RSC Low0 |
  8668. * |-----------------------------------------------------------------------|
  8669. * | WAPI RSC Low1 |
  8670. * |-----------------------------------------------------------------------|
  8671. * | WAPI RSC Hi0 |
  8672. * |-----------------------------------------------------------------------|
  8673. * | WAPI RSC Hi1 |
  8674. * |-----------------------------------------------------------------------|
  8675. *
  8676. * The following field definitions describe the format of the security
  8677. * indication message sent from the target to the host.
  8678. * - MSG_TYPE
  8679. * Bits 7:0
  8680. * Purpose: identifies this as a security specification message
  8681. * Value: 0xb
  8682. * - SEC_TYPE
  8683. * Bits 14:8
  8684. * Purpose: specifies which type of security applies to the peer
  8685. * Value: htt_sec_type enum value
  8686. * - UNICAST
  8687. * Bit 15
  8688. * Purpose: whether this security is applied to unicast or multicast data
  8689. * Value: 1 -> unicast, 0 -> multicast
  8690. * - PEER_ID
  8691. * Bits 31:16
  8692. * Purpose: The ID number for the peer the security specification is for
  8693. * Value: peer ID
  8694. * - MICHAEL_KEY_K0
  8695. * Bits 31:0
  8696. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8697. * Value: Michael Key K0 (if security type is TKIP)
  8698. * - MICHAEL_KEY_K1
  8699. * Bits 31:0
  8700. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8701. * Value: Michael Key K1 (if security type is TKIP)
  8702. * - WAPI_RSC_LOW0
  8703. * Bits 31:0
  8704. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8705. * Value: WAPI RSC Low0 (if security type is WAPI)
  8706. * - WAPI_RSC_LOW1
  8707. * Bits 31:0
  8708. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8709. * Value: WAPI RSC Low1 (if security type is WAPI)
  8710. * - WAPI_RSC_HI0
  8711. * Bits 31:0
  8712. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8713. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8714. * - WAPI_RSC_HI1
  8715. * Bits 31:0
  8716. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8717. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8718. */
  8719. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8720. #define HTT_SEC_IND_SEC_TYPE_S 8
  8721. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8722. #define HTT_SEC_IND_UNICAST_S 15
  8723. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8724. #define HTT_SEC_IND_PEER_ID_S 16
  8725. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8726. do { \
  8727. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8728. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8729. } while (0)
  8730. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8731. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8732. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8733. do { \
  8734. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8735. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8736. } while (0)
  8737. #define HTT_SEC_IND_UNICAST_GET(word) \
  8738. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8739. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8740. do { \
  8741. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8742. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8743. } while (0)
  8744. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8745. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8746. #define HTT_SEC_IND_BYTES 28
  8747. /**
  8748. * @brief target -> host rx ADDBA / DELBA message definitions
  8749. *
  8750. * @details
  8751. * The following diagram shows the format of the rx ADDBA message sent
  8752. * from the target to the host:
  8753. *
  8754. * |31 20|19 16|15 8|7 0|
  8755. * |---------------------------------------------------------------------|
  8756. * | peer ID | TID | window size | msg type |
  8757. * |---------------------------------------------------------------------|
  8758. *
  8759. * The following diagram shows the format of the rx DELBA message sent
  8760. * from the target to the host:
  8761. *
  8762. * |31 20|19 16|15 10|9 8|7 0|
  8763. * |---------------------------------------------------------------------|
  8764. * | peer ID | TID | window size | IR| msg type |
  8765. * |---------------------------------------------------------------------|
  8766. *
  8767. * The following field definitions describe the format of the rx ADDBA
  8768. * and DELBA messages sent from the target to the host.
  8769. * - MSG_TYPE
  8770. * Bits 7:0
  8771. * Purpose: identifies this as an rx ADDBA or DELBA message
  8772. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8773. * - IR (initiator / recipient)
  8774. * Bits 9:8 (DELBA only)
  8775. * Purpose: specify whether the DELBA handshake was initiated by the
  8776. * local STA/AP, or by the peer STA/AP
  8777. * Value:
  8778. * 0 - unspecified
  8779. * 1 - initiator (a.k.a. originator)
  8780. * 2 - recipient (a.k.a. responder)
  8781. * 3 - unused / reserved
  8782. * - WIN_SIZE
  8783. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8784. * Purpose: Specifies the length of the block ack window (max = 64).
  8785. * Value:
  8786. * block ack window length specified by the received ADDBA/DELBA
  8787. * management message.
  8788. * - TID
  8789. * Bits 19:16
  8790. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8791. * Value:
  8792. * TID specified by the received ADDBA or DELBA management message.
  8793. * - PEER_ID
  8794. * Bits 31:20
  8795. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8796. * Value:
  8797. * ID (hash value) used by the host for fast, direct lookup of
  8798. * host SW peer info, including rx reorder states.
  8799. */
  8800. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8801. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8802. #define HTT_RX_ADDBA_TID_M 0xf0000
  8803. #define HTT_RX_ADDBA_TID_S 16
  8804. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8805. #define HTT_RX_ADDBA_PEER_ID_S 20
  8806. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8807. do { \
  8808. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8809. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8810. } while (0)
  8811. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8812. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8813. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8814. do { \
  8815. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8816. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8817. } while (0)
  8818. #define HTT_RX_ADDBA_TID_GET(word) \
  8819. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8820. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8821. do { \
  8822. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8823. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8824. } while (0)
  8825. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8826. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8827. #define HTT_RX_ADDBA_BYTES 4
  8828. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8829. #define HTT_RX_DELBA_INITIATOR_S 8
  8830. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8831. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8832. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8833. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8834. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8835. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8836. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8837. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8838. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8839. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8840. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8843. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8844. } while (0)
  8845. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8846. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8847. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8848. do { \
  8849. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8850. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8851. } while (0)
  8852. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8853. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8854. #define HTT_RX_DELBA_BYTES 4
  8855. /**
  8856. * @brief tx queue group information element definition
  8857. *
  8858. * @details
  8859. * The following diagram shows the format of the tx queue group
  8860. * information element, which can be included in target --> host
  8861. * messages to specify the number of tx "credits" (tx descriptors
  8862. * for LL, or tx buffers for HL) available to a particular group
  8863. * of host-side tx queues, and which host-side tx queues belong to
  8864. * the group.
  8865. *
  8866. * |31|30 24|23 16|15|14|13 0|
  8867. * |------------------------------------------------------------------------|
  8868. * | X| reserved | tx queue grp ID | A| S| credit count |
  8869. * |------------------------------------------------------------------------|
  8870. * | vdev ID mask | AC mask |
  8871. * |------------------------------------------------------------------------|
  8872. *
  8873. * The following definitions describe the fields within the tx queue group
  8874. * information element:
  8875. * - credit_count
  8876. * Bits 13:1
  8877. * Purpose: specify how many tx credits are available to the tx queue group
  8878. * Value: An absolute or relative, positive or negative credit value
  8879. * The 'A' bit specifies whether the value is absolute or relative.
  8880. * The 'S' bit specifies whether the value is positive or negative.
  8881. * A negative value can only be relative, not absolute.
  8882. * An absolute value replaces any prior credit value the host has for
  8883. * the tx queue group in question.
  8884. * A relative value is added to the prior credit value the host has for
  8885. * the tx queue group in question.
  8886. * - sign
  8887. * Bit 14
  8888. * Purpose: specify whether the credit count is positive or negative
  8889. * Value: 0 -> positive, 1 -> negative
  8890. * - absolute
  8891. * Bit 15
  8892. * Purpose: specify whether the credit count is absolute or relative
  8893. * Value: 0 -> relative, 1 -> absolute
  8894. * - txq_group_id
  8895. * Bits 23:16
  8896. * Purpose: indicate which tx queue group's credit and/or membership are
  8897. * being specified
  8898. * Value: 0 to max_tx_queue_groups-1
  8899. * - reserved
  8900. * Bits 30:16
  8901. * Value: 0x0
  8902. * - eXtension
  8903. * Bit 31
  8904. * Purpose: specify whether another tx queue group info element follows
  8905. * Value: 0 -> no more tx queue group information elements
  8906. * 1 -> another tx queue group information element immediately follows
  8907. * - ac_mask
  8908. * Bits 15:0
  8909. * Purpose: specify which Access Categories belong to the tx queue group
  8910. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8911. * the tx queue group.
  8912. * The AC bit-mask values are obtained by left-shifting by the
  8913. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8914. * - vdev_id_mask
  8915. * Bits 31:16
  8916. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8917. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8918. * belong to the tx queue group.
  8919. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8920. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8921. */
  8922. PREPACK struct htt_txq_group {
  8923. A_UINT32
  8924. credit_count: 14,
  8925. sign: 1,
  8926. absolute: 1,
  8927. tx_queue_group_id: 8,
  8928. reserved0: 7,
  8929. extension: 1;
  8930. A_UINT32
  8931. ac_mask: 16,
  8932. vdev_id_mask: 16;
  8933. } POSTPACK;
  8934. /* first word */
  8935. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8936. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8937. #define HTT_TXQ_GROUP_SIGN_S 14
  8938. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8939. #define HTT_TXQ_GROUP_ABS_S 15
  8940. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8941. #define HTT_TXQ_GROUP_ID_S 16
  8942. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8943. #define HTT_TXQ_GROUP_EXT_S 31
  8944. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8945. /* second word */
  8946. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8947. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8948. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8949. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8950. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8953. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8954. } while (0)
  8955. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8956. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8957. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8958. do { \
  8959. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8960. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8961. } while (0)
  8962. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8963. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8964. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8965. do { \
  8966. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8967. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8968. } while (0)
  8969. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8970. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8971. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8974. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8975. } while (0)
  8976. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8977. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8978. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8981. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8982. } while (0)
  8983. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8984. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8985. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8988. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8989. } while (0)
  8990. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8991. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8992. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8995. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8996. } while (0)
  8997. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8998. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8999. /**
  9000. * @brief target -> host TX completion indication message definition
  9001. *
  9002. * @details
  9003. * The following diagram shows the format of the TX completion indication sent
  9004. * from the target to the host
  9005. *
  9006. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9007. * |-------------------------------------------------------------------|
  9008. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9009. * |-------------------------------------------------------------------|
  9010. * payload:| MSDU1 ID | MSDU0 ID |
  9011. * |-------------------------------------------------------------------|
  9012. * : MSDU3 ID | MSDU2 ID :
  9013. * |-------------------------------------------------------------------|
  9014. * | struct htt_tx_compl_ind_append_retries |
  9015. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9016. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9017. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9018. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9019. * |-------------------------------------------------------------------|
  9020. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9021. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9022. * | MSDU0 tx_tsf64_low |
  9023. * |-------------------------------------------------------------------|
  9024. * | MSDU0 tx_tsf64_high |
  9025. * |-------------------------------------------------------------------|
  9026. * | MSDU1 tx_tsf64_low |
  9027. * |-------------------------------------------------------------------|
  9028. * | MSDU1 tx_tsf64_high |
  9029. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9030. * | phy_timestamp |
  9031. * |-------------------------------------------------------------------|
  9032. * | rate specs (see below) |
  9033. * |-------------------------------------------------------------------|
  9034. * | seqctrl | framectrl |
  9035. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9036. * Where:
  9037. * A0 = append (a.k.a. append0)
  9038. * A1 = append1
  9039. * TP = MSDU tx power presence
  9040. * A2 = append2
  9041. * A3 = append3
  9042. * A4 = append4
  9043. *
  9044. * The following field definitions describe the format of the TX completion
  9045. * indication sent from the target to the host
  9046. * Header fields:
  9047. * - msg_type
  9048. * Bits 7:0
  9049. * Purpose: identifies this as HTT TX completion indication
  9050. * Value: 0x7
  9051. * - status
  9052. * Bits 10:8
  9053. * Purpose: the TX completion status of payload fragmentations descriptors
  9054. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9055. * - tid
  9056. * Bits 14:11
  9057. * Purpose: the tid associated with those fragmentation descriptors. It is
  9058. * valid or not, depending on the tid_invalid bit.
  9059. * Value: 0 to 15
  9060. * - tid_invalid
  9061. * Bits 15:15
  9062. * Purpose: this bit indicates whether the tid field is valid or not
  9063. * Value: 0 indicates valid; 1 indicates invalid
  9064. * - num
  9065. * Bits 23:16
  9066. * Purpose: the number of payload in this indication
  9067. * Value: 1 to 255
  9068. * - append (a.k.a. append0)
  9069. * Bits 24:24
  9070. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9071. * the number of tx retries for one MSDU at the end of this message
  9072. * Value: 0 indicates no appending; 1 indicates appending
  9073. * - append1
  9074. * Bits 25:25
  9075. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9076. * contains the timestamp info for each TX msdu id in payload.
  9077. * The order of the timestamps matches the order of the MSDU IDs.
  9078. * Note that a big-endian host needs to account for the reordering
  9079. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9080. * conversion) when determining which tx timestamp corresponds to
  9081. * which MSDU ID.
  9082. * Value: 0 indicates no appending; 1 indicates appending
  9083. * - msdu_tx_power_presence
  9084. * Bits 26:26
  9085. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9086. * for each MSDU referenced by the TX_COMPL_IND message.
  9087. * The tx power is reported in 0.5 dBm units.
  9088. * The order of the per-MSDU tx power reports matches the order
  9089. * of the MSDU IDs.
  9090. * Note that a big-endian host needs to account for the reordering
  9091. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9092. * conversion) when determining which Tx Power corresponds to
  9093. * which MSDU ID.
  9094. * Value: 0 indicates MSDU tx power reports are not appended,
  9095. * 1 indicates MSDU tx power reports are appended
  9096. * - append2
  9097. * Bits 27:27
  9098. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9099. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9100. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9101. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9102. * for each MSDU, for convenience.
  9103. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9104. * this append2 bit is set).
  9105. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9106. * dB above the noise floor.
  9107. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9108. * 1 indicates MSDU ACK RSSI values are appended.
  9109. * - append3
  9110. * Bits 28:28
  9111. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9112. * contains the tx tsf info based on wlan global TSF for
  9113. * each TX msdu id in payload.
  9114. * The order of the tx tsf matches the order of the MSDU IDs.
  9115. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9116. * values to indicate the the lower 32 bits and higher 32 bits of
  9117. * the tx tsf.
  9118. * The tx_tsf64 here represents the time MSDU was acked and the
  9119. * tx_tsf64 has microseconds units.
  9120. * Value: 0 indicates no appending; 1 indicates appending
  9121. * - append4
  9122. * Bits 29:29
  9123. * Purpose: Indicate whether data frame control fields and fields required
  9124. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9125. * message. The order of the this message matches the order of
  9126. * the MSDU IDs.
  9127. * Value: 0 indicates frame control fields and fields required for
  9128. * radio tap header values are not appended,
  9129. * 1 indicates frame control fields and fields required for
  9130. * radio tap header values are appended.
  9131. * Payload fields:
  9132. * - hmsdu_id
  9133. * Bits 15:0
  9134. * Purpose: this ID is used to track the Tx buffer in host
  9135. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9136. */
  9137. PREPACK struct htt_tx_data_hdr_information {
  9138. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9139. A_UINT32 /* word 1 */
  9140. /* preamble:
  9141. * 0-OFDM,
  9142. * 1-CCk,
  9143. * 2-HT,
  9144. * 3-VHT
  9145. */
  9146. preamble: 2, /* [1:0] */
  9147. /* mcs:
  9148. * In case of HT preamble interpret
  9149. * MCS along with NSS.
  9150. * Valid values for HT are 0 to 7.
  9151. * HT mcs 0 with NSS 2 is mcs 8.
  9152. * Valid values for VHT are 0 to 9.
  9153. */
  9154. mcs: 4, /* [5:2] */
  9155. /* rate:
  9156. * This is applicable only for
  9157. * CCK and OFDM preamble type
  9158. * rate 0: OFDM 48 Mbps,
  9159. * 1: OFDM 24 Mbps,
  9160. * 2: OFDM 12 Mbps
  9161. * 3: OFDM 6 Mbps
  9162. * 4: OFDM 54 Mbps
  9163. * 5: OFDM 36 Mbps
  9164. * 6: OFDM 18 Mbps
  9165. * 7: OFDM 9 Mbps
  9166. * rate 0: CCK 11 Mbps Long
  9167. * 1: CCK 5.5 Mbps Long
  9168. * 2: CCK 2 Mbps Long
  9169. * 3: CCK 1 Mbps Long
  9170. * 4: CCK 11 Mbps Short
  9171. * 5: CCK 5.5 Mbps Short
  9172. * 6: CCK 2 Mbps Short
  9173. */
  9174. rate : 3, /* [ 8: 6] */
  9175. rssi : 8, /* [16: 9] units=dBm */
  9176. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9177. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9178. stbc : 1, /* [22] */
  9179. sgi : 1, /* [23] */
  9180. ldpc : 1, /* [24] */
  9181. beamformed: 1, /* [25] */
  9182. /* tx_retry_cnt:
  9183. * Indicates retry count of data tx frames provided by the host.
  9184. */
  9185. tx_retry_cnt: 6; /* [31:26] */
  9186. A_UINT32 /* word 2 */
  9187. framectrl:16, /* [15: 0] */
  9188. seqno:16; /* [31:16] */
  9189. } POSTPACK;
  9190. #define HTT_TX_COMPL_IND_STATUS_S 8
  9191. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9192. #define HTT_TX_COMPL_IND_TID_S 11
  9193. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9194. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9195. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9196. #define HTT_TX_COMPL_IND_NUM_S 16
  9197. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9198. #define HTT_TX_COMPL_IND_APPEND_S 24
  9199. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9200. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9201. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9202. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9203. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9204. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9205. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9206. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9207. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9208. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9209. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9210. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9213. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9214. } while (0)
  9215. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9216. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9217. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9218. do { \
  9219. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9220. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9221. } while (0)
  9222. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9223. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9224. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9225. do { \
  9226. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9227. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9228. } while (0)
  9229. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9230. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9231. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9232. do { \
  9233. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9234. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9235. } while (0)
  9236. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9237. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9238. HTT_TX_COMPL_IND_TID_INV_S)
  9239. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9240. do { \
  9241. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9242. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9243. } while (0)
  9244. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9245. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9246. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9247. do { \
  9248. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9249. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9250. } while (0)
  9251. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9252. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9253. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9254. do { \
  9255. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9256. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9257. } while (0)
  9258. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9259. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9260. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9261. do { \
  9262. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9263. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9264. } while (0)
  9265. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9266. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9267. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9268. do { \
  9269. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9270. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9271. } while (0)
  9272. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9273. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9274. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9275. do { \
  9276. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9277. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9278. } while (0)
  9279. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9280. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9281. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9282. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9283. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9284. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9285. #define HTT_TX_COMPL_IND_STAT_OK 0
  9286. /* DISCARD:
  9287. * current meaning:
  9288. * MSDUs were queued for transmission but filtered by HW or SW
  9289. * without any over the air attempts
  9290. * legacy meaning (HL Rome):
  9291. * MSDUs were discarded by the target FW without any over the air
  9292. * attempts due to lack of space
  9293. */
  9294. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9295. /* NO_ACK:
  9296. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9297. */
  9298. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9299. /* POSTPONE:
  9300. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9301. * be downloaded again later (in the appropriate order), when they are
  9302. * deliverable.
  9303. */
  9304. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9305. /*
  9306. * The PEER_DEL tx completion status is used for HL cases
  9307. * where the peer the frame is for has been deleted.
  9308. * The host has already discarded its copy of the frame, but
  9309. * it still needs the tx completion to restore its credit.
  9310. */
  9311. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9312. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9313. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9314. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9315. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9316. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9317. PREPACK struct htt_tx_compl_ind_base {
  9318. A_UINT32 hdr;
  9319. A_UINT16 payload[1/*or more*/];
  9320. } POSTPACK;
  9321. PREPACK struct htt_tx_compl_ind_append_retries {
  9322. A_UINT16 msdu_id;
  9323. A_UINT8 tx_retries;
  9324. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9325. 0: this is the last append_retries struct */
  9326. } POSTPACK;
  9327. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9328. A_UINT32 timestamp[1/*or more*/];
  9329. } POSTPACK;
  9330. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9331. A_UINT32 tx_tsf64_low;
  9332. A_UINT32 tx_tsf64_high;
  9333. } POSTPACK;
  9334. /* htt_tx_data_hdr_information payload extension fields: */
  9335. /* DWORD zero */
  9336. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9337. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9338. /* DWORD one */
  9339. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9340. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9341. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9342. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9343. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9344. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9345. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9346. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9347. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9348. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9349. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9350. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9351. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9352. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9353. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9354. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9355. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9356. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9357. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9358. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9359. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9360. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9361. /* DWORD two */
  9362. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9363. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9364. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9365. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9366. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9367. do { \
  9368. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9369. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9370. } while (0)
  9371. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9372. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9373. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9374. do { \
  9375. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9376. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9377. } while (0)
  9378. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9379. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9380. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9381. do { \
  9382. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9383. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9384. } while (0)
  9385. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9386. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9387. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9388. do { \
  9389. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9390. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9391. } while (0)
  9392. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9393. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9394. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9395. do { \
  9396. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9397. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9398. } while (0)
  9399. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9400. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9401. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9402. do { \
  9403. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9404. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9405. } while (0)
  9406. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9407. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9408. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9409. do { \
  9410. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9411. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9412. } while (0)
  9413. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9414. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9415. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9416. do { \
  9417. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9418. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9419. } while (0)
  9420. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9421. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9422. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9423. do { \
  9424. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9425. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9426. } while (0)
  9427. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9428. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9429. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9430. do { \
  9431. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9432. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9433. } while (0)
  9434. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9435. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9436. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9437. do { \
  9438. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9439. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9440. } while (0)
  9441. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9442. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9443. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9444. do { \
  9445. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9446. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9447. } while (0)
  9448. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9449. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9450. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9451. do { \
  9452. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9453. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9454. } while (0)
  9455. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9456. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9457. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9458. do { \
  9459. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9460. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9461. } while (0)
  9462. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9463. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9464. /**
  9465. * @brief target -> host rate-control update indication message
  9466. *
  9467. * @details
  9468. * The following diagram shows the format of the RC Update message
  9469. * sent from the target to the host, while processing the tx-completion
  9470. * of a transmitted PPDU.
  9471. *
  9472. * |31 24|23 16|15 8|7 0|
  9473. * |-------------------------------------------------------------|
  9474. * | peer ID | vdev ID | msg_type |
  9475. * |-------------------------------------------------------------|
  9476. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9477. * |-------------------------------------------------------------|
  9478. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9479. * |-------------------------------------------------------------|
  9480. * | : |
  9481. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9482. * | : |
  9483. * |-------------------------------------------------------------|
  9484. * | : |
  9485. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9486. * | : |
  9487. * |-------------------------------------------------------------|
  9488. * : :
  9489. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9490. *
  9491. */
  9492. typedef struct {
  9493. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9494. A_UINT32 rate_code_flags;
  9495. A_UINT32 flags; /* Encodes information such as excessive
  9496. retransmission, aggregate, some info
  9497. from .11 frame control,
  9498. STBC, LDPC, (SGI and Tx Chain Mask
  9499. are encoded in ptx_rc->flags field),
  9500. AMPDU truncation (BT/time based etc.),
  9501. RTS/CTS attempt */
  9502. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9503. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9504. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9505. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9506. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9507. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9508. } HTT_RC_TX_DONE_PARAMS;
  9509. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9510. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9511. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9512. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9513. #define HTT_RC_UPDATE_VDEVID_S 8
  9514. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9515. #define HTT_RC_UPDATE_PEERID_S 16
  9516. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9517. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9518. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9519. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9520. do { \
  9521. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9522. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9523. } while (0)
  9524. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9525. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9526. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9527. do { \
  9528. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9529. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9530. } while (0)
  9531. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9532. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9533. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9534. do { \
  9535. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9536. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9537. } while (0)
  9538. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9539. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9540. /**
  9541. * @brief target -> host rx fragment indication message definition
  9542. *
  9543. * @details
  9544. * The following field definitions describe the format of the rx fragment
  9545. * indication message sent from the target to the host.
  9546. * The rx fragment indication message shares the format of the
  9547. * rx indication message, but not all fields from the rx indication message
  9548. * are relevant to the rx fragment indication message.
  9549. *
  9550. *
  9551. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9552. * |-----------+-------------------+---------------------+-------------|
  9553. * | peer ID | |FV| ext TID | msg type |
  9554. * |-------------------------------------------------------------------|
  9555. * | | flush | flush |
  9556. * | | end | start |
  9557. * | | seq num | seq num |
  9558. * |-------------------------------------------------------------------|
  9559. * | reserved | FW rx desc bytes |
  9560. * |-------------------------------------------------------------------|
  9561. * | | FW MSDU Rx |
  9562. * | | desc B0 |
  9563. * |-------------------------------------------------------------------|
  9564. * Header fields:
  9565. * - MSG_TYPE
  9566. * Bits 7:0
  9567. * Purpose: identifies this as an rx fragment indication message
  9568. * Value: 0xa
  9569. * - EXT_TID
  9570. * Bits 12:8
  9571. * Purpose: identify the traffic ID of the rx data, including
  9572. * special "extended" TID values for multicast, broadcast, and
  9573. * non-QoS data frames
  9574. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9575. * - FLUSH_VALID (FV)
  9576. * Bit 13
  9577. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9578. * is valid
  9579. * Value:
  9580. * 1 -> flush IE is valid and needs to be processed
  9581. * 0 -> flush IE is not valid and should be ignored
  9582. * - PEER_ID
  9583. * Bits 31:16
  9584. * Purpose: Identify, by ID, which peer sent the rx data
  9585. * Value: ID of the peer who sent the rx data
  9586. * - FLUSH_SEQ_NUM_START
  9587. * Bits 5:0
  9588. * Purpose: Indicate the start of a series of MPDUs to flush
  9589. * Not all MPDUs within this series are necessarily valid - the host
  9590. * must check each sequence number within this range to see if the
  9591. * corresponding MPDU is actually present.
  9592. * This field is only valid if the FV bit is set.
  9593. * Value:
  9594. * The sequence number for the first MPDUs to check to flush.
  9595. * The sequence number is masked by 0x3f.
  9596. * - FLUSH_SEQ_NUM_END
  9597. * Bits 11:6
  9598. * Purpose: Indicate the end of a series of MPDUs to flush
  9599. * Value:
  9600. * The sequence number one larger than the sequence number of the
  9601. * last MPDU to check to flush.
  9602. * The sequence number is masked by 0x3f.
  9603. * Not all MPDUs within this series are necessarily valid - the host
  9604. * must check each sequence number within this range to see if the
  9605. * corresponding MPDU is actually present.
  9606. * This field is only valid if the FV bit is set.
  9607. * Rx descriptor fields:
  9608. * - FW_RX_DESC_BYTES
  9609. * Bits 15:0
  9610. * Purpose: Indicate how many bytes in the Rx indication are used for
  9611. * FW Rx descriptors
  9612. * Value: 1
  9613. */
  9614. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9615. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9616. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9617. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9618. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9619. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9620. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9621. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9622. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9623. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9624. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9625. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9626. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9627. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9628. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9629. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9630. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9631. #define HTT_RX_FRAG_IND_BYTES \
  9632. (4 /* msg hdr */ + \
  9633. 4 /* flush spec */ + \
  9634. 4 /* (unused) FW rx desc bytes spec */ + \
  9635. 4 /* FW rx desc */)
  9636. /**
  9637. * @brief target -> host test message definition
  9638. *
  9639. * @details
  9640. * The following field definitions describe the format of the test
  9641. * message sent from the target to the host.
  9642. * The message consists of a 4-octet header, followed by a variable
  9643. * number of 32-bit integer values, followed by a variable number
  9644. * of 8-bit character values.
  9645. *
  9646. * |31 16|15 8|7 0|
  9647. * |-----------------------------------------------------------|
  9648. * | num chars | num ints | msg type |
  9649. * |-----------------------------------------------------------|
  9650. * | int 0 |
  9651. * |-----------------------------------------------------------|
  9652. * | int 1 |
  9653. * |-----------------------------------------------------------|
  9654. * | ... |
  9655. * |-----------------------------------------------------------|
  9656. * | char 3 | char 2 | char 1 | char 0 |
  9657. * |-----------------------------------------------------------|
  9658. * | | | ... | char 4 |
  9659. * |-----------------------------------------------------------|
  9660. * - MSG_TYPE
  9661. * Bits 7:0
  9662. * Purpose: identifies this as a test message
  9663. * Value: HTT_MSG_TYPE_TEST
  9664. * - NUM_INTS
  9665. * Bits 15:8
  9666. * Purpose: indicate how many 32-bit integers follow the message header
  9667. * - NUM_CHARS
  9668. * Bits 31:16
  9669. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9670. */
  9671. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9672. #define HTT_RX_TEST_NUM_INTS_S 8
  9673. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9674. #define HTT_RX_TEST_NUM_CHARS_S 16
  9675. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9676. do { \
  9677. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9678. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9679. } while (0)
  9680. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9681. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9682. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9683. do { \
  9684. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9685. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9686. } while (0)
  9687. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9688. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9689. /**
  9690. * @brief target -> host packet log message
  9691. *
  9692. * @details
  9693. * The following field definitions describe the format of the packet log
  9694. * message sent from the target to the host.
  9695. * The message consists of a 4-octet header,followed by a variable number
  9696. * of 32-bit character values.
  9697. *
  9698. * |31 16|15 12|11 10|9 8|7 0|
  9699. * |------------------------------------------------------------------|
  9700. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9701. * |------------------------------------------------------------------|
  9702. * | payload |
  9703. * |------------------------------------------------------------------|
  9704. * - MSG_TYPE
  9705. * Bits 7:0
  9706. * Purpose: identifies this as a pktlog message
  9707. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9708. * - mac_id
  9709. * Bits 9:8
  9710. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9711. * Value: 0-3
  9712. * - pdev_id
  9713. * Bits 11:10
  9714. * Purpose: pdev_id
  9715. * Value: 0-3
  9716. * 0 (for rings at SOC level),
  9717. * 1/2/3 PDEV -> 0/1/2
  9718. * - payload_size
  9719. * Bits 31:16
  9720. * Purpose: explicitly specify the payload size
  9721. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9722. */
  9723. PREPACK struct htt_pktlog_msg {
  9724. A_UINT32 header;
  9725. A_UINT32 payload[1/* or more */];
  9726. } POSTPACK;
  9727. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9728. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9729. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9730. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9731. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9732. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9733. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9734. do { \
  9735. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9736. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9737. } while (0)
  9738. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9739. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9740. HTT_T2H_PKTLOG_MAC_ID_S)
  9741. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9744. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9745. } while (0)
  9746. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9747. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9748. HTT_T2H_PKTLOG_PDEV_ID_S)
  9749. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9752. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9753. } while (0)
  9754. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9755. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9756. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9757. /*
  9758. * Rx reorder statistics
  9759. * NB: all the fields must be defined in 4 octets size.
  9760. */
  9761. struct rx_reorder_stats {
  9762. /* Non QoS MPDUs received */
  9763. A_UINT32 deliver_non_qos;
  9764. /* MPDUs received in-order */
  9765. A_UINT32 deliver_in_order;
  9766. /* Flush due to reorder timer expired */
  9767. A_UINT32 deliver_flush_timeout;
  9768. /* Flush due to move out of window */
  9769. A_UINT32 deliver_flush_oow;
  9770. /* Flush due to DELBA */
  9771. A_UINT32 deliver_flush_delba;
  9772. /* MPDUs dropped due to FCS error */
  9773. A_UINT32 fcs_error;
  9774. /* MPDUs dropped due to monitor mode non-data packet */
  9775. A_UINT32 mgmt_ctrl;
  9776. /* Unicast-data MPDUs dropped due to invalid peer */
  9777. A_UINT32 invalid_peer;
  9778. /* MPDUs dropped due to duplication (non aggregation) */
  9779. A_UINT32 dup_non_aggr;
  9780. /* MPDUs dropped due to processed before */
  9781. A_UINT32 dup_past;
  9782. /* MPDUs dropped due to duplicate in reorder queue */
  9783. A_UINT32 dup_in_reorder;
  9784. /* Reorder timeout happened */
  9785. A_UINT32 reorder_timeout;
  9786. /* invalid bar ssn */
  9787. A_UINT32 invalid_bar_ssn;
  9788. /* reorder reset due to bar ssn */
  9789. A_UINT32 ssn_reset;
  9790. /* Flush due to delete peer */
  9791. A_UINT32 deliver_flush_delpeer;
  9792. /* Flush due to offload*/
  9793. A_UINT32 deliver_flush_offload;
  9794. /* Flush due to out of buffer*/
  9795. A_UINT32 deliver_flush_oob;
  9796. /* MPDUs dropped due to PN check fail */
  9797. A_UINT32 pn_fail;
  9798. /* MPDUs dropped due to unable to allocate memory */
  9799. A_UINT32 store_fail;
  9800. /* Number of times the tid pool alloc succeeded */
  9801. A_UINT32 tid_pool_alloc_succ;
  9802. /* Number of times the MPDU pool alloc succeeded */
  9803. A_UINT32 mpdu_pool_alloc_succ;
  9804. /* Number of times the MSDU pool alloc succeeded */
  9805. A_UINT32 msdu_pool_alloc_succ;
  9806. /* Number of times the tid pool alloc failed */
  9807. A_UINT32 tid_pool_alloc_fail;
  9808. /* Number of times the MPDU pool alloc failed */
  9809. A_UINT32 mpdu_pool_alloc_fail;
  9810. /* Number of times the MSDU pool alloc failed */
  9811. A_UINT32 msdu_pool_alloc_fail;
  9812. /* Number of times the tid pool freed */
  9813. A_UINT32 tid_pool_free;
  9814. /* Number of times the MPDU pool freed */
  9815. A_UINT32 mpdu_pool_free;
  9816. /* Number of times the MSDU pool freed */
  9817. A_UINT32 msdu_pool_free;
  9818. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9819. A_UINT32 msdu_queued;
  9820. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9821. A_UINT32 msdu_recycled;
  9822. /* Number of MPDUs with invalid peer but A2 found in AST */
  9823. A_UINT32 invalid_peer_a2_in_ast;
  9824. /* Number of MPDUs with invalid peer but A3 found in AST */
  9825. A_UINT32 invalid_peer_a3_in_ast;
  9826. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9827. A_UINT32 invalid_peer_bmc_mpdus;
  9828. /* Number of MSDUs with err attention word */
  9829. A_UINT32 rxdesc_err_att;
  9830. /* Number of MSDUs with flag of peer_idx_invalid */
  9831. A_UINT32 rxdesc_err_peer_idx_inv;
  9832. /* Number of MSDUs with flag of peer_idx_timeout */
  9833. A_UINT32 rxdesc_err_peer_idx_to;
  9834. /* Number of MSDUs with flag of overflow */
  9835. A_UINT32 rxdesc_err_ov;
  9836. /* Number of MSDUs with flag of msdu_length_err */
  9837. A_UINT32 rxdesc_err_msdu_len;
  9838. /* Number of MSDUs with flag of mpdu_length_err */
  9839. A_UINT32 rxdesc_err_mpdu_len;
  9840. /* Number of MSDUs with flag of tkip_mic_err */
  9841. A_UINT32 rxdesc_err_tkip_mic;
  9842. /* Number of MSDUs with flag of decrypt_err */
  9843. A_UINT32 rxdesc_err_decrypt;
  9844. /* Number of MSDUs with flag of fcs_err */
  9845. A_UINT32 rxdesc_err_fcs;
  9846. /* Number of Unicast (bc_mc bit is not set in attention word)
  9847. * frames with invalid peer handler
  9848. */
  9849. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9850. /* Number of unicast frame directly (direct bit is set in attention word)
  9851. * to DUT with invalid peer handler
  9852. */
  9853. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9854. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9855. * frames with invalid peer handler
  9856. */
  9857. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9858. /* Number of MSDUs dropped due to no first MSDU flag */
  9859. A_UINT32 rxdesc_no_1st_msdu;
  9860. /* Number of MSDUs droped due to ring overflow */
  9861. A_UINT32 msdu_drop_ring_ov;
  9862. /* Number of MSDUs dropped due to FC mismatch */
  9863. A_UINT32 msdu_drop_fc_mismatch;
  9864. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9865. A_UINT32 msdu_drop_mgmt_remote_ring;
  9866. /* Number of MSDUs dropped due to errors not reported in attention word */
  9867. A_UINT32 msdu_drop_misc;
  9868. /* Number of MSDUs go to offload before reorder */
  9869. A_UINT32 offload_msdu_wal;
  9870. /* Number of data frame dropped by offload after reorder */
  9871. A_UINT32 offload_msdu_reorder;
  9872. /* Number of MPDUs with sequence number in the past and within the BA window */
  9873. A_UINT32 dup_past_within_window;
  9874. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9875. A_UINT32 dup_past_outside_window;
  9876. /* Number of MSDUs with decrypt/MIC error */
  9877. A_UINT32 rxdesc_err_decrypt_mic;
  9878. /* Number of data MSDUs received on both local and remote rings */
  9879. A_UINT32 data_msdus_on_both_rings;
  9880. /* MPDUs never filled */
  9881. A_UINT32 holes_not_filled;
  9882. };
  9883. /*
  9884. * Rx Remote buffer statistics
  9885. * NB: all the fields must be defined in 4 octets size.
  9886. */
  9887. struct rx_remote_buffer_mgmt_stats {
  9888. /* Total number of MSDUs reaped for Rx processing */
  9889. A_UINT32 remote_reaped;
  9890. /* MSDUs recycled within firmware */
  9891. A_UINT32 remote_recycled;
  9892. /* MSDUs stored by Data Rx */
  9893. A_UINT32 data_rx_msdus_stored;
  9894. /* Number of HTT indications from WAL Rx MSDU */
  9895. A_UINT32 wal_rx_ind;
  9896. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9897. A_UINT32 wal_rx_ind_unconsumed;
  9898. /* Number of HTT indications from Data Rx MSDU */
  9899. A_UINT32 data_rx_ind;
  9900. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9901. A_UINT32 data_rx_ind_unconsumed;
  9902. /* Number of HTT indications from ATHBUF */
  9903. A_UINT32 athbuf_rx_ind;
  9904. /* Number of remote buffers requested for refill */
  9905. A_UINT32 refill_buf_req;
  9906. /* Number of remote buffers filled by the host */
  9907. A_UINT32 refill_buf_rsp;
  9908. /* Number of times MAC hw_index = f/w write_index */
  9909. A_INT32 mac_no_bufs;
  9910. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9911. A_INT32 fw_indices_equal;
  9912. /* Number of times f/w finds no buffers to post */
  9913. A_INT32 host_no_bufs;
  9914. };
  9915. /*
  9916. * TXBF MU/SU packets and NDPA statistics
  9917. * NB: all the fields must be defined in 4 octets size.
  9918. */
  9919. struct rx_txbf_musu_ndpa_pkts_stats {
  9920. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9921. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9922. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9923. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9924. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9925. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9926. };
  9927. /*
  9928. * htt_dbg_stats_status -
  9929. * present - The requested stats have been delivered in full.
  9930. * This indicates that either the stats information was contained
  9931. * in its entirety within this message, or else this message
  9932. * completes the delivery of the requested stats info that was
  9933. * partially delivered through earlier STATS_CONF messages.
  9934. * partial - The requested stats have been delivered in part.
  9935. * One or more subsequent STATS_CONF messages with the same
  9936. * cookie value will be sent to deliver the remainder of the
  9937. * information.
  9938. * error - The requested stats could not be delivered, for example due
  9939. * to a shortage of memory to construct a message holding the
  9940. * requested stats.
  9941. * invalid - The requested stat type is either not recognized, or the
  9942. * target is configured to not gather the stats type in question.
  9943. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9944. * series_done - This special value indicates that no further stats info
  9945. * elements are present within a series of stats info elems
  9946. * (within a stats upload confirmation message).
  9947. */
  9948. enum htt_dbg_stats_status {
  9949. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9950. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9951. HTT_DBG_STATS_STATUS_ERROR = 2,
  9952. HTT_DBG_STATS_STATUS_INVALID = 3,
  9953. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9954. };
  9955. /**
  9956. * @brief target -> host statistics upload
  9957. *
  9958. * @details
  9959. * The following field definitions describe the format of the HTT target
  9960. * to host stats upload confirmation message.
  9961. * The message contains a cookie echoed from the HTT host->target stats
  9962. * upload request, which identifies which request the confirmation is
  9963. * for, and a series of tag-length-value stats information elements.
  9964. * The tag-length header for each stats info element also includes a
  9965. * status field, to indicate whether the request for the stat type in
  9966. * question was fully met, partially met, unable to be met, or invalid
  9967. * (if the stat type in question is disabled in the target).
  9968. * A special value of all 1's in this status field is used to indicate
  9969. * the end of the series of stats info elements.
  9970. *
  9971. *
  9972. * |31 16|15 8|7 5|4 0|
  9973. * |------------------------------------------------------------|
  9974. * | reserved | msg type |
  9975. * |------------------------------------------------------------|
  9976. * | cookie LSBs |
  9977. * |------------------------------------------------------------|
  9978. * | cookie MSBs |
  9979. * |------------------------------------------------------------|
  9980. * | stats entry length | reserved | S |stat type|
  9981. * |------------------------------------------------------------|
  9982. * | |
  9983. * | type-specific stats info |
  9984. * | |
  9985. * |------------------------------------------------------------|
  9986. * | stats entry length | reserved | S |stat type|
  9987. * |------------------------------------------------------------|
  9988. * | |
  9989. * | type-specific stats info |
  9990. * | |
  9991. * |------------------------------------------------------------|
  9992. * | n/a | reserved | 111 | n/a |
  9993. * |------------------------------------------------------------|
  9994. * Header fields:
  9995. * - MSG_TYPE
  9996. * Bits 7:0
  9997. * Purpose: identifies this is a statistics upload confirmation message
  9998. * Value: 0x9
  9999. * - COOKIE_LSBS
  10000. * Bits 31:0
  10001. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10002. * message with its preceding host->target stats request message.
  10003. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10004. * - COOKIE_MSBS
  10005. * Bits 31:0
  10006. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10007. * message with its preceding host->target stats request message.
  10008. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10009. *
  10010. * Stats Information Element tag-length header fields:
  10011. * - STAT_TYPE
  10012. * Bits 4:0
  10013. * Purpose: identifies the type of statistics info held in the
  10014. * following information element
  10015. * Value: htt_dbg_stats_type
  10016. * - STATUS
  10017. * Bits 7:5
  10018. * Purpose: indicate whether the requested stats are present
  10019. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10020. * the completion of the stats entry series
  10021. * - LENGTH
  10022. * Bits 31:16
  10023. * Purpose: indicate the stats information size
  10024. * Value: This field specifies the number of bytes of stats information
  10025. * that follows the element tag-length header.
  10026. * It is expected but not required that this length is a multiple of
  10027. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10028. * subsequent stats entry header will begin on a 4-byte aligned
  10029. * boundary.
  10030. */
  10031. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10032. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10033. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10034. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10035. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10036. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10037. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10038. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10039. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10040. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10041. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10042. do { \
  10043. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10044. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10045. } while (0)
  10046. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10047. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10048. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10049. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10052. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10053. } while (0)
  10054. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10055. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10056. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10057. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10060. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10061. } while (0)
  10062. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10063. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10064. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10065. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10066. #define HTT_MAX_AGGR 64
  10067. #define HTT_HL_MAX_AGGR 18
  10068. /**
  10069. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10070. *
  10071. * @details
  10072. * The following field definitions describe the format of the HTT host
  10073. * to target frag_desc/msdu_ext bank configuration message.
  10074. * The message contains the based address and the min and max id of the
  10075. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10076. * MSDU_EXT/FRAG_DESC.
  10077. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10078. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10079. * the hardware does the mapping/translation.
  10080. *
  10081. * Total banks that can be configured is configured to 16.
  10082. *
  10083. * This should be called before any TX has be initiated by the HTT
  10084. *
  10085. * |31 16|15 8|7 5|4 0|
  10086. * |------------------------------------------------------------|
  10087. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10088. * |------------------------------------------------------------|
  10089. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10090. #if HTT_PADDR64
  10091. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10092. #endif
  10093. * |------------------------------------------------------------|
  10094. * | ... |
  10095. * |------------------------------------------------------------|
  10096. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10097. #if HTT_PADDR64
  10098. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10099. #endif
  10100. * |------------------------------------------------------------|
  10101. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10102. * |------------------------------------------------------------|
  10103. * | ... |
  10104. * |------------------------------------------------------------|
  10105. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10106. * |------------------------------------------------------------|
  10107. * Header fields:
  10108. * - MSG_TYPE
  10109. * Bits 7:0
  10110. * Value: 0x6
  10111. * for systems with 64-bit format for bus addresses:
  10112. * - BANKx_BASE_ADDRESS_LO
  10113. * Bits 31:0
  10114. * Purpose: Provide a mechanism to specify the base address of the
  10115. * MSDU_EXT bank physical/bus address.
  10116. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10117. * - BANKx_BASE_ADDRESS_HI
  10118. * Bits 31:0
  10119. * Purpose: Provide a mechanism to specify the base address of the
  10120. * MSDU_EXT bank physical/bus address.
  10121. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10122. * for systems with 32-bit format for bus addresses:
  10123. * - BANKx_BASE_ADDRESS
  10124. * Bits 31:0
  10125. * Purpose: Provide a mechanism to specify the base address of the
  10126. * MSDU_EXT bank physical/bus address.
  10127. * Value: MSDU_EXT bank physical / bus address
  10128. * - BANKx_MIN_ID
  10129. * Bits 15:0
  10130. * Purpose: Provide a mechanism to specify the min index that needs to
  10131. * mapped.
  10132. * - BANKx_MAX_ID
  10133. * Bits 31:16
  10134. * Purpose: Provide a mechanism to specify the max index that needs to
  10135. * mapped.
  10136. *
  10137. */
  10138. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10139. * safe value.
  10140. * @note MAX supported banks is 16.
  10141. */
  10142. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10143. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10144. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10145. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10146. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10147. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10148. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10149. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10150. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10151. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10152. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10153. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10154. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10155. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10156. do { \
  10157. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10158. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10159. } while (0)
  10160. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10161. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10162. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10163. do { \
  10164. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10165. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10166. } while (0)
  10167. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10168. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10169. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10170. do { \
  10171. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10172. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10173. } while (0)
  10174. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10175. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10176. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10177. do { \
  10178. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10179. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10180. } while (0)
  10181. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10182. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10183. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10184. do { \
  10185. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10186. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10187. } while (0)
  10188. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10189. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10190. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10191. do { \
  10192. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10193. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10194. } while (0)
  10195. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10196. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10197. /*
  10198. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10199. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10200. * addresses are stored in a XXX-bit field.
  10201. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10202. * htt_tx_frag_desc64_bank_cfg_t structs.
  10203. */
  10204. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10205. _paddr_bits_, \
  10206. _paddr__bank_base_address_) \
  10207. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10208. /** word 0 \
  10209. * msg_type: 8, \
  10210. * pdev_id: 2, \
  10211. * swap: 1, \
  10212. * reserved0: 5, \
  10213. * num_banks: 8, \
  10214. * desc_size: 8; \
  10215. */ \
  10216. A_UINT32 word0; \
  10217. /* \
  10218. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10219. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10220. * the second A_UINT32). \
  10221. */ \
  10222. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10223. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10224. } POSTPACK
  10225. /* define htt_tx_frag_desc32_bank_cfg_t */
  10226. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10227. /* define htt_tx_frag_desc64_bank_cfg_t */
  10228. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10229. /*
  10230. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10231. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10232. */
  10233. #if HTT_PADDR64
  10234. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10235. #else
  10236. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10237. #endif
  10238. /**
  10239. * @brief target -> host HTT TX Credit total count update message definition
  10240. *
  10241. *|31 16|15|14 9| 8 |7 0 |
  10242. *|---------------------+--+----------+-------+----------|
  10243. *|cur htt credit delta | Q| reserved | sign | msg type |
  10244. *|------------------------------------------------------|
  10245. *
  10246. * Header fields:
  10247. * - MSG_TYPE
  10248. * Bits 7:0
  10249. * Purpose: identifies this as a htt tx credit delta update message
  10250. * Value: 0xe
  10251. * - SIGN
  10252. * Bits 8
  10253. * identifies whether credit delta is positive or negative
  10254. * Value:
  10255. * - 0x0: credit delta is positive, rebalance in some buffers
  10256. * - 0x1: credit delta is negative, rebalance out some buffers
  10257. * - reserved
  10258. * Bits 14:9
  10259. * Value: 0x0
  10260. * - TXQ_GRP
  10261. * Bit 15
  10262. * Purpose: indicates whether any tx queue group information elements
  10263. * are appended to the tx credit update message
  10264. * Value: 0 -> no tx queue group information element is present
  10265. * 1 -> a tx queue group information element immediately follows
  10266. * - DELTA_COUNT
  10267. * Bits 31:16
  10268. * Purpose: Specify current htt credit delta absolute count
  10269. */
  10270. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10271. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10272. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10273. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10274. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10275. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10276. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10277. do { \
  10278. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10279. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10280. } while (0)
  10281. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10282. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10283. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10284. do { \
  10285. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10286. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10287. } while (0)
  10288. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10289. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10290. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10291. do { \
  10292. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10293. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10294. } while (0)
  10295. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10296. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10297. #define HTT_TX_CREDIT_MSG_BYTES 4
  10298. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10299. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10300. /**
  10301. * @brief HTT WDI_IPA Operation Response Message
  10302. *
  10303. * @details
  10304. * HTT WDI_IPA Operation Response message is sent by target
  10305. * to host confirming suspend or resume operation.
  10306. * |31 24|23 16|15 8|7 0|
  10307. * |----------------+----------------+----------------+----------------|
  10308. * | op_code | Rsvd | msg_type |
  10309. * |-------------------------------------------------------------------|
  10310. * | Rsvd | Response len |
  10311. * |-------------------------------------------------------------------|
  10312. * | |
  10313. * | Response-type specific info |
  10314. * | |
  10315. * | |
  10316. * |-------------------------------------------------------------------|
  10317. * Header fields:
  10318. * - MSG_TYPE
  10319. * Bits 7:0
  10320. * Purpose: Identifies this as WDI_IPA Operation Response message
  10321. * value: = 0x13
  10322. * - OP_CODE
  10323. * Bits 31:16
  10324. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10325. * value: = enum htt_wdi_ipa_op_code
  10326. * - RSP_LEN
  10327. * Bits 16:0
  10328. * Purpose: length for the response-type specific info
  10329. * value: = length in bytes for response-type specific info
  10330. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10331. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10332. */
  10333. PREPACK struct htt_wdi_ipa_op_response_t
  10334. {
  10335. /* DWORD 0: flags and meta-data */
  10336. A_UINT32
  10337. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10338. reserved1: 8,
  10339. op_code: 16;
  10340. A_UINT32
  10341. rsp_len: 16,
  10342. reserved2: 16;
  10343. } POSTPACK;
  10344. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10345. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10346. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10347. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10348. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10349. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10350. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10351. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10352. do { \
  10353. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10354. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10355. } while (0)
  10356. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10357. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10358. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10361. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10362. } while (0)
  10363. enum htt_phy_mode {
  10364. htt_phy_mode_11a = 0,
  10365. htt_phy_mode_11g = 1,
  10366. htt_phy_mode_11b = 2,
  10367. htt_phy_mode_11g_only = 3,
  10368. htt_phy_mode_11na_ht20 = 4,
  10369. htt_phy_mode_11ng_ht20 = 5,
  10370. htt_phy_mode_11na_ht40 = 6,
  10371. htt_phy_mode_11ng_ht40 = 7,
  10372. htt_phy_mode_11ac_vht20 = 8,
  10373. htt_phy_mode_11ac_vht40 = 9,
  10374. htt_phy_mode_11ac_vht80 = 10,
  10375. htt_phy_mode_11ac_vht20_2g = 11,
  10376. htt_phy_mode_11ac_vht40_2g = 12,
  10377. htt_phy_mode_11ac_vht80_2g = 13,
  10378. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10379. htt_phy_mode_11ac_vht160 = 15,
  10380. htt_phy_mode_max,
  10381. };
  10382. /**
  10383. * @brief target -> host HTT channel change indication
  10384. * @details
  10385. * Specify when a channel change occurs.
  10386. * This allows the host to precisely determine which rx frames arrived
  10387. * on the old channel and which rx frames arrived on the new channel.
  10388. *
  10389. *|31 |7 0 |
  10390. *|-------------------------------------------+----------|
  10391. *| reserved | msg type |
  10392. *|------------------------------------------------------|
  10393. *| primary_chan_center_freq_mhz |
  10394. *|------------------------------------------------------|
  10395. *| contiguous_chan1_center_freq_mhz |
  10396. *|------------------------------------------------------|
  10397. *| contiguous_chan2_center_freq_mhz |
  10398. *|------------------------------------------------------|
  10399. *| phy_mode |
  10400. *|------------------------------------------------------|
  10401. *
  10402. * Header fields:
  10403. * - MSG_TYPE
  10404. * Bits 7:0
  10405. * Purpose: identifies this as a htt channel change indication message
  10406. * Value: 0x15
  10407. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10408. * Bits 31:0
  10409. * Purpose: identify the (center of the) new 20 MHz primary channel
  10410. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10411. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10412. * Bits 31:0
  10413. * Purpose: identify the (center of the) contiguous frequency range
  10414. * comprising the new channel.
  10415. * For example, if the new channel is a 80 MHz channel extending
  10416. * 60 MHz beyond the primary channel, this field would be 30 larger
  10417. * than the primary channel center frequency field.
  10418. * Value: center frequency of the contiguous frequency range comprising
  10419. * the full channel in MHz units
  10420. * (80+80 channels also use the CONTIG_CHAN2 field)
  10421. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10422. * Bits 31:0
  10423. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10424. * within a VHT 80+80 channel.
  10425. * This field is only relevant for VHT 80+80 channels.
  10426. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10427. * channel (arbitrary value for cases besides VHT 80+80)
  10428. * - PHY_MODE
  10429. * Bits 31:0
  10430. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10431. * and band
  10432. * Value: htt_phy_mode enum value
  10433. */
  10434. PREPACK struct htt_chan_change_t
  10435. {
  10436. /* DWORD 0: flags and meta-data */
  10437. A_UINT32
  10438. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10439. reserved1: 24;
  10440. A_UINT32 primary_chan_center_freq_mhz;
  10441. A_UINT32 contig_chan1_center_freq_mhz;
  10442. A_UINT32 contig_chan2_center_freq_mhz;
  10443. A_UINT32 phy_mode;
  10444. } POSTPACK;
  10445. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10446. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10447. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10448. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10449. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10450. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10451. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10452. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10453. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10456. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10457. } while (0)
  10458. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10459. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10460. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10461. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10464. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10465. } while (0)
  10466. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10467. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10468. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10469. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10470. do { \
  10471. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10472. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10473. } while (0)
  10474. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10475. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10476. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10477. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10478. do { \
  10479. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10480. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10481. } while (0)
  10482. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10483. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10484. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10485. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10486. /**
  10487. * @brief rx offload packet error message
  10488. *
  10489. * @details
  10490. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10491. * of target payload like mic err.
  10492. *
  10493. * |31 24|23 16|15 8|7 0|
  10494. * |----------------+----------------+----------------+----------------|
  10495. * | tid | vdev_id | msg_sub_type | msg_type |
  10496. * |-------------------------------------------------------------------|
  10497. * : (sub-type dependent content) :
  10498. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10499. * Header fields:
  10500. * - msg_type
  10501. * Bits 7:0
  10502. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10503. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10504. * - msg_sub_type
  10505. * Bits 15:8
  10506. * Purpose: Identifies which type of rx error is reported by this message
  10507. * value: htt_rx_ofld_pkt_err_type
  10508. * - vdev_id
  10509. * Bits 23:16
  10510. * Purpose: Identifies which vdev received the erroneous rx frame
  10511. * value:
  10512. * - tid
  10513. * Bits 31:24
  10514. * Purpose: Identifies the traffic type of the rx frame
  10515. * value:
  10516. *
  10517. * - The payload fields used if the sub-type == MIC error are shown below.
  10518. * Note - MIC err is per MSDU, while PN is per MPDU.
  10519. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10520. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10521. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10522. * instead of sending separate HTT messages for each wrong MSDU within
  10523. * the MPDU.
  10524. *
  10525. * |31 24|23 16|15 8|7 0|
  10526. * |----------------+----------------+----------------+----------------|
  10527. * | Rsvd | key_id | peer_id |
  10528. * |-------------------------------------------------------------------|
  10529. * | receiver MAC addr 31:0 |
  10530. * |-------------------------------------------------------------------|
  10531. * | Rsvd | receiver MAC addr 47:32 |
  10532. * |-------------------------------------------------------------------|
  10533. * | transmitter MAC addr 31:0 |
  10534. * |-------------------------------------------------------------------|
  10535. * | Rsvd | transmitter MAC addr 47:32 |
  10536. * |-------------------------------------------------------------------|
  10537. * | PN 31:0 |
  10538. * |-------------------------------------------------------------------|
  10539. * | Rsvd | PN 47:32 |
  10540. * |-------------------------------------------------------------------|
  10541. * - peer_id
  10542. * Bits 15:0
  10543. * Purpose: identifies which peer is frame is from
  10544. * value:
  10545. * - key_id
  10546. * Bits 23:16
  10547. * Purpose: identifies key_id of rx frame
  10548. * value:
  10549. * - RA_31_0 (receiver MAC addr 31:0)
  10550. * Bits 31:0
  10551. * Purpose: identifies by MAC address which vdev received the frame
  10552. * value: MAC address lower 4 bytes
  10553. * - RA_47_32 (receiver MAC addr 47:32)
  10554. * Bits 15:0
  10555. * Purpose: identifies by MAC address which vdev received the frame
  10556. * value: MAC address upper 2 bytes
  10557. * - TA_31_0 (transmitter MAC addr 31:0)
  10558. * Bits 31:0
  10559. * Purpose: identifies by MAC address which peer transmitted the frame
  10560. * value: MAC address lower 4 bytes
  10561. * - TA_47_32 (transmitter MAC addr 47:32)
  10562. * Bits 15:0
  10563. * Purpose: identifies by MAC address which peer transmitted the frame
  10564. * value: MAC address upper 2 bytes
  10565. * - PN_31_0
  10566. * Bits 31:0
  10567. * Purpose: Identifies pn of rx frame
  10568. * value: PN lower 4 bytes
  10569. * - PN_47_32
  10570. * Bits 15:0
  10571. * Purpose: Identifies pn of rx frame
  10572. * value:
  10573. * TKIP or CCMP: PN upper 2 bytes
  10574. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10575. */
  10576. enum htt_rx_ofld_pkt_err_type {
  10577. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10578. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10579. };
  10580. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10581. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10582. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10583. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10584. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10585. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10586. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10587. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10588. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10589. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10590. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10591. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10592. do { \
  10593. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10594. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10595. } while (0)
  10596. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10597. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10598. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10599. do { \
  10600. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10601. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10602. } while (0)
  10603. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10604. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10605. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10606. do { \
  10607. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10608. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10609. } while (0)
  10610. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10620. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10628. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10629. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10630. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10631. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10632. do { \
  10633. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10634. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10635. } while (0)
  10636. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10637. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10638. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10639. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10640. do { \
  10641. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10642. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10643. } while (0)
  10644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10645. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10646. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10648. do { \
  10649. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10650. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10651. } while (0)
  10652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10653. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10654. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10656. do { \
  10657. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10658. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10659. } while (0)
  10660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10661. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10662. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10664. do { \
  10665. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10666. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10667. } while (0)
  10668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10669. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10670. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10672. do { \
  10673. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10674. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10675. } while (0)
  10676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10677. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10678. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10680. do { \
  10681. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10682. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10683. } while (0)
  10684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10685. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10686. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10688. do { \
  10689. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10690. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10691. } while (0)
  10692. /**
  10693. * @brief peer rate report message
  10694. *
  10695. * @details
  10696. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10697. * justified rate of all the peers.
  10698. *
  10699. * |31 24|23 16|15 8|7 0|
  10700. * |----------------+----------------+----------------+----------------|
  10701. * | peer_count | | msg_type |
  10702. * |-------------------------------------------------------------------|
  10703. * : Payload (variant number of peer rate report) :
  10704. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10705. * Header fields:
  10706. * - msg_type
  10707. * Bits 7:0
  10708. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10709. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10710. * - reserved
  10711. * Bits 15:8
  10712. * Purpose:
  10713. * value:
  10714. * - peer_count
  10715. * Bits 31:16
  10716. * Purpose: Specify how many peer rate report elements are present in the payload.
  10717. * value:
  10718. *
  10719. * Payload:
  10720. * There are variant number of peer rate report follow the first 32 bits.
  10721. * The peer rate report is defined as follows.
  10722. *
  10723. * |31 20|19 16|15 0|
  10724. * |-----------------------+---------+---------------------------------|-
  10725. * | reserved | phy | peer_id | \
  10726. * |-------------------------------------------------------------------| -> report #0
  10727. * | rate | /
  10728. * |-----------------------+---------+---------------------------------|-
  10729. * | reserved | phy | peer_id | \
  10730. * |-------------------------------------------------------------------| -> report #1
  10731. * | rate | /
  10732. * |-----------------------+---------+---------------------------------|-
  10733. * | reserved | phy | peer_id | \
  10734. * |-------------------------------------------------------------------| -> report #2
  10735. * | rate | /
  10736. * |-------------------------------------------------------------------|-
  10737. * : :
  10738. * : :
  10739. * : :
  10740. * :-------------------------------------------------------------------:
  10741. *
  10742. * - peer_id
  10743. * Bits 15:0
  10744. * Purpose: identify the peer
  10745. * value:
  10746. * - phy
  10747. * Bits 19:16
  10748. * Purpose: identify which phy is in use
  10749. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10750. * Please see enum htt_peer_report_phy_type for detail.
  10751. * - reserved
  10752. * Bits 31:20
  10753. * Purpose:
  10754. * value:
  10755. * - rate
  10756. * Bits 31:0
  10757. * Purpose: represent the justified rate of the peer specified by peer_id
  10758. * value:
  10759. */
  10760. enum htt_peer_rate_report_phy_type {
  10761. HTT_PEER_RATE_REPORT_11B = 0,
  10762. HTT_PEER_RATE_REPORT_11A_G,
  10763. HTT_PEER_RATE_REPORT_11N,
  10764. HTT_PEER_RATE_REPORT_11AC,
  10765. };
  10766. #define HTT_PEER_RATE_REPORT_SIZE 8
  10767. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10768. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10769. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10770. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10771. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10772. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10773. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10774. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10775. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10776. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10779. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10780. } while (0)
  10781. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10782. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10783. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10784. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10785. do { \
  10786. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10787. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10788. } while (0)
  10789. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10790. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10791. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10792. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10795. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10796. } while (0)
  10797. /**
  10798. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10799. *
  10800. * @details
  10801. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10802. * a flow of descriptors.
  10803. *
  10804. * This message is in TLV format and indicates the parameters to be setup a
  10805. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10806. * receive descriptors from a specified pool.
  10807. *
  10808. * The message would appear as follows:
  10809. *
  10810. * |31 24|23 16|15 8|7 0|
  10811. * |----------------+----------------+----------------+----------------|
  10812. * header | reserved | num_flows | msg_type |
  10813. * |-------------------------------------------------------------------|
  10814. * | |
  10815. * : payload :
  10816. * | |
  10817. * |-------------------------------------------------------------------|
  10818. *
  10819. * The header field is one DWORD long and is interpreted as follows:
  10820. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10821. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10822. * this message
  10823. * b'16-31 - reserved: These bits are reserved for future use
  10824. *
  10825. * Payload:
  10826. * The payload would contain multiple objects of the following structure. Each
  10827. * object represents a flow.
  10828. *
  10829. * |31 24|23 16|15 8|7 0|
  10830. * |----------------+----------------+----------------+----------------|
  10831. * header | reserved | num_flows | msg_type |
  10832. * |-------------------------------------------------------------------|
  10833. * payload0| flow_type |
  10834. * |-------------------------------------------------------------------|
  10835. * | flow_id |
  10836. * |-------------------------------------------------------------------|
  10837. * | reserved0 | flow_pool_id |
  10838. * |-------------------------------------------------------------------|
  10839. * | reserved1 | flow_pool_size |
  10840. * |-------------------------------------------------------------------|
  10841. * | reserved2 |
  10842. * |-------------------------------------------------------------------|
  10843. * payload1| flow_type |
  10844. * |-------------------------------------------------------------------|
  10845. * | flow_id |
  10846. * |-------------------------------------------------------------------|
  10847. * | reserved0 | flow_pool_id |
  10848. * |-------------------------------------------------------------------|
  10849. * | reserved1 | flow_pool_size |
  10850. * |-------------------------------------------------------------------|
  10851. * | reserved2 |
  10852. * |-------------------------------------------------------------------|
  10853. * | . |
  10854. * | . |
  10855. * | . |
  10856. * |-------------------------------------------------------------------|
  10857. *
  10858. * Each payload is 5 DWORDS long and is interpreted as follows:
  10859. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10860. * this flow is associated. It can be VDEV, peer,
  10861. * or tid (AC). Based on enum htt_flow_type.
  10862. *
  10863. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10864. * object. For flow_type vdev it is set to the
  10865. * vdevid, for peer it is peerid and for tid, it is
  10866. * tid_num.
  10867. *
  10868. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10869. * in the host for this flow
  10870. * b'16:31 - reserved0: This field in reserved for the future. In case
  10871. * we have a hierarchical implementation (HCM) of
  10872. * pools, it can be used to indicate the ID of the
  10873. * parent-pool.
  10874. *
  10875. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10876. * Descriptors for this flow will be
  10877. * allocated from this pool in the host.
  10878. * b'16:31 - reserved1: This field in reserved for the future. In case
  10879. * we have a hierarchical implementation of pools,
  10880. * it can be used to indicate the max number of
  10881. * descriptors in the pool. The b'0:15 can be used
  10882. * to indicate min number of descriptors in the
  10883. * HCM scheme.
  10884. *
  10885. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10886. * we have a hierarchical implementation of pools,
  10887. * b'0:15 can be used to indicate the
  10888. * priority-based borrowing (PBB) threshold of
  10889. * the flow's pool. The b'16:31 are still left
  10890. * reserved.
  10891. */
  10892. enum htt_flow_type {
  10893. FLOW_TYPE_VDEV = 0,
  10894. /* Insert new flow types above this line */
  10895. };
  10896. PREPACK struct htt_flow_pool_map_payload_t {
  10897. A_UINT32 flow_type;
  10898. A_UINT32 flow_id;
  10899. A_UINT32 flow_pool_id:16,
  10900. reserved0:16;
  10901. A_UINT32 flow_pool_size:16,
  10902. reserved1:16;
  10903. A_UINT32 reserved2;
  10904. } POSTPACK;
  10905. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10906. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10907. (sizeof(struct htt_flow_pool_map_payload_t))
  10908. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10909. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10910. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10911. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10912. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10913. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10914. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10916. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10917. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10918. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10919. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10920. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10921. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10922. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10923. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10924. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10925. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10926. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10927. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10928. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10929. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10930. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10931. do { \
  10932. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10933. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10934. } while (0)
  10935. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10936. do { \
  10937. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10938. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10939. } while (0)
  10940. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10941. do { \
  10942. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10943. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10944. } while (0)
  10945. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10946. do { \
  10947. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10948. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10949. } while (0)
  10950. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10951. do { \
  10952. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10953. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10954. } while (0)
  10955. /**
  10956. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10957. *
  10958. * @details
  10959. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10960. * down a flow of descriptors.
  10961. * This message indicates that for the flow (whose ID is provided) is wanting
  10962. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10963. * pool of descriptors from where descriptors are being allocated for this
  10964. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10965. * be unmapped by the host.
  10966. *
  10967. * The message would appear as follows:
  10968. *
  10969. * |31 24|23 16|15 8|7 0|
  10970. * |----------------+----------------+----------------+----------------|
  10971. * | reserved0 | msg_type |
  10972. * |-------------------------------------------------------------------|
  10973. * | flow_type |
  10974. * |-------------------------------------------------------------------|
  10975. * | flow_id |
  10976. * |-------------------------------------------------------------------|
  10977. * | reserved1 | flow_pool_id |
  10978. * |-------------------------------------------------------------------|
  10979. *
  10980. * The message is interpreted as follows:
  10981. * dword0 - b'0:7 - msg_type: This will be set to
  10982. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10983. * b'8:31 - reserved0: Reserved for future use
  10984. *
  10985. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10986. * this flow is associated. It can be VDEV, peer,
  10987. * or tid (AC). Based on enum htt_flow_type.
  10988. *
  10989. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10990. * object. For flow_type vdev it is set to the
  10991. * vdevid, for peer it is peerid and for tid, it is
  10992. * tid_num.
  10993. *
  10994. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10995. * used in the host for this flow
  10996. * b'16:31 - reserved0: This field in reserved for the future.
  10997. *
  10998. */
  10999. PREPACK struct htt_flow_pool_unmap_t {
  11000. A_UINT32 msg_type:8,
  11001. reserved0:24;
  11002. A_UINT32 flow_type;
  11003. A_UINT32 flow_id;
  11004. A_UINT32 flow_pool_id:16,
  11005. reserved1:16;
  11006. } POSTPACK;
  11007. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11008. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11009. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11010. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11011. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11012. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11013. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11014. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11015. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11016. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11017. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11018. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11019. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11020. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11021. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11022. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11023. do { \
  11024. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11025. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11026. } while (0)
  11027. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11028. do { \
  11029. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11030. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11031. } while (0)
  11032. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11033. do { \
  11034. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11035. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11036. } while (0)
  11037. /**
  11038. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11039. *
  11040. * @details
  11041. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11042. * SRNG ring setup is done
  11043. *
  11044. * This message indicates whether the last setup operation is successful.
  11045. * It will be sent to host when host set respose_required bit in
  11046. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11047. * The message would appear as follows:
  11048. *
  11049. * |31 24|23 16|15 8|7 0|
  11050. * |--------------- +----------------+----------------+----------------|
  11051. * | setup_status | ring_id | pdev_id | msg_type |
  11052. * |-------------------------------------------------------------------|
  11053. *
  11054. * The message is interpreted as follows:
  11055. * dword0 - b'0:7 - msg_type: This will be set to
  11056. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11057. * b'8:15 - pdev_id:
  11058. * 0 (for rings at SOC/UMAC level),
  11059. * 1/2/3 mac id (for rings at LMAC level)
  11060. * b'16:23 - ring_id: Identify the ring which is set up
  11061. * More details can be got from enum htt_srng_ring_id
  11062. * b'24:31 - setup_status: Indicate status of setup operation
  11063. * Refer to htt_ring_setup_status
  11064. */
  11065. PREPACK struct htt_sring_setup_done_t {
  11066. A_UINT32 msg_type: 8,
  11067. pdev_id: 8,
  11068. ring_id: 8,
  11069. setup_status: 8;
  11070. } POSTPACK;
  11071. enum htt_ring_setup_status {
  11072. htt_ring_setup_status_ok = 0,
  11073. htt_ring_setup_status_error,
  11074. };
  11075. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11076. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11077. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11078. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11079. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11080. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11081. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11082. do { \
  11083. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11084. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11085. } while (0)
  11086. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11087. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11088. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11089. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11090. HTT_SRING_SETUP_DONE_RING_ID_S)
  11091. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11092. do { \
  11093. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11094. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11095. } while (0)
  11096. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11097. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11098. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11099. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11100. HTT_SRING_SETUP_DONE_STATUS_S)
  11101. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11102. do { \
  11103. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11104. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11105. } while (0)
  11106. /**
  11107. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11108. *
  11109. * @details
  11110. * HTT TX map flow entry with tqm flow pointer
  11111. * Sent from firmware to host to add tqm flow pointer in corresponding
  11112. * flow search entry. Flow metadata is replayed back to host as part of this
  11113. * struct to enable host to find the specific flow search entry
  11114. *
  11115. * The message would appear as follows:
  11116. *
  11117. * |31 28|27 18|17 14|13 8|7 0|
  11118. * |-------+------------------------------------------+----------------|
  11119. * | rsvd0 | fse_hsh_idx | msg_type |
  11120. * |-------------------------------------------------------------------|
  11121. * | rsvd1 | tid | peer_id |
  11122. * |-------------------------------------------------------------------|
  11123. * | tqm_flow_pntr_lo |
  11124. * |-------------------------------------------------------------------|
  11125. * | tqm_flow_pntr_hi |
  11126. * |-------------------------------------------------------------------|
  11127. * | fse_meta_data |
  11128. * |-------------------------------------------------------------------|
  11129. *
  11130. * The message is interpreted as follows:
  11131. *
  11132. * dword0 - b'0:7 - msg_type: This will be set to
  11133. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11134. *
  11135. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11136. * for this flow entry
  11137. *
  11138. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11139. *
  11140. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11141. *
  11142. * dword1 - b'14:17 - tid
  11143. *
  11144. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11145. *
  11146. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11147. *
  11148. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11149. *
  11150. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11151. * given by host
  11152. */
  11153. PREPACK struct htt_tx_map_flow_info {
  11154. A_UINT32
  11155. msg_type: 8,
  11156. fse_hsh_idx: 20,
  11157. rsvd0: 4;
  11158. A_UINT32
  11159. peer_id: 14,
  11160. tid: 4,
  11161. rsvd1: 14;
  11162. A_UINT32 tqm_flow_pntr_lo;
  11163. A_UINT32 tqm_flow_pntr_hi;
  11164. struct htt_tx_flow_metadata fse_meta_data;
  11165. } POSTPACK;
  11166. /* DWORD 0 */
  11167. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11168. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11169. /* DWORD 1 */
  11170. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11171. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11172. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11173. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11174. /* DWORD 0 */
  11175. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11176. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11177. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11178. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11179. do { \
  11180. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11181. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11182. } while (0)
  11183. /* DWORD 1 */
  11184. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11185. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11186. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11187. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11190. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11191. } while (0)
  11192. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11193. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11194. HTT_TX_MAP_FLOW_INFO_TID_S)
  11195. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11198. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11199. } while (0)
  11200. /*
  11201. * htt_dbg_ext_stats_status -
  11202. * present - The requested stats have been delivered in full.
  11203. * This indicates that either the stats information was contained
  11204. * in its entirety within this message, or else this message
  11205. * completes the delivery of the requested stats info that was
  11206. * partially delivered through earlier STATS_CONF messages.
  11207. * partial - The requested stats have been delivered in part.
  11208. * One or more subsequent STATS_CONF messages with the same
  11209. * cookie value will be sent to deliver the remainder of the
  11210. * information.
  11211. * error - The requested stats could not be delivered, for example due
  11212. * to a shortage of memory to construct a message holding the
  11213. * requested stats.
  11214. * invalid - The requested stat type is either not recognized, or the
  11215. * target is configured to not gather the stats type in question.
  11216. */
  11217. enum htt_dbg_ext_stats_status {
  11218. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11219. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11220. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11221. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11222. };
  11223. /**
  11224. * @brief target -> host ppdu stats upload
  11225. *
  11226. * @details
  11227. * The following field definitions describe the format of the HTT target
  11228. * to host ppdu stats indication message.
  11229. *
  11230. *
  11231. * |31 16|15 12|11 10|9 8|7 0 |
  11232. * |----------------------------------------------------------------------|
  11233. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11234. * |----------------------------------------------------------------------|
  11235. * | ppdu_id |
  11236. * |----------------------------------------------------------------------|
  11237. * | Timestamp in us |
  11238. * |----------------------------------------------------------------------|
  11239. * | reserved |
  11240. * |----------------------------------------------------------------------|
  11241. * | type-specific stats info |
  11242. * | (see htt_ppdu_stats.h) |
  11243. * |----------------------------------------------------------------------|
  11244. * Header fields:
  11245. * - MSG_TYPE
  11246. * Bits 7:0
  11247. * Purpose: Identifies this is a PPDU STATS indication
  11248. * message.
  11249. * Value: 0x1d
  11250. * - mac_id
  11251. * Bits 9:8
  11252. * Purpose: mac_id of this ppdu_id
  11253. * Value: 0-3
  11254. * - pdev_id
  11255. * Bits 11:10
  11256. * Purpose: pdev_id of this ppdu_id
  11257. * Value: 0-3
  11258. * 0 (for rings at SOC level),
  11259. * 1/2/3 PDEV -> 0/1/2
  11260. * - payload_size
  11261. * Bits 31:16
  11262. * Purpose: total tlv size
  11263. * Value: payload_size in bytes
  11264. */
  11265. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11266. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11267. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11268. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11269. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11270. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11271. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11272. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11273. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11274. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11275. do { \
  11276. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11277. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11278. } while (0)
  11279. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11280. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11281. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11282. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11283. do { \
  11284. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11285. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11286. } while (0)
  11287. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11288. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11289. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11290. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11291. do { \
  11292. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11293. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11294. } while (0)
  11295. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11296. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11297. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11298. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11299. do { \
  11300. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11301. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11302. } while (0)
  11303. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11304. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11305. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11306. /* htt_t2h_ppdu_stats_ind_hdr_t
  11307. * This struct contains the fields within the header of the
  11308. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11309. * stats info.
  11310. * This struct assumes little-endian layout, and thus is only
  11311. * suitable for use within processors known to be little-endian
  11312. * (such as the target).
  11313. * In contrast, the above macros provide endian-portable methods
  11314. * to get and set the bitfields within this PPDU_STATS_IND header.
  11315. */
  11316. typedef struct {
  11317. A_UINT32 msg_type: 8, /* bits 7:0 */
  11318. mac_id: 2, /* bits 9:8 */
  11319. pdev_id: 2, /* bits 11:10 */
  11320. reserved1: 4, /* bits 15:12 */
  11321. payload_size: 16; /* bits 31:16 */
  11322. A_UINT32 ppdu_id;
  11323. A_UINT32 timestamp_us;
  11324. A_UINT32 reserved2;
  11325. } htt_t2h_ppdu_stats_ind_hdr_t;
  11326. /**
  11327. * @brief target -> host extended statistics upload
  11328. *
  11329. * @details
  11330. * The following field definitions describe the format of the HTT target
  11331. * to host stats upload confirmation message.
  11332. * The message contains a cookie echoed from the HTT host->target stats
  11333. * upload request, which identifies which request the confirmation is
  11334. * for, and a single stats can span over multiple HTT stats indication
  11335. * due to the HTT message size limitation so every HTT ext stats indication
  11336. * will have tag-length-value stats information elements.
  11337. * The tag-length header for each HTT stats IND message also includes a
  11338. * status field, to indicate whether the request for the stat type in
  11339. * question was fully met, partially met, unable to be met, or invalid
  11340. * (if the stat type in question is disabled in the target).
  11341. * A Done bit 1's indicate the end of the of stats info elements.
  11342. *
  11343. *
  11344. * |31 16|15 12|11|10 8|7 5|4 0|
  11345. * |--------------------------------------------------------------|
  11346. * | reserved | msg type |
  11347. * |--------------------------------------------------------------|
  11348. * | cookie LSBs |
  11349. * |--------------------------------------------------------------|
  11350. * | cookie MSBs |
  11351. * |--------------------------------------------------------------|
  11352. * | stats entry length | rsvd | D| S | stat type |
  11353. * |--------------------------------------------------------------|
  11354. * | type-specific stats info |
  11355. * | (see htt_stats.h) |
  11356. * |--------------------------------------------------------------|
  11357. * Header fields:
  11358. * - MSG_TYPE
  11359. * Bits 7:0
  11360. * Purpose: Identifies this is a extended statistics upload confirmation
  11361. * message.
  11362. * Value: 0x1c
  11363. * - COOKIE_LSBS
  11364. * Bits 31:0
  11365. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11366. * message with its preceding host->target stats request message.
  11367. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11368. * - COOKIE_MSBS
  11369. * Bits 31:0
  11370. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11371. * message with its preceding host->target stats request message.
  11372. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11373. *
  11374. * Stats Information Element tag-length header fields:
  11375. * - STAT_TYPE
  11376. * Bits 7:0
  11377. * Purpose: identifies the type of statistics info held in the
  11378. * following information element
  11379. * Value: htt_dbg_ext_stats_type
  11380. * - STATUS
  11381. * Bits 10:8
  11382. * Purpose: indicate whether the requested stats are present
  11383. * Value: htt_dbg_ext_stats_status
  11384. * - DONE
  11385. * Bits 11
  11386. * Purpose:
  11387. * Indicates the completion of the stats entry, this will be the last
  11388. * stats conf HTT segment for the requested stats type.
  11389. * Value:
  11390. * 0 -> the stats retrieval is ongoing
  11391. * 1 -> the stats retrieval is complete
  11392. * - LENGTH
  11393. * Bits 31:16
  11394. * Purpose: indicate the stats information size
  11395. * Value: This field specifies the number of bytes of stats information
  11396. * that follows the element tag-length header.
  11397. * It is expected but not required that this length is a multiple of
  11398. * 4 bytes.
  11399. */
  11400. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11401. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11402. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11403. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11404. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11405. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11406. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11407. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11408. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11409. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11410. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11411. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11414. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11415. } while (0)
  11416. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11417. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11418. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11419. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11420. do { \
  11421. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11422. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11423. } while (0)
  11424. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11425. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11426. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11427. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11428. do { \
  11429. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11430. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11431. } while (0)
  11432. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11433. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11434. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11435. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11438. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11439. } while (0)
  11440. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11441. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11442. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11443. typedef enum {
  11444. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11445. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11446. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11447. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11448. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11449. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11450. /* Reserved from 128 - 255 for target internal use.*/
  11451. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11452. } HTT_PEER_TYPE;
  11453. /** 2 word representation of MAC addr */
  11454. typedef struct {
  11455. /** upper 4 bytes of MAC address */
  11456. A_UINT32 mac_addr31to0;
  11457. /** lower 2 bytes of MAC address */
  11458. A_UINT32 mac_addr47to32;
  11459. } htt_mac_addr;
  11460. /** macro to convert MAC address from char array to HTT word format */
  11461. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11462. (phtt_mac_addr)->mac_addr31to0 = \
  11463. (((c_macaddr)[0] << 0) | \
  11464. ((c_macaddr)[1] << 8) | \
  11465. ((c_macaddr)[2] << 16) | \
  11466. ((c_macaddr)[3] << 24)); \
  11467. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11468. } while (0)
  11469. /**
  11470. * @brief target -> host monitor mac header indication message
  11471. *
  11472. * @details
  11473. * The following diagram shows the format of the monitor mac header message
  11474. * sent from the target to the host.
  11475. * This message is primarily sent when promiscuous rx mode is enabled.
  11476. * One message is sent per rx PPDU.
  11477. *
  11478. * |31 24|23 16|15 8|7 0|
  11479. * |-------------------------------------------------------------|
  11480. * | peer_id | reserved0 | msg_type |
  11481. * |-------------------------------------------------------------|
  11482. * | reserved1 | num_mpdu |
  11483. * |-------------------------------------------------------------|
  11484. * | struct hw_rx_desc |
  11485. * | (see wal_rx_desc.h) |
  11486. * |-------------------------------------------------------------|
  11487. * | struct ieee80211_frame_addr4 |
  11488. * | (see ieee80211_defs.h) |
  11489. * |-------------------------------------------------------------|
  11490. * | struct ieee80211_frame_addr4 |
  11491. * | (see ieee80211_defs.h) |
  11492. * |-------------------------------------------------------------|
  11493. * | ...... |
  11494. * |-------------------------------------------------------------|
  11495. *
  11496. * Header fields:
  11497. * - msg_type
  11498. * Bits 7:0
  11499. * Purpose: Identifies this is a monitor mac header indication message.
  11500. * Value: 0x20
  11501. * - peer_id
  11502. * Bits 31:16
  11503. * Purpose: Software peer id given by host during association,
  11504. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11505. * for rx PPDUs received from unassociated peers.
  11506. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11507. * - num_mpdu
  11508. * Bits 15:0
  11509. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11510. * delivered within the message.
  11511. * Value: 1 to 32
  11512. * num_mpdu is limited to a maximum value of 32, due to buffer
  11513. * size limits. For PPDUs with more than 32 MPDUs, only the
  11514. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11515. * the PPDU will be provided.
  11516. */
  11517. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11518. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11519. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11520. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11521. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11522. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11523. do { \
  11524. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11525. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11526. } while (0)
  11527. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11528. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11529. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11530. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11531. do { \
  11532. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11533. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11534. } while (0)
  11535. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11536. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11537. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11538. /**
  11539. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11540. *
  11541. * @details
  11542. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11543. * the flow pool associated with the specified ID is resized
  11544. *
  11545. * The message would appear as follows:
  11546. *
  11547. * |31 16|15 8|7 0|
  11548. * |---------------------------------+----------------+----------------|
  11549. * | reserved0 | Msg type |
  11550. * |-------------------------------------------------------------------|
  11551. * | flow pool new size | flow pool ID |
  11552. * |-------------------------------------------------------------------|
  11553. *
  11554. * The message is interpreted as follows:
  11555. * b'0:7 - msg_type: This will be set to
  11556. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11557. *
  11558. * b'0:15 - flow pool ID: Existing flow pool ID
  11559. *
  11560. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11561. *
  11562. */
  11563. PREPACK struct htt_flow_pool_resize_t {
  11564. A_UINT32 msg_type:8,
  11565. reserved0:24;
  11566. A_UINT32 flow_pool_id:16,
  11567. flow_pool_new_size:16;
  11568. } POSTPACK;
  11569. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11570. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11571. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11572. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11573. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11574. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11575. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11576. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11577. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11578. do { \
  11579. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11580. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11581. } while (0)
  11582. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11583. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11584. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11585. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11586. do { \
  11587. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11588. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11589. } while (0)
  11590. /**
  11591. * @brief host -> target channel change message
  11592. *
  11593. * @details
  11594. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11595. * to associate RX frames to correct channel they were received on.
  11596. * The following field definitions describe the format of the HTT target
  11597. * to host channel change message.
  11598. * |31 16|15 8|7 5|4 0|
  11599. * |------------------------------------------------------------|
  11600. * | reserved | MSG_TYPE |
  11601. * |------------------------------------------------------------|
  11602. * | CHAN_MHZ |
  11603. * |------------------------------------------------------------|
  11604. * | BAND_CENTER_FREQ1 |
  11605. * |------------------------------------------------------------|
  11606. * | BAND_CENTER_FREQ2 |
  11607. * |------------------------------------------------------------|
  11608. * | CHAN_PHY_MODE |
  11609. * |------------------------------------------------------------|
  11610. * Header fields:
  11611. * - MSG_TYPE
  11612. * Bits 7:0
  11613. * Value: 0xf
  11614. * - CHAN_MHZ
  11615. * Bits 31:0
  11616. * Purpose: frequency of the primary 20mhz channel.
  11617. * - BAND_CENTER_FREQ1
  11618. * Bits 31:0
  11619. * Purpose: centre frequency of the full channel.
  11620. * - BAND_CENTER_FREQ2
  11621. * Bits 31:0
  11622. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11623. * - CHAN_PHY_MODE
  11624. * Bits 31:0
  11625. * Purpose: phy mode of the channel.
  11626. */
  11627. PREPACK struct htt_chan_change_msg {
  11628. A_UINT32 chan_mhz; /* frequency in mhz */
  11629. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11630. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11631. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11632. } POSTPACK;
  11633. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11634. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11635. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11636. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11637. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11638. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11639. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11640. /*
  11641. * The read and write indices point to the data within the host buffer.
  11642. * Because the first 4 bytes of the host buffer is used for the read index and
  11643. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11644. * The read index and write index are the byte offsets from the base of the
  11645. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11646. * Refer the ASCII text picture below.
  11647. */
  11648. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11649. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11650. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11651. /*
  11652. ***************************************************************************
  11653. *
  11654. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11655. *
  11656. ***************************************************************************
  11657. *
  11658. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11659. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11660. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11661. * written into the Host memory region mentioned below.
  11662. *
  11663. * Read index is updated by the Host. At any point of time, the read index will
  11664. * indicate the index that will next be read by the Host. The read index is
  11665. * in units of bytes offset from the base of the meta-data buffer.
  11666. *
  11667. * Write index is updated by the FW. At any point of time, the write index will
  11668. * indicate from where the FW can start writing any new data. The write index is
  11669. * in units of bytes offset from the base of the meta-data buffer.
  11670. *
  11671. * If the Host is not fast enough in reading the CFR data, any new capture data
  11672. * would be dropped if there is no space left to write the new captures.
  11673. *
  11674. * The last 4 bytes of the memory region will have the magic pattern
  11675. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11676. * not overrun the host buffer.
  11677. *
  11678. * ,--------------------. read and write indices store the
  11679. * | | byte offset from the base of the
  11680. * | ,--------+--------. meta-data buffer to the next
  11681. * | | | | location within the data buffer
  11682. * | | v v that will be read / written
  11683. * ************************************************************************
  11684. * * Read * Write * * Magic *
  11685. * * index * index * CFR data1 ...... CFR data N * pattern *
  11686. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11687. * ************************************************************************
  11688. * |<---------- data buffer ---------->|
  11689. *
  11690. * |<----------------- meta-data buffer allocated in Host ----------------|
  11691. *
  11692. * Note:
  11693. * - Considering the 4 bytes needed to store the Read index (R) and the
  11694. * Write index (W), the initial value is as follows:
  11695. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11696. * - Buffer empty condition:
  11697. * R = W
  11698. *
  11699. * Regarding CFR data format:
  11700. * --------------------------
  11701. *
  11702. * Each CFR tone is stored in HW as 16-bits with the following format:
  11703. * {bits[15:12], bits[11:6], bits[5:0]} =
  11704. * {unsigned exponent (4 bits),
  11705. * signed mantissa_real (6 bits),
  11706. * signed mantissa_imag (6 bits)}
  11707. *
  11708. * CFR_real = mantissa_real * 2^(exponent-5)
  11709. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11710. *
  11711. *
  11712. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11713. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11714. *
  11715. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11716. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11717. * .
  11718. * .
  11719. * .
  11720. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11721. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11722. */
  11723. /* Bandwidth of peer CFR captures */
  11724. typedef enum {
  11725. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11726. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11727. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11728. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11729. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11730. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11731. } HTT_PEER_CFR_CAPTURE_BW;
  11732. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11733. * was captured
  11734. */
  11735. typedef enum {
  11736. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11737. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11738. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11739. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11740. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11741. } HTT_PEER_CFR_CAPTURE_MODE;
  11742. typedef enum {
  11743. /* This message type is currently used for the below purpose:
  11744. *
  11745. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11746. * wmi_peer_cfr_capture_cmd.
  11747. * If payload_present bit is set to 0 then the associated memory region
  11748. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11749. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11750. * message; the CFR dump will be present at the end of the message,
  11751. * after the chan_phy_mode.
  11752. */
  11753. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11754. /* Always keep this last */
  11755. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11756. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11757. /**
  11758. * @brief target -> host CFR dump completion indication message definition
  11759. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11760. *
  11761. * @details
  11762. * The following diagram shows the format of the Channel Frequency Response
  11763. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11764. * the channel capture of a peer is copied by Firmware into the Host memory
  11765. *
  11766. * **************************************************************************
  11767. *
  11768. * Message format when the CFR capture message type is
  11769. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11770. *
  11771. * **************************************************************************
  11772. *
  11773. * |31 16|15 |8|7 0|
  11774. * |----------------------------------------------------------------|
  11775. * header: | reserved |P| msg_type |
  11776. * word 0 | | | |
  11777. * |----------------------------------------------------------------|
  11778. * payload: | cfr_capture_msg_type |
  11779. * word 1 | |
  11780. * |----------------------------------------------------------------|
  11781. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11782. * word 2 | | | | | | | | |
  11783. * |----------------------------------------------------------------|
  11784. * | mac_addr31to0 |
  11785. * word 3 | |
  11786. * |----------------------------------------------------------------|
  11787. * | unused / reserved | mac_addr47to32 |
  11788. * word 4 | | |
  11789. * |----------------------------------------------------------------|
  11790. * | index |
  11791. * word 5 | |
  11792. * |----------------------------------------------------------------|
  11793. * | length |
  11794. * word 6 | |
  11795. * |----------------------------------------------------------------|
  11796. * | timestamp |
  11797. * word 7 | |
  11798. * |----------------------------------------------------------------|
  11799. * | counter |
  11800. * word 8 | |
  11801. * |----------------------------------------------------------------|
  11802. * | chan_mhz |
  11803. * word 9 | |
  11804. * |----------------------------------------------------------------|
  11805. * | band_center_freq1 |
  11806. * word 10 | |
  11807. * |----------------------------------------------------------------|
  11808. * | band_center_freq2 |
  11809. * word 11 | |
  11810. * |----------------------------------------------------------------|
  11811. * | chan_phy_mode |
  11812. * word 12 | |
  11813. * |----------------------------------------------------------------|
  11814. * where,
  11815. * P - payload present bit (payload_present explained below)
  11816. * req_id - memory request id (mem_req_id explained below)
  11817. * S - status field (status explained below)
  11818. * capbw - capture bandwidth (capture_bw explained below)
  11819. * mode - mode of capture (mode explained below)
  11820. * sts - space time streams (sts_count explained below)
  11821. * chbw - channel bandwidth (channel_bw explained below)
  11822. * captype - capture type (cap_type explained below)
  11823. *
  11824. * The following field definitions describe the format of the CFR dump
  11825. * completion indication sent from the target to the host
  11826. *
  11827. * Header fields:
  11828. *
  11829. * Word 0
  11830. * - msg_type
  11831. * Bits 7:0
  11832. * Purpose: Identifies this as CFR TX completion indication
  11833. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11834. * - payload_present
  11835. * Bit 8
  11836. * Purpose: Identifies how CFR data is sent to host
  11837. * Value: 0 - If CFR Payload is written to host memory
  11838. * 1 - If CFR Payload is sent as part of HTT message
  11839. * (This is the requirement for SDIO/USB where it is
  11840. * not possible to write CFR data to host memory)
  11841. * - reserved
  11842. * Bits 31:9
  11843. * Purpose: Reserved
  11844. * Value: 0
  11845. *
  11846. * Payload fields:
  11847. *
  11848. * Word 1
  11849. * - cfr_capture_msg_type
  11850. * Bits 31:0
  11851. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11852. * to specify the format used for the remainder of the message
  11853. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11854. * (currently only MSG_TYPE_1 is defined)
  11855. *
  11856. * Word 2
  11857. * - mem_req_id
  11858. * Bits 6:0
  11859. * Purpose: Contain the mem request id of the region where the CFR capture
  11860. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11861. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11862. this value is invalid)
  11863. * - status
  11864. * Bit 7
  11865. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11866. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11867. * - capture_bw
  11868. * Bits 10:8
  11869. * Purpose: Carry the bandwidth of the CFR capture
  11870. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11871. * - mode
  11872. * Bits 13:11
  11873. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11874. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11875. * - sts_count
  11876. * Bits 16:14
  11877. * Purpose: Carry the number of space time streams
  11878. * Value: Number of space time streams
  11879. * - channel_bw
  11880. * Bits 19:17
  11881. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11882. * measurement
  11883. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11884. * - cap_type
  11885. * Bits 23:20
  11886. * Purpose: Carry the type of the capture
  11887. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11888. * - vdev_id
  11889. * Bits 31:24
  11890. * Purpose: Carry the virtual device id
  11891. * Value: vdev ID
  11892. *
  11893. * Word 3
  11894. * - mac_addr31to0
  11895. * Bits 31:0
  11896. * Purpose: Contain the bits 31:0 of the peer MAC address
  11897. * Value: Bits 31:0 of the peer MAC address
  11898. *
  11899. * Word 4
  11900. * - mac_addr47to32
  11901. * Bits 15:0
  11902. * Purpose: Contain the bits 47:32 of the peer MAC address
  11903. * Value: Bits 47:32 of the peer MAC address
  11904. *
  11905. * Word 5
  11906. * - index
  11907. * Bits 31:0
  11908. * Purpose: Contain the index at which this CFR dump was written in the Host
  11909. * allocated memory. This index is the number of bytes from the base address.
  11910. * Value: Index position
  11911. *
  11912. * Word 6
  11913. * - length
  11914. * Bits 31:0
  11915. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11916. * Value: Length of the CFR capture of the peer
  11917. *
  11918. * Word 7
  11919. * - timestamp
  11920. * Bits 31:0
  11921. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11922. * clock used for this timestamp is private to the target and not visible to
  11923. * the host i.e., Host can interpret only the relative timestamp deltas from
  11924. * one message to the next, but can't interpret the absolute timestamp from a
  11925. * single message.
  11926. * Value: Timestamp in microseconds
  11927. *
  11928. * Word 8
  11929. * - counter
  11930. * Bits 31:0
  11931. * Purpose: Carry the count of the current CFR capture from FW. This is
  11932. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11933. * in host memory)
  11934. * Value: Count of the current CFR capture
  11935. *
  11936. * Word 9
  11937. * - chan_mhz
  11938. * Bits 31:0
  11939. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11940. * Value: Primary 20 channel frequency
  11941. *
  11942. * Word 10
  11943. * - band_center_freq1
  11944. * Bits 31:0
  11945. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11946. * Value: Center frequency 1 in MHz
  11947. *
  11948. * Word 11
  11949. * - band_center_freq2
  11950. * Bits 31:0
  11951. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11952. * the VDEV
  11953. * 80plus80 mode
  11954. * Value: Center frequency 2 in MHz
  11955. *
  11956. * Word 12
  11957. * - chan_phy_mode
  11958. * Bits 31:0
  11959. * Purpose: Carry the phy mode of the channel, of the VDEV
  11960. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11961. */
  11962. PREPACK struct htt_cfr_dump_ind_type_1 {
  11963. A_UINT32 mem_req_id:7,
  11964. status:1,
  11965. capture_bw:3,
  11966. mode:3,
  11967. sts_count:3,
  11968. channel_bw:3,
  11969. cap_type:4,
  11970. vdev_id:8;
  11971. htt_mac_addr addr;
  11972. A_UINT32 index;
  11973. A_UINT32 length;
  11974. A_UINT32 timestamp;
  11975. A_UINT32 counter;
  11976. struct htt_chan_change_msg chan;
  11977. } POSTPACK;
  11978. PREPACK struct htt_cfr_dump_compl_ind {
  11979. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11980. union {
  11981. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11982. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11983. /* If there is a need to change the memory layout and its associated
  11984. * HTT indication format, a new CFR capture message type can be
  11985. * introduced and added into this union.
  11986. */
  11987. };
  11988. } POSTPACK;
  11989. /*
  11990. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11991. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11992. */
  11993. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11994. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11995. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11996. do { \
  11997. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11998. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11999. } while(0)
  12000. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12001. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12002. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12003. /*
  12004. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12005. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12006. */
  12007. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12008. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12009. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12010. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12011. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12012. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12013. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12014. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12015. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12016. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12017. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12018. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12019. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12020. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12021. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12022. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12023. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12024. do { \
  12025. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12026. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12027. } while (0)
  12028. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12029. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12030. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12031. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12032. do { \
  12033. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12034. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12035. } while (0)
  12036. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12037. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12038. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12039. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12040. do { \
  12041. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12042. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12043. } while (0)
  12044. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12045. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12046. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12047. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12048. do { \
  12049. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12050. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12051. } while (0)
  12052. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12053. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12054. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12055. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12058. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12059. } while (0)
  12060. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12061. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12062. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12063. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12064. do { \
  12065. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12066. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12067. } while (0)
  12068. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12069. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12070. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12071. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12074. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12075. } while (0)
  12076. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12077. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12078. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12079. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12082. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12083. } while (0)
  12084. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12085. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12086. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12087. /**
  12088. * @brief target -> host peer (PPDU) stats message
  12089. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12090. * @details
  12091. * This message is generated by FW when FW is sending stats to host
  12092. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12093. * This message is sent autonomously by the target rather than upon request
  12094. * by the host.
  12095. * The following field definitions describe the format of the HTT target
  12096. * to host peer stats indication message.
  12097. *
  12098. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12099. * or more PPDU stats records.
  12100. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12101. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12102. * then the message would start with the
  12103. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12104. * below.
  12105. *
  12106. * |31 16|15|14|13 11|10 9|8|7 0|
  12107. * |-------------------------------------------------------------|
  12108. * | reserved |MSG_TYPE |
  12109. * |-------------------------------------------------------------|
  12110. * rec 0 | TLV header |
  12111. * rec 0 |-------------------------------------------------------------|
  12112. * rec 0 | ppdu successful bytes |
  12113. * rec 0 |-------------------------------------------------------------|
  12114. * rec 0 | ppdu retry bytes |
  12115. * rec 0 |-------------------------------------------------------------|
  12116. * rec 0 | ppdu failed bytes |
  12117. * rec 0 |-------------------------------------------------------------|
  12118. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12119. * rec 0 |-------------------------------------------------------------|
  12120. * rec 0 | retried MSDUs | successful MSDUs |
  12121. * rec 0 |-------------------------------------------------------------|
  12122. * rec 0 | TX duration | failed MSDUs |
  12123. * rec 0 |-------------------------------------------------------------|
  12124. * ...
  12125. * |-------------------------------------------------------------|
  12126. * rec N | TLV header |
  12127. * rec N |-------------------------------------------------------------|
  12128. * rec N | ppdu successful bytes |
  12129. * rec N |-------------------------------------------------------------|
  12130. * rec N | ppdu retry bytes |
  12131. * rec N |-------------------------------------------------------------|
  12132. * rec N | ppdu failed bytes |
  12133. * rec N |-------------------------------------------------------------|
  12134. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12135. * rec N |-------------------------------------------------------------|
  12136. * rec N | retried MSDUs | successful MSDUs |
  12137. * rec N |-------------------------------------------------------------|
  12138. * rec N | TX duration | failed MSDUs |
  12139. * rec N |-------------------------------------------------------------|
  12140. *
  12141. * where:
  12142. * A = is A-MPDU flag
  12143. * BA = block-ack failure flags
  12144. * BW = bandwidth spec
  12145. * SG = SGI enabled spec
  12146. * S = skipped rate ctrl
  12147. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12148. *
  12149. * Header
  12150. * ------
  12151. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12152. * dword0 - b'8:31 - reserved : Reserved for future use
  12153. *
  12154. * payload include below peer_stats information
  12155. * --------------------------------------------
  12156. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12157. * @tx_success_bytes : total successful bytes in the PPDU.
  12158. * @tx_retry_bytes : total retried bytes in the PPDU.
  12159. * @tx_failed_bytes : total failed bytes in the PPDU.
  12160. * @tx_ratecode : rate code used for the PPDU.
  12161. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12162. * @ba_ack_failed : BA/ACK failed for this PPDU
  12163. * b00 -> BA received
  12164. * b01 -> BA failed once
  12165. * b10 -> BA failed twice, when HW retry is enabled.
  12166. * @bw : BW
  12167. * b00 -> 20 MHz
  12168. * b01 -> 40 MHz
  12169. * b10 -> 80 MHz
  12170. * b11 -> 160 MHz (or 80+80)
  12171. * @sg : SGI enabled
  12172. * @s : skipped ratectrl
  12173. * @peer_id : peer id
  12174. * @tx_success_msdus : successful MSDUs
  12175. * @tx_retry_msdus : retried MSDUs
  12176. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12177. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12178. */
  12179. /**
  12180. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12181. *
  12182. * @details
  12183. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12184. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12185. * This message will only be sent if the backpressure condition has existed
  12186. * continuously for an initial period (100 ms).
  12187. * Repeat messages with updated information will be sent after each
  12188. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12189. * This message indicates the ring id along with current head and tail index
  12190. * locations (i.e. write and read indices).
  12191. * The backpressure time indicates the time in ms for which continous
  12192. * backpressure has been observed in the ring.
  12193. *
  12194. * The message format is as follows:
  12195. *
  12196. * |31 24|23 16|15 8|7 0|
  12197. * |----------------+----------------+----------------+----------------|
  12198. * | ring_id | ring_type | pdev_id | msg_type |
  12199. * |-------------------------------------------------------------------|
  12200. * | tail_idx | head_idx |
  12201. * |-------------------------------------------------------------------|
  12202. * | backpressure_time_ms |
  12203. * |-------------------------------------------------------------------|
  12204. *
  12205. * The message is interpreted as follows:
  12206. * dword0 - b'0:7 - msg_type: This will be set to
  12207. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12208. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12209. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12210. the msg is for LMAC ring.
  12211. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12212. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12213. * htt_backpressure_lmac_ring_id. This represents
  12214. * the ring id for which continous backpressure is seen
  12215. *
  12216. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12217. * the ring indicated by the ring_id
  12218. *
  12219. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12220. * the ring indicated by the ring id
  12221. *
  12222. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12223. * backpressure has been seen in the ring
  12224. * indicated by the ring_id.
  12225. * Units = milliseconds
  12226. */
  12227. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12228. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12229. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12230. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12231. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12232. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12233. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12234. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12235. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12236. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12237. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12238. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12239. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12240. do { \
  12241. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12242. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12243. } while (0)
  12244. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12245. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12246. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12247. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12248. do { \
  12249. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12250. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12251. } while (0)
  12252. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12253. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12254. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12255. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12256. do { \
  12257. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12258. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12259. } while (0)
  12260. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12261. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12262. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12263. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12264. do { \
  12265. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12266. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12267. } while (0)
  12268. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12269. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12270. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12271. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12272. do { \
  12273. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12274. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12275. } while (0)
  12276. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12277. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12278. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12279. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12280. do { \
  12281. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12282. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12283. } while (0)
  12284. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12285. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12286. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12287. enum htt_backpressure_ring_type {
  12288. HTT_SW_RING_TYPE_UMAC,
  12289. HTT_SW_RING_TYPE_LMAC,
  12290. HTT_SW_RING_TYPE_MAX,
  12291. };
  12292. /* Ring id for which the message is sent to host */
  12293. enum htt_backpressure_umac_ringid {
  12294. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12295. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12296. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12297. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12298. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12299. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12300. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12301. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12302. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12303. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12304. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12305. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12306. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12307. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12308. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12309. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12310. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12311. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12312. HTT_SW_UMAC_RING_IDX_MAX,
  12313. };
  12314. enum htt_backpressure_lmac_ringid {
  12315. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12316. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12317. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12318. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12319. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12320. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12321. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12322. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12323. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12324. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12325. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12326. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12327. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12328. HTT_SW_LMAC_RING_IDX_MAX,
  12329. };
  12330. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12331. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12332. pdev_id: 8,
  12333. ring_type: 8, /* htt_backpressure_ring_type */
  12334. /*
  12335. * ring_id holds an enum value from either
  12336. * htt_backpressure_umac_ringid or
  12337. * htt_backpressure_lmac_ringid, based on
  12338. * the ring_type setting.
  12339. */
  12340. ring_id: 8;
  12341. A_UINT16 head_idx;
  12342. A_UINT16 tail_idx;
  12343. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12344. } POSTPACK;
  12345. /*
  12346. * Defines two 32 bit words that can be used by the target to indicate a per
  12347. * user RU allocation and rate information.
  12348. *
  12349. * This information is currently provided in the "sw_response_reference_ptr"
  12350. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12351. * "rx_ppdu_end_user_stats" TLV.
  12352. *
  12353. * VALID:
  12354. * The consumer of these words must explicitly check the valid bit,
  12355. * and only attempt interpretation of any of the remaining fields if
  12356. * the valid bit is set to 1.
  12357. *
  12358. * VERSION:
  12359. * The consumer of these words must also explicitly check the version bit,
  12360. * and only use the V0 definition if the VERSION field is set to 0.
  12361. *
  12362. * Version 1 is currently undefined, with the exception of the VALID and
  12363. * VERSION fields.
  12364. *
  12365. * Version 0:
  12366. *
  12367. * The fields below are duplicated per BW.
  12368. *
  12369. * The consumer must determine which BW field to use, based on the UL OFDMA
  12370. * PPDU BW indicated by HW.
  12371. *
  12372. * RU_START: RU26 start index for the user.
  12373. * Note that this is always using the RU26 index, regardless
  12374. * of the actual RU assigned to the user
  12375. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12376. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12377. *
  12378. * For example, 20MHz (the value in the top row is RU_START)
  12379. *
  12380. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12381. * RU Size 1 (52): | | | | | |
  12382. * RU Size 2 (106): | | | |
  12383. * RU Size 3 (242): | |
  12384. *
  12385. * RU_SIZE: Indicates the RU size, as defined by enum
  12386. * htt_ul_ofdma_user_info_ru_size.
  12387. *
  12388. * LDPC: LDPC enabled (if 0, BCC is used)
  12389. *
  12390. * DCM: DCM enabled
  12391. *
  12392. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12393. * |---------------------------------+--------------------------------|
  12394. * |Ver|Valid| FW internal |
  12395. * |---------------------------------+--------------------------------|
  12396. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12397. * |---------------------------------+--------------------------------|
  12398. */
  12399. enum htt_ul_ofdma_user_info_ru_size {
  12400. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12401. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12402. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12403. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12404. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12405. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12406. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12407. };
  12408. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12409. struct htt_ul_ofdma_user_info_v0 {
  12410. A_UINT32 word0;
  12411. A_UINT32 word1;
  12412. };
  12413. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12414. A_UINT32 w0_fw_rsvd:30; \
  12415. A_UINT32 w0_valid:1; \
  12416. A_UINT32 w0_version:1;
  12417. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12418. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12419. };
  12420. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12421. A_UINT32 w1_nss:3; \
  12422. A_UINT32 w1_mcs:4; \
  12423. A_UINT32 w1_ldpc:1; \
  12424. A_UINT32 w1_dcm:1; \
  12425. A_UINT32 w1_ru_start:7; \
  12426. A_UINT32 w1_ru_size:3; \
  12427. A_UINT32 w1_trig_type:4; \
  12428. A_UINT32 w1_unused:9;
  12429. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12430. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12431. };
  12432. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12433. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12434. union {
  12435. A_UINT32 word0;
  12436. struct {
  12437. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12438. };
  12439. };
  12440. union {
  12441. A_UINT32 word1;
  12442. struct {
  12443. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12444. };
  12445. };
  12446. } POSTPACK;
  12447. enum HTT_UL_OFDMA_TRIG_TYPE {
  12448. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12449. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12450. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12451. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12452. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12453. };
  12454. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12455. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12456. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12457. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12458. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12459. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12460. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12461. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12462. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12463. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12464. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12465. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12466. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12467. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12468. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12469. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12470. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12471. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12472. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12473. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12474. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12475. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12476. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12477. /*--- word 0 ---*/
  12478. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12479. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12480. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12481. do { \
  12482. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12483. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12484. } while (0)
  12485. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12486. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12487. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12488. do { \
  12489. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12490. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12491. } while (0)
  12492. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12493. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12494. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12495. do { \
  12496. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12497. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12498. } while (0)
  12499. /*--- word 1 ---*/
  12500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12501. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12502. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12503. do { \
  12504. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12505. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12506. } while (0)
  12507. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12508. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12509. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12510. do { \
  12511. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12512. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12513. } while (0)
  12514. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12515. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12516. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12517. do { \
  12518. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12519. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12520. } while (0)
  12521. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12522. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12523. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12524. do { \
  12525. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12526. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12527. } while (0)
  12528. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12529. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12530. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12531. do { \
  12532. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12533. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12534. } while (0)
  12535. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12536. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12537. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12538. do { \
  12539. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12540. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12541. } while (0)
  12542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12543. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12544. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12545. do { \
  12546. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12547. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12548. } while (0)
  12549. /**
  12550. * @brief target -> host channel calibration data message
  12551. * @brief host -> target channel calibration data message
  12552. *
  12553. * @details
  12554. * The following field definitions describe the format of the channel
  12555. * calibration data message sent from the target to the host when
  12556. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12557. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12558. * The message is defined as htt_chan_caldata_msg followed by a variable
  12559. * number of 32-bit character values.
  12560. *
  12561. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12562. * |------------------------------------------------------------------|
  12563. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12564. * |------------------------------------------------------------------|
  12565. * | payload size | mhz |
  12566. * |------------------------------------------------------------------|
  12567. * | center frequency 2 | center frequency 1 |
  12568. * |------------------------------------------------------------------|
  12569. * | check sum |
  12570. * |------------------------------------------------------------------|
  12571. * | payload |
  12572. * |------------------------------------------------------------------|
  12573. * message info field:
  12574. * - MSG_TYPE
  12575. * Bits 7:0
  12576. * Purpose: identifies this as a channel calibration data message
  12577. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12578. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12579. * - SUB_TYPE
  12580. * Bits 11:8
  12581. * Purpose: T2H: indicates whether target is providing chan cal data
  12582. * to the host to store, or requesting that the host
  12583. * download previously-stored data.
  12584. * H2T: indicates whether the host is providing the requested
  12585. * channel cal data, or if it is rejecting the data
  12586. * request because it does not have the requested data.
  12587. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12588. * - CHKSUM_VALID
  12589. * Bit 12
  12590. * Purpose: indicates if the checksum field is valid
  12591. * value:
  12592. * - FRAG
  12593. * Bit 19:16
  12594. * Purpose: indicates the fragment index for message
  12595. * value: 0 for first fragment, 1 for second fragment, ...
  12596. * - APPEND
  12597. * Bit 20
  12598. * Purpose: indicates if this is the last fragment
  12599. * value: 0 = final fragment, 1 = more fragments will be appended
  12600. *
  12601. * channel and payload size field
  12602. * - MHZ
  12603. * Bits 15:0
  12604. * Purpose: indicates the channel primary frequency
  12605. * Value:
  12606. * - PAYLOAD_SIZE
  12607. * Bits 31:16
  12608. * Purpose: indicates the bytes of calibration data in payload
  12609. * Value:
  12610. *
  12611. * center frequency field
  12612. * - CENTER FREQUENCY 1
  12613. * Bits 15:0
  12614. * Purpose: indicates the channel center frequency
  12615. * Value: channel center frequency, in MHz units
  12616. * - CENTER FREQUENCY 2
  12617. * Bits 31:16
  12618. * Purpose: indicates the secondary channel center frequency,
  12619. * only for 11acvht 80plus80 mode
  12620. * Value: secondary channel center frequeny, in MHz units, if applicable
  12621. *
  12622. * checksum field
  12623. * - CHECK_SUM
  12624. * Bits 31:0
  12625. * Purpose: check the payload data, it is just for this fragment.
  12626. * This is intended for the target to check that the channel
  12627. * calibration data returned by the host is the unmodified data
  12628. * that was previously provided to the host by the target.
  12629. * value: checksum of fragment payload
  12630. */
  12631. PREPACK struct htt_chan_caldata_msg {
  12632. /* DWORD 0: message info */
  12633. A_UINT32
  12634. msg_type: 8,
  12635. sub_type: 4 ,
  12636. chksum_valid: 1, /** 1:valid, 0:invalid */
  12637. reserved1: 3,
  12638. frag_idx: 4, /** fragment index for calibration data */
  12639. appending: 1, /** 0: no fragment appending,
  12640. * 1: extra fragment appending */
  12641. reserved2: 11;
  12642. /* DWORD 1: channel and payload size */
  12643. A_UINT32
  12644. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12645. payload_size: 16; /** unit: bytes */
  12646. /* DWORD 2: center frequency */
  12647. A_UINT32
  12648. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12649. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12650. * valid only for 11acvht 80plus80 mode */
  12651. /* DWORD 3: check sum */
  12652. A_UINT32 chksum;
  12653. /* variable length for calibration data */
  12654. A_UINT32 payload[1/* or more */];
  12655. } POSTPACK;
  12656. /* T2H SUBTYPE */
  12657. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12658. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12659. /* H2T SUBTYPE */
  12660. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12661. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12662. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12663. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12664. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12665. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12666. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12667. do { \
  12668. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12669. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12670. } while (0)
  12671. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12672. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12673. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12674. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12675. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12676. do { \
  12677. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12678. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12679. } while (0)
  12680. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12681. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12682. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12683. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12684. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12685. do { \
  12686. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12687. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12688. } while (0)
  12689. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12690. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12691. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12692. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12693. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12694. do { \
  12695. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12696. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12697. } while (0)
  12698. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12699. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12700. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12701. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12702. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12703. do { \
  12704. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12705. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12706. } while (0)
  12707. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12708. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12709. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12710. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12711. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12712. do { \
  12713. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12714. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12715. } while (0)
  12716. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12717. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12718. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12719. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12720. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12721. do { \
  12722. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12723. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12724. } while (0)
  12725. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12726. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12727. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12728. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12729. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12730. do { \
  12731. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12732. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12733. } while (0)
  12734. /**
  12735. * @brief - HTT PPDU ID format
  12736. *
  12737. * @details
  12738. * The following field definitions describe the format of the PPDU ID.
  12739. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12740. *
  12741. * |31 30|29 24| 23| 22|21 19|18 17|16 12|11 0|
  12742. * +---------------------------------------------------------------------------
  12743. * |rsvd |seq_cmd_type|tqm_cmd| rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12744. * +---------------------------------------------------------------------------
  12745. *
  12746. * sch id :Schedule command id
  12747. * Bits [11 : 0] : monotonically increasing counter to track the
  12748. * PPDU posted to a specific transmit queue.
  12749. *
  12750. * hwq_id: Hardware Queue ID.
  12751. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12752. *
  12753. * mac_id: MAC ID
  12754. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12755. *
  12756. * seq_idx: Sequence index.
  12757. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12758. * a particular TXOP.
  12759. *
  12760. * tqm_cmd: HWSCH/TQM flag.
  12761. * Bit [23] : Always set to 0.
  12762. *
  12763. * seq_cmd_type: Sequence command type.
  12764. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12765. * Refer to enum HTT_STATS_FTYPE for values.
  12766. */
  12767. PREPACK struct htt_ppdu_id {
  12768. A_UINT32
  12769. sch_id: 12,
  12770. hwq_id: 5,
  12771. mac_id: 2,
  12772. seq_idx: 3,
  12773. reserved1: 1,
  12774. tqm_cmd: 1,
  12775. seq_cmd_type: 6,
  12776. reserved2: 2;
  12777. } POSTPACK;
  12778. #define HTT_PPDU_ID_SCH_ID_S 0
  12779. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12780. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12781. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12782. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12783. do { \
  12784. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12785. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12786. } while (0)
  12787. #define HTT_PPDU_ID_HWQ_ID_S 12
  12788. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12789. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12790. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12791. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12792. do { \
  12793. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12794. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12795. } while (0)
  12796. #define HTT_PPDU_ID_MAC_ID_S 17
  12797. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12798. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12799. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12800. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12801. do { \
  12802. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12803. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12804. } while (0)
  12805. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12806. #define HTT_PPDU_ID_SEQ_IDX_M 0x00380000
  12807. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12808. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12809. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12810. do { \
  12811. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12812. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12813. } while (0)
  12814. #define HTT_PPDU_ID_TQM_CMD_S 23
  12815. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12816. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12817. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12818. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12819. do { \
  12820. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12821. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12822. } while (0)
  12823. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12824. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12825. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12826. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12827. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12830. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12831. } while (0)
  12832. #endif