htt.h 382 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509
  1. /*
  2. * Copyright (c) 2011-2016 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 <a_types.h> /* A_UINT32 */
  34. #include <a_osapi.h> /* PREPACK, POSTPACK */
  35. #ifdef ATHR_WIN_NWF
  36. #pragma warning(disable:4214) /*bit field types other than int */
  37. #endif
  38. #include "wlan_defs.h"
  39. #include <htt_common.h>
  40. /*
  41. * Unless explicitly specified to use 64 bits to represent physical addresses
  42. * (or more precisely, bus addresses), default to 32 bits.
  43. */
  44. #ifndef HTT_PADDR64
  45. #define HTT_PADDR64 0
  46. #endif
  47. #ifndef offsetof
  48. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  49. #endif
  50. /*
  51. * HTT version history:
  52. * 1.0 initial numbered version
  53. * 1.1 modifications to STATS messages.
  54. * These modifications are not backwards compatible, but since the
  55. * STATS messages themselves are non-essential (they are for debugging),
  56. * the 1.1 version of the HTT message library as a whole is compatible
  57. * with the 1.0 version.
  58. * 1.2 reset mask IE added to STATS_REQ message
  59. * 1.3 stat config IE added to STATS_REQ message
  60. *----
  61. * 2.0 FW rx PPDU desc added to RX_IND message
  62. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  63. *----
  64. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  65. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  66. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  67. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  68. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  69. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  70. * 3.5 Added flush and fail stats in rx_reorder stats structure
  71. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  72. * 3.7 Made changes to support EOS Mac_core 3.0
  73. * 3.8 Added txq_group information element definition;
  74. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  75. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  76. * Allow buffer addresses in bus-address format to be stored as
  77. * either 32 bits or 64 bits.
  78. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  79. * messages to specify which HTT options to use.
  80. * Initial TLV options cover:
  81. * - whether to use 32 or 64 bits to represent LL bus addresses
  82. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  83. * - how many tx queue groups to use
  84. * 3.11 Expand rx debug stats:
  85. * - Expand the rx_reorder_stats struct with stats about successful and
  86. * failed rx buffer allcoations.
  87. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  88. * the supply, allocation, use, and recycling of rx buffers for the
  89. * "remote ring" of rx buffers in host member in LL systems.
  90. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  91. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  92. * 3.13 Add constants + macros to support 64-bit address format for the
  93. * tx fragments descriptor, the rx ring buffer, and the rx ring
  94. * index shadow register.
  95. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  96. * - Add htt_tx_msdu_desc_ext_t struct def.
  97. * - Add TLV to specify whether the target supports the HTT tx MSDU
  98. * extension descriptor.
  99. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  100. * "extension" bit, to specify whether a HTT tx MSDU extension
  101. * descriptor is present.
  102. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  103. * (This allows the host to obtain key information about the MSDU
  104. * from a memory location already in the cache, rather than taking a
  105. * cache miss for each MSDU by reading the HW rx descs.)
  106. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  107. * whether a copy-engine classification result is appended to TX_FRM.
  108. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  109. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  110. * tx frames in the target after the peer has already been deleted.
  111. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  112. * 3.20 Expand rx_reorder_stats.
  113. * 3.21 Add optional rx channel spec to HL RX_IND.
  114. * 3.22 Expand rx_reorder_stats
  115. * (distinguish duplicates within vs. outside block ack window)
  116. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  117. * The justified rate is calculated by two steps. The first is to multiply
  118. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  119. * by a low pass filter.
  120. * This change allows HL download scheduling to consider the WLAN rate
  121. * that will be used for transmitting the downloaded frames.
  122. * 3.24 Expand rx_reorder_stats
  123. * (add counter for decrypt / MIC errors)
  124. * 3.25 Expand rx_reorder_stats
  125. * (add counter of frames received into both local + remote rings)
  126. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  127. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  128. * 3.27 Add a new interface for flow-control. The following t2h messages have
  129. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  130. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  131. * 3.28 Add a new interface for ring interface change. The following two h2t
  132. * and one t2h messages have been included:
  133. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  134. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  135. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  136. * information elements passed from the host to a Lithium target,
  137. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  138. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  139. * targets).
  140. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  141. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  142. */
  143. #define HTT_CURRENT_VERSION_MAJOR 3
  144. #define HTT_CURRENT_VERSION_MINOR 31
  145. #define HTT_NUM_TX_FRAG_DESC 1024
  146. #define HTT_WIFI_IP_VERSION(x, y) ((x) == (y))
  147. #define HTT_CHECK_SET_VAL(field, val) \
  148. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  149. /* macros to assist in sign-extending fields from HTT messages */
  150. #define HTT_SIGN_BIT_MASK(field) \
  151. ((field ## _M + (1 << field ## _S)) >> 1)
  152. #define HTT_SIGN_BIT(_val, field) \
  153. (_val & HTT_SIGN_BIT_MASK(field))
  154. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  155. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  156. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  157. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  158. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  159. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  160. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  161. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  162. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  163. /*
  164. * TEMPORARY:
  165. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  166. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  167. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  168. * updated.
  169. */
  170. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  171. /*
  172. * TEMPORARY:
  173. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  174. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  175. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  176. * updated.
  177. */
  178. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  179. /* HTT Access Category values */
  180. enum HTT_AC_WMM {
  181. /* WMM Access Categories */
  182. HTT_AC_WMM_BE = 0x0,
  183. HTT_AC_WMM_BK = 0x1,
  184. HTT_AC_WMM_VI = 0x2,
  185. HTT_AC_WMM_VO = 0x3,
  186. /* extension Access Categories */
  187. HTT_AC_EXT_NON_QOS = 0x4,
  188. HTT_AC_EXT_UCAST_MGMT = 0x5,
  189. HTT_AC_EXT_MCAST_DATA = 0x6,
  190. HTT_AC_EXT_MCAST_MGMT = 0x7,
  191. };
  192. enum HTT_AC_WMM_MASK {
  193. /* WMM Access Categories */
  194. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  195. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  196. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  197. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  198. /* extension Access Categories */
  199. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  200. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  201. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  202. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  203. };
  204. #define HTT_AC_MASK_WMM \
  205. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  206. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  207. #define HTT_AC_MASK_EXT \
  208. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  209. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  210. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  211. /*
  212. * htt_dbg_stats_type -
  213. * bit positions for each stats type within a stats type bitmask
  214. * The bitmask contains 24 bits.
  215. */
  216. enum htt_dbg_stats_type {
  217. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  218. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  219. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  220. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  221. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  222. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  223. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  224. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  225. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  226. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  227. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  228. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  229. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  230. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  231. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  232. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  233. /* bits 16-23 currently reserved */
  234. /* keep this last */
  235. HTT_DBG_NUM_STATS
  236. };
  237. /*=== HTT option selection TLVs ===
  238. * Certain HTT messages have alternatives or options.
  239. * For such cases, the host and target need to agree on which option to use.
  240. * Option specification TLVs can be appended to the VERSION_REQ and
  241. * VERSION_CONF messages to select options other than the default.
  242. * These TLVs are entirely optional - if they are not provided, there is a
  243. * well-defined default for each option. If they are provided, they can be
  244. * provided in any order. Each TLV can be present or absent independent of
  245. * the presence / absence of other TLVs.
  246. *
  247. * The HTT option selection TLVs use the following format:
  248. * |31 16|15 8|7 0|
  249. * |---------------------------------+----------------+----------------|
  250. * | value (payload) | length | tag |
  251. * |-------------------------------------------------------------------|
  252. * The value portion need not be only 2 bytes; it can be extended by any
  253. * integer number of 4-byte units. The total length of the TLV, including
  254. * the tag and length fields, must be a multiple of 4 bytes. The length
  255. * field specifies the total TLV size in 4-byte units. Thus, the typical
  256. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  257. * field, would store 0x1 in its length field, to show that the TLV occupies
  258. * a single 4-byte unit.
  259. */
  260. /*--- TLV header format - applies to all HTT option TLVs ---*/
  261. enum HTT_OPTION_TLV_TAGS {
  262. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  263. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  264. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  265. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  266. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  267. };
  268. PREPACK struct htt_option_tlv_header_t {
  269. A_UINT8 tag;
  270. A_UINT8 length;
  271. } POSTPACK;
  272. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  273. #define HTT_OPTION_TLV_TAG_S 0
  274. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  275. #define HTT_OPTION_TLV_LENGTH_S 8
  276. /*
  277. * value0 - 16 bit value field stored in word0
  278. * The TLV's value field may be longer than 2 bytes, in which case
  279. * the remainder of the value is stored in word1, word2, etc.
  280. */
  281. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  282. #define HTT_OPTION_TLV_VALUE0_S 16
  283. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  284. do { \
  285. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  286. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  287. } while (0)
  288. #define HTT_OPTION_TLV_TAG_GET(word) \
  289. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  290. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  291. do { \
  292. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  293. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  294. } while (0)
  295. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  296. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  297. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  298. do { \
  299. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  300. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  301. } while (0)
  302. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  303. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  304. /*--- format of specific HTT option TLVs ---*/
  305. /*
  306. * HTT option TLV for specifying LL bus address size
  307. * Some chips require bus addresses used by the target to access buffers
  308. * within the host's memory to be 32 bits; others require bus addresses
  309. * used by the target to access buffers within the host's memory to be
  310. * 64 bits.
  311. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  312. * a suffix to the VERSION_CONF message to specify which bus address format
  313. * the target requires.
  314. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  315. * default to providing bus addresses to the target in 32-bit format.
  316. */
  317. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  318. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  319. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  320. };
  321. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  322. struct htt_option_tlv_header_t hdr;
  323. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  324. } POSTPACK;
  325. /*
  326. * HTT option TLV for specifying whether HL systems should indicate
  327. * over-the-air tx completion for individual frames, or should instead
  328. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  329. * requests an OTA tx completion for a particular tx frame.
  330. * This option does not apply to LL systems, where the TX_COMPL_IND
  331. * is mandatory.
  332. * This option is primarily intended for HL systems in which the tx frame
  333. * downloads over the host --> target bus are as slow as or slower than
  334. * the transmissions over the WLAN PHY. For cases where the bus is faster
  335. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  336. * and consquently will send one TX_COMPL_IND message that covers several
  337. * tx frames. For cases where the WLAN PHY is faster than the bus,
  338. * the target will end up transmitting very short A-MPDUs, and consequently
  339. * sending many TX_COMPL_IND messages, which each cover a very small number
  340. * of tx frames.
  341. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  342. * a suffix to the VERSION_REQ message to request whether the host desires to
  343. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  344. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  345. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  346. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  347. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  348. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  349. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  350. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  351. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  352. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  353. * TLV.
  354. */
  355. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  356. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  357. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  358. };
  359. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  360. struct htt_option_tlv_header_t hdr;
  361. A_UINT16 hl_suppress_tx_compl_ind;/*HL_SUPPRESS_TX_COMPL_IND enum*/
  362. } POSTPACK;
  363. /*
  364. * HTT option TLV for specifying how many tx queue groups the target
  365. * may establish.
  366. * This TLV specifies the maximum value the target may send in the
  367. * txq_group_id field of any TXQ_GROUP information elements sent by
  368. * the target to the host. This allows the host to pre-allocate an
  369. * appropriate number of tx queue group structs.
  370. *
  371. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  372. * a suffix to the VERSION_REQ message to specify whether the host supports
  373. * tx queue groups at all, and if so if there is any limit on the number of
  374. * tx queue groups that the host supports.
  375. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  376. * a suffix to the VERSION_CONF message. If the host has specified in the
  377. * VER_REQ message a limit on the number of tx queue groups the host can
  378. * supprt, the target shall limit its specification of the maximum tx groups
  379. * to be no larger than this host-specified limit.
  380. *
  381. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  382. * shall preallocate 4 tx queue group structs, and the target shall not
  383. * specify a txq_group_id larger than 3.
  384. */
  385. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  386. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  387. /*
  388. * values 1 through N specify the max number of tx queue groups
  389. * the sender supports
  390. */
  391. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  392. };
  393. /* TEMPORARY backwards-compatibility alias for a typo fix -
  394. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  395. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  396. * to support the old name (with the typo) until all references to the
  397. * old name are replaced with the new name.
  398. */
  399. #define htt_option_tlv_mac_tx_queue_groups_t \
  400. htt_option_tlv_max_tx_queue_groups_t
  401. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  402. struct htt_option_tlv_header_t hdr;
  403. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  404. } POSTPACK;
  405. /*
  406. * HTT option TLV for specifying whether the target supports an extended
  407. * version of the HTT tx descriptor. If the target provides this TLV
  408. * and specifies in the TLV that the target supports an extended version
  409. * of the HTT tx descriptor, the target must check the "extension" bit in
  410. * the HTT tx descriptor, and if the extension bit is set, to expect a
  411. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  412. * descriptor. Furthermore, the target must provide room for the HTT
  413. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  414. * This option is intended for systems where the host needs to explicitly
  415. * control the transmission parameters such as tx power for individual
  416. * tx frames.
  417. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  418. * as a suffix to the VERSION_CONF message to explicitly specify whether
  419. * the target supports the HTT tx MSDU extension descriptor.
  420. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  421. * by the host as lack of target support for the HTT tx MSDU extension
  422. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  423. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  424. * the HTT tx MSDU extension descriptor.
  425. * The host is not required to provide the HTT tx MSDU extension descriptor
  426. * just because the target supports it; the target must check the
  427. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  428. * extension descriptor is present.
  429. */
  430. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  431. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  432. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  433. };
  434. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  435. struct htt_option_tlv_header_t hdr;
  436. A_UINT16 tx_msdu_desc_ext_support;/*SUPPORT_TX_MSDU_DESC_EXT enum*/
  437. } POSTPACK;
  438. /*=== host -> target messages ===============================================*/
  439. enum htt_h2t_msg_type {
  440. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  441. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  442. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  443. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  444. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  445. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  446. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  447. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  448. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  449. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  450. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /*per vdev amsdu subfrm limit*/
  451. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  452. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  453. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  454. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  455. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  456. /* keep this last */
  457. HTT_H2T_NUM_MSGS
  458. };
  459. /*
  460. * HTT host to target message type -
  461. * stored in bits 7:0 of the first word of the message
  462. */
  463. #define HTT_H2T_MSG_TYPE_M 0xff
  464. #define HTT_H2T_MSG_TYPE_S 0
  465. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  466. do { \
  467. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  468. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  469. } while (0)
  470. #define HTT_H2T_MSG_TYPE_GET(word) \
  471. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  472. /**
  473. * @brief target -> host version number request message definition
  474. *
  475. * |31 24|23 16|15 8|7 0|
  476. * |----------------+----------------+----------------+----------------|
  477. * | reserved | msg type |
  478. * |-------------------------------------------------------------------|
  479. * : option request TLV (optional) |
  480. * :...................................................................:
  481. *
  482. * The VER_REQ message may consist of a single 4-byte word, or may be
  483. * extended with TLVs that specify which HTT options the host is requesting
  484. * from the target.
  485. * The following option TLVs may be appended to the VER_REQ message:
  486. * - HL_SUPPRESS_TX_COMPL_IND
  487. * - HL_MAX_TX_QUEUE_GROUPS
  488. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  489. * may be appended to the VER_REQ message (but only one TLV of each type).
  490. *
  491. * Header fields:
  492. * - MSG_TYPE
  493. * Bits 7:0
  494. * Purpose: identifies this as a version number request message
  495. * Value: 0x0
  496. */
  497. #define HTT_VER_REQ_BYTES 4
  498. /* TBDXXX: figure out a reasonable number */
  499. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  500. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  501. /**
  502. * @brief HTT tx MSDU descriptor
  503. *
  504. * @details
  505. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  506. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  507. * the target firmware needs for the FW's tx processing, particularly
  508. * for creating the HW msdu descriptor.
  509. * The same HTT tx descriptor is used for HL and LL systems, though
  510. * a few fields within the tx descriptor are used only by LL or
  511. * only by HL.
  512. * The HTT tx descriptor is defined in two manners: by a struct with
  513. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  514. * definitions.
  515. * The target should use the struct def, for simplicitly and clarity,
  516. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  517. * neutral. Specifically, the host shall use the get/set macros built
  518. * around the mask + shift defs.
  519. */
  520. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  521. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  522. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  523. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  524. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  525. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  526. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  527. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  528. #define HTT_TX_VDEV_ID_WORD 0
  529. #define HTT_TX_VDEV_ID_MASK 0x3f
  530. #define HTT_TX_VDEV_ID_SHIFT 16
  531. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  532. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  533. #define HTT_TX_MSDU_LEN_DWORD 1
  534. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  535. /*
  536. * HTT_VAR_PADDR macros
  537. * Allow physical / bus addresses to be either a single 32-bit value,
  538. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  539. */
  540. /*
  541. * Note that in this macro A_UINT32 has been converted to
  542. * uint32_t only to address checkpath errors caused by declaring
  543. * var_name as A_UINT32.
  544. */
  545. #define HTT_VAR_PADDR32(var_name) uint32_t (var_name)
  546. #define HTT_VAR_PADDR64_LE(var_name) \
  547. struct { \
  548. /* little-endian: lo precedes hi */ \
  549. A_UINT32 lo; \
  550. A_UINT32 hi; \
  551. } var_name
  552. /*
  553. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  554. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  555. * addresses are stored in a XXX-bit field.
  556. * This macro is used to define both htt_tx_msdu_desc32_t and
  557. * htt_tx_msdu_desc64_t structs.
  558. */
  559. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  560. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  561. { \
  562. /* DWORD 0: flags and meta-data */ \
  563. A_UINT32 \
  564. msg_type:8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  565. \
  566. /* pkt_subtype - \
  567. * Detailed specification of the tx frame contents, extending the \
  568. * general specification provided by pkt_type. \
  569. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  570. *pkt_type | pkt_subtype \
  571. *============================================================== \
  572. *802.3 | bit 0:3 - Reserved \
  573. * | bit 4: 0x0 - Copy-Engine Classification Results \
  574. * | not appended to the HTT message \
  575. * | 0x1 - Copy-Engine Classification Results \
  576. * | appended to the HTT message in the \
  577. * | format: \
  578. * | [HTT tx desc, frame header, \
  579. * | CE classification results] \
  580. * | The CE classification results begin \
  581. * | at the next 4-byte boundary after \
  582. * | the frame header. \
  583. *------------+------------------------------------------------- \
  584. *Eth2 | bit 0:3 - Reserved \
  585. * | bit 4: 0x0 - Copy-Engine Classification Results \
  586. * | not appended to the HTT message \
  587. * | 0x1 - Copy-Engine Classification Results \
  588. * | appended to the HTT message. \
  589. * | See the above specification of the \
  590. * | CE classification results location. \
  591. *------------+------------------------------------------------- \
  592. *native WiFi | bit 0:3 - Reserved \
  593. * | bit 4: 0x0 - Copy-Engine Classification Results \
  594. * | not appended to the HTT message \
  595. * | 0x1 - Copy-Engine Classification Results \
  596. * | appended to the HTT message. \
  597. * | See the above specification of the \
  598. * | CE classification results location. \
  599. *------------+------------------------------------------------- \
  600. *mgmt | 0x0 - 802.11 MAC header absent \
  601. * | 0x1 - 802.11 MAC header present \
  602. *------------+------------------------------------------------- \
  603. *raw | bit 0: 0x0 - 802.11 MAC header absent \
  604. * | 0x1 - 802.11 MAC header present \
  605. * | bit 1: 0x0 - allow aggregation \
  606. * | 0x1 - don't allow aggregation \
  607. * | bit 2: 0x0 - perform encryption \
  608. * | 0x1 - don't perform encryption \
  609. * | bit 3: 0x0 - perform tx classification / queuing \
  610. * | 0x1 - don't perform tx classification; \
  611. * | insert the frame into the "misc" \
  612. * | tx queue \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message. \
  617. * | See the above specification of the \
  618. * | CE classification results location. \
  619. */ \
  620. pkt_subtype:5, \
  621. \
  622. /* pkt_type - \
  623. * General specification of the tx frame contents. \
  624. * The htt_pkt_type enum should be used to specify \
  625. * and check the value of this field. \
  626. */ \
  627. pkt_type:3, \
  628. \
  629. /* vdev_id - \
  630. * ID for the vdev that is sending this tx frame. \
  631. * For certain non-standard packet types, e.g. pkt_type == raw \
  632. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  633. * This field is used primarily for determining where to queue \
  634. * broadcast and multicast frames. \
  635. */ \
  636. vdev_id:6, \
  637. /* ext_tid - \
  638. * The extended traffic ID. \
  639. * If the TID is unknown, the extended TID is set to \
  640. * HTT_TX_EXT_TID_INVALID. \
  641. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  642. * value of the QoS TID. \
  643. * If the tx frame is non-QoS data, then the extended TID is set to \
  644. * HTT_TX_EXT_TID_NON_QOS. \
  645. * If the tx frame is multicast or broadcast, then the extended TID \
  646. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  647. */ \
  648. ext_tid:5, \
  649. \
  650. /* postponed - \
  651. * This flag indicates whether the tx frame has been downloaded to \
  652. * the target before but discarded by the target, and now is being \
  653. * downloaded again; or if this is a new frame that is being \
  654. * downloaded for the first time. \
  655. * This flag allows the target to determine the correct order for \
  656. * transmitting new vs. old frames. \
  657. * value: 0 -> new frame, 1 -> re-send of a previously
  658. * sent frame \
  659. * This flag only applies to HL systems, since in LL systems, \
  660. * the tx flow control is handled entirely within the target. \
  661. */ \
  662. postponed:1, \
  663. \
  664. /* extension - \
  665. * This flag indicates whether a HTT tx MSDU extension descriptor\
  666. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor.\
  667. * \
  668. * 0x0 - no extension MSDU descriptor is present \
  669. * 0x1 - an extension MSDU descriptor immediately follows the \
  670. * regular MSDU descriptor \
  671. */ \
  672. extension:1, \
  673. \
  674. /* cksum_offload - \
  675. * This flag indicates whether checksum offload is enabled or not \
  676. * for this frame. Target FW use this flag to turn on HW checksumming \
  677. * 0x0 - No checksum offload \
  678. * 0x1 - L3 header checksum only \
  679. * 0x2 - L4 checksum only \
  680. * 0x3 - L3 header checksum + L4 checksum \
  681. */ \
  682. cksum_offload:2, \
  683. \
  684. /* tx_comp_req - \
  685. * This flag indicates whether Tx Completion \
  686. * from fw is required or not. \
  687. * This flag is only relevant if tx completion is not \
  688. * universally enabled. \
  689. * For all LL systems, tx completion is mandatory, \
  690. * so this flag will be irrelevant. \
  691. * For HL systems tx completion is optional, but HL systems in which \
  692. * the bus throughput exceeds the WLAN throughput will \
  693. * probably want to always use tx completion, and thus \
  694. * would not check this flag. \
  695. * This flag is required when tx completions are not used universally, \
  696. * but are still required for certain tx frames for which \
  697. * an OTA delivery acknowledgment is needed by the host. \
  698. * In practice, this would be for HL systems in which the \
  699. * bus throughput is less than the WLAN throughput. \
  700. * \
  701. * 0x0 - Tx Completion Indication from Fw not required \
  702. * 0x1 - Tx Completion Indication from Fw is required \
  703. */ \
  704. tx_compl_req:1; \
  705. \
  706. \
  707. /* DWORD 1: MSDU length and ID */ \
  708. A_UINT32 \
  709. len:16, /* MSDU length, in bytes */ \
  710. id:16; /* MSDU ID used to identify the MSDU to the host, \
  711. * and this id is used to calculate fragmentation \
  712. * descriptor pointer inside the target based on \
  713. * the base address, configured inside the target. \
  714. */ \
  715. \
  716. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  717. /* frags_desc_ptr - \
  718. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  719. * where the tx frame's fragments reside in memory. \
  720. * This field only applies to LL systems, since in HL systems the \
  721. * (degenerate single-fragment) fragmentation descriptor is created \
  722. * within the target. \
  723. */ \
  724. _paddr__frags_desc_ptr_; \
  725. \
  726. /* DWORD 3 (or 4): peerid, chanfreq */ \
  727. /* \
  728. * Peer ID : Target can use this value to know which peer-id packet \
  729. * destined to. \
  730. * It's intended to be specified by host in case of NAWDS. \
  731. */ \
  732. A_UINT16 peerid; \
  733. \
  734. /* \
  735. * Channel frequency: This identifies the desired channel \
  736. * frequency (in mhz) for tx frames. This is used by FW to help \
  737. * determine when it is safe to transmit or drop frames for \
  738. * off-channel operation. \
  739. * The default value of zero indicates to FW that the \
  740. * corresponding VDEV's home channel (if there is one) is \
  741. * the desired channel frequency. \
  742. */ \
  743. A_UINT16 chanfreq; \
  744. \
  745. /* Reason reserved is commented is increasing the htt
  746. * structure size leads to some wierd issues.
  747. * A_UINT32 reserved_dword3_bits0_31; \
  748. */ \
  749. } POSTPACK
  750. /* define a htt_tx_msdu_desc32_t type */
  751. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  752. /* define a htt_tx_msdu_desc64_t type */
  753. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  754. /*
  755. * Make htt_tx_msdu_desc_t be an alias for either
  756. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  757. */
  758. #if HTT_PADDR64
  759. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  760. #else
  761. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  762. #endif
  763. /* decriptor information for Management frame*/
  764. /*
  765. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  766. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  767. */
  768. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  769. extern A_UINT32 mgmt_hdr_len;
  770. PREPACK struct htt_mgmt_tx_desc_t {
  771. A_UINT32 msg_type;
  772. #if HTT_PADDR64
  773. A_UINT64 frag_paddr; /* DMAble address of the data */
  774. #else
  775. A_UINT32 frag_paddr; /* DMAble address of the data */
  776. #endif
  777. A_UINT32 desc_id; /* returned to host during completion
  778. * to free the meory*/
  779. A_UINT32 len; /* Fragment length */
  780. A_UINT32 vdev_id; /* virtual device ID */
  781. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  782. } POSTPACK;
  783. PREPACK struct htt_mgmt_tx_compl_ind {
  784. A_UINT32 desc_id;
  785. A_UINT32 status;
  786. } POSTPACK;
  787. /*
  788. * This SDU header size comes from the summation of the following:
  789. * 1. Max of:
  790. * a. Native WiFi header, for native WiFi frames: 24 bytes
  791. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  792. * b. 802.11 header, for raw frames: 36 bytes
  793. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  794. * QoS header, HT header)
  795. * c. 802.3 header, for ethernet frames: 14 bytes
  796. * (destination address, source address, ethertype / length)
  797. * 2. Max of:
  798. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  799. * b. IPv6 header, up through the Traffic Class: 2 bytes
  800. * 3. 802.1Q VLAN header: 4 bytes
  801. * 4. LLC/SNAP header: 8 bytes
  802. */
  803. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  804. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  805. #define HTT_TX_HDR_SIZE_ETHERNET 14
  806. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  807. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_nwifi,
  808. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  809. HTT_TX_HDR_SIZE_NATIVE_WIFI);
  810. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_enet,
  811. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  812. HTT_TX_HDR_SIZE_ETHERNET);
  813. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  814. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  815. #define HTT_TX_HDR_SIZE_802_1Q 4
  816. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  817. #define HTT_COMMON_TX_FRM_HDR_LEN \
  818. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  819. HTT_TX_HDR_SIZE_802_1Q + \
  820. HTT_TX_HDR_SIZE_LLC_SNAP)
  821. #define HTT_HL_TX_FRM_HDR_LEN \
  822. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  823. #define HTT_LL_TX_FRM_HDR_LEN \
  824. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  825. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  826. /* dword 0 */
  827. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  828. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  829. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  830. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  831. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  832. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  833. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  834. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  835. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  836. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  837. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  838. #define HTT_TX_DESC_PKT_TYPE_S 13
  839. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  840. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  841. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  842. #define HTT_TX_DESC_VDEV_ID_S 16
  843. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  844. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  845. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  846. #define HTT_TX_DESC_EXT_TID_S 22
  847. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  848. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  849. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  850. #define HTT_TX_DESC_POSTPONED_S 27
  851. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  852. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  853. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  854. #define HTT_TX_DESC_EXTENSION_S 28
  855. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  858. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  859. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  862. #define HTT_TX_DESC_TX_COMP_S 31
  863. /* dword 1 */
  864. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  865. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  866. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  867. #define HTT_TX_DESC_FRM_LEN_S 0
  868. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  869. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  870. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  871. #define HTT_TX_DESC_FRM_ID_S 16
  872. /* dword 2 */
  873. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  874. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  875. /* for systems using 64-bit format for bus addresses */
  876. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  877. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  878. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  879. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  880. /* for systems using 32-bit format for bus addresses */
  881. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  882. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  883. /* dword 3 */
  884. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  885. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  886. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  887. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  888. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  889. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  890. #if HTT_PADDR64
  891. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  892. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  893. #else
  894. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  895. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  896. #endif
  897. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  898. #define HTT_TX_DESC_PEER_ID_S 0
  899. /*
  900. * TEMPORARY:
  901. * The original definitions for the PEER_ID fields contained typos
  902. * (with _DESC_PADDR appended to this PEER_ID field name).
  903. * Retain deprecated original names for PEER_ID fields until all code that
  904. * refers to them has been updated.
  905. */
  906. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  907. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  908. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  909. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  910. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  911. HTT_TX_DESC_PEER_ID_M
  912. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  913. HTT_TX_DESC_PEER_ID_S
  914. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  915. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  916. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  917. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  918. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  919. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  920. #if HTT_PADDR64
  921. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  922. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  923. #else
  924. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  925. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  926. #endif
  927. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  928. #define HTT_TX_DESC_CHAN_FREQ_S 16
  929. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  930. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  931. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  932. do { \
  933. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  934. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  935. } while (0)
  936. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  937. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  938. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  939. do { \
  940. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  941. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  942. } while (0)
  943. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  944. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  945. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  946. do { \
  947. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  948. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  949. } while (0)
  950. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  951. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  952. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  953. do { \
  954. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  955. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  956. } while (0)
  957. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  958. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  959. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  960. do { \
  961. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  962. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  963. } while (0)
  964. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  965. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  966. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  972. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  973. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  979. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  980. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  986. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  987. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  993. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  994. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1001. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1008. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1015. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1019. } while (0)
  1020. /* enums used in the HTT tx MSDU extension descriptor */
  1021. enum {
  1022. htt_tx_guard_interval_regular = 0,
  1023. htt_tx_guard_interval_short = 1,
  1024. };
  1025. enum {
  1026. htt_tx_preamble_type_ofdm = 0,
  1027. htt_tx_preamble_type_cck = 1,
  1028. htt_tx_preamble_type_ht = 2,
  1029. htt_tx_preamble_type_vht = 3,
  1030. };
  1031. enum {
  1032. htt_tx_bandwidth_5MHz = 0,
  1033. htt_tx_bandwidth_10MHz = 1,
  1034. htt_tx_bandwidth_20MHz = 2,
  1035. htt_tx_bandwidth_40MHz = 3,
  1036. htt_tx_bandwidth_80MHz = 4,
  1037. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1038. };
  1039. /**
  1040. * @brief HTT tx MSDU extension descriptor
  1041. * @details
  1042. * If the target supports HTT tx MSDU extension descriptors, the host has
  1043. * the option of appending the following struct following the regular
  1044. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1045. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1046. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1047. * tx specs for each frame.
  1048. */
  1049. PREPACK struct htt_tx_msdu_desc_ext_t {
  1050. /* DWORD 0: flags */
  1051. A_UINT32 valid_pwr:1,/* bit 0:if set, tx pwr spec is valid */
  1052. valid_mcs_mask:1,/* bit 1:if set, tx MCS mask spec is valid */
  1053. valid_nss_mask:1,/* bit 2:if set, tx Nss mask spec is valid */
  1054. valid_guard_interval:1,/* bit 3:if set, tx guard intv spec is valid */
  1055. valid_preamble_type_mask:1,/* 4:if set, tx preamble mask is valid */
  1056. valid_chainmask:1,/* bit 5:if set, tx chainmask spec is valid */
  1057. valid_retries:1,/* bit 6:if set, tx retries spec is valid */
  1058. valid_bandwidth:1,/* bit 7:if set, tx bandwidth spec is valid */
  1059. valid_expire_tsf:1,/* bit 8:if set, tx expire TSF spec is valid */
  1060. is_dsrc:1, /* bit 9:if set, MSDU is a DSRC frame */
  1061. reserved0_31_7:22; /* bits 31:10 - unused, set to 0x0 */
  1062. /* DWORD 1:tx power, tx rate, tx BW */
  1063. A_UINT32
  1064. /* pwr -
  1065. * Specify what power the tx frame needs to be transmitted at.
  1066. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1067. * The value needs to be appropriately sign-extended when extracting
  1068. * the value from the message and storing it in a variable that is
  1069. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1070. * automatically handles this sign-extension.)
  1071. * If the transmission uses multiple tx chains, this power spec is
  1072. * the total transmit power, assuming incoherent combination of
  1073. * per-chain power to produce the total power.
  1074. */
  1075. pwr:8,
  1076. /* mcs_mask -
  1077. * Specify the allowable values for MCS index (modulation and coding)
  1078. * to use for transmitting the frame.
  1079. *
  1080. * For HT / VHT preamble types, this mask directly corresponds to
  1081. * the HT or VHT MCS indices that are allowed. For each bit N set
  1082. * within the mask, MCS index N is allowed for transmitting the frame.
  1083. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1084. * rates versus OFDM rates, so the host has the option of specifying
  1085. * that the target must transmit the frame with CCK or OFDM rates
  1086. * (not HT or VHT), but leaving the decision to the target whether
  1087. * to use CCK or OFDM.
  1088. *
  1089. * For CCK and OFDM, the bits within this mask are interpreted as
  1090. * follows:
  1091. * bit 0 -> CCK 1 Mbps rate is allowed
  1092. * bit 1 -> CCK 2 Mbps rate is allowed
  1093. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1094. * bit 3 -> CCK 11 Mbps rate is allowed
  1095. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1096. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1097. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1098. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1099. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1100. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1101. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1102. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1103. *
  1104. * The MCS index specification needs to be compatible with the
  1105. * bandwidth mask specification. For example, a MCS index == 9
  1106. * specification is inconsistent with a preamble type == VHT,
  1107. * Nss == 1, and channel bandwidth == 20 MHz.
  1108. *
  1109. * Furthermore, the host has only a limited ability to specify to
  1110. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1111. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1112. */
  1113. mcs_mask:12,
  1114. /* nss_mask -
  1115. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1116. * Each bit in this mask corresponds to a Nss value:
  1117. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1118. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1119. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1120. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1121. * The values in the Nss mask must be suitable for the recipient, e.g.
  1122. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1123. * recipient which only supports 2x2 MIMO.
  1124. */
  1125. nss_mask:4,
  1126. /* guard_interval -
  1127. * Specify a htt_tx_guard_interval enum value to indicate whether
  1128. * the transmission should use a regular guard interval or a
  1129. * short guard interval.
  1130. */
  1131. guard_interval:1,
  1132. /* preamble_type_mask -
  1133. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1134. * may choose from for transmitting this frame.
  1135. * The bits in this mask correspond to the values in the
  1136. * htt_tx_preamble_type enum. For example, to allow the target
  1137. * to transmit the frame as either CCK or OFDM, this field would
  1138. * be set to
  1139. * (1 << htt_tx_preamble_type_ofdm) |
  1140. * (1 << htt_tx_preamble_type_cck)
  1141. */
  1142. preamble_type_mask:4,
  1143. reserved1_31_29:3; /* unused, set to 0x0 */
  1144. /* DWORD 2: tx chain mask, tx retries */
  1145. A_UINT32
  1146. /* chain_mask - specify which chains to transmit from */
  1147. chain_mask:4,
  1148. /* retry_limit -
  1149. * Specify the maximum number of transmissions, including the
  1150. * initial transmission, to attempt before giving up if no ack
  1151. * is received.
  1152. * If the tx rate is specified, then all retries shall use the
  1153. * same rate as the initial transmission.
  1154. * If no tx rate is specified, the target can choose whether to
  1155. * retain the original rate during the retransmissions, or to
  1156. * fall back to a more robust rate.
  1157. */
  1158. retry_limit:4,
  1159. /* bandwidth_mask -
  1160. * Specify what channel widths may be used for the transmission.
  1161. * A value of zero indicates "don't care" - the target may choose
  1162. * the transmission bandwidth.
  1163. * The bits within this mask correspond to the htt_tx_bandwidth
  1164. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1165. * The bandwidth_mask must be consistent with the
  1166. * preamble_type_mask * and mcs_mask specs, if they are
  1167. * provided. For example,
  1168. * 80 MHz and 160 MHz can only be enabled in the mask
  1169. * if preamble_type == VHT.
  1170. */
  1171. bandwidth_mask:6,
  1172. reserved2_31_14:18; /* unused, set to 0x0 */
  1173. /* DWORD 3: tx expiry time (TSF) LSBs */
  1174. A_UINT32 expire_tsf_lo;
  1175. /* DWORD 4: tx expiry time (TSF) MSBs */
  1176. A_UINT32 expire_tsf_hi;
  1177. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1178. } POSTPACK;
  1179. /* DWORD 0 */
  1180. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1181. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1182. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1183. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1184. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1185. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1186. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1187. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1188. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1189. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1190. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1191. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1200. /* DWORD 1 */
  1201. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1202. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1203. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1204. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1205. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1206. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1207. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1208. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1209. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1210. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1211. /* DWORD 2 */
  1212. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1213. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1214. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1215. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1216. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1217. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1218. /* DWORD 0 */
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1220. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1221. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1226. } while (0)
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1228. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1229. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1234. } while (0)
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1236. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1237. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1239. do { \
  1240. HTT_CHECK_SET_VAL( \
  1241. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1242. ((_var) |= ((_val) \
  1243. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >>\
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL( \
  1251. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1252. ((_var) |= ((_val) \
  1253. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1254. } while (0)
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1256. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1257. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1261. ((_var) |= ((_val) << \
  1262. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1287. } while (0)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1289. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1290. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1295. } while (0)
  1296. /* DWORD 1 */
  1297. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1301. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1302. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1303. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1304. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1305. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1306. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1329. } while (0)
  1330. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK,\
  1336. _val); \
  1337. ((_var) |= ((_val) << \
  1338. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1339. } while (0)
  1340. /* DWORD 2 */
  1341. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1348. } while (0)
  1349. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1350. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1351. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1352. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1356. } while (0)
  1357. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1364. } while (0)
  1365. typedef enum {
  1366. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1367. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1368. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1369. } htt_11ax_ltf_subtype_t;
  1370. typedef enum {
  1371. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1372. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1373. HTT_TX_MSDU_EXT2_DESC_PREAM_HT,
  1374. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1375. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1376. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1377. } htt_tx_ext2_preamble_type_t;
  1378. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1379. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1380. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1381. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1382. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1383. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1384. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1385. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1386. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1387. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1388. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1390. /**
  1391. * @brief HTT tx MSDU extension descriptor v2
  1392. * @details
  1393. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1394. * is received as tcl_exit_base->host_meta_info in firmware.
  1395. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1396. * are already part of tcl_exit_base.
  1397. */
  1398. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1399. /* DWORD 0: flags */
  1400. A_UINT32
  1401. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1402. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1403. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1404. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1405. valid_retries : 1, /* if set, tx retries spec is valid */
  1406. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1407. /* if set, tx dyn_bw and bw_mask are valid */
  1408. valid_bw_info : 1,
  1409. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1410. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1411. valid_key_flags : 1, /* if set, key flags is valid */
  1412. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1413. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1414. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1415. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1416. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1417. * 1 = ENCRYPT,
  1418. * 2 ~ 3 - Reserved
  1419. */
  1420. /* retry_limit -
  1421. * Specify the maximum number of transmissions, including the
  1422. * initial transmission, to attempt before giving up if no ack
  1423. * is received.
  1424. * If the tx rate is specified, then all retries shall use the
  1425. * same rate as the initial transmission.
  1426. * If no tx rate is specified, the target can choose whether to
  1427. * retain the original rate during the retransmissions, or to
  1428. * fall back to a more robust rate.
  1429. */
  1430. retry_limit : 4,
  1431. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1432. * Valid only for 11ax preamble types HE_SU
  1433. * and HE_EXT_SU
  1434. */
  1435. /* Takes enum values of htt_11ax_ltf_subtype_t
  1436. * Valid only for 11ax preamble types HE_SU
  1437. * and HE_EXT_SU
  1438. */
  1439. ltf_subtype_11ax : 2,
  1440. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1441. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1442. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1443. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1444. */
  1445. reserved0_31 : 1;
  1446. /* DWORD 1: tx power, tx rate */
  1447. A_UINT32
  1448. /* unit of the power field is 0.5 dbm
  1449. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1450. * signed value ranging from -64dbm to 63.5 dbm
  1451. */
  1452. power : 8,
  1453. /* mcs bit mask of 0 ~ 11
  1454. * Setting more than one MCS isn't currently
  1455. * supported by the target (but is supported
  1456. * in the interface in case in the future
  1457. * the target supports specifications of
  1458. * a limited set of MCS values.
  1459. */
  1460. mcs_mask : 12,
  1461. /* Nss bit mask 0 ~ 7
  1462. * Setting more than one Nss isn't currently
  1463. * supported by the target (but is supported
  1464. * in the interface in case in the future
  1465. * the target supports specifications of
  1466. * a limited set of Nss values.
  1467. */
  1468. nss_mask : 8,
  1469. /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1470. pream_type : 3,
  1471. reserved1_31 : 1;
  1472. /* DWORD 2: tx chain mask, tx retries */
  1473. A_UINT32
  1474. /* chain_mask - specify which chains to transmit from */
  1475. chain_mask : 8,
  1476. /* Key Index and related flags - used in mesh mode
  1477. * TODO: Update Enum values for key_flags
  1478. */
  1479. key_flags : 8,
  1480. /*
  1481. * Channel frequency: This identifies the desired channel
  1482. * frequency (in MHz) for tx frames. This is used by FW to help
  1483. * determine when it is safe to transmit or drop frames for
  1484. * off-channel operation.
  1485. * The default value of zero indicates to FW that the corresponding
  1486. * VDEV's home channel (if there is one) is the desired channel
  1487. * frequency.
  1488. */
  1489. chanfreq : 16;
  1490. /* DWORD 3: tx expiry time (TSF) LSBs */
  1491. A_UINT32 expire_tsf_lo;
  1492. /* DWORD 4: tx expiry time (TSF) MSBs */
  1493. A_UINT32 expire_tsf_hi;
  1494. } POSTPACK;
  1495. /* DWORD 0 */
  1496. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1497. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1498. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1499. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1500. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1501. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1502. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1503. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1504. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1505. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1506. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1507. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1508. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1509. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1510. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1511. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1512. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1513. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1522. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1523. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1524. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1525. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1526. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1527. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1528. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1529. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1530. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1531. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1532. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1533. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1534. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1535. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1536. /* DWORD 1 */
  1537. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1538. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1539. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1540. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1541. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1542. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1543. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1544. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1545. /* DWORD 2 */
  1546. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1547. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1548. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1549. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1550. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1551. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1552. /* DWORD 0 */
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1554. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1555. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1557. do { \
  1558. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1559. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S));\
  1560. } while (0)
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1563. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK,\
  1567. _val); \
  1568. ((_var) |= \
  1569. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1573. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK,\
  1577. _val); \
  1578. ((_var) |= \
  1579. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1580. } while (0)
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1582. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1583. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1585. do { \
  1586. HTT_CHECK_SET_VAL( \
  1587. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1588. ((_var) |= ((_val) \
  1589. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1593. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES,\
  1597. _val); \
  1598. ((_var) |= ((_val) << \
  1599. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1603. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO,\
  1607. _val); \
  1608. ((_var) |= \
  1609. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >>\
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL( \
  1617. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1618. ((_var) |= ((_val) \
  1619. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1623. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK,\
  1627. _val); \
  1628. ((_var) |= \
  1629. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL( \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1638. ((_var) |= \
  1639. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL( \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1648. ((_var) |= \
  1649. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME,\
  1657. _val); \
  1658. ((_var) |= ((_val) << \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ,\
  1667. _val); \
  1668. ((_var) |= ((_val) << \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S));\
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val);\
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S));\
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val);\
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S));\
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val);\
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S));\
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val);\
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S));\
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val);\
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S));\
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX,\
  1717. _val); \
  1718. ((_var) |= ((_val) << \
  1719. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S));\
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val);\
  1735. ((_var) |= ((_val) << \
  1736. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1737. } while (0)
  1738. /* DWORD 1 */
  1739. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1743. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1744. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1745. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1746. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1747. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1748. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1752. do { \
  1753. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val);\
  1754. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S));\
  1755. } while (0)
  1756. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1757. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1758. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1759. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1760. do { \
  1761. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val);\
  1762. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S));\
  1763. } while (0)
  1764. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1765. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1766. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1767. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1768. do { \
  1769. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val);\
  1770. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S));\
  1771. } while (0)
  1772. /* DWORD 2 */
  1773. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val);\
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S));\
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val);\
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S));\
  1788. } while (0)
  1789. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1790. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1791. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1792. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val);\
  1795. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S));\
  1796. } while (0)
  1797. typedef enum {
  1798. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1799. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1800. } htt_tcl_metadata_type;
  1801. /**
  1802. * @brief HTT TCL command number format
  1803. * @details
  1804. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1805. * available to firmware as tcl_exit_base->tcl_status_number.
  1806. * For regular / multicast packets host will send vdev and mac id and for
  1807. * NAWDS packets, host will send peer id.
  1808. * A_UINT32 is used to avoid endianness conversion problems.
  1809. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1810. */
  1811. typedef struct {
  1812. A_UINT32
  1813. type: 1, /* vdev_id based or peer_id based */
  1814. rsvd: 31;
  1815. } htt_tx_tcl_vdev_or_peer_t;
  1816. typedef struct {
  1817. A_UINT32
  1818. type: 1, /* vdev_id based or peer_id based */
  1819. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1820. vdev_id: 8,
  1821. pdev_id: 2,
  1822. rsvd: 20;
  1823. } htt_tx_tcl_vdev_metadata;
  1824. typedef struct {
  1825. A_UINT32
  1826. type: 1, /* vdev_id based or peer_id based */
  1827. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1828. peer_id: 14,
  1829. rsvd: 16;
  1830. } htt_tx_tcl_peer_metadata;
  1831. PREPACK struct htt_tx_tcl_metadata {
  1832. union {
  1833. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1834. htt_tx_tcl_vdev_metadata vdev_meta;
  1835. htt_tx_tcl_peer_metadata peer_meta;
  1836. };
  1837. } POSTPACK;
  1838. /* DWORD 0 */
  1839. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1840. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1841. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1842. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1843. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1844. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1845. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1846. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1847. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1848. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1849. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1850. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1851. HTT_TX_TCL_METADATA_TYPE_S)
  1852. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val);\
  1855. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S));\
  1856. } while (0)
  1857. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1858. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1859. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1860. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1861. do { \
  1862. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val);\
  1863. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S));\
  1864. } while (0)
  1865. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1866. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1867. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1868. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1869. do { \
  1870. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val);\
  1871. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S));\
  1872. } while (0)
  1873. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1874. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1875. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1876. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val);\
  1879. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S));\
  1880. } while (0)
  1881. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1882. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1883. HTT_TX_TCL_METADATA_PEER_ID_S)
  1884. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val);\
  1887. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S));\
  1888. } while (0)
  1889. typedef enum {
  1890. HTT_TX_FW2WBM_TX_STATUS_OK,
  1891. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1892. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1893. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1894. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1895. HTT_TX_FW2WBM_TX_STATUS_MAX
  1896. } htt_tx_fw2wbm_tx_status_t;
  1897. typedef enum {
  1898. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1899. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1900. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1901. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1902. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1903. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1904. } htt_tx_fw2wbm_reinject_reason_t;
  1905. /**
  1906. * @brief HTT TX WBM Completion from firmware to host
  1907. * @details
  1908. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1909. * DWORD 3 and 4 for software based completions (Exception frames and
  1910. * TQM bypass frames)
  1911. * For software based completions, wbm_release_ring->release_source_module will
  1912. * be set to release_source_fw
  1913. */
  1914. PREPACK struct htt_tx_wbm_completion {
  1915. A_UINT32
  1916. sch_cmd_id: 24,
  1917. /* If set, this packet was queued via exception path */
  1918. exception_frame: 1,
  1919. rsvd0_31_25: 7;
  1920. A_UINT32
  1921. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1922. * reception of an ACK or BA, this field indicates
  1923. * the RSSI of the received ACK or BA frame.
  1924. * When the frame is removed as result of a direct
  1925. * remove command from the SW, this field is set
  1926. * to 0x0 (which is never a valid value when real
  1927. * RSSI is available).
  1928. * Units: dB w.r.t noise floor
  1929. */
  1930. /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1931. tx_status: 4,
  1932. /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1933. reinject_reason: 4,
  1934. rsvd1_31_16: 16;
  1935. } POSTPACK;
  1936. /* DWORD 0 */
  1937. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1938. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1939. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1940. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1941. /* DWORD 1 */
  1942. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1943. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1944. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1945. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1946. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1947. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1948. /* DWORD 0 */
  1949. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1950. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1951. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1952. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val);\
  1955. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S));\
  1956. } while (0)
  1957. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1958. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1959. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1960. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val);\
  1963. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S));\
  1964. } while (0)
  1965. /* DWORD 1 */
  1966. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1967. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1968. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1969. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val);\
  1972. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S));\
  1973. } while (0)
  1974. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1975. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1976. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1977. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val);\
  1980. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S));\
  1981. } while (0)
  1982. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  1983. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  1984. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  1985. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val);\
  1988. ((_var) |= ((_val) << \
  1989. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  1990. } while (0)
  1991. typedef enum {
  1992. TX_FLOW_PRIORITY_BE,
  1993. TX_FLOW_PRIORITY_HIGH,
  1994. TX_FLOW_PRIORITY_LOW,
  1995. } htt_tx_flow_priority_t;
  1996. typedef enum {
  1997. TX_FLOW_LATENCY_SENSITIVE,
  1998. TX_FLOW_LATENCY_INSENSITIVE,
  1999. } htt_tx_flow_latency_t;
  2000. typedef enum {
  2001. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2002. TX_FLOW_INTERACTIVE_TRAFFIC,
  2003. TX_FLOW_PERIODIC_TRAFFIC,
  2004. TX_FLOW_BURSTY_TRAFFIC,
  2005. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2006. } htt_tx_flow_traffic_pattern_t;
  2007. /**
  2008. * @brief HTT TX Flow search metadata format
  2009. * @details
  2010. * Host will set this metadata in flow table's flow search entry along with
  2011. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2012. * firmware and TQM ring if the flow search entry wins.
  2013. * This metadata is available to firmware in that first MSDU's
  2014. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2015. * to one of the available flows for specific tid and returns the tqm flow
  2016. * pointer as part of htt_tx_map_flow_info message.
  2017. */
  2018. PREPACK struct htt_tx_flow_metadata {
  2019. A_UINT32
  2020. rsvd0_1_0: 2,
  2021. tid: 4,
  2022. /* Takes enum values of htt_tx_flow_priority_t */
  2023. priority: 3,
  2024. /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2025. traffic_pattern: 3,
  2026. /* If set, tid field in this struct is the final tid.
  2027. * Else choose final tid based on latency, priority.
  2028. */
  2029. tid_override: 1,
  2030. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2031. /* Takes enum values of htt_tx_flow_latency_t */
  2032. latency_sensitive: 2,
  2033. /* Used by host to map flow metadata with flow entry */
  2034. host_flow_identifier: 16;
  2035. } POSTPACK;
  2036. /* DWORD 0 */
  2037. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2038. #define HTT_TX_FLOW_METADATA_TID_S 2
  2039. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2040. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2041. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2042. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2043. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2044. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2045. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2046. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2047. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2048. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2049. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2050. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2051. /* DWORD 0 */
  2052. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2053. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2054. HTT_TX_FLOW_METADATA_TID_S)
  2055. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2059. } while (0)
  2060. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2061. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2062. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2063. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S));\
  2067. } while (0)
  2068. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2069. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2070. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2071. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val);\
  2074. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S));\
  2075. } while (0)
  2076. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2077. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2078. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2079. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val);\
  2082. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S));\
  2083. } while (0)
  2084. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2085. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2086. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2087. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val);\
  2090. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S));\
  2091. } while (0)
  2092. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2093. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2094. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2095. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S));\
  2099. } while (0)
  2100. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2101. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2102. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2103. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val);\
  2106. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S));\
  2107. } while (0)
  2108. /**
  2109. * @brief for HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and
  2110. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2111. *
  2112. * @details
  2113. * HTT wds entry from source port learning
  2114. * Host will learn wds entries from rx and send this message to firmware
  2115. * to enable firmware to configure/delete AST entries for wds clients.
  2116. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2117. * and when SA's entry is deleted, firmware removes this AST entry
  2118. *
  2119. * The message would appear as follows:
  2120. *
  2121. * |31 30|29 |17 16|15 8|7 0|
  2122. * |----------------+----------------+----------------+----------------|
  2123. * | rsvd0 |PDVID| vdev_id | msg_type |
  2124. * |-------------------------------------------------------------------|
  2125. * | sa_addr_31_0 |
  2126. * |-------------------------------------------------------------------|
  2127. * | | ta_peer_id | sa_addr_47_32 |
  2128. * |-------------------------------------------------------------------|
  2129. * Where PDVID = pdev_id
  2130. *
  2131. * The message is interpreted as follows:
  2132. *
  2133. * dword0 - b'0:7 - msg_type: This will be set to
  2134. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2135. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2136. *
  2137. * dword0 - b'8:15 - vdev_id
  2138. *
  2139. * dword0 - b'16:17 - pdev_id
  2140. *
  2141. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2142. *
  2143. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2144. *
  2145. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2146. *
  2147. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2148. */
  2149. PREPACK struct htt_wds_entry {
  2150. A_UINT32
  2151. msg_type: 8,
  2152. vdev_id: 8,
  2153. pdev_id: 2,
  2154. rsvd0: 14;
  2155. A_UINT32 sa_addr_31_0;
  2156. A_UINT32
  2157. sa_addr_47_32: 16,
  2158. ta_peer_id: 14,
  2159. rsvd2: 2;
  2160. } POSTPACK;
  2161. /* DWORD 0 */
  2162. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2163. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2164. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2165. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2166. /* DWORD 2 */
  2167. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2168. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2169. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2170. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2171. /* DWORD 0 */
  2172. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2173. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2174. HTT_WDS_ENTRY_VDEV_ID_S)
  2175. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2178. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2179. } while (0)
  2180. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2181. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2182. HTT_WDS_ENTRY_PDEV_ID_S)
  2183. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2186. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2187. } while (0)
  2188. /* DWORD 2 */
  2189. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2190. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2191. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2192. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2195. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2196. } while (0)
  2197. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2198. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2199. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2200. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2201. do { \
  2202. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2203. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2204. } while (0)
  2205. /**
  2206. * @brief MAC DMA rx ring setup specification
  2207. * @details
  2208. * To allow for dynamic rx ring reconfiguration and to avoid race
  2209. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2210. * it uses. Instead, it sends this message to the target, indicating how
  2211. * the rx ring used by the host should be set up and maintained.
  2212. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2213. * specifications.
  2214. *
  2215. * |31 16|15 8|7 0|
  2216. * |---------------------------------------------------------------|
  2217. * header: | reserved | num rings | msg type |
  2218. * |---------------------------------------------------------------|
  2219. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2220. #if HTT_PADDR64
  2221. * | FW_IDX shadow register physical address (bits 63:32) |
  2222. #endif
  2223. * |---------------------------------------------------------------|
  2224. * | rx ring base physical address (bits 31:0) |
  2225. #if HTT_PADDR64
  2226. * | rx ring base physical address (bits 63:32) |
  2227. #endif
  2228. * |---------------------------------------------------------------|
  2229. * | rx ring buffer size | rx ring length |
  2230. * |---------------------------------------------------------------|
  2231. * | FW_IDX initial value | enabled flags |
  2232. * |---------------------------------------------------------------|
  2233. * | MSDU payload offset | 802.11 header offset |
  2234. * |---------------------------------------------------------------|
  2235. * | PPDU end offset | PPDU start offset |
  2236. * |---------------------------------------------------------------|
  2237. * | MPDU end offset | MPDU start offset |
  2238. * |---------------------------------------------------------------|
  2239. * | MSDU end offset | MSDU start offset |
  2240. * |---------------------------------------------------------------|
  2241. * | frag info offset | rx attention offset |
  2242. * |---------------------------------------------------------------|
  2243. * payload 2, if present, has the same format as payload 1
  2244. * Header fields:
  2245. * - MSG_TYPE
  2246. * Bits 7:0
  2247. * Purpose: identifies this as an rx ring configuration message
  2248. * Value: 0x2
  2249. * - NUM_RINGS
  2250. * Bits 15:8
  2251. * Purpose: indicates whether the host is setting up one rx ring or two
  2252. * Value: 1 or 2
  2253. * Payload:
  2254. * for systems using 64-bit format for bus addresses:
  2255. * - IDX_SHADOW_REG_PADDR_LO
  2256. * Bits 31:0
  2257. * Value: lower 4 bytes of physical address of the host's
  2258. * FW_IDX shadow register
  2259. * - IDX_SHADOW_REG_PADDR_HI
  2260. * Bits 31:0
  2261. * Value: upper 4 bytes of physical address of the host's
  2262. * FW_IDX shadow register
  2263. * - RING_BASE_PADDR_LO
  2264. * Bits 31:0
  2265. * Value: lower 4 bytes of physical address of the host's rx ring
  2266. * - RING_BASE_PADDR_HI
  2267. * Bits 31:0
  2268. * Value: uppper 4 bytes of physical address of the host's rx ring
  2269. * for systems using 32-bit format for bus addresses:
  2270. * - IDX_SHADOW_REG_PADDR
  2271. * Bits 31:0
  2272. * Value: physical address of the host's FW_IDX shadow register
  2273. * - RING_BASE_PADDR
  2274. * Bits 31:0
  2275. * Value: physical address of the host's rx ring
  2276. * - RING_LEN
  2277. * Bits 15:0
  2278. * Value: number of elements in the rx ring
  2279. * - RING_BUF_SZ
  2280. * Bits 31:16
  2281. * Value: size of the buffers referenced by the rx ring, in byte units
  2282. * - ENABLED_FLAGS
  2283. * Bits 15:0
  2284. * Value: 1-bit flags to show whether different rx fields are enabled
  2285. * bit 0: 802.11 header enabled (1) or disabled (0)
  2286. * bit 1: MSDU payload enabled (1) or disabled (0)
  2287. * bit 2: PPDU start enabled (1) or disabled (0)
  2288. * bit 3: PPDU end enabled (1) or disabled (0)
  2289. * bit 4: MPDU start enabled (1) or disabled (0)
  2290. * bit 5: MPDU end enabled (1) or disabled (0)
  2291. * bit 6: MSDU start enabled (1) or disabled (0)
  2292. * bit 7: MSDU end enabled (1) or disabled (0)
  2293. * bit 8: rx attention enabled (1) or disabled (0)
  2294. * bit 9: frag info enabled (1) or disabled (0)
  2295. * bit 10: unicast rx enabled (1) or disabled (0)
  2296. * bit 11: multicast rx enabled (1) or disabled (0)
  2297. * bit 12: ctrl rx enabled (1) or disabled (0)
  2298. * bit 13: mgmt rx enabled (1) or disabled (0)
  2299. * bit 14: null rx enabled (1) or disabled (0)
  2300. * bit 15: phy data rx enabled (1) or disabled (0)
  2301. * - IDX_INIT_VAL
  2302. * Bits 31:16
  2303. * Purpose: Specify the initial value for the FW_IDX.
  2304. * Value: the number of buffers initially present in the host's rx ring
  2305. * - OFFSET_802_11_HDR
  2306. * Bits 15:0
  2307. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2308. * - OFFSET_MSDU_PAYLOAD
  2309. * Bits 31:16
  2310. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2311. * - OFFSET_PPDU_START
  2312. * Bits 15:0
  2313. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2314. * - OFFSET_PPDU_END
  2315. * Bits 31:16
  2316. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2317. * - OFFSET_MPDU_START
  2318. * Bits 15:0
  2319. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2320. * - OFFSET_MPDU_END
  2321. * Bits 31:16
  2322. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2323. * - OFFSET_MSDU_START
  2324. * Bits 15:0
  2325. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2326. * - OFFSET_MSDU_END
  2327. * Bits 31:16
  2328. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2329. * - OFFSET_RX_ATTN
  2330. * Bits 15:0
  2331. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2332. * - OFFSET_FRAG_INFO
  2333. * Bits 31:16
  2334. * Value: offset in QUAD-bytes of frag info table
  2335. */
  2336. /* header fields */
  2337. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2338. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2339. /* payload fields */
  2340. /* for systems using a 64-bit format for bus addresses */
  2341. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2342. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2345. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2346. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2347. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2348. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2349. /* for systems using a 32-bit format for bus addresses */
  2350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2351. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2352. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2353. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2354. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2355. #define HTT_RX_RING_CFG_LEN_S 0
  2356. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2357. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2358. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2359. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2360. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2361. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2362. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2363. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2364. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2365. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2366. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2367. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2368. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2369. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2370. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2371. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2372. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2373. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2374. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2375. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2376. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2377. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2378. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2379. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2380. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2381. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2382. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2383. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2384. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2385. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2386. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2387. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2388. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2389. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2390. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2391. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2392. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2393. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2394. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2395. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2396. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2397. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2398. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2399. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2400. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2401. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2402. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2403. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2404. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2405. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2406. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2407. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2408. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2409. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2410. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2411. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2412. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2413. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2414. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2415. #if HTT_PADDR64
  2416. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2417. #else
  2418. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2419. #endif
  2420. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2421. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2422. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2423. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2424. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2427. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2428. } while (0)
  2429. /* degenerate case for 32-bit fields */
  2430. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2431. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2432. ((_var) = (_val))
  2433. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2434. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2435. ((_var) = (_val))
  2436. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2437. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2438. ((_var) = (_val))
  2439. /* degenerate case for 32-bit fields */
  2440. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2441. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) ((_var) = (_val))
  2442. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2443. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) ((_var) = (_val))
  2444. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2445. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) ((_var) = (_val))
  2446. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2447. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2448. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2451. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2452. } while (0)
  2453. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2454. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2455. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2458. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2459. } while (0)
  2460. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2461. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2462. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2463. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2466. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2467. } while (0)
  2468. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2469. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2470. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2471. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2474. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2475. } while (0)
  2476. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2477. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2478. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2479. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2480. do { \
  2481. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2482. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2483. } while (0)
  2484. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2485. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2486. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2487. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2490. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2491. } while (0)
  2492. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2493. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2494. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2495. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2498. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2499. } while (0)
  2500. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2501. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2502. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2503. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2504. do { \
  2505. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2506. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2507. } while (0)
  2508. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2509. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2510. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2511. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2512. do { \
  2513. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2514. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2515. } while (0)
  2516. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2517. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2518. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2519. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2520. do { \
  2521. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2522. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2523. } while (0)
  2524. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2525. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2526. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2527. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2528. do { \
  2529. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2530. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2531. } while (0)
  2532. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2533. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2534. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2535. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2538. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2539. } while (0)
  2540. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2541. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2542. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2543. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2546. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2547. } while (0)
  2548. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2549. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2550. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2551. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2554. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2555. } while (0)
  2556. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2557. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2558. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2559. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2560. do { \
  2561. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2562. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2563. } while (0)
  2564. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2565. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2566. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2567. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2568. do { \
  2569. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2570. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2571. } while (0)
  2572. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2573. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2574. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2575. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2576. do { \
  2577. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2578. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2579. } while (0)
  2580. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2581. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2582. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2583. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2584. do { \
  2585. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2586. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2587. } while (0)
  2588. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2589. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2590. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2591. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2592. do { \
  2593. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2594. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2595. } while (0)
  2596. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2597. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2598. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2599. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2600. do { \
  2601. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2602. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2603. } while (0)
  2604. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2605. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2606. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2607. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2610. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2611. } while (0)
  2612. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2613. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2614. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2615. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2618. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2619. } while (0)
  2620. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2621. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2622. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2623. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2626. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2627. } while (0)
  2628. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2629. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2630. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2631. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2634. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2635. } while (0)
  2636. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2637. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2638. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2639. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2642. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2643. } while (0)
  2644. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2645. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2646. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2647. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2650. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2651. } while (0)
  2652. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2653. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2654. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2655. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2658. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2659. } while (0)
  2660. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2661. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2662. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2663. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2664. do { \
  2665. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2666. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2667. } while (0)
  2668. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2669. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2670. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2671. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2672. do { \
  2673. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2674. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2675. } while (0)
  2676. /**
  2677. * @brief host -> target FW statistics retrieve
  2678. *
  2679. * @details
  2680. * The following field definitions describe the format of the HTT host
  2681. * to target FW stats retrieve message. The message specifies the type of
  2682. * stats host wants to retrieve.
  2683. *
  2684. * |31 24|23 16|15 8|7 0|
  2685. * |-----------------------------------------------------------|
  2686. * | stats types request bitmask | msg type |
  2687. * |-----------------------------------------------------------|
  2688. * | stats types reset bitmask | reserved |
  2689. * |-----------------------------------------------------------|
  2690. * | stats type | config value |
  2691. * |-----------------------------------------------------------|
  2692. * | cookie LSBs |
  2693. * |-----------------------------------------------------------|
  2694. * | cookie MSBs |
  2695. * |-----------------------------------------------------------|
  2696. * Header fields:
  2697. * - MSG_TYPE
  2698. * Bits 7:0
  2699. * Purpose: identifies this is a stats upload request message
  2700. * Value: 0x3
  2701. * - UPLOAD_TYPES
  2702. * Bits 31:8
  2703. * Purpose: identifies which types of FW statistics to upload
  2704. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2705. * - RESET_TYPES
  2706. * Bits 31:8
  2707. * Purpose: identifies which types of FW statistics to reset
  2708. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2709. * - CFG_VAL
  2710. * Bits 23:0
  2711. * Purpose: give an opaque configuration value to the specified stats type
  2712. * Value: stats-type specific configuration value
  2713. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2714. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2715. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2716. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2717. * - CFG_STAT_TYPE
  2718. * Bits 31:24
  2719. * Purpose: specify which stats type (if any) the config value applies to
  2720. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2721. * a valid configuration specification
  2722. * - COOKIE_LSBS
  2723. * Bits 31:0
  2724. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2725. * message with its preceding host->target stats request message.
  2726. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2727. * - COOKIE_MSBS
  2728. * Bits 31:0
  2729. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2730. * message with its preceding host->target stats request message.
  2731. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2732. */
  2733. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2734. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2735. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2736. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2737. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2738. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2739. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2740. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2741. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2742. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2743. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2744. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2745. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2746. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2749. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2750. } while (0)
  2751. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2752. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2753. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2754. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2755. do { \
  2756. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2757. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2758. } while (0)
  2759. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2760. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2761. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2762. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2763. do { \
  2764. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2765. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2766. } while (0)
  2767. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2768. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2769. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2770. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2773. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2774. } while (0)
  2775. /**
  2776. * @brief host -> target HTT out-of-band sync request
  2777. *
  2778. * @details
  2779. * The HTT SYNC tells the target to suspend processing of subsequent
  2780. * HTT host-to-target messages until some other target agent locally
  2781. * informs the target HTT FW that the current sync counter is equal to
  2782. * or greater than (in a modulo sense) the sync counter specified in
  2783. * the SYNC message.
  2784. * This allows other host-target components to synchronize their operation
  2785. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2786. * security key has been downloaded to and activated by the target.
  2787. * In the absence of any explicit synchronization counter value
  2788. * specification, the target HTT FW will use zero as the default current
  2789. * sync value.
  2790. *
  2791. * |31 24|23 16|15 8|7 0|
  2792. * |-----------------------------------------------------------|
  2793. * | reserved | sync count | msg type |
  2794. * |-----------------------------------------------------------|
  2795. * Header fields:
  2796. * - MSG_TYPE
  2797. * Bits 7:0
  2798. * Purpose: identifies this as a sync message
  2799. * Value: 0x4
  2800. * - SYNC_COUNT
  2801. * Bits 15:8
  2802. * Purpose: specifies what sync value the HTT FW will wait for from
  2803. * an out-of-band specification to resume its operation
  2804. * Value: in-band sync counter value to compare against the out-of-band
  2805. * counter spec.
  2806. * The HTT target FW will suspend its host->target message processing
  2807. * as long as
  2808. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  2809. */
  2810. #define HTT_H2T_SYNC_MSG_SZ 4
  2811. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  2812. #define HTT_H2T_SYNC_COUNT_S 8
  2813. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  2814. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  2815. HTT_H2T_SYNC_COUNT_S)
  2816. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  2819. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  2820. } while (0)
  2821. /**
  2822. * @brief HTT aggregation configuration
  2823. */
  2824. #define HTT_AGGR_CFG_MSG_SZ 4
  2825. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  2826. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  2827. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  2828. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  2829. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  2830. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  2831. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  2832. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  2835. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  2836. } while (0)
  2837. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2838. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2839. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  2840. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  2843. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  2844. } while (0)
  2845. /**
  2846. * @brief host -> target HTT configure max amsdu info per vdev
  2847. *
  2848. * @details
  2849. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  2850. *
  2851. * |31 21|20 16|15 8|7 0|
  2852. * |-----------------------------------------------------------|
  2853. * | reserved | vdev id | max amsdu | msg type |
  2854. * |-----------------------------------------------------------|
  2855. * Header fields:
  2856. * - MSG_TYPE
  2857. * Bits 7:0
  2858. * Purpose: identifies this as a aggr cfg ex message
  2859. * Value: 0xa
  2860. * - MAX_NUM_AMSDU_SUBFRM
  2861. * Bits 15:8
  2862. * Purpose: max MSDUs per A-MSDU
  2863. * - VDEV_ID
  2864. * Bits 20:16
  2865. * Purpose: ID of the vdev to which this limit is applied
  2866. */
  2867. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  2868. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  2869. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  2870. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  2871. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  2872. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2873. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2874. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  2875. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  2878. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  2879. } while (0)
  2880. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  2881. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  2882. HTT_AGGR_CFG_EX_VDEV_ID_S)
  2883. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  2886. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  2887. } while (0)
  2888. /**
  2889. * @brief HTT WDI_IPA Config Message
  2890. *
  2891. * @details
  2892. * The HTT WDI_IPA config message is created/sent by host at driver
  2893. * init time. It contains information about data structures used on
  2894. * WDI_IPA TX and RX path.
  2895. * TX CE ring is used for pushing packet metadata from IPA uC
  2896. * to WLAN FW
  2897. * TX Completion ring is used for generating TX completions from
  2898. * WLAN FW to IPA uC
  2899. * RX Indication ring is used for indicating RX packets from FW
  2900. * to IPA uC
  2901. * RX Ring2 is used as either completion ring or as second
  2902. * indication ring. when Ring2 is used as completion ring, IPA uC
  2903. * puts completed RX packet meta data to Ring2. when Ring2 is used
  2904. * as second indication ring, RX packets for LTE-WLAN aggregation are
  2905. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  2906. * indicated in RX Indication ring. Please see WDI_IPA specification
  2907. * for more details.
  2908. * |31 24|23 16|15 8|7 0|
  2909. * |----------------+----------------+----------------+----------------|
  2910. * | tx pkt pool size | Rsvd | msg_type |
  2911. * |-------------------------------------------------------------------|
  2912. * | tx comp ring base (bits 31:0) |
  2913. #if HTT_PADDR64
  2914. * | tx comp ring base (bits 63:32) |
  2915. #endif
  2916. * |-------------------------------------------------------------------|
  2917. * | tx comp ring size |
  2918. * |-------------------------------------------------------------------|
  2919. * | tx comp WR_IDX physical address (bits 31:0) |
  2920. #if HTT_PADDR64
  2921. * | tx comp WR_IDX physical address (bits 63:32) |
  2922. #endif
  2923. * |-------------------------------------------------------------------|
  2924. * | tx CE WR_IDX physical address (bits 31:0) |
  2925. #if HTT_PADDR64
  2926. * | tx CE WR_IDX physical address (bits 63:32) |
  2927. #endif
  2928. * |-------------------------------------------------------------------|
  2929. * | rx indication ring base (bits 31:0) |
  2930. #if HTT_PADDR64
  2931. * | rx indication ring base (bits 63:32) |
  2932. #endif
  2933. * |-------------------------------------------------------------------|
  2934. * | rx indication ring size |
  2935. * |-------------------------------------------------------------------|
  2936. * | rx ind RD_IDX physical address (bits 31:0) |
  2937. #if HTT_PADDR64
  2938. * | rx ind RD_IDX physical address (bits 63:32) |
  2939. #endif
  2940. * |-------------------------------------------------------------------|
  2941. * | rx ind WR_IDX physical address (bits 31:0) |
  2942. #if HTT_PADDR64
  2943. * | rx ind WR_IDX physical address (bits 63:32) |
  2944. #endif
  2945. * |-------------------------------------------------------------------|
  2946. * |-------------------------------------------------------------------|
  2947. * | rx ring2 base (bits 31:0) |
  2948. #if HTT_PADDR64
  2949. * | rx ring2 base (bits 63:32) |
  2950. #endif
  2951. * |-------------------------------------------------------------------|
  2952. * | rx ring2 size |
  2953. * |-------------------------------------------------------------------|
  2954. * | rx ring2 RD_IDX physical address (bits 31:0) |
  2955. #if HTT_PADDR64
  2956. * | rx ring2 RD_IDX physical address (bits 63:32) |
  2957. #endif
  2958. * |-------------------------------------------------------------------|
  2959. * | rx ring2 WR_IDX physical address (bits 31:0) |
  2960. #if HTT_PADDR64
  2961. * | rx ring2 WR_IDX physical address (bits 63:32) |
  2962. #endif
  2963. * |-------------------------------------------------------------------|
  2964. *
  2965. * Header fields:
  2966. * Header fields:
  2967. * - MSG_TYPE
  2968. * Bits 7:0
  2969. * Purpose: Identifies this as WDI_IPA config message
  2970. * value: = 0x8
  2971. * - TX_PKT_POOL_SIZE
  2972. * Bits 15:0
  2973. * Purpose: Total number of TX packet buffer pool allocated by Host for
  2974. * WDI_IPA TX path
  2975. * For systems using 32-bit format for bus addresses:
  2976. * - TX_COMP_RING_BASE_ADDR
  2977. * Bits 31:0
  2978. * Purpose: TX Completion Ring base address in DDR
  2979. * - TX_COMP_RING_SIZE
  2980. * Bits 31:0
  2981. * Purpose: TX Completion Ring size (must be power of 2)
  2982. * - TX_COMP_WR_IDX_ADDR
  2983. * Bits 31:0
  2984. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2985. * updates the Write Index for WDI_IPA TX completion ring
  2986. * - TX_CE_WR_IDX_ADDR
  2987. * Bits 31:0
  2988. * Purpose: DDR address where IPA uC
  2989. * updates the WR Index for TX CE ring
  2990. * (needed for fusion platforms)
  2991. * - RX_IND_RING_BASE_ADDR
  2992. * Bits 31:0
  2993. * Purpose: RX Indication Ring base address in DDR
  2994. * - RX_IND_RING_SIZE
  2995. * Bits 31:0
  2996. * Purpose: RX Indication Ring size
  2997. * - RX_IND_RD_IDX_ADDR
  2998. * Bits 31:0
  2999. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3000. * RX indication ring
  3001. * - RX_IND_WR_IDX_ADDR
  3002. * Bits 31:0
  3003. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3004. * updates the Write Index for WDI_IPA RX indication ring
  3005. * - RX_RING2_BASE_ADDR
  3006. * Bits 31:0
  3007. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3008. * - RX_RING2_SIZE
  3009. * Bits 31:0
  3010. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3011. * - RX_RING2_RD_IDX_ADDR
  3012. * Bits 31:0
  3013. * Purpose: If Second RX ring is Indication ring, DDR address where
  3014. * IPA uC updates the Read Index for Ring2.
  3015. * If Second RX ring is completion ring, this is NOT used
  3016. * - RX_RING2_WR_IDX_ADDR
  3017. * Bits 31:0
  3018. * Purpose: If Second RX ring is Indication ring, DDR address where
  3019. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3020. * If second RX ring is completion ring, DDR address where
  3021. * IPA uC updates the Write Index for Ring 2.
  3022. * For systems using 64-bit format for bus addresses:
  3023. * - TX_COMP_RING_BASE_ADDR_LO
  3024. * Bits 31:0
  3025. * Purpose: Lower 4 bytes of TX Completion Ring base physical
  3026. * address in DDR
  3027. * - TX_COMP_RING_BASE_ADDR_HI
  3028. * Bits 31:0
  3029. * Purpose: Higher 4 bytes of TX Completion Ring base physical
  3030. * address in DDR
  3031. * - TX_COMP_RING_SIZE
  3032. * Bits 31:0
  3033. * Purpose: TX Completion Ring size (must be power of 2)
  3034. * - TX_COMP_WR_IDX_ADDR_LO
  3035. * Bits 31:0
  3036. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3037. * Lower 4 bytes of DDR address where WIFI FW
  3038. * updates the Write Index for WDI_IPA TX completion ring
  3039. * - TX_COMP_WR_IDX_ADDR_HI
  3040. * Bits 31:0
  3041. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3042. * Higher 4 bytes of DDR address where WIFI FW
  3043. * updates the Write Index for WDI_IPA TX completion ring
  3044. * - TX_CE_WR_IDX_ADDR_LO
  3045. * Bits 31:0
  3046. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3047. * updates the WR Index for TX CE ring
  3048. * (needed for fusion platforms)
  3049. * - TX_CE_WR_IDX_ADDR_HI
  3050. * Bits 31:0
  3051. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3052. * updates the WR Index for TX CE ring
  3053. * (needed for fusion platforms)
  3054. * - RX_IND_RING_BASE_ADDR_LO
  3055. * Bits 31:0
  3056. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3057. * - RX_IND_RING_BASE_ADDR_HI
  3058. * Bits 31:0
  3059. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3060. * - RX_IND_RING_SIZE
  3061. * Bits 31:0
  3062. * Purpose: RX Indication Ring size
  3063. * - RX_IND_RD_IDX_ADDR_LO
  3064. * Bits 31:0
  3065. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the
  3066. * Read Index for WDI_IPA RX indication ring
  3067. * - RX_IND_RD_IDX_ADDR_HI
  3068. * Bits 31:0
  3069. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the
  3070. * Read Index for WDI_IPA RX indication ring
  3071. * - RX_IND_WR_IDX_ADDR_LO
  3072. * Bits 31:0
  3073. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3074. * Lower 4 bytes of DDR address where WIFI FW
  3075. * updates the Write Index for WDI_IPA RX indication ring
  3076. * - RX_IND_WR_IDX_ADDR_HI
  3077. * Bits 31:0
  3078. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3079. * Higher 4 bytes of DDR address where WIFI FW
  3080. * updates the Write Index for WDI_IPA RX indication ring
  3081. * - RX_RING2_BASE_ADDR_LO
  3082. * Bits 31:0
  3083. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)
  3084. * base address in DDR
  3085. * - RX_RING2_BASE_ADDR_HI
  3086. * Bits 31:0
  3087. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)
  3088. * base address in DDR
  3089. * - RX_RING2_SIZE
  3090. * Bits 31:0
  3091. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3092. * - RX_RING2_RD_IDX_ADDR_LO
  3093. * Bits 31:0
  3094. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3095. * DDR address where IPA uC updates the Read Index for Ring2.
  3096. * If Second RX ring is completion ring, this is NOT used
  3097. * - RX_RING2_RD_IDX_ADDR_HI
  3098. * Bits 31:0
  3099. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3100. * DDR address where IPA uC updates the Read Index for Ring2.
  3101. * If Second RX ring is completion ring, this is NOT used
  3102. * - RX_RING2_WR_IDX_ADDR_LO
  3103. * Bits 31:0
  3104. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3105. * DDR address where WIFI FW updates the Write Index
  3106. * for WDI_IPA RX ring2
  3107. * If second RX ring is completion ring, lower 4 bytes of
  3108. * DDR address where IPA uC updates the Write Index for Ring 2.
  3109. * - RX_RING2_WR_IDX_ADDR_HI
  3110. * Bits 31:0
  3111. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3112. * DDR address where WIFI FW updates the Write Index
  3113. * for WDI_IPA RX ring2
  3114. * If second RX ring is completion ring, higher 4 bytes of
  3115. * DDR address where IPA uC updates the Write Index for Ring 2.
  3116. */
  3117. #if HTT_PADDR64
  3118. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3119. #else
  3120. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3121. #endif
  3122. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3123. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3126. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3128. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3129. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3132. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3133. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3134. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3135. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3137. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3138. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3139. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3140. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3141. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3142. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3143. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3144. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3145. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3146. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3147. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3148. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3149. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3150. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3151. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3152. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3153. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3154. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3155. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3156. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3157. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3158. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3159. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3160. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3161. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3162. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3163. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3164. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3165. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3166. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3167. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3168. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3169. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3170. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3171. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3172. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3173. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3174. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3175. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3176. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3177. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3178. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3179. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3180. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3181. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3182. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3183. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3184. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3185. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> \
  3186. HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3187. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3188. do { \
  3189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3190. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3191. } while (0)
  3192. /* for systems using 32-bit format for bus addr */
  3193. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3194. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> \
  3195. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3196. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL( \
  3199. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val);\
  3200. ((_var) |= \
  3201. ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3202. } while (0)
  3203. /* for systems using 64-bit format for bus addr */
  3204. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3205. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> \
  3206. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3207. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3208. do { \
  3209. HTT_CHECK_SET_VAL( \
  3210. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val);\
  3211. ((_var) |= \
  3212. ((_val) << \
  3213. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3214. } while (0)
  3215. /* for systems using 64-bit format for bus addr */
  3216. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3217. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> \
  3218. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3219. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3220. do { \
  3221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3223. } while (0)
  3224. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3225. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> \
  3226. HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3227. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3228. do { \
  3229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3231. } while (0)
  3232. /* for systems using 32-bit format for bus addr */
  3233. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3234. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> \
  3235. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3236. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3237. do { \
  3238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3240. } while (0)
  3241. /* for systems using 64-bit format for bus addr */
  3242. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3243. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> \
  3244. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3245. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3246. do { \
  3247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3249. } while (0)
  3250. /* for systems using 64-bit format for bus addr */
  3251. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3252. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> \
  3253. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3254. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3255. do { \
  3256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3258. } while (0)
  3259. /* for systems using 32-bit format for bus addr */
  3260. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3261. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> \
  3262. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3263. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3264. do { \
  3265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3267. } while (0)
  3268. /* for systems using 64-bit format for bus addr */
  3269. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3270. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >>\
  3271. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3272. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3273. do { \
  3274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3276. } while (0)
  3277. /* for systems using 64-bit format for bus addr */
  3278. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3279. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> \
  3280. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3281. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3282. do { \
  3283. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3284. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3285. } while (0)
  3286. /* for systems using 32-bit format for bus addr */
  3287. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3288. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> \
  3289. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3290. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3291. do { \
  3292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3294. } while (0)
  3295. /* for systems using 64-bit format for bus addr */
  3296. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3297. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> \
  3298. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3299. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3300. do { \
  3301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3303. } while (0)
  3304. /* for systems using 64-bit format for bus addr */
  3305. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3306. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> \
  3307. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3308. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3309. do { \
  3310. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3311. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3312. } while (0)
  3313. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3314. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> \
  3315. HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3316. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3317. do { \
  3318. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3319. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3320. } while (0)
  3321. /* for systems using 32-bit format for bus addr */
  3322. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3323. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> \
  3324. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3325. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3329. } while (0)
  3330. /* for systems using 64-bit format for bus addr */
  3331. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3332. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> \
  3333. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3334. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3337. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3338. } while (0)
  3339. /* for systems using 64-bit format for bus addr */
  3340. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3341. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> \
  3342. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3343. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3344. do { \
  3345. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3346. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3347. } while (0)
  3348. /* for systems using 32-bit format for bus addr */
  3349. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3350. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> \
  3351. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3352. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3355. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3356. } while (0)
  3357. /* for systems using 64-bit format for bus addr */
  3358. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3359. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> \
  3360. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3361. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3364. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3365. } while (0)
  3366. /* for systems using 64-bit format for bus addr */
  3367. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3368. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> \
  3369. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3370. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3373. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3374. } while (0)
  3375. /* for systems using 32-bit format for bus addr */
  3376. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3377. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> \
  3378. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3379. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3382. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3383. } while (0)
  3384. /* for systems using 64-bit format for bus addr */
  3385. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3386. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> \
  3387. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3388. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3391. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3392. } while (0)
  3393. /* for systems using 64-bit format for bus addr */
  3394. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3395. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> \
  3396. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3397. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3400. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3401. } while (0)
  3402. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3403. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> \
  3404. HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3405. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3408. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3409. } while (0)
  3410. /* for systems using 32-bit format for bus addr */
  3411. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3412. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> \
  3413. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3414. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3417. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3418. } while (0)
  3419. /* for systems using 64-bit format for bus addr */
  3420. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3421. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> \
  3422. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3423. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3424. do { \
  3425. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3426. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3427. } while (0)
  3428. /* for systems using 64-bit format for bus addr */
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3430. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> \
  3431. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3435. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3436. } while (0)
  3437. /* for systems using 32-bit format for bus addr */
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3439. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> \
  3440. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3441. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3444. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3445. } while (0)
  3446. /* for systems using 64-bit format for bus addr */
  3447. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3448. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> \
  3449. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3450. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3451. do { \
  3452. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3453. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3454. } while (0)
  3455. /* for systems using 64-bit format for bus addr */
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3457. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> \
  3458. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3460. do { \
  3461. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3462. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3463. } while (0)
  3464. /*
  3465. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3466. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3467. * addresses are stored in a XXX-bit field.
  3468. * This macro is used to define both htt_wdi_ipa_config32_t and
  3469. * htt_wdi_ipa_config64_t structs.
  3470. */
  3471. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3472. _paddr__tx_comp_ring_base_addr_, \
  3473. _paddr__tx_comp_wr_idx_addr_, \
  3474. _paddr__tx_ce_wr_idx_addr_, \
  3475. _paddr__rx_ind_ring_base_addr_, \
  3476. _paddr__rx_ind_rd_idx_addr_, \
  3477. _paddr__rx_ind_wr_idx_addr_, \
  3478. _paddr__rx_ring2_base_addr_,\
  3479. _paddr__rx_ring2_rd_idx_addr_,\
  3480. _paddr__rx_ring2_wr_idx_addr_) \
  3481. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3482. { \
  3483. /* DWORD 0: flags and meta-data */ \
  3484. A_UINT32 \
  3485. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3486. reserved:8, \
  3487. tx_pkt_pool_size:16;\
  3488. /* DWORD 1 */\
  3489. _paddr__tx_comp_ring_base_addr_;\
  3490. /* DWORD 2 (or 3)*/\
  3491. A_UINT32 tx_comp_ring_size;\
  3492. /* DWORD 3 (or 4)*/\
  3493. _paddr__tx_comp_wr_idx_addr_;\
  3494. /* DWORD 4 (or 6)*/\
  3495. _paddr__tx_ce_wr_idx_addr_;\
  3496. /* DWORD 5 (or 8)*/\
  3497. _paddr__rx_ind_ring_base_addr_;\
  3498. /* DWORD 6 (or 10)*/\
  3499. A_UINT32 rx_ind_ring_size;\
  3500. /* DWORD 7 (or 11)*/\
  3501. _paddr__rx_ind_rd_idx_addr_;\
  3502. /* DWORD 8 (or 13)*/\
  3503. _paddr__rx_ind_wr_idx_addr_;\
  3504. /* DWORD 9 (or 15)*/\
  3505. _paddr__rx_ring2_base_addr_;\
  3506. /* DWORD 10 (or 17) */\
  3507. A_UINT32 rx_ring2_size;\
  3508. /* DWORD 11 (or 18) */\
  3509. _paddr__rx_ring2_rd_idx_addr_;\
  3510. /* DWORD 12 (or 20) */\
  3511. _paddr__rx_ring2_wr_idx_addr_;\
  3512. } POSTPACK
  3513. /* define a htt_wdi_ipa_config32_t type */
  3514. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr),
  3515. HTT_VAR_PADDR32(tx_comp_wr_idx_addr),
  3516. HTT_VAR_PADDR32(tx_ce_wr_idx_addr),
  3517. HTT_VAR_PADDR32(rx_ind_ring_base_addr),
  3518. HTT_VAR_PADDR32(rx_ind_rd_idx_addr),
  3519. HTT_VAR_PADDR32(rx_ind_wr_idx_addr),
  3520. HTT_VAR_PADDR32(rx_ring2_base_addr),
  3521. HTT_VAR_PADDR32(rx_ring2_rd_idx_addr),
  3522. HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3523. /* define a htt_wdi_ipa_config64_t type */
  3524. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr),
  3525. HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr),
  3526. HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr),
  3527. HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr),
  3528. HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr),
  3529. HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr),
  3530. HTT_VAR_PADDR64_LE(rx_ring2_base_addr),
  3531. HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr),
  3532. HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3533. #if HTT_PADDR64
  3534. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3535. #else
  3536. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3537. #endif
  3538. enum htt_wdi_ipa_op_code {
  3539. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3540. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3541. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3542. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3543. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3544. /* keep this last */
  3545. HTT_WDI_IPA_OPCODE_MAX
  3546. };
  3547. /**
  3548. * @brief HTT WDI_IPA Operation Request Message
  3549. *
  3550. * @details
  3551. * HTT WDI_IPA Operation Request message is sent by host
  3552. * to either suspend or resume WDI_IPA TX or RX path.
  3553. * |31 24|23 16|15 8|7 0|
  3554. * |----------------+----------------+----------------+----------------|
  3555. * | op_code | Rsvd | msg_type |
  3556. * |-------------------------------------------------------------------|
  3557. *
  3558. * Header fields:
  3559. * - MSG_TYPE
  3560. * Bits 7:0
  3561. * Purpose: Identifies this as WDI_IPA Operation Request message
  3562. * value: = 0x9
  3563. * - OP_CODE
  3564. * Bits 31:16
  3565. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3566. * value: = enum htt_wdi_ipa_op_code
  3567. */
  3568. PREPACK struct htt_wdi_ipa_op_request_t {
  3569. /* DWORD 0: flags and meta-data */
  3570. A_UINT32
  3571. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3572. reserved:8,
  3573. op_code:16;
  3574. } POSTPACK;
  3575. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3576. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3577. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3578. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> \
  3580. HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3581. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3584. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3585. } while (0)
  3586. /*
  3587. * @brief host -> target HTT_SRING_SETUP message
  3588. *
  3589. * @details
  3590. * After target is booted up, Host can send SRING setup message for
  3591. * each host facing LMAC SRING. Target setups up HW registers based
  3592. * on setup message and confirms back to Host if response_required is set.
  3593. * Host should wait for confirmation message before sending new SRING
  3594. * setup message
  3595. *
  3596. * The message would appear as follows:
  3597. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3598. * |--------------- +-----------------+----------------+------------------|
  3599. * | ring_type | ring_id | pdev_id | msg_type |
  3600. * |----------------------------------------------------------------------|
  3601. * | ring_base_addr_lo |
  3602. * |----------------------------------------------------------------------|
  3603. * | ring_base_addr_hi |
  3604. * |----------------------------------------------------------------------|
  3605. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3606. * |----------------------------------------------------------------------|
  3607. * | ring_head_offset32_remote_addr_lo |
  3608. * |----------------------------------------------------------------------|
  3609. * | ring_head_offset32_remote_addr_hi |
  3610. * |----------------------------------------------------------------------|
  3611. * | ring_tail_offset32_remote_addr_lo |
  3612. * |----------------------------------------------------------------------|
  3613. * | ring_tail_offset32_remote_addr_hi |
  3614. * |----------------------------------------------------------------------|
  3615. * | ring_msi_addr_lo |
  3616. * |----------------------------------------------------------------------|
  3617. * | ring_msi_addr_hi |
  3618. * |----------------------------------------------------------------------|
  3619. * | ring_msi_data |
  3620. * |----------------------------------------------------------------------|
  3621. * | intr_timer_th |IM| intr_batch_counter_th |
  3622. * |----------------------------------------------------------------------|
  3623. * | reserved |RR|PTCF| intr_low_threshold |
  3624. * |----------------------------------------------------------------------|
  3625. * Where
  3626. * IM = sw_intr_mode
  3627. * RR = response_required
  3628. * PTCF = prefetch_timer_cfg
  3629. *
  3630. * The message is interpreted as follows:
  3631. * dword0 - b'0:7 - msg_type: This will be set to
  3632. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3633. * b'8:15 - pdev_id:
  3634. * 0 (for rings at SOC/UMAC level),
  3635. * 1/2/3 mac id (for rings at LMAC level)
  3636. * b'16:23 - ring_id: identify which ring is to setup,
  3637. * more details can be got from enum htt_srng_ring_id
  3638. * b'24:31 - ring_type: identify type of host rings,
  3639. * more details can be got from enum htt_srng_ring_type
  3640. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3641. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3642. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3643. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3644. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3645. * SW_TO_HW_RING.
  3646. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3647. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3648. * Lower 32 bits of memory address of the remote variable
  3649. * storing the 4-byte word offset that identifies the head
  3650. * element within the ring.
  3651. * (The head offset variable has type A_UINT32.)
  3652. * Valid for HW_TO_SW and SW_TO_SW rings.
  3653. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3654. * Upper 32 bits of memory address of the remote variable
  3655. * storing the 4-byte word offset that identifies the head
  3656. * element within the ring.
  3657. * (The head offset variable has type A_UINT32.)
  3658. * Valid for HW_TO_SW and SW_TO_SW rings.
  3659. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3660. * Lower 32 bits of memory address of the remote variable
  3661. * storing the 4-byte word offset that identifies the tail
  3662. * element within the ring.
  3663. * (The tail offset variable has type A_UINT32.)
  3664. * Valid for HW_TO_SW and SW_TO_SW rings.
  3665. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3666. * Upper 32 bits of memory address of the remote variable
  3667. * storing the 4-byte word offset that identifies the tail
  3668. * element within the ring.
  3669. * (The tail offset variable has type A_UINT32.)
  3670. * Valid for HW_TO_SW and SW_TO_SW rings.
  3671. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3672. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3673. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3674. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3675. * dword10 - b'0:31 - ring_msi_data: MSI data
  3676. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3677. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3678. * dword11 - b'0:14 - intr_batch_counter_th:
  3679. * batch counter threshold is in units of 4-byte words.
  3680. * HW internally maintains and increments batch count.
  3681. * (see SRING spec for detail description).
  3682. * When batch count reaches threshold value, an interrupt
  3683. * is generated by HW.
  3684. * b'15 - sw_intr_mode:
  3685. * This configuration shall be static.
  3686. * Only programmed at power up.
  3687. * 0: generate pulse style sw interrupts
  3688. * 1: generate level style sw interrupts
  3689. * b'16:31 - intr_timer_th:
  3690. * The timer init value when timer is idle or is
  3691. * initialized to start downcounting.
  3692. * In 8us units (to cover a range of 0 to 524 ms)
  3693. * dword12 - b'0:15 - intr_low_threshold:
  3694. * Used only by Consumer ring to generate ring_sw_int_p.
  3695. * Ring entries low threshold water mark, that is used
  3696. * in combination with the interrupt timer as well as
  3697. * the the clearing of the level interrupt.
  3698. * b'16:18 - prefetch_timer_cfg:
  3699. * Used only by Consumer ring to set timer mode to
  3700. * support Application prefetch handling.
  3701. * The external tail offset/pointer will be updated
  3702. * at following intervals:
  3703. * 3'b000: (Prefetch feature disabled; used only for debug)
  3704. * 3'b001: 1 usec
  3705. * 3'b010: 4 usec
  3706. * 3'b011: 8 usec (default)
  3707. * 3'b100: 16 usec
  3708. * Others: Reserverd
  3709. * b'19 - response_required:
  3710. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3711. * b'20:31 - reserved: reserved for future use
  3712. */
  3713. PREPACK struct htt_sring_setup_t {
  3714. A_UINT32 msg_type: 8,
  3715. pdev_id: 8,
  3716. ring_id: 8,
  3717. ring_type: 8;
  3718. A_UINT32 ring_base_addr_lo;
  3719. A_UINT32 ring_base_addr_hi;
  3720. A_UINT32 ring_size: 16,
  3721. ring_entry_size: 8,
  3722. ring_misc_cfg_flag: 8;
  3723. A_UINT32 ring_head_offset32_remote_addr_lo;
  3724. A_UINT32 ring_head_offset32_remote_addr_hi;
  3725. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3726. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3727. A_UINT32 ring_msi_addr_lo;
  3728. A_UINT32 ring_msi_addr_hi;
  3729. A_UINT32 ring_msi_data;
  3730. A_UINT32 intr_batch_counter_th: 15,
  3731. sw_intr_mode: 1,
  3732. intr_timer_th: 16;
  3733. A_UINT32 intr_low_threshold: 16,
  3734. prefetch_timer_cfg: 3,
  3735. response_required: 1,
  3736. reserved1: 12;
  3737. } POSTPACK;
  3738. enum htt_srng_ring_type {
  3739. HTT_HW_TO_SW_RING = 0,
  3740. HTT_SW_TO_HW_RING,
  3741. HTT_SW_TO_SW_RING,
  3742. /* Insert new ring types above this line */
  3743. };
  3744. enum htt_srng_ring_id {
  3745. /* Used by FW to feed remote buffers and update remote packets */
  3746. HTT_RXDMA_HOST_BUF_RING = 0,
  3747. /*
  3748. * For getting all PPDU/MPDU/MSDU status deescriptors on host for
  3749. * monitor VAP or packet log purposes
  3750. */
  3751. HTT_RXDMA_MONITOR_STATUS_RING,
  3752. /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3753. HTT_RXDMA_MONITOR_BUF_RING,
  3754. /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3755. HTT_RXDMA_MONITOR_DESC_RING,
  3756. /* Per MPDU indication to host for monitor traffic upload */
  3757. HTT_RXDMA_MONITOR_DEST_RING,
  3758. /* (mobile only) used by host to provide remote RX buffers */
  3759. HTT_HOST1_TO_FW_RXBUF_RING,
  3760. /* (mobile only) second ring used by host to provide remote RX buffers*/
  3761. HTT_HOST2_TO_FW_RXBUF_RING,
  3762. /*
  3763. * Add Other SRING which can't be directly configured by host software
  3764. * above this line
  3765. */
  3766. };
  3767. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3768. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3769. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3770. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3771. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3772. HTT_SRING_SETUP_PDEV_ID_S)
  3773. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3776. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3777. } while (0)
  3778. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3779. #define HTT_SRING_SETUP_RING_ID_S 16
  3780. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3781. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3782. HTT_SRING_SETUP_RING_ID_S)
  3783. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3784. do { \
  3785. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3786. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3787. } while (0)
  3788. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3789. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3790. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3791. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3792. HTT_SRING_SETUP_RING_TYPE_S)
  3793. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3796. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3797. } while (0)
  3798. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3799. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3800. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3801. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3802. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3803. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3804. do { \
  3805. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val);\
  3806. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S));\
  3807. } while (0)
  3808. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3809. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3810. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3811. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3812. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3813. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3814. do { \
  3815. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val);\
  3816. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S));\
  3817. } while (0)
  3818. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3819. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3820. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3821. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3822. HTT_SRING_SETUP_RING_SIZE_S)
  3823. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3824. do { \
  3825. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3826. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3827. } while (0)
  3828. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff00000
  3829. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3830. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3831. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3832. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3833. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3834. do { \
  3835. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3836. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3837. } while (0)
  3838. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff0000000
  3839. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3840. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var)\
  3841. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3842. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3843. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3844. do { \
  3845. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3846. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3847. } while (0)
  3848. /* This control bit is applicable to only Producer, which updates Ring ID field
  3849. * of each descriptor before pushing into the ring.
  3850. * 0: updates ring_id(default)
  3851. * 1: ring_id updating disabled
  3852. */
  3853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01
  3854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 0
  3855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3856. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3857. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3859. do { \
  3860. HTT_CHECK_SET_VAL( \
  3861. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val);\
  3862. ((_var) |= ((_val) << \
  3863. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  3864. } while (0)
  3865. /* This control bit is applicable to only Producer, which updates Loopcnt field
  3866. * of each descriptor before pushing into the ring.
  3867. * 0: updates Loopcnt(default)
  3868. * 1: Loopcnt updating disabled
  3869. */
  3870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02
  3871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 1
  3872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  3873. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  3874. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  3875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  3876. do { \
  3877. HTT_CHECK_SET_VAL( \
  3878. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  3879. ((_var) |= ((_val) << \
  3880. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  3881. } while (0)
  3882. /* Secured access enable/disable bit. SRNG drives value of this register bit
  3883. * into security_id port of GXI/AXI.
  3884. */
  3885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04
  3886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 2
  3887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  3888. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  3889. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  3890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  3891. do { \
  3892. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY,\
  3893. _val); \
  3894. ((_var) |= ((_val) << \
  3895. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S));\
  3896. } while (0)
  3897. /* During MSI write operation, SRNG drives value of this register bit into
  3898. * swap bit of GXI/AXI.
  3899. */
  3900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08
  3901. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 3
  3902. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  3903. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  3904. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  3905. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  3906. do { \
  3907. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP,\
  3908. _val); \
  3909. ((_var) |= ((_val) << \
  3910. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  3911. } while (0)
  3912. /* During Pointer write operation, SRNG drives value of this register bit into
  3913. * swap bit of GXI/AXI.
  3914. */
  3915. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10
  3916. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 4
  3917. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  3918. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  3919. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  3920. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  3921. do { \
  3922. HTT_CHECK_SET_VAL( \
  3923. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  3924. ((_var) |= ((_val) << \
  3925. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  3926. } while (0)
  3927. /* During any data or TLV write operation, SRNG drives value of this register
  3928. * bit into swap bit of GXI/AXI.
  3929. */
  3930. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20
  3931. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 5
  3932. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  3933. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  3934. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  3935. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  3936. do { \
  3937. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP,\
  3938. _val); \
  3939. ((_var) |= ((_val) << \
  3940. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S));\
  3941. } while (0)
  3942. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40
  3943. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80
  3944. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  3945. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  3946. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  3947. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  3948. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  3949. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  3950. do { \
  3951. HTT_CHECK_SET_VAL( \
  3952. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  3953. ((_var) |= ((_val) << \
  3954. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  3955. } while (0)
  3956. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  3957. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  3958. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  3959. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >>\
  3960. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  3961. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val)\
  3962. do { \
  3963. HTT_CHECK_SET_VAL( \
  3964. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val);\
  3965. ((_var) |= ((_val) << \
  3966. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  3967. } while (0)
  3968. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  3969. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  3970. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  3971. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  3972. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  3973. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  3974. do { \
  3975. HTT_CHECK_SET_VAL( \
  3976. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  3977. ((_var) |= ((_val) << \
  3978. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S));\
  3979. } while (0)
  3980. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  3981. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  3982. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  3983. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  3984. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  3985. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  3986. do { \
  3987. HTT_CHECK_SET_VAL( \
  3988. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  3989. ((_var) |= ((_val) << \
  3990. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  3991. } while (0)
  3992. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  3993. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  3994. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  3995. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  3996. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  3997. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  3998. do { \
  3999. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4000. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4001. } while (0)
  4002. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4003. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4004. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4005. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4006. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4007. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4008. do { \
  4009. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4010. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4011. } while (0)
  4012. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4013. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4014. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4015. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4016. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4017. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4018. do { \
  4019. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4020. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4021. } while (0)
  4022. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4023. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4024. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4025. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4026. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4027. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4030. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4031. } while (0)
  4032. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4033. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4034. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4035. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4036. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4037. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4038. do { \
  4039. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4040. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4041. } while (0)
  4042. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4043. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4044. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4045. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4046. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4047. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4048. do { \
  4049. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4050. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4051. } while (0)
  4052. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4053. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4054. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4056. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4057. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4060. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4061. } while (0)
  4062. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4063. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4064. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4065. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4066. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4067. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4068. do { \
  4069. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4070. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4071. } while (0)
  4072. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4073. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4074. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4076. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4077. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4081. } while (0)
  4082. /**
  4083. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4084. *
  4085. * @details
  4086. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4087. * configure RXDMA rings.
  4088. * The configuration is per ring based and includes both packet subtypes
  4089. * and PPDU/MPDU TLVs.
  4090. *
  4091. * The message would appear as follows:
  4092. *
  4093. * |31 26|25|24|23 16|15 8|7 0|
  4094. * |-----------------+----------------+----------------+---------------|
  4095. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4096. * |-------------------------------------------------------------------|
  4097. * | rsvd2 | ring_buffer_size |
  4098. * |-------------------------------------------------------------------|
  4099. * | packet_type_enable_flags_0 |
  4100. * |-------------------------------------------------------------------|
  4101. * | packet_type_enable_flags_1 |
  4102. * |-------------------------------------------------------------------|
  4103. * | packet_type_enable_flags_2 |
  4104. * |-------------------------------------------------------------------|
  4105. * | packet_type_enable_flags_3 |
  4106. * |-------------------------------------------------------------------|
  4107. * | tlv_filter_in_flags |
  4108. * |-------------------------------------------------------------------|
  4109. * Where:
  4110. * PS = pkt_swap
  4111. * SS = status_swap
  4112. * The message is interpreted as follows:
  4113. * dword0 - b'0:7 - msg_type: This will be set to
  4114. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4115. * b'8:15 - pdev_id:
  4116. * 0 (for rings at SOC/UMAC level),
  4117. * 1/2/3 mac id (for rings at LMAC level)
  4118. * b'16:23 - ring_id : Identify the ring to configure.
  4119. * More details can be got from enum htt_srng_ring_id
  4120. * b'24 - status_swap: 1 is to swap status TLV
  4121. * b'25 - pkt_swap: 1 is to swap packet TLV
  4122. * b'26:31 - rsvd1: reserved for future use
  4123. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4124. * in byte units.
  4125. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4126. * - b'16:31 - rsvd2: Reserved for future use
  4127. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4128. * Enable MGMT packet from 0b0000 to 0b1001
  4129. * bits from low to high: FP, MD, MO - 3 bits
  4130. * FP: Filter_Pass
  4131. * MD: Monitor_Direct
  4132. * MO: Monitor_Other
  4133. * 10 mgmt subtypes * 3 bits -> 30 bits
  4134. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4135. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4136. * Enable MGMT packet from 0b1010 to 0b1111
  4137. * bits from low to high: FP, MD, MO - 3 bits
  4138. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4139. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4140. * Enable CTRL packet from 0b0000 to 0b1001
  4141. * bits from low to high: FP, MD, MO - 3 bits
  4142. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4143. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4144. * Enable CTRL packet from 0b1010 to 0b1111,
  4145. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4146. * bits from low to high: FP, MD, MO - 3 bits
  4147. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4148. * dword6 - b'0:31 - tlv_filter_in_flags:
  4149. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4150. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4151. */
  4152. PREPACK struct htt_rx_ring_selection_cfg_t {
  4153. A_UINT32 msg_type: 8,
  4154. pdev_id: 8,
  4155. ring_id: 8,
  4156. status_swap: 1,
  4157. pkt_swap: 1,
  4158. rsvd1: 6;
  4159. A_UINT32 ring_buffer_size: 16,
  4160. rsvd2: 16;
  4161. A_UINT32 packet_type_enable_flags_0;
  4162. A_UINT32 packet_type_enable_flags_1;
  4163. A_UINT32 packet_type_enable_flags_2;
  4164. A_UINT32 packet_type_enable_flags_3;
  4165. A_UINT32 tlv_filter_in_flags;
  4166. } POSTPACK;
  4167. #define HTT_RX_RING_SELECTION_CFG_SZ \
  4168. (sizeof(struct htt_rx_ring_selection_cfg_t))
  4169. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4170. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4171. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4172. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4173. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4174. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4177. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4178. } while (0)
  4179. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4180. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4181. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4182. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4183. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4184. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4187. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4188. } while (0)
  4189. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4190. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4191. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4192. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4193. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4194. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP,\
  4197. _val); \
  4198. ((_var) |= ((_val) << \
  4199. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4200. } while (0)
  4201. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4202. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4203. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4204. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4205. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4206. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP,\
  4209. _val); \
  4210. ((_var) |= ((_val) << \
  4211. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4212. } while (0)
  4213. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4214. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4215. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4216. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4217. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4218. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE,\
  4221. _val); \
  4222. ((_var) |= ((_val) << \
  4223. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4224. } while (0)
  4225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4228. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4229. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL( \
  4233. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, \
  4234. _val); \
  4235. ((_var) |= ((_val) << \
  4236. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4237. } while (0)
  4238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4241. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4242. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4243. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL( \
  4246. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val);\
  4247. ((_var) |= ((_val) << \
  4248. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4249. } while (0)
  4250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4253. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4254. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL( \
  4258. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val);\
  4259. ((_var) |= ((_val) << \
  4260. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4261. } while (0)
  4262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4265. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4266. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL( \
  4270. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val);\
  4271. ((_var) |= ((_val) << \
  4272. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4273. } while (0)
  4274. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4275. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4276. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4277. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4278. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4279. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL( \
  4282. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4283. ((_var) |= ((_val) << \
  4284. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4285. } while (0)
  4286. /*
  4287. * Subtype based MGMT frames enable bits.
  4288. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4289. */
  4290. /* association request */
  4291. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M \
  4292. 0x00000001
  4293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M \
  4295. 0x00000002
  4296. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4297. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M \
  4298. 0x00000004
  4299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4300. /* association response */
  4301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M \
  4302. 0x00000008
  4303. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4304. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M \
  4305. 0x00000010
  4306. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4307. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M \
  4308. 0x00000020
  4309. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4310. /* Reassociation request */
  4311. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M \
  4312. 0x00000040
  4313. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4314. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M \
  4315. 0x00000080
  4316. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4317. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M \
  4318. 0x00000100
  4319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4320. /* Reassociation response */
  4321. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M \
  4322. 0x00000200
  4323. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4324. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M \
  4325. 0x00000400
  4326. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4327. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M \
  4328. 0x00000800
  4329. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4330. /* Probe request */
  4331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M \
  4332. 0x00001000
  4333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M \
  4335. 0x00002000
  4336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4337. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M \
  4338. 0x00004000
  4339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4340. /* Probe response */
  4341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M \
  4342. 0x00008000
  4343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4344. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M \
  4345. 0x00010000
  4346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M \
  4348. 0x00020000
  4349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4350. /* Timing Advertisement */
  4351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M \
  4352. 0x00040000
  4353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M \
  4355. 0x00080000
  4356. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4357. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M \
  4358. 0x00100000
  4359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4360. /* Reserved */
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M \
  4362. 0x00200000
  4363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M \
  4365. 0x00400000
  4366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M \
  4368. 0x00800000
  4369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4370. /* Beacon */
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M \
  4372. 0x01000001
  4373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M \
  4375. 0x02000001
  4376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M \
  4378. 0x00000001
  4379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4380. /* ATIM */
  4381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M \
  4382. 0x00000001
  4383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M \
  4385. 0x00000001
  4386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M \
  4388. 0x00000001
  4389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4390. /* Disassociation */
  4391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M \
  4392. 0x00000001
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M \
  4395. 0x00000002
  4396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M \
  4398. 0x00000004
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4400. /* Authentication */
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M \
  4402. 0x00000008
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M \
  4405. 0x00000010
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M \
  4408. 0x00000020
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4410. /* Deauthentication */
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M \
  4412. 0x00000040
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M \
  4415. 0x00000080
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M \
  4418. 0x00000100
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4420. /* Action */
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M \
  4422. 0x00000200
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M \
  4425. 0x00000400
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M \
  4428. 0x00000800
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4430. /* Action No Ack */
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M \
  4432. 0x00001000
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M \
  4435. 0x00002000
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M \
  4438. 0x00004000
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4440. /* Reserved */
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M \
  4442. 0x00008000
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M \
  4445. 0x00010000
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M \
  4448. 0x00020000
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4450. /*
  4451. * Subtype based CTRL frames enable bits.
  4452. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4453. */
  4454. /* Reserved */
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M \
  4456. 0x00000001
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M \
  4459. 0x00000002
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M \
  4462. 0x00000004
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4464. /* Reserved */
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M \
  4466. 0x00000008
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M \
  4469. 0x00000010
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M \
  4472. 0x00000020
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4474. /* Reserved */
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M \
  4476. 0x00000040
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M \
  4479. 0x00000080
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M \
  4482. 0x00000100
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4484. /* Reserved */
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M \
  4486. 0x00000200
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M \
  4489. 0x00000400
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M \
  4492. 0x00000800
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4494. /* Reserved */
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M \
  4496. 0x00001000
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M \
  4499. 0x00002000
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M \
  4502. 0x00004000
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4504. /* Reserved */
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M \
  4506. 0x00008000
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M \
  4509. 0x00010000
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M \
  4512. 0x00020000
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4514. /* Reserved */
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M \
  4516. 0x00040000
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M \
  4519. 0x00080000
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M \
  4522. 0x00100000
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4524. /* Control Wrapper */
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M \
  4526. 0x00200000
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M \
  4529. 0x00400000
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M \
  4532. 0x00800000
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4534. /* Block Ack Request */
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M \
  4536. 0x01000001
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M \
  4539. 0x02000001
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M \
  4542. 0x00000001
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4544. /* Block Ack*/
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M \
  4546. 0x00000001
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M \
  4549. 0x00000001
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M \
  4552. 0x00000001
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4554. /* PS-POLL */
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M \
  4556. 0x00000001
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M \
  4559. 0x00000002
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M \
  4562. 0x00000004
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4564. /* RTS */
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M \
  4566. 0x00000008
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M \
  4569. 0x00000010
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M \
  4572. 0x00000020
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4574. /* CTS */
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M \
  4576. 0x00000040
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M \
  4579. 0x00000080
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M \
  4582. 0x00000100
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4584. /* ACK */
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M \
  4586. 0x00000200
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M \
  4589. 0x00000400
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M \
  4592. 0x00000800
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4594. /* CF-END */
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M \
  4596. 0x00001000
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M \
  4599. 0x00002000
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M \
  4602. 0x00004000
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4604. /* CF-END + CF-ACK */
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M \
  4606. 0x00008000
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M \
  4609. 0x00010000
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M \
  4612. 0x00020000
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4614. /* Multicast data */
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M \
  4616. 0x00040000
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M \
  4619. 0x00080000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M \
  4622. 0x00100000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4624. /* Unicast data */
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M \
  4626. 0x00200000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M \
  4629. 0x00400000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M \
  4632. 0x00800000
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4634. /* NULL data */
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M \
  4636. 0x01000000
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M \
  4639. 0x02000000
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M \
  4642. 0x04000000
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4645. do { \
  4646. HTT_CHECK_SET_VAL(httsym, value); \
  4647. (word) |= (value) << httsym##_S; \
  4648. } while (0)
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4650. (((word) & httsym##_M) >> httsym##_S)
  4651. #define htt_rx_ring_pkt_enable_subtype_set( \
  4652. word, flag, mode, type, subtype, val) \
  4653. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, \
  4654. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype,\
  4655. val)
  4656. #define htt_rx_ring_pkt_enable_subtype_get( \
  4657. word, flag, mode, type, subtype) \
  4658. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word,\
  4659. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4660. /* Definition to filter in TLVs */
  4661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4665. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M \
  4672. 0x00000020
  4673. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4674. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4675. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4676. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4677. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4678. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4679. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4680. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4681. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4682. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M \
  4683. 0x00000400
  4684. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4685. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4686. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4687. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M \
  4688. 0x00001000
  4689. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S\
  4690. 12
  4691. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4692. do { \
  4693. HTT_CHECK_SET_VAL(httsym, enable); \
  4694. (word) |= (enable) << httsym##_S; \
  4695. } while (0)
  4696. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4697. (((word) & httsym##_M) >> httsym##_S)
  4698. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4699. HTT_RX_RING_TLV_ENABLE_SET( \
  4700. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4701. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4702. HTT_RX_RING_TLV_ENABLE_GET(word, \
  4703. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4704. /**
  4705. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4706. * host --> target Receive Flow Steering configuration message definition.
  4707. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4708. * The reason for this is we want RFS to be configured and ready before MAC
  4709. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4710. *
  4711. * |31 24|23 16|15 9|8|7 0|
  4712. * |----------------+----------------+----------------+----------------|
  4713. * | reserved |E| msg type |
  4714. * |-------------------------------------------------------------------|
  4715. * Where E = RFS enable flag
  4716. *
  4717. * The RFS_CONFIG message consists of a single 4-byte word.
  4718. *
  4719. * Header fields:
  4720. * - MSG_TYPE
  4721. * Bits 7:0
  4722. * Purpose: identifies this as a RFS config msg
  4723. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4724. * - RFS_CONFIG
  4725. * Bit 8
  4726. * Purpose: Tells target whether to enable (1) or disable (0)
  4727. * flow steering feature when sending rx indication messages to host
  4728. */
  4729. #define HTT_RFS_CFG_REQ_BYTES 4
  4730. #define HTT_H2T_RFS_CONFIG_M 0x100
  4731. #define HTT_H2T_RFS_CONFIG_S 8
  4732. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4733. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4734. HTT_H2T_RFS_CONFIG_S)
  4735. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4736. do { \
  4737. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4738. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4739. } while (0)
  4740. /*=== target -> host messages ===============================================*/
  4741. enum htt_t2h_msg_type {
  4742. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4743. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4744. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4745. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4746. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4747. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4748. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4749. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4750. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4751. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4752. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4753. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4754. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,/* no longer used */
  4755. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4756. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4757. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4758. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4759. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4760. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4761. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4762. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4763. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4764. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4765. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4766. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4767. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4768. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4769. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4770. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4771. HTT_T2H_MSG_TYPE_TEST,
  4772. /* keep this last */
  4773. HTT_T2H_NUM_MSGS
  4774. };
  4775. /*
  4776. * HTT target to host message type -
  4777. * stored in bits 7:0 of the first word of the message
  4778. */
  4779. #define HTT_T2H_MSG_TYPE_M 0xff
  4780. #define HTT_T2H_MSG_TYPE_S 0
  4781. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4784. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4785. } while (0)
  4786. #define HTT_T2H_MSG_TYPE_GET(word) \
  4787. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4788. /**
  4789. * @brief target -> host version number confirmation message definition
  4790. *
  4791. * |31 24|23 16|15 8|7 0|
  4792. * |----------------+----------------+----------------+----------------|
  4793. * | reserved | major number | minor number | msg type |
  4794. * |-------------------------------------------------------------------|
  4795. * : option request TLV (optional) |
  4796. * :...................................................................:
  4797. *
  4798. * The VER_CONF message may consist of a single 4-byte word, or may be
  4799. * extended with TLVs that specify HTT options selected by the target.
  4800. * The following option TLVs may be appended to the VER_CONF message:
  4801. * - LL_BUS_ADDR_SIZE
  4802. * - HL_SUPPRESS_TX_COMPL_IND
  4803. * - MAX_TX_QUEUE_GROUPS
  4804. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4805. * may be appended to the VER_CONF message (but only one TLV of each type).
  4806. *
  4807. * Header fields:
  4808. * - MSG_TYPE
  4809. * Bits 7:0
  4810. * Purpose: identifies this as a version number confirmation message
  4811. * Value: 0x0
  4812. * - VER_MINOR
  4813. * Bits 15:8
  4814. * Purpose: Specify the minor number of the HTT message library version
  4815. * in use by the target firmware.
  4816. * The minor number specifies the specific revision within a range
  4817. * of fundamentally compatible HTT message definition revisions.
  4818. * Compatible revisions involve adding new messages or perhaps
  4819. * adding new fields to existing messages, in a backwards-compatible
  4820. * manner.
  4821. * Incompatible revisions involve changing the message type values,
  4822. * or redefining existing messages.
  4823. * Value: minor number
  4824. * - VER_MAJOR
  4825. * Bits 15:8
  4826. * Purpose: Specify the major number of the HTT message library version
  4827. * in use by the target firmware.
  4828. * The major number specifies the family of minor revisions that are
  4829. * fundamentally compatible with each other, but not with prior or
  4830. * later families.
  4831. * Value: major number
  4832. */
  4833. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4834. #define HTT_VER_CONF_MINOR_S 8
  4835. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4836. #define HTT_VER_CONF_MAJOR_S 16
  4837. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4838. do { \
  4839. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4840. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4841. } while (0)
  4842. #define HTT_VER_CONF_MINOR_GET(word) \
  4843. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4844. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4847. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  4848. } while (0)
  4849. #define HTT_VER_CONF_MAJOR_GET(word) \
  4850. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  4851. #define HTT_VER_CONF_BYTES 4
  4852. /**
  4853. * @brief - target -> host HTT Rx In order indication message
  4854. *
  4855. * @details
  4856. *
  4857. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  4858. * |----------------+-------------------+---------------------+---------------|
  4859. * | peer ID | P| F| O| ext TID | msg type |
  4860. * |--------------------------------------------------------------------------|
  4861. * | MSDU count | Reserved | vdev id |
  4862. * |--------------------------------------------------------------------------|
  4863. * | MSDU 0 bus address (bits 31:0) |
  4864. #if HTT_PADDR64
  4865. * | MSDU 0 bus address (bits 63:32) |
  4866. #endif
  4867. * |--------------------------------------------------------------------------|
  4868. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  4869. * |--------------------------------------------------------------------------|
  4870. * | MSDU 1 bus address (bits 31:0) |
  4871. #if HTT_PADDR64
  4872. * | MSDU 1 bus address (bits 63:32) |
  4873. #endif
  4874. * |--------------------------------------------------------------------------|
  4875. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  4876. * |--------------------------------------------------------------------------|
  4877. */
  4878. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  4879. *
  4880. * @details
  4881. * bits
  4882. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  4883. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4884. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  4885. * | | frag | | | | fail |chksum fail|
  4886. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4887. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  4888. */
  4889. struct htt_rx_in_ord_paddr_ind_hdr_t {
  4890. A_UINT32 /* word 0 */
  4891. msg_type:8,
  4892. ext_tid:5,
  4893. offload:1,
  4894. frag:1,
  4895. /*
  4896. * Tell host whether to store MSDUs referenced in this message
  4897. * in pktlog
  4898. */
  4899. pktlog:1,
  4900. peer_id:16;
  4901. A_UINT32 /* word 1 */
  4902. vap_id:8,
  4903. reserved_1:8,
  4904. msdu_cnt:16;
  4905. };
  4906. struct htt_rx_in_ord_paddr_ind_msdu32_t {
  4907. A_UINT32 dma_addr;
  4908. A_UINT32
  4909. length:16,
  4910. fw_desc:8,
  4911. msdu_info:8;
  4912. };
  4913. struct htt_rx_in_ord_paddr_ind_msdu64_t {
  4914. A_UINT32 dma_addr_lo;
  4915. A_UINT32 dma_addr_hi;
  4916. A_UINT32
  4917. length:16,
  4918. fw_desc:8,
  4919. msdu_info:8;
  4920. };
  4921. #if HTT_PADDR64
  4922. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  4923. #else
  4924. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  4925. #endif
  4926. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES \
  4927. (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  4928. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS \
  4929. (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  4930. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET \
  4931. HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  4932. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET \
  4933. HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  4934. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 \
  4935. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  4936. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 \
  4937. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  4938. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 \
  4939. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  4940. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 \
  4941. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  4942. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES \
  4943. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  4944. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS \
  4945. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  4946. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  4947. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  4948. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  4949. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  4950. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  4951. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  4952. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  4953. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  4954. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  4955. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  4956. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  4957. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  4958. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  4959. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  4960. /* for systems using 64-bit format for bus addresses */
  4961. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  4962. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  4963. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  4964. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  4965. /* for systems using 32-bit format for bus addresses */
  4966. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  4967. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  4968. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  4969. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  4970. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  4971. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  4972. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  4973. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  4974. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  4977. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  4978. } while (0)
  4979. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  4980. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  4981. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  4982. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  4983. do { \
  4984. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  4985. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  4986. } while (0)
  4987. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  4988. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  4989. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  4990. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  4991. do { \
  4992. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  4993. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  4994. } while (0)
  4995. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  4996. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  4997. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  4998. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  4999. do { \
  5000. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5001. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5002. } while (0)
  5003. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5004. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  5005. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5006. /* for systems using 64-bit format for bus addresses */
  5007. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5008. do { \
  5009. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5010. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5011. } while (0)
  5012. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5013. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  5014. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5015. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5016. do { \
  5017. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5018. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5019. } while (0)
  5020. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5021. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  5022. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5023. /* for systems using 32-bit format for bus addresses */
  5024. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5027. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5028. } while (0)
  5029. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5030. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  5031. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5032. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5033. do { \
  5034. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  5035. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5036. } while (0)
  5037. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5038. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  5039. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5040. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5041. do { \
  5042. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5043. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5044. } while (0)
  5045. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5046. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  5047. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5048. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5049. do { \
  5050. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  5051. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  5052. } while (0)
  5053. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5054. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  5055. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5056. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5057. do { \
  5058. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  5059. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5060. } while (0)
  5061. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5062. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  5063. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5064. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5065. do { \
  5066. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5067. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5068. } while (0)
  5069. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5070. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  5071. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5072. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5073. do { \
  5074. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5075. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5076. } while (0)
  5077. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5078. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> \
  5079. HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5080. /* definitions used within target -> host rx indication message */
  5081. PREPACK struct htt_rx_ind_hdr_prefix_t {
  5082. A_UINT32 /* word 0 */
  5083. msg_type:8,
  5084. ext_tid:5,
  5085. release_valid:1,
  5086. flush_valid:1,
  5087. reserved0:1,
  5088. peer_id:16;
  5089. A_UINT32 /* word 1 */
  5090. flush_start_seq_num:6,
  5091. flush_end_seq_num:6,
  5092. release_start_seq_num:6,
  5093. release_end_seq_num:6,
  5094. num_mpdu_ranges:8;
  5095. } POSTPACK;
  5096. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5097. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5098. #define HTT_TGT_RSSI_INVALID 0x80
  5099. PREPACK struct htt_rx_ppdu_desc_t {
  5100. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5101. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5102. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5103. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5104. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5105. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5106. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5107. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5108. A_UINT32 /* word 0 */
  5109. rssi_cmb:8,
  5110. timestamp_submicrosec:8,
  5111. phy_err_code:8,
  5112. phy_err:1,
  5113. legacy_rate:4,
  5114. legacy_rate_sel:1,
  5115. end_valid:1,
  5116. start_valid:1;
  5117. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5118. union {
  5119. A_UINT32 /* word 1 */
  5120. rssi0_pri20:8,
  5121. rssi0_ext20:8,
  5122. rssi0_ext40:8,
  5123. rssi0_ext80:8;
  5124. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  5125. } u0;
  5126. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5127. union {
  5128. A_UINT32 /* word 2 */
  5129. rssi1_pri20:8,
  5130. rssi1_ext20:8,
  5131. rssi1_ext40:8,
  5132. rssi1_ext80:8;
  5133. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  5134. } u1;
  5135. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5136. union {
  5137. A_UINT32 /* word 3 */
  5138. rssi2_pri20:8,
  5139. rssi2_ext20:8,
  5140. rssi2_ext40:8,
  5141. rssi2_ext80:8;
  5142. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  5143. } u2;
  5144. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5145. union {
  5146. A_UINT32 /* word 4 */
  5147. rssi3_pri20:8,
  5148. rssi3_ext20:8,
  5149. rssi3_ext40:8,
  5150. rssi3_ext80:8;
  5151. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  5152. } u3;
  5153. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5154. A_UINT32 tsf32; /* word 5 */
  5155. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5156. A_UINT32 timestamp_microsec; /* word 6 */
  5157. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5158. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5159. A_UINT32 /* word 7 */
  5160. vht_sig_a1:24,
  5161. preamble_type:8;
  5162. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5163. A_UINT32 /* word 8 */
  5164. vht_sig_a2:24,
  5165. reserved0:8;
  5166. } POSTPACK;
  5167. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5168. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5169. PREPACK struct htt_rx_ind_hdr_suffix_t {
  5170. A_UINT32 /* word 0 */
  5171. fw_rx_desc_bytes:16,
  5172. reserved0:16;
  5173. } POSTPACK;
  5174. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5175. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5176. PREPACK struct htt_rx_ind_hdr_t {
  5177. struct htt_rx_ind_hdr_prefix_t prefix;
  5178. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5179. struct htt_rx_ind_hdr_suffix_t suffix;
  5180. } POSTPACK;
  5181. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5182. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5183. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5184. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5185. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5186. /*
  5187. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5188. * the offset into the HTT rx indication message at which the
  5189. * FW rx PPDU descriptor resides
  5190. */
  5191. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5192. /*
  5193. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5194. * the offset into the HTT rx indication message at which the
  5195. * header suffix (FW rx MSDU byte count) resides
  5196. */
  5197. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5198. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5199. /*
  5200. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5201. * the offset into the HTT rx indication message at which the per-MSDU
  5202. * information starts
  5203. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5204. * per-MSDU information portion of the message. The per-MSDU info itself
  5205. * starts at byte 12.
  5206. */
  5207. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5208. /**
  5209. * @brief target -> host rx indication message definition
  5210. *
  5211. * @details
  5212. * The following field definitions describe the format of the rx indication
  5213. * message sent from the target to the host.
  5214. * The message consists of three major sections:
  5215. * 1. a fixed-length header
  5216. * 2. a variable-length list of firmware rx MSDU descriptors
  5217. * 3. one or more 4-octet MPDU range information elements
  5218. * The fixed length header itself has two sub-sections
  5219. * 1. the message meta-information, including identification of the
  5220. * sender and type of the received data, and a 4-octet flush/release IE
  5221. * 2. the firmware rx PPDU descriptor
  5222. *
  5223. * The format of the message is depicted below.
  5224. * in this depiction, the following abbreviations are used for information
  5225. * elements within the message:
  5226. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5227. * elements associated with the PPDU start are valid.
  5228. * Specifically, the following fields are valid only if SV is set:
  5229. * RSSI (all variants), L, legacy rate, preamble type, service,
  5230. * VHT-SIG-A
  5231. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5232. * elements associated with the PPDU end are valid.
  5233. * Specifically, the following fields are valid only if EV is set:
  5234. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5235. * - L - Legacy rate selector - if legacy rates are used, this flag
  5236. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5237. * (L == 0) PHY.
  5238. * - P - PHY error flag - boolean indication of whether the rx frame had
  5239. * a PHY error
  5240. *
  5241. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5242. * |----------------+-------------------+---------------------+---------------|
  5243. * | peer ID | |RV|FV| ext TID | msg type |
  5244. * |--------------------------------------------------------------------------|
  5245. * | num | release | release | flush | flush |
  5246. * | MPDU | end | start | end | start |
  5247. * | ranges | seq num | seq num | seq num | seq num |
  5248. * |==========================================================================|
  5249. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5250. * |V|V| | rate | | | timestamp | RSSI |
  5251. * |--------------------------------------------------------------------------|
  5252. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5253. * |--------------------------------------------------------------------------|
  5254. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5255. * |--------------------------------------------------------------------------|
  5256. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5257. * |--------------------------------------------------------------------------|
  5258. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5259. * |--------------------------------------------------------------------------|
  5260. * | TSF LSBs |
  5261. * |--------------------------------------------------------------------------|
  5262. * | microsec timestamp |
  5263. * |--------------------------------------------------------------------------|
  5264. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5265. * |--------------------------------------------------------------------------|
  5266. * | service | HT-SIG / VHT-SIG-A2 |
  5267. * |==========================================================================|
  5268. * | reserved | FW rx desc bytes |
  5269. * |--------------------------------------------------------------------------|
  5270. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5271. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5272. * |--------------------------------------------------------------------------|
  5273. * : : :
  5274. * |--------------------------------------------------------------------------|
  5275. * | alignment | MSDU Rx |
  5276. * | padding | desc Bn |
  5277. * |--------------------------------------------------------------------------|
  5278. * | reserved | MPDU range status | MPDU count |
  5279. * |--------------------------------------------------------------------------|
  5280. * : reserved : MPDU range status : MPDU count :
  5281. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5282. *
  5283. * Header fields:
  5284. * - MSG_TYPE
  5285. * Bits 7:0
  5286. * Purpose: identifies this as an rx indication message
  5287. * Value: 0x1
  5288. * - EXT_TID
  5289. * Bits 12:8
  5290. * Purpose: identify the traffic ID of the rx data, including
  5291. * special "extended" TID values for multicast, broadcast, and
  5292. * non-QoS data frames
  5293. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5294. * - FLUSH_VALID (FV)
  5295. * Bit 13
  5296. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5297. * is valid
  5298. * Value:
  5299. * 1 -> flush IE is valid and needs to be processed
  5300. * 0 -> flush IE is not valid and should be ignored
  5301. * - REL_VALID (RV)
  5302. * Bit 13
  5303. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5304. * is valid
  5305. * Value:
  5306. * 1 -> release IE is valid and needs to be processed
  5307. * 0 -> release IE is not valid and should be ignored
  5308. * - PEER_ID
  5309. * Bits 31:16
  5310. * Purpose: Identify, by ID, which peer sent the rx data
  5311. * Value: ID of the peer who sent the rx data
  5312. * - FLUSH_SEQ_NUM_START
  5313. * Bits 5:0
  5314. * Purpose: Indicate the start of a series of MPDUs to flush
  5315. * Not all MPDUs within this series are necessarily valid - the host
  5316. * must check each sequence number within this range to see if the
  5317. * corresponding MPDU is actually present.
  5318. * This field is only valid if the FV bit is set.
  5319. * Value:
  5320. * The sequence number for the first MPDUs to check to flush.
  5321. * The sequence number is masked by 0x3f.
  5322. * - FLUSH_SEQ_NUM_END
  5323. * Bits 11:6
  5324. * Purpose: Indicate the end of a series of MPDUs to flush
  5325. * Value:
  5326. * The sequence number one larger than the sequence number of the
  5327. * last MPDU to check to flush.
  5328. * The sequence number is masked by 0x3f.
  5329. * Not all MPDUs within this series are necessarily valid - the host
  5330. * must check each sequence number within this range to see if the
  5331. * corresponding MPDU is actually present.
  5332. * This field is only valid if the FV bit is set.
  5333. * - REL_SEQ_NUM_START
  5334. * Bits 17:12
  5335. * Purpose: Indicate the start of a series of MPDUs to release.
  5336. * All MPDUs within this series are present and valid - the host
  5337. * need not check each sequence number within this range to see if
  5338. * the corresponding MPDU is actually present.
  5339. * This field is only valid if the RV bit is set.
  5340. * Value:
  5341. * The sequence number for the first MPDUs to check to release.
  5342. * The sequence number is masked by 0x3f.
  5343. * - REL_SEQ_NUM_END
  5344. * Bits 23:18
  5345. * Purpose: Indicate the end of a series of MPDUs to release.
  5346. * Value:
  5347. * The sequence number one larger than the sequence number of the
  5348. * last MPDU to check to release.
  5349. * The sequence number is masked by 0x3f.
  5350. * All MPDUs within this series are present and valid - the host
  5351. * need not check each sequence number within this range to see if
  5352. * the corresponding MPDU is actually present.
  5353. * This field is only valid if the RV bit is set.
  5354. * - NUM_MPDU_RANGES
  5355. * Bits 31:24
  5356. * Purpose: Indicate how many ranges of MPDUs are present.
  5357. * Each MPDU range consists of a series of contiguous MPDUs within the
  5358. * rx frame sequence which all have the same MPDU status.
  5359. * Value: 1-63 (typically a small number, like 1-3)
  5360. *
  5361. * Rx PPDU descriptor fields:
  5362. * - RSSI_CMB
  5363. * Bits 7:0
  5364. * Purpose: Combined RSSI from all active rx chains, across the active
  5365. * bandwidth.
  5366. * Value: RSSI dB units w.r.t. noise floor
  5367. * - TIMESTAMP_SUBMICROSEC
  5368. * Bits 15:8
  5369. * Purpose: high-resolution timestamp
  5370. * Value:
  5371. * Sub-microsecond time of PPDU reception.
  5372. * This timestamp ranges from [0,MAC clock MHz).
  5373. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5374. * to form a high-resolution, large range rx timestamp.
  5375. * - PHY_ERR_CODE
  5376. * Bits 23:16
  5377. * Purpose:
  5378. * If the rx frame processing resulted in a PHY error, indicate what
  5379. * type of rx PHY error occurred.
  5380. * Value:
  5381. * This field is valid if the "P" (PHY_ERR) flag is set.
  5382. * TBD: document/specify the values for this field
  5383. * - PHY_ERR
  5384. * Bit 24
  5385. * Purpose: indicate whether the rx PPDU had a PHY error
  5386. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5387. * - LEGACY_RATE
  5388. * Bits 28:25
  5389. * Purpose:
  5390. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5391. * specify which rate was used.
  5392. * Value:
  5393. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5394. * flag.
  5395. * If LEGACY_RATE_SEL is 0:
  5396. * 0x8: OFDM 48 Mbps
  5397. * 0x9: OFDM 24 Mbps
  5398. * 0xA: OFDM 12 Mbps
  5399. * 0xB: OFDM 6 Mbps
  5400. * 0xC: OFDM 54 Mbps
  5401. * 0xD: OFDM 36 Mbps
  5402. * 0xE: OFDM 18 Mbps
  5403. * 0xF: OFDM 9 Mbps
  5404. * If LEGACY_RATE_SEL is 1:
  5405. * 0x8: CCK 11 Mbps long preamble
  5406. * 0x9: CCK 5.5 Mbps long preamble
  5407. * 0xA: CCK 2 Mbps long preamble
  5408. * 0xB: CCK 1 Mbps long preamble
  5409. * 0xC: CCK 11 Mbps short preamble
  5410. * 0xD: CCK 5.5 Mbps short preamble
  5411. * 0xE: CCK 2 Mbps short preamble
  5412. * - LEGACY_RATE_SEL
  5413. * Bit 29
  5414. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5415. * Value:
  5416. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5417. * used a legacy rate.
  5418. * 0 -> OFDM, 1 -> CCK
  5419. * - END_VALID
  5420. * Bit 30
  5421. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5422. * the start of the PPDU are valid. Specifically, the following
  5423. * fields are only valid if END_VALID is set:
  5424. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5425. * TIMESTAMP_SUBMICROSEC
  5426. * Value:
  5427. * 0 -> rx PPDU desc end fields are not valid
  5428. * 1 -> rx PPDU desc end fields are valid
  5429. * - START_VALID
  5430. * Bit 31
  5431. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5432. * the end of the PPDU are valid. Specifically, the following
  5433. * fields are only valid if START_VALID is set:
  5434. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5435. * VHT-SIG-A
  5436. * Value:
  5437. * 0 -> rx PPDU desc start fields are not valid
  5438. * 1 -> rx PPDU desc start fields are valid
  5439. * - RSSI0_PRI20
  5440. * Bits 7:0
  5441. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5442. * Value: RSSI dB units w.r.t. noise floor
  5443. *
  5444. * - RSSI0_EXT20
  5445. * Bits 7:0
  5446. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5447. * (if the rx bandwidth was >= 40 MHz)
  5448. * Value: RSSI dB units w.r.t. noise floor
  5449. * - RSSI0_EXT40
  5450. * Bits 7:0
  5451. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5452. * (if the rx bandwidth was >= 80 MHz)
  5453. * Value: RSSI dB units w.r.t. noise floor
  5454. * - RSSI0_EXT80
  5455. * Bits 7:0
  5456. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5457. * (if the rx bandwidth was >= 160 MHz)
  5458. * Value: RSSI dB units w.r.t. noise floor
  5459. *
  5460. * - RSSI1_PRI20
  5461. * Bits 7:0
  5462. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5463. * Value: RSSI dB units w.r.t. noise floor
  5464. * - RSSI1_EXT20
  5465. * Bits 7:0
  5466. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5467. * (if the rx bandwidth was >= 40 MHz)
  5468. * Value: RSSI dB units w.r.t. noise floor
  5469. * - RSSI1_EXT40
  5470. * Bits 7:0
  5471. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5472. * (if the rx bandwidth was >= 80 MHz)
  5473. * Value: RSSI dB units w.r.t. noise floor
  5474. * - RSSI1_EXT80
  5475. * Bits 7:0
  5476. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5477. * (if the rx bandwidth was >= 160 MHz)
  5478. * Value: RSSI dB units w.r.t. noise floor
  5479. *
  5480. * - RSSI2_PRI20
  5481. * Bits 7:0
  5482. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5483. * Value: RSSI dB units w.r.t. noise floor
  5484. * - RSSI2_EXT20
  5485. * Bits 7:0
  5486. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5487. * (if the rx bandwidth was >= 40 MHz)
  5488. * Value: RSSI dB units w.r.t. noise floor
  5489. * - RSSI2_EXT40
  5490. * Bits 7:0
  5491. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5492. * (if the rx bandwidth was >= 80 MHz)
  5493. * Value: RSSI dB units w.r.t. noise floor
  5494. * - RSSI2_EXT80
  5495. * Bits 7:0
  5496. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5497. * (if the rx bandwidth was >= 160 MHz)
  5498. * Value: RSSI dB units w.r.t. noise floor
  5499. *
  5500. * - RSSI3_PRI20
  5501. * Bits 7:0
  5502. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5503. * Value: RSSI dB units w.r.t. noise floor
  5504. * - RSSI3_EXT20
  5505. * Bits 7:0
  5506. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5507. * (if the rx bandwidth was >= 40 MHz)
  5508. * Value: RSSI dB units w.r.t. noise floor
  5509. * - RSSI3_EXT40
  5510. * Bits 7:0
  5511. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5512. * (if the rx bandwidth was >= 80 MHz)
  5513. * Value: RSSI dB units w.r.t. noise floor
  5514. * - RSSI3_EXT80
  5515. * Bits 7:0
  5516. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5517. * (if the rx bandwidth was >= 160 MHz)
  5518. * Value: RSSI dB units w.r.t. noise floor
  5519. *
  5520. * - TSF32
  5521. * Bits 31:0
  5522. * Purpose: specify the time the rx PPDU was received, in TSF units
  5523. * Value: 32 LSBs of the TSF
  5524. * - TIMESTAMP_MICROSEC
  5525. * Bits 31:0
  5526. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5527. * Value: PPDU rx time, in microseconds
  5528. * - VHT_SIG_A1
  5529. * Bits 23:0
  5530. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5531. * from the rx PPDU
  5532. * Value:
  5533. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5534. * VHT-SIG-A1 data.
  5535. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5536. * first 24 bits of the HT-SIG data.
  5537. * Otherwise, this field is invalid.
  5538. * Refer to the the 802.11 protocol for the definition of the
  5539. * HT-SIG and VHT-SIG-A1 fields
  5540. * - VHT_SIG_A2
  5541. * Bits 23:0
  5542. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5543. * from the rx PPDU
  5544. * Value:
  5545. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5546. * VHT-SIG-A2 data.
  5547. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5548. * last 24 bits of the HT-SIG data.
  5549. * Otherwise, this field is invalid.
  5550. * Refer to the the 802.11 protocol for the definition of the
  5551. * HT-SIG and VHT-SIG-A2 fields
  5552. * - PREAMBLE_TYPE
  5553. * Bits 31:24
  5554. * Purpose: indicate the PHY format of the received burst
  5555. * Value:
  5556. * 0x4: Legacy (OFDM/CCK)
  5557. * 0x8: HT
  5558. * 0x9: HT with TxBF
  5559. * 0xC: VHT
  5560. * 0xD: VHT with TxBF
  5561. * - SERVICE
  5562. * Bits 31:24
  5563. * Purpose: TBD
  5564. * Value: TBD
  5565. *
  5566. * Rx MSDU descriptor fields:
  5567. * - FW_RX_DESC_BYTES
  5568. * Bits 15:0
  5569. * Purpose: Indicate how many bytes in the Rx indication are used for
  5570. * FW Rx descriptors
  5571. *
  5572. * Payload fields:
  5573. * - MPDU_COUNT
  5574. * Bits 7:0
  5575. * Purpose: Indicate how many sequential MPDUs share the same status.
  5576. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5577. * - MPDU_STATUS
  5578. * Bits 15:8
  5579. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5580. * received successfully.
  5581. * Value:
  5582. * 0x1: success
  5583. * 0x2: FCS error
  5584. * 0x3: duplicate error
  5585. * 0x4: replay error
  5586. * 0x5: invalid peer
  5587. */
  5588. /* header fields */
  5589. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5590. #define HTT_RX_IND_EXT_TID_S 8
  5591. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5592. #define HTT_RX_IND_FLUSH_VALID_S 13
  5593. #define HTT_RX_IND_REL_VALID_M 0x4000
  5594. #define HTT_RX_IND_REL_VALID_S 14
  5595. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5596. #define HTT_RX_IND_PEER_ID_S 16
  5597. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5598. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5599. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5600. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5601. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5602. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5603. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5604. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5605. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5606. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5607. /* rx PPDU descriptor fields */
  5608. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5609. #define HTT_RX_IND_RSSI_CMB_S 0
  5610. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5611. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5612. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5613. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5614. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5615. #define HTT_RX_IND_PHY_ERR_S 24
  5616. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5617. #define HTT_RX_IND_LEGACY_RATE_S 25
  5618. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5619. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5620. #define HTT_RX_IND_END_VALID_M 0x40000000
  5621. #define HTT_RX_IND_END_VALID_S 30
  5622. #define HTT_RX_IND_START_VALID_M 0x80000000
  5623. #define HTT_RX_IND_START_VALID_S 31
  5624. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5625. #define HTT_RX_IND_RSSI_PRI20_S 0
  5626. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5627. #define HTT_RX_IND_RSSI_EXT20_S 8
  5628. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5629. #define HTT_RX_IND_RSSI_EXT40_S 16
  5630. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5631. #define HTT_RX_IND_RSSI_EXT80_S 24
  5632. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5633. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5634. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5635. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5636. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5637. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5638. #define HTT_RX_IND_SERVICE_M 0xff000000
  5639. #define HTT_RX_IND_SERVICE_S 24
  5640. /* rx MSDU descriptor fields */
  5641. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5642. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5643. /* payload fields */
  5644. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5645. #define HTT_RX_IND_MPDU_COUNT_S 0
  5646. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5647. #define HTT_RX_IND_MPDU_STATUS_S 8
  5648. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5649. do { \
  5650. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5651. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5652. } while (0)
  5653. #define HTT_RX_IND_EXT_TID_GET(word) \
  5654. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5655. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5656. do { \
  5657. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5658. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5659. } while (0)
  5660. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5661. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5662. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5665. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5666. } while (0)
  5667. #define HTT_RX_IND_REL_VALID_GET(word) \
  5668. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5669. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5672. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5673. } while (0)
  5674. #define HTT_RX_IND_PEER_ID_GET(word) \
  5675. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5676. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5677. do { \
  5678. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5679. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5680. } while (0)
  5681. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5682. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  5683. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5684. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5685. do { \
  5686. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5687. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5688. } while (0)
  5689. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5690. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5691. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5692. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5695. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5696. } while (0)
  5697. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5698. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5699. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5700. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5701. do { \
  5702. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5703. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5704. } while (0)
  5705. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5706. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5707. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5708. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5709. do { \
  5710. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5711. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5712. } while (0)
  5713. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5714. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5715. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5716. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5717. do { \
  5718. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5719. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5720. } while (0)
  5721. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5722. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5723. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5724. /* FW rx PPDU descriptor fields */
  5725. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5726. do { \
  5727. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5728. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5729. } while (0)
  5730. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5731. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5732. HTT_RX_IND_RSSI_CMB_S)
  5733. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5736. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5737. } while (0)
  5738. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5739. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5740. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5741. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5744. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5745. } while (0)
  5746. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5747. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5748. HTT_RX_IND_PHY_ERR_CODE_S)
  5749. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5750. do { \
  5751. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5752. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5753. } while (0)
  5754. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5755. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5756. HTT_RX_IND_PHY_ERR_S)
  5757. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5758. do { \
  5759. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5760. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5761. } while (0)
  5762. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5763. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5764. HTT_RX_IND_LEGACY_RATE_S)
  5765. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5766. do { \
  5767. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5768. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5769. } while (0)
  5770. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5771. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5772. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5773. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5774. do { \
  5775. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5776. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5777. } while (0)
  5778. #define HTT_RX_IND_END_VALID_GET(word) \
  5779. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5780. HTT_RX_IND_END_VALID_S)
  5781. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5782. do { \
  5783. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5784. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5785. } while (0)
  5786. #define HTT_RX_IND_START_VALID_GET(word) \
  5787. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5788. HTT_RX_IND_START_VALID_S)
  5789. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5790. do { \
  5791. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5792. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5793. } while (0)
  5794. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5795. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5796. HTT_RX_IND_RSSI_PRI20_S)
  5797. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5798. do { \
  5799. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5800. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5801. } while (0)
  5802. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5803. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5804. HTT_RX_IND_RSSI_EXT20_S)
  5805. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5806. do { \
  5807. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5808. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5809. } while (0)
  5810. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5811. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5812. HTT_RX_IND_RSSI_EXT40_S)
  5813. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5816. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5817. } while (0)
  5818. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5819. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5820. HTT_RX_IND_RSSI_EXT80_S)
  5821. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5822. do { \
  5823. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5824. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5825. } while (0)
  5826. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5827. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5828. HTT_RX_IND_VHT_SIG_A1_S)
  5829. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5830. do { \
  5831. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5832. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5833. } while (0)
  5834. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5835. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5836. HTT_RX_IND_VHT_SIG_A2_S)
  5837. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5838. do { \
  5839. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5840. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5841. } while (0)
  5842. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5843. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5844. HTT_RX_IND_PREAMBLE_TYPE_S)
  5845. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5846. do { \
  5847. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5848. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5849. } while (0)
  5850. #define HTT_RX_IND_SERVICE_GET(word) \
  5851. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5852. HTT_RX_IND_SERVICE_S)
  5853. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5854. do { \
  5855. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5856. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5857. } while (0)
  5858. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5859. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5860. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5861. do { \
  5862. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5863. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5864. } while (0)
  5865. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5866. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5867. #define HTT_RX_IND_HL_BYTES \
  5868. (HTT_RX_IND_HDR_BYTES + \
  5869. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  5870. 4 /* single MPDU range information element */)
  5871. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  5872. /* Could we use one macro entry? */
  5873. #define HTT_WORD_SET(word, field, value) \
  5874. do { \
  5875. HTT_CHECK_SET_VAL(field, value); \
  5876. (word) |= ((value) << field ## _S); \
  5877. } while (0)
  5878. #define HTT_WORD_GET(word, field) \
  5879. (((word) & field ## _M) >> field ## _S)
  5880. PREPACK struct hl_htt_rx_ind_base {
  5881. /*
  5882. * align with LL case rx indication message,but
  5883. * reduced to 5 words
  5884. */
  5885. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  5886. } POSTPACK;
  5887. /*
  5888. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  5889. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  5890. * HL host needed info. The field is just after the msdu fw rx desc.
  5891. */
  5892. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5893. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  5894. struct htt_rx_ind_hl_rx_desc_t {
  5895. A_UINT8 ver;
  5896. A_UINT8 len;
  5897. struct {
  5898. A_UINT8
  5899. first_msdu:1,
  5900. last_msdu:1,
  5901. c3_failed:1,
  5902. c4_failed:1,
  5903. ipv6:1,
  5904. tcp:1,
  5905. udp:1,
  5906. reserved:1;
  5907. } flags;
  5908. };
  5909. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  5910. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5911. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  5912. #define HTT_RX_IND_HL_RX_DESC_VER 0
  5913. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  5914. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5915. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  5916. #define HTT_RX_IND_HL_FLAG_OFFSET \
  5917. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  5918. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  5919. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  5920. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  5921. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  5922. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  5923. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  5924. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  5925. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  5926. /* This structure is used in HL, the basic descriptor information
  5927. * used by host. the structure is translated by FW from HW desc
  5928. * or generated by FW. But in HL monitor mode, the host would use
  5929. * the same structure with LL.
  5930. */
  5931. PREPACK struct hl_htt_rx_desc_base {
  5932. A_UINT32
  5933. seq_num:12,
  5934. encrypted:1,
  5935. chan_info_present:1,
  5936. resv0:2,
  5937. mcast_bcast:1,
  5938. fragment:1,
  5939. key_id_oct:8,
  5940. resv1:6;
  5941. A_UINT32 pn_31_0;
  5942. union {
  5943. struct {
  5944. A_UINT16 pn_47_32;
  5945. A_UINT16 pn_63_48;
  5946. } pn16;
  5947. A_UINT32 pn_63_32;
  5948. } u0;
  5949. A_UINT32 pn_95_64;
  5950. A_UINT32 pn_127_96;
  5951. } POSTPACK;
  5952. /*
  5953. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  5954. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  5955. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  5956. * Please see htt_chan_change_t for description of the fields.
  5957. */
  5958. PREPACK struct htt_chan_info_t
  5959. {
  5960. A_UINT32
  5961. primary_chan_center_freq_mhz:16,
  5962. contig_chan1_center_freq_mhz:16;
  5963. A_UINT32
  5964. contig_chan2_center_freq_mhz:16,
  5965. phy_mode:8,
  5966. reserved:8;
  5967. } POSTPACK;
  5968. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  5969. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  5970. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  5971. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  5972. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  5973. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  5974. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  5975. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  5976. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  5977. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  5978. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  5979. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  5980. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  5981. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  5982. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  5983. #define HTT_HL_RX_DESC_PN_OFFSET \
  5984. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  5985. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  5986. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  5987. /* Channel information */
  5988. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  5989. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  5990. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  5991. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  5992. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  5993. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  5994. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  5995. #define HTT_CHAN_INFO_PHY_MODE_S 16
  5996. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  5997. do { \
  5998. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  5999. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6000. } while (0)
  6001. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6002. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  6003. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6004. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6005. do { \
  6006. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6007. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6008. } while (0)
  6009. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6010. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  6011. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6012. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6013. do { \
  6014. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6015. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6016. } while (0)
  6017. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6018. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  6019. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6020. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6021. do { \
  6022. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6023. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6024. } while (0)
  6025. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6026. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  6027. >> HTT_CHAN_INFO_PHY_MODE_S)
  6028. /*
  6029. * @brief target -> host rx reorder flush message definition
  6030. *
  6031. * @details
  6032. * The following field definitions describe the format of the rx flush
  6033. * message sent from the target to the host.
  6034. * The message consists of a 4-octet header, followed by one or more
  6035. * 4-octet payload information elements.
  6036. *
  6037. * |31 24|23 8|7 0|
  6038. * |--------------------------------------------------------------|
  6039. * | TID | peer ID | msg type |
  6040. * |--------------------------------------------------------------|
  6041. * | seq num end | seq num start | MPDU status | reserved |
  6042. * |--------------------------------------------------------------|
  6043. * First DWORD:
  6044. * - MSG_TYPE
  6045. * Bits 7:0
  6046. * Purpose: identifies this as an rx flush message
  6047. * Value: 0x2
  6048. * - PEER_ID
  6049. * Bits 23:8 (only bits 18:8 actually used)
  6050. * Purpose: identify which peer's rx data is being flushed
  6051. * Value: (rx) peer ID
  6052. * - TID
  6053. * Bits 31:24 (only bits 27:24 actually used)
  6054. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6055. * Value: traffic identifier
  6056. * Second DWORD:
  6057. * - MPDU_STATUS
  6058. * Bits 15:8
  6059. * Purpose:
  6060. * Indicate whether the flushed MPDUs should be discarded or processed.
  6061. * Value:
  6062. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6063. * stages of rx processing
  6064. * other: discard the MPDUs
  6065. * It is anticipated that flush messages will always have
  6066. * MPDU status == 1, but the status flag is included for
  6067. * flexibility.
  6068. * - SEQ_NUM_START
  6069. * Bits 23:16
  6070. * Purpose:
  6071. * Indicate the start of a series of consecutive MPDUs being flushed.
  6072. * Not all MPDUs within this range are necessarily valid - the host
  6073. * must check each sequence number within this range to see if the
  6074. * corresponding MPDU is actually present.
  6075. * Value:
  6076. * The sequence number for the first MPDU in the sequence.
  6077. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6078. * - SEQ_NUM_END
  6079. * Bits 30:24
  6080. * Purpose:
  6081. * Indicate the end of a series of consecutive MPDUs being flushed.
  6082. * Value:
  6083. * The sequence number one larger than the sequence number of the
  6084. * last MPDU being flushed.
  6085. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6086. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6087. * are to be released for further rx processing.
  6088. * Not all MPDUs within this range are necessarily valid - the host
  6089. * must check each sequence number within this range to see if the
  6090. * corresponding MPDU is actually present.
  6091. */
  6092. /* first DWORD */
  6093. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6094. #define HTT_RX_FLUSH_PEER_ID_S 8
  6095. #define HTT_RX_FLUSH_TID_M 0xff000000
  6096. #define HTT_RX_FLUSH_TID_S 24
  6097. /* second DWORD */
  6098. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6099. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6100. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6101. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6102. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6103. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6104. #define HTT_RX_FLUSH_BYTES 8
  6105. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6106. do { \
  6107. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6108. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6109. } while (0)
  6110. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6111. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6112. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6113. do { \
  6114. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6115. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6116. } while (0)
  6117. #define HTT_RX_FLUSH_TID_GET(word) \
  6118. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6119. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6120. do { \
  6121. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6122. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6123. } while (0)
  6124. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6125. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6126. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6127. do { \
  6128. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6129. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6130. } while (0)
  6131. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6132. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  6133. HTT_RX_FLUSH_SEQ_NUM_START_S)
  6134. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6135. do { \
  6136. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6137. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6138. } while (0)
  6139. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6140. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6141. /*
  6142. * @brief target -> host rx pn check indication message
  6143. *
  6144. * @details
  6145. * The following field definitions describe the format of the Rx PN check
  6146. * indication message sent from the target to the host.
  6147. * The message consists of a 4-octet header, followed by the start and
  6148. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6149. * IE is one octet containing the sequence number that failed the PN
  6150. * check.
  6151. *
  6152. * |31 24|23 8|7 0|
  6153. * |--------------------------------------------------------------|
  6154. * | TID | peer ID | msg type |
  6155. * |--------------------------------------------------------------|
  6156. * | Reserved | PN IE count | seq num end | seq num start|
  6157. * |--------------------------------------------------------------|
  6158. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6159. * |--------------------------------------------------------------|
  6160. * First DWORD:
  6161. * - MSG_TYPE
  6162. * Bits 7:0
  6163. * Purpose: Identifies this as an rx pn check indication message
  6164. * Value: 0x2
  6165. * - PEER_ID
  6166. * Bits 23:8 (only bits 18:8 actually used)
  6167. * Purpose: identify which peer
  6168. * Value: (rx) peer ID
  6169. * - TID
  6170. * Bits 31:24 (only bits 27:24 actually used)
  6171. * Purpose: identify traffic identifier
  6172. * Value: traffic identifier
  6173. * Second DWORD:
  6174. * - SEQ_NUM_START
  6175. * Bits 7:0
  6176. * Purpose:
  6177. * Indicates the starting sequence number of the MPDU in this
  6178. * series of MPDUs that went though PN check.
  6179. * Value:
  6180. * The sequence number for the first MPDU in the sequence.
  6181. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6182. * - SEQ_NUM_END
  6183. * Bits 15:8
  6184. * Purpose:
  6185. * Indicates the ending sequence number of the MPDU in this
  6186. * series of MPDUs that went though PN check.
  6187. * Value:
  6188. * The sequence number one larger then the sequence number of the last
  6189. * MPDU being flushed.
  6190. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6191. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  6192. * have been checked for invalid PN numbers and are ready
  6193. * to be released for further processing.
  6194. * Not all MPDUs within this range are necessarily valid - the host
  6195. * must check each sequence number within this range to see if the
  6196. * corresponding MPDU is actually present.
  6197. * - PN_IE_COUNT
  6198. * Bits 23:16
  6199. * Purpose:
  6200. * Used to determine the variable number of PN information
  6201. * elements in this message
  6202. *
  6203. * PN information elements:
  6204. * - PN_IE_x-
  6205. * Purpose:
  6206. * Each PN information element contains the sequence number
  6207. * of the MPDU that has failed the target PN check.
  6208. * Value:
  6209. * Contains the 6 LSBs of the 802.11 sequence number
  6210. * corresponding to the MPDU that failed the PN check.
  6211. */
  6212. /* first DWORD */
  6213. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6214. #define HTT_RX_PN_IND_PEER_ID_S 8
  6215. #define HTT_RX_PN_IND_TID_M 0xff000000
  6216. #define HTT_RX_PN_IND_TID_S 24
  6217. /* second DWORD */
  6218. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6219. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6220. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6221. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6222. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6223. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6224. #define HTT_RX_PN_IND_BYTES 8
  6225. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6226. do { \
  6227. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6228. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6229. } while (0)
  6230. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6231. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6232. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6235. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6236. } while (0)
  6237. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6238. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6239. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6240. do { \
  6241. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6242. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6243. } while (0)
  6244. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6245. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  6246. HTT_RX_PN_IND_SEQ_NUM_START_S)
  6247. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6250. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6251. } while (0)
  6252. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6253. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6254. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6257. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6258. } while (0)
  6259. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6260. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6261. /*
  6262. * @brief target -> host rx offload deliver message for LL system
  6263. *
  6264. * @details
  6265. * In a low latency system this message is sent whenever the offload
  6266. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6267. * The DMA of the actual packets into host memory is done before sending out
  6268. * this message. This message indicates only how many MSDUs to reap. The
  6269. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6270. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6271. * DMA'd by the MAC directly into host memory these packets do not contain
  6272. * the MAC descriptors in the header portion of the packet. Instead they contain
  6273. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6274. * message, the packets are delivered directly to the NW stack without going
  6275. * through the regular reorder buffering and PN checking path since it has
  6276. * already been done in target.
  6277. *
  6278. * |31 24|23 16|15 8|7 0|
  6279. * |-----------------------------------------------------------------------|
  6280. * | Total MSDU count | reserved | msg type |
  6281. * |-----------------------------------------------------------------------|
  6282. *
  6283. * @brief target -> host rx offload deliver message for HL system
  6284. *
  6285. * @details
  6286. * In a high latency system this message is sent whenever the offload manager
  6287. * flushes out the packets it has coalesced in its coalescing buffer. The
  6288. * actual packets are also carried along with this message. When the host
  6289. * receives this message, it is expected to deliver these packets to the NW
  6290. * stack directly instead of routing them through the reorder buffering and
  6291. * PN checking path since it has already been done in target.
  6292. *
  6293. * |31 24|23 16|15 8|7 0|
  6294. * |-----------------------------------------------------------------------|
  6295. * | Total MSDU count | reserved | msg type |
  6296. * |-----------------------------------------------------------------------|
  6297. * | peer ID | MSDU length |
  6298. * |-----------------------------------------------------------------------|
  6299. * | MSDU payload | FW Desc | tid | vdev ID |
  6300. * |-----------------------------------------------------------------------|
  6301. * | MSDU payload contd. |
  6302. * |-----------------------------------------------------------------------|
  6303. * | peer ID | MSDU length |
  6304. * |-----------------------------------------------------------------------|
  6305. * | MSDU payload | FW Desc | tid | vdev ID |
  6306. * |-----------------------------------------------------------------------|
  6307. * | MSDU payload contd. |
  6308. * |-----------------------------------------------------------------------|
  6309. *
  6310. */
  6311. /* first DWORD */
  6312. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6313. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6314. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6315. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6317. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6318. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6319. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6320. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6321. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6322. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6323. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6324. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6325. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6326. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6327. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  6328. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6329. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6330. do { \
  6331. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6332. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6333. } while (0) \
  6334. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6335. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  6336. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6337. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6340. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6341. } while (0) \
  6342. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6343. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  6344. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6345. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6346. do { \
  6347. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6348. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6349. } while (0) \
  6350. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6351. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  6352. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6353. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6354. do { \
  6355. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6356. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6357. } while (0) \
  6358. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6359. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  6360. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6361. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6364. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6365. } while (0) \
  6366. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6367. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  6368. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6369. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6370. do { \
  6371. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6372. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6373. } while (0) \
  6374. /**
  6375. * @brief target -> host rx peer map/unmap message definition
  6376. *
  6377. * @details
  6378. * The following diagram shows the format of the rx peer map message sent
  6379. * from the target to the host. This layout assumes the target operates
  6380. * as little-endian.
  6381. *
  6382. * |31 24|23 16|15 8|7 0|
  6383. * |-----------------------------------------------------------------------|
  6384. * | peer ID | VDEV ID | msg type |
  6385. * |-----------------------------------------------------------------------|
  6386. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6387. * |-----------------------------------------------------------------------|
  6388. * | reserved | MAC addr 5 | MAC addr 4 |
  6389. * |-----------------------------------------------------------------------|
  6390. *
  6391. *
  6392. * The following diagram shows the format of the rx peer unmap message sent
  6393. * from the target to the host.
  6394. *
  6395. * |31 24|23 16|15 8|7 0|
  6396. * |-----------------------------------------------------------------------|
  6397. * | peer ID | VDEV ID | msg type |
  6398. * |-----------------------------------------------------------------------|
  6399. *
  6400. * The following field definitions describe the format of the rx peer map
  6401. * and peer unmap messages sent from the target to the host.
  6402. * - MSG_TYPE
  6403. * Bits 7:0
  6404. * Purpose: identifies this as an rx peer map or peer unmap message
  6405. * Value: peer map -> 0x3, peer unmap -> 0x4
  6406. * - VDEV_ID
  6407. * Bits 15:8
  6408. * Purpose: Indicates which virtual device the peer is associated
  6409. * with.
  6410. * Value: vdev ID (used in the host to look up the vdev object)
  6411. * - PEER_ID
  6412. * Bits 31:16
  6413. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6414. * freeing (unmap)
  6415. * Value: (rx) peer ID
  6416. * - MAC_ADDR_L32 (peer map only)
  6417. * Bits 31:0
  6418. * Purpose: Identifies which peer node the peer ID is for.
  6419. * Value: lower 4 bytes of peer node's MAC address
  6420. * - MAC_ADDR_U16 (peer map only)
  6421. * Bits 15:0
  6422. * Purpose: Identifies which peer node the peer ID is for.
  6423. * Value: upper 2 bytes of peer node's MAC address
  6424. */
  6425. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6426. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6427. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6428. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6429. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6430. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6431. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6432. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6433. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6434. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6437. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6438. } while (0)
  6439. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6440. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6441. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6442. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6445. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6446. } while (0)
  6447. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6448. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6449. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6450. #define HTT_RX_PEER_MAP_BYTES 12
  6451. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6452. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6453. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6454. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6455. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6456. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6457. #define HTT_RX_PEER_UNMAP_BYTES 4
  6458. /**
  6459. * @brief target -> host message specifying security parameters
  6460. *
  6461. * @details
  6462. * The following diagram shows the format of the security specification
  6463. * message sent from the target to the host.
  6464. * This security specification message tells the host whether a PN check is
  6465. * necessary on rx data frames, and if so, how large the PN counter is.
  6466. * This message also tells the host about the security processing to apply
  6467. * to defragmented rx frames - specifically, whether a Message Integrity
  6468. * Check is required, and the Michael key to use.
  6469. *
  6470. * |31 24|23 16|15|14 8|7 0|
  6471. * |-----------------------------------------------------------------------|
  6472. * | peer ID | U| security type | msg type |
  6473. * |-----------------------------------------------------------------------|
  6474. * | Michael Key K0 |
  6475. * |-----------------------------------------------------------------------|
  6476. * | Michael Key K1 |
  6477. * |-----------------------------------------------------------------------|
  6478. * | WAPI RSC Low0 |
  6479. * |-----------------------------------------------------------------------|
  6480. * | WAPI RSC Low1 |
  6481. * |-----------------------------------------------------------------------|
  6482. * | WAPI RSC Hi0 |
  6483. * |-----------------------------------------------------------------------|
  6484. * | WAPI RSC Hi1 |
  6485. * |-----------------------------------------------------------------------|
  6486. *
  6487. * The following field definitions describe the format of the security
  6488. * indication message sent from the target to the host.
  6489. * - MSG_TYPE
  6490. * Bits 7:0
  6491. * Purpose: identifies this as a security specification message
  6492. * Value: 0xb
  6493. * - SEC_TYPE
  6494. * Bits 14:8
  6495. * Purpose: specifies which type of security applies to the peer
  6496. * Value: htt_sec_type enum value
  6497. * - UNICAST
  6498. * Bit 15
  6499. * Purpose: whether this security is applied to unicast or multicast data
  6500. * Value: 1 -> unicast, 0 -> multicast
  6501. * - PEER_ID
  6502. * Bits 31:16
  6503. * Purpose: The ID number for the peer the security specification is for
  6504. * Value: peer ID
  6505. * - MICHAEL_KEY_K0
  6506. * Bits 31:0
  6507. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6508. * Value: Michael Key K0 (if security type is TKIP)
  6509. * - MICHAEL_KEY_K1
  6510. * Bits 31:0
  6511. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6512. * Value: Michael Key K1 (if security type is TKIP)
  6513. * - WAPI_RSC_LOW0
  6514. * Bits 31:0
  6515. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6516. * Value: WAPI RSC Low0 (if security type is WAPI)
  6517. * - WAPI_RSC_LOW1
  6518. * Bits 31:0
  6519. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6520. * Value: WAPI RSC Low1 (if security type is WAPI)
  6521. * - WAPI_RSC_HI0
  6522. * Bits 31:0
  6523. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6524. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6525. * - WAPI_RSC_HI1
  6526. * Bits 31:0
  6527. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6528. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6529. */
  6530. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6531. #define HTT_SEC_IND_SEC_TYPE_S 8
  6532. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6533. #define HTT_SEC_IND_UNICAST_S 15
  6534. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6535. #define HTT_SEC_IND_PEER_ID_S 16
  6536. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6539. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6540. } while (0)
  6541. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6542. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6543. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6546. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6547. } while (0)
  6548. #define HTT_SEC_IND_UNICAST_GET(word) \
  6549. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6550. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6553. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6554. } while (0)
  6555. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6556. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6557. #define HTT_SEC_IND_BYTES 28
  6558. /**
  6559. * @brief target -> host rx ADDBA / DELBA message definitions
  6560. *
  6561. * @details
  6562. * The following diagram shows the format of the rx ADDBA message sent
  6563. * from the target to the host:
  6564. *
  6565. * |31 20|19 16|15 8|7 0|
  6566. * |---------------------------------------------------------------------|
  6567. * | peer ID | TID | window size | msg type |
  6568. * |---------------------------------------------------------------------|
  6569. *
  6570. * The following diagram shows the format of the rx DELBA message sent
  6571. * from the target to the host:
  6572. *
  6573. * |31 20|19 16|15 8|7 0|
  6574. * |---------------------------------------------------------------------|
  6575. * | peer ID | TID | reserved | msg type |
  6576. * |---------------------------------------------------------------------|
  6577. *
  6578. * The following field definitions describe the format of the rx ADDBA
  6579. * and DELBA messages sent from the target to the host.
  6580. * - MSG_TYPE
  6581. * Bits 7:0
  6582. * Purpose: identifies this as an rx ADDBA or DELBA message
  6583. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6584. * - WIN_SIZE
  6585. * Bits 15:8 (ADDBA only)
  6586. * Purpose: Specifies the length of the block ack window (max = 64).
  6587. * Value:
  6588. * block ack window length specified by the received ADDBA
  6589. * management message.
  6590. * - TID
  6591. * Bits 19:16
  6592. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6593. * Value:
  6594. * TID specified by the received ADDBA or DELBA management message.
  6595. * - PEER_ID
  6596. * Bits 31:20
  6597. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6598. * Value:
  6599. * ID (hash value) used by the host for fast, direct lookup of
  6600. * host SW peer info, including rx reorder states.
  6601. */
  6602. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6603. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6604. #define HTT_RX_ADDBA_TID_M 0xf0000
  6605. #define HTT_RX_ADDBA_TID_S 16
  6606. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6607. #define HTT_RX_ADDBA_PEER_ID_S 20
  6608. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6609. do { \
  6610. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6611. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6612. } while (0)
  6613. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6614. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6615. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6616. do { \
  6617. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6618. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6619. } while (0)
  6620. #define HTT_RX_ADDBA_TID_GET(word) \
  6621. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6622. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  6625. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  6626. } while (0)
  6627. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  6628. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  6629. #define HTT_RX_ADDBA_BYTES 4
  6630. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  6631. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  6632. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  6633. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  6634. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  6635. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  6636. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  6637. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  6638. #define HTT_RX_DELBA_BYTES 4
  6639. /**
  6640. * @brief tx queue group information element definition
  6641. *
  6642. * @details
  6643. * The following diagram shows the format of the tx queue group
  6644. * information element, which can be included in target --> host
  6645. * messages to specify the number of tx "credits" (tx descriptors
  6646. * for LL, or tx buffers for HL) available to a particular group
  6647. * of host-side tx queues, and which host-side tx queues belong to
  6648. * the group.
  6649. *
  6650. * |31|30 24|23 16|15|14|13 0|
  6651. * |------------------------------------------------------------------------|
  6652. * | X| reserved | tx queue grp ID | A| S| credit count |
  6653. * |------------------------------------------------------------------------|
  6654. * | vdev ID mask | AC mask |
  6655. * |------------------------------------------------------------------------|
  6656. *
  6657. * The following definitions describe the fields within the tx queue group
  6658. * information element:
  6659. * - credit_count
  6660. * Bits 13:1
  6661. * Purpose: specify how many tx credits are available to the tx queue group
  6662. * Value: An absolute or relative, positive or negative credit value
  6663. * The 'A' bit specifies whether the value is absolute or relative.
  6664. * The 'S' bit specifies whether the value is positive or negative.
  6665. * A negative value can only be relative, not absolute.
  6666. * An absolute value replaces any prior credit value the host has for
  6667. * the tx queue group in question.
  6668. * A relative value is added to the prior credit value the host has for
  6669. * the tx queue group in question.
  6670. * - sign
  6671. * Bit 14
  6672. * Purpose: specify whether the credit count is positive or negative
  6673. * Value: 0 -> positive, 1 -> negative
  6674. * - absolute
  6675. * Bit 15
  6676. * Purpose: specify whether the credit count is absolute or relative
  6677. * Value: 0 -> relative, 1 -> absolute
  6678. * - txq_group_id
  6679. * Bits 23:16
  6680. * Purpose: indicate which tx queue group's credit and/or membership are
  6681. * being specified
  6682. * Value: 0 to max_tx_queue_groups-1
  6683. * - reserved
  6684. * Bits 30:16
  6685. * Value: 0x0
  6686. * - eXtension
  6687. * Bit 31
  6688. * Purpose: specify whether another tx queue group info element follows
  6689. * Value: 0 -> no more tx queue group information elements
  6690. * 1 -> another tx queue group information element immediately follows
  6691. * - ac_mask
  6692. * Bits 15:0
  6693. * Purpose: specify which Access Categories belong to the tx queue group
  6694. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  6695. * the tx queue group.
  6696. * The AC bit-mask values are obtained by left-shifting by the
  6697. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  6698. * - vdev_id_mask
  6699. * Bits 31:16
  6700. * Purpose: specify which vdev's tx queues belong to the tx queue group
  6701. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  6702. * belong to the tx queue group.
  6703. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  6704. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  6705. */
  6706. PREPACK struct htt_txq_group {
  6707. A_UINT32
  6708. credit_count:14,
  6709. sign:1,
  6710. absolute:1,
  6711. tx_queue_group_id:8,
  6712. reserved0:7,
  6713. extension:1;
  6714. A_UINT32
  6715. ac_mask:16,
  6716. vdev_id_mask:16;
  6717. } POSTPACK;
  6718. /* first word */
  6719. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  6720. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  6721. #define HTT_TXQ_GROUP_SIGN_S 14
  6722. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  6723. #define HTT_TXQ_GROUP_ABS_S 15
  6724. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  6725. #define HTT_TXQ_GROUP_ID_S 16
  6726. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  6727. #define HTT_TXQ_GROUP_EXT_S 31
  6728. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  6729. /* second word */
  6730. #define HTT_TXQ_GROUP_AC_MASK_S 0
  6731. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  6732. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  6733. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  6734. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  6735. do { \
  6736. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  6737. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  6738. } while (0)
  6739. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  6740. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  6741. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  6742. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  6743. do { \
  6744. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  6745. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  6746. } while (0)
  6747. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  6748. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  6749. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  6750. do { \
  6751. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  6752. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  6753. } while (0)
  6754. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  6755. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  6756. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  6759. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  6760. } while (0)
  6761. #define HTT_TXQ_GROUP_ID_GET(_info) \
  6762. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  6763. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  6764. do { \
  6765. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  6766. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  6767. } while (0)
  6768. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  6769. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  6770. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  6771. do { \
  6772. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  6773. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  6774. } while (0)
  6775. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  6776. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  6777. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  6778. do { \
  6779. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  6780. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  6781. } while (0)
  6782. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  6783. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  6784. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  6785. /**
  6786. * @brief target -> host TX completion indication message definition
  6787. *
  6788. * @details
  6789. * The following diagram shows the format of the TX completion indication sent
  6790. * from the target to the host
  6791. *
  6792. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  6793. * |-------------------------------------------------------------|
  6794. * header: | reserved |append| num | t_i| tid |status| msg_type |
  6795. * |-------------------------------------------------------------|
  6796. * payload: | MSDU1 ID | MSDU0 ID |
  6797. * |-------------------------------------------------------------|
  6798. * : MSDU3 ID : MSDU2 ID :
  6799. * |-------------------------------------------------------------|
  6800. * | struct htt_tx_compl_ind_append_retries |
  6801. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6802. *
  6803. * The following field definitions describe the format of the TX completion
  6804. * indication sent from the target to the host
  6805. * Header fields:
  6806. * - msg_type
  6807. * Bits 7:0
  6808. * Purpose: identifies this as HTT TX completion indication
  6809. * Value: 0x7
  6810. * - status
  6811. * Bits 10:8
  6812. * Purpose: the TX completion status of payload fragmentations descriptors
  6813. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  6814. * - tid
  6815. * Bits 14:11
  6816. * Purpose: the tid associated with those fragmentation descriptors. It is
  6817. * valid or not, depending on the tid_invalid bit.
  6818. * Value: 0 to 15
  6819. * - tid_invalid
  6820. * Bits 15:15
  6821. * Purpose: this bit indicates whether the tid field is valid or not
  6822. * Value: 0 indicates valid; 1 indicates invalid
  6823. * - num
  6824. * Bits 23:16
  6825. * Purpose: the number of payload in this indication
  6826. * Value: 1 to 255
  6827. * - append
  6828. * Bits 24:24
  6829. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  6830. * the number of tx retries for one MSDU at the end of this message
  6831. * Value: 0 indicates no appending; 1 indicates appending
  6832. * Payload fields:
  6833. * - hmsdu_id
  6834. * Bits 15:0
  6835. * Purpose: this ID is used to track the Tx buffer in host
  6836. * Value: 0 to "size of host MSDU descriptor pool - 1"
  6837. */
  6838. #define HTT_TX_COMPL_IND_STATUS_S 8
  6839. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  6840. #define HTT_TX_COMPL_IND_TID_S 11
  6841. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  6842. #define HTT_TX_COMPL_IND_TID_INV_S 15
  6843. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  6844. #define HTT_TX_COMPL_IND_NUM_S 16
  6845. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  6846. #define HTT_TX_COMPL_IND_APPEND_S 24
  6847. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  6848. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  6849. do { \
  6850. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  6851. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  6852. } while (0)
  6853. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  6854. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  6855. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  6856. do { \
  6857. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  6858. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  6859. } while (0)
  6860. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  6861. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  6862. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  6863. do { \
  6864. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  6865. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  6866. } while (0)
  6867. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  6868. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  6869. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  6870. do { \
  6871. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  6872. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  6873. } while (0)
  6874. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  6875. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  6876. HTT_TX_COMPL_IND_TID_INV_S)
  6877. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  6878. do { \
  6879. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  6880. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  6881. } while (0)
  6882. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  6883. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  6884. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  6885. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  6886. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  6887. #define HTT_TX_COMPL_IND_STAT_OK 0
  6888. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  6889. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  6890. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  6891. /*
  6892. * The PEER_DEL tx completion status is used for HL cases
  6893. * where the peer the frame is for has been deleted.
  6894. * The host has already discarded its copy of the frame, but
  6895. * it still needs the tx completion to restore its credit.
  6896. */
  6897. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  6898. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  6899. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  6900. PREPACK struct htt_tx_compl_ind_base {
  6901. A_UINT32 hdr;
  6902. A_UINT16 payload[1 /*or more */];
  6903. } POSTPACK;
  6904. PREPACK struct htt_tx_compl_ind_append_retries {
  6905. A_UINT16 msdu_id;
  6906. A_UINT8 tx_retries;
  6907. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  6908. 0: this is the last append_retries struct */
  6909. } POSTPACK;
  6910. /**
  6911. * @brief target -> host rate-control update indication message
  6912. *
  6913. * @details
  6914. * The following diagram shows the format of the RC Update message
  6915. * sent from the target to the host, while processing the tx-completion
  6916. * of a transmitted PPDU.
  6917. *
  6918. * |31 24|23 16|15 8|7 0|
  6919. * |-------------------------------------------------------------|
  6920. * | peer ID | vdev ID | msg_type |
  6921. * |-------------------------------------------------------------|
  6922. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6923. * |-------------------------------------------------------------|
  6924. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  6925. * |-------------------------------------------------------------|
  6926. * | : |
  6927. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  6928. * | : |
  6929. * |-------------------------------------------------------------|
  6930. * | : |
  6931. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  6932. * | : |
  6933. * |-------------------------------------------------------------|
  6934. * : :
  6935. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6936. *
  6937. */
  6938. typedef struct {
  6939. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  6940. A_UINT32 rate_code_flags;
  6941. A_UINT32 flags; /* Encodes information such as excessive
  6942. retransmission, aggregate, some info
  6943. from .11 frame control,
  6944. STBC, LDPC, (SGI and Tx Chain Mask
  6945. are encoded in ptx_rc->flags field),
  6946. AMPDU truncation (BT/time based etc.),
  6947. RTS/CTS attempt */
  6948. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  6949. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  6950. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  6951. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  6952. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  6953. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  6954. } HTT_RC_TX_DONE_PARAMS;
  6955. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  6956. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  6957. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  6958. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  6959. #define HTT_RC_UPDATE_VDEVID_S 8
  6960. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  6961. #define HTT_RC_UPDATE_PEERID_S 16
  6962. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  6963. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  6964. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  6965. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  6966. do { \
  6967. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  6968. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  6969. } while (0)
  6970. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  6971. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  6972. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  6973. do { \
  6974. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  6975. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  6976. } while (0)
  6977. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  6978. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  6979. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  6980. do { \
  6981. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  6982. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  6983. } while (0)
  6984. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  6985. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  6986. /**
  6987. * @brief target -> host rx fragment indication message definition
  6988. *
  6989. * @details
  6990. * The following field definitions describe the format of the rx fragment
  6991. * indication message sent from the target to the host.
  6992. * The rx fragment indication message shares the format of the
  6993. * rx indication message, but not all fields from the rx indication message
  6994. * are relevant to the rx fragment indication message.
  6995. *
  6996. *
  6997. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6998. * |-----------+-------------------+---------------------+-------------|
  6999. * | peer ID | |FV| ext TID | msg type |
  7000. * |-------------------------------------------------------------------|
  7001. * | | flush | flush |
  7002. * | | end | start |
  7003. * | | seq num | seq num |
  7004. * |-------------------------------------------------------------------|
  7005. * | reserved | FW rx desc bytes |
  7006. * |-------------------------------------------------------------------|
  7007. * | | FW MSDU Rx |
  7008. * | | desc B0 |
  7009. * |-------------------------------------------------------------------|
  7010. * Header fields:
  7011. * - MSG_TYPE
  7012. * Bits 7:0
  7013. * Purpose: identifies this as an rx fragment indication message
  7014. * Value: 0xa
  7015. * - EXT_TID
  7016. * Bits 12:8
  7017. * Purpose: identify the traffic ID of the rx data, including
  7018. * special "extended" TID values for multicast, broadcast, and
  7019. * non-QoS data frames
  7020. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7021. * - FLUSH_VALID (FV)
  7022. * Bit 13
  7023. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7024. * is valid
  7025. * Value:
  7026. * 1 -> flush IE is valid and needs to be processed
  7027. * 0 -> flush IE is not valid and should be ignored
  7028. * - PEER_ID
  7029. * Bits 31:16
  7030. * Purpose: Identify, by ID, which peer sent the rx data
  7031. * Value: ID of the peer who sent the rx data
  7032. * - FLUSH_SEQ_NUM_START
  7033. * Bits 5:0
  7034. * Purpose: Indicate the start of a series of MPDUs to flush
  7035. * Not all MPDUs within this series are necessarily valid - the host
  7036. * must check each sequence number within this range to see if the
  7037. * corresponding MPDU is actually present.
  7038. * This field is only valid if the FV bit is set.
  7039. * Value:
  7040. * The sequence number for the first MPDUs to check to flush.
  7041. * The sequence number is masked by 0x3f.
  7042. * - FLUSH_SEQ_NUM_END
  7043. * Bits 11:6
  7044. * Purpose: Indicate the end of a series of MPDUs to flush
  7045. * Value:
  7046. * The sequence number one larger than the sequence number of the
  7047. * last MPDU to check to flush.
  7048. * The sequence number is masked by 0x3f.
  7049. * Not all MPDUs within this series are necessarily valid - the host
  7050. * must check each sequence number within this range to see if the
  7051. * corresponding MPDU is actually present.
  7052. * This field is only valid if the FV bit is set.
  7053. * Rx descriptor fields:
  7054. * - FW_RX_DESC_BYTES
  7055. * Bits 15:0
  7056. * Purpose: Indicate how many bytes in the Rx indication are used for
  7057. * FW Rx descriptors
  7058. * Value: 1
  7059. */
  7060. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7061. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7062. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7063. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7064. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7065. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7066. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7067. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7068. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7069. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7070. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7071. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7072. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7073. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7074. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7075. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7076. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7077. #define HTT_RX_FRAG_IND_BYTES \
  7078. (4 /* msg hdr */ + \
  7079. 4 /* flush spec */ + \
  7080. 4 /* (unused) FW rx desc bytes spec */ + \
  7081. 4 /* FW rx desc */)
  7082. /**
  7083. * @brief target -> host test message definition
  7084. *
  7085. * @details
  7086. * The following field definitions describe the format of the test
  7087. * message sent from the target to the host.
  7088. * The message consists of a 4-octet header, followed by a variable
  7089. * number of 32-bit integer values, followed by a variable number
  7090. * of 8-bit character values.
  7091. *
  7092. * |31 16|15 8|7 0|
  7093. * |-----------------------------------------------------------|
  7094. * | num chars | num ints | msg type |
  7095. * |-----------------------------------------------------------|
  7096. * | int 0 |
  7097. * |-----------------------------------------------------------|
  7098. * | int 1 |
  7099. * |-----------------------------------------------------------|
  7100. * | ... |
  7101. * |-----------------------------------------------------------|
  7102. * | char 3 | char 2 | char 1 | char 0 |
  7103. * |-----------------------------------------------------------|
  7104. * | | | ... | char 4 |
  7105. * |-----------------------------------------------------------|
  7106. * - MSG_TYPE
  7107. * Bits 7:0
  7108. * Purpose: identifies this as a test message
  7109. * Value: HTT_MSG_TYPE_TEST
  7110. * - NUM_INTS
  7111. * Bits 15:8
  7112. * Purpose: indicate how many 32-bit integers follow the message header
  7113. * - NUM_CHARS
  7114. * Bits 31:16
  7115. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7116. */
  7117. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7118. #define HTT_RX_TEST_NUM_INTS_S 8
  7119. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7120. #define HTT_RX_TEST_NUM_CHARS_S 16
  7121. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7122. do { \
  7123. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7124. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7125. } while (0)
  7126. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7127. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7128. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7129. do { \
  7130. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7131. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7132. } while (0)
  7133. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7134. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7135. /**
  7136. * @brief target -> host packet log message
  7137. *
  7138. * @details
  7139. * The following field definitions describe the format of the packet log
  7140. * message sent from the target to the host.
  7141. * The message consists of a 4-octet header,followed by a variable number
  7142. * of 32-bit character values.
  7143. *
  7144. * |31 24|23 16|15 8|7 0|
  7145. * |-----------------------------------------------------------|
  7146. * | | | | msg type |
  7147. * |-----------------------------------------------------------|
  7148. * | payload |
  7149. * |-----------------------------------------------------------|
  7150. * - MSG_TYPE
  7151. * Bits 7:0
  7152. * Purpose: identifies this as a test message
  7153. * Value: HTT_MSG_TYPE_PACKETLOG
  7154. */
  7155. PREPACK struct htt_pktlog_msg {
  7156. A_UINT32 header;
  7157. A_UINT32 payload[1 /* or more */];
  7158. } POSTPACK;
  7159. /*
  7160. * Rx reorder statistics
  7161. * NB: all the fields must be defined in 4 octets size.
  7162. */
  7163. struct rx_reorder_stats {
  7164. /* Non QoS MPDUs received */
  7165. A_UINT32 deliver_non_qos;
  7166. /* MPDUs received in-order */
  7167. A_UINT32 deliver_in_order;
  7168. /* Flush due to reorder timer expired */
  7169. A_UINT32 deliver_flush_timeout;
  7170. /* Flush due to move out of window */
  7171. A_UINT32 deliver_flush_oow;
  7172. /* Flush due to DELBA */
  7173. A_UINT32 deliver_flush_delba;
  7174. /* MPDUs dropped due to FCS error */
  7175. A_UINT32 fcs_error;
  7176. /* MPDUs dropped due to monitor mode non-data packet */
  7177. A_UINT32 mgmt_ctrl;
  7178. /* Unicast-data MPDUs dropped due to invalid peer */
  7179. A_UINT32 invalid_peer;
  7180. /* MPDUs dropped due to duplication (non aggregation) */
  7181. A_UINT32 dup_non_aggr;
  7182. /* MPDUs dropped due to processed before */
  7183. A_UINT32 dup_past;
  7184. /* MPDUs dropped due to duplicate in reorder queue */
  7185. A_UINT32 dup_in_reorder;
  7186. /* Reorder timeout happened */
  7187. A_UINT32 reorder_timeout;
  7188. /* invalid bar ssn */
  7189. A_UINT32 invalid_bar_ssn;
  7190. /* reorder reset due to bar ssn */
  7191. A_UINT32 ssn_reset;
  7192. /* Flush due to delete peer */
  7193. A_UINT32 deliver_flush_delpeer;
  7194. /* Flush due to offload */
  7195. A_UINT32 deliver_flush_offload;
  7196. /* Flush due to out of buffer */
  7197. A_UINT32 deliver_flush_oob;
  7198. /* MPDUs dropped due to PN check fail */
  7199. A_UINT32 pn_fail;
  7200. /* MPDUs dropped due to unable to allocate memory */
  7201. A_UINT32 store_fail;
  7202. /* Number of times the tid pool alloc succeeded */
  7203. A_UINT32 tid_pool_alloc_succ;
  7204. /* Number of times the MPDU pool alloc succeeded */
  7205. A_UINT32 mpdu_pool_alloc_succ;
  7206. /* Number of times the MSDU pool alloc succeeded */
  7207. A_UINT32 msdu_pool_alloc_succ;
  7208. /* Number of times the tid pool alloc failed */
  7209. A_UINT32 tid_pool_alloc_fail;
  7210. /* Number of times the MPDU pool alloc failed */
  7211. A_UINT32 mpdu_pool_alloc_fail;
  7212. /* Number of times the MSDU pool alloc failed */
  7213. A_UINT32 msdu_pool_alloc_fail;
  7214. /* Number of times the tid pool freed */
  7215. A_UINT32 tid_pool_free;
  7216. /* Number of times the MPDU pool freed */
  7217. A_UINT32 mpdu_pool_free;
  7218. /* Number of times the MSDU pool freed */
  7219. A_UINT32 msdu_pool_free;
  7220. /* number of MSDUs undelivered to HTT and queued
  7221. * to Data Rx MSDU free list */
  7222. A_UINT32 msdu_queued;
  7223. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7224. A_UINT32 msdu_recycled;
  7225. /* Number of MPDUs with invalid peer but A2 found in AST */
  7226. A_UINT32 invalid_peer_a2_in_ast;
  7227. /* Number of MPDUs with invalid peer but A3 found in AST */
  7228. A_UINT32 invalid_peer_a3_in_ast;
  7229. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7230. A_UINT32 invalid_peer_bmc_mpdus;
  7231. /* Number of MSDUs with err attention word */
  7232. A_UINT32 rxdesc_err_att;
  7233. /* Number of MSDUs with flag of peer_idx_invalid */
  7234. A_UINT32 rxdesc_err_peer_idx_inv;
  7235. /* Number of MSDUs with flag of peer_idx_timeout */
  7236. A_UINT32 rxdesc_err_peer_idx_to;
  7237. /* Number of MSDUs with flag of overflow */
  7238. A_UINT32 rxdesc_err_ov;
  7239. /* Number of MSDUs with flag of msdu_length_err */
  7240. A_UINT32 rxdesc_err_msdu_len;
  7241. /* Number of MSDUs with flag of mpdu_length_err */
  7242. A_UINT32 rxdesc_err_mpdu_len;
  7243. /* Number of MSDUs with flag of tkip_mic_err */
  7244. A_UINT32 rxdesc_err_tkip_mic;
  7245. /* Number of MSDUs with flag of decrypt_err */
  7246. A_UINT32 rxdesc_err_decrypt;
  7247. /* Number of MSDUs with flag of fcs_err */
  7248. A_UINT32 rxdesc_err_fcs;
  7249. /* Number of Unicast (bc_mc bit is not set in attention word)
  7250. * frames with invalid peer handler
  7251. */
  7252. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7253. /* Number of unicast frame directly (direct bit is set in attention word)
  7254. * to DUT with invalid peer handler
  7255. */
  7256. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7257. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7258. * frames with invalid peer handler
  7259. */
  7260. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7261. /* Number of MSDUs dropped due to no first MSDU flag */
  7262. A_UINT32 rxdesc_no_1st_msdu;
  7263. /* Number of MSDUs droped due to ring overflow */
  7264. A_UINT32 msdu_drop_ring_ov;
  7265. /* Number of MSDUs dropped due to FC mismatch */
  7266. A_UINT32 msdu_drop_fc_mismatch;
  7267. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7268. A_UINT32 msdu_drop_mgmt_remote_ring;
  7269. /* Number of MSDUs dropped due to errors not reported in attention word */
  7270. A_UINT32 msdu_drop_misc;
  7271. /* Number of MSDUs go to offload before reorder */
  7272. A_UINT32 offload_msdu_wal;
  7273. /* Number of data frame dropped by offload after reorder */
  7274. A_UINT32 offload_msdu_reorder;
  7275. /* Number of MPDUs with sequence number in the past and within
  7276. the BA window */
  7277. A_UINT32 dup_past_within_window;
  7278. /* Number of MPDUs with sequence number in the past and
  7279. * outside the BA window */
  7280. A_UINT32 dup_past_outside_window;
  7281. /* Number of MSDUs with decrypt/MIC error */
  7282. A_UINT32 rxdesc_err_decrypt_mic;
  7283. /* Number of data MSDUs received on both local and remote rings */
  7284. A_UINT32 data_msdus_on_both_rings;
  7285. };
  7286. /*
  7287. * Rx Remote buffer statistics
  7288. * NB: all the fields must be defined in 4 octets size.
  7289. */
  7290. struct rx_remote_buffer_mgmt_stats {
  7291. /* Total number of MSDUs reaped for Rx processing */
  7292. A_UINT32 remote_reaped;
  7293. /* MSDUs recycled within firmware */
  7294. A_UINT32 remote_recycled;
  7295. /* MSDUs stored by Data Rx */
  7296. A_UINT32 data_rx_msdus_stored;
  7297. /* Number of HTT indications from WAL Rx MSDU */
  7298. A_UINT32 wal_rx_ind;
  7299. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7300. A_UINT32 wal_rx_ind_unconsumed;
  7301. /* Number of HTT indications from Data Rx MSDU */
  7302. A_UINT32 data_rx_ind;
  7303. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7304. A_UINT32 data_rx_ind_unconsumed;
  7305. /* Number of HTT indications from ATHBUF */
  7306. A_UINT32 athbuf_rx_ind;
  7307. /* Number of remote buffers requested for refill */
  7308. A_UINT32 refill_buf_req;
  7309. /* Number of remote buffers filled by the host */
  7310. A_UINT32 refill_buf_rsp;
  7311. /* Number of times MAC hw_index = f/w write_index */
  7312. A_INT32 mac_no_bufs;
  7313. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7314. A_INT32 fw_indices_equal;
  7315. /* Number of times f/w finds no buffers to post */
  7316. A_INT32 host_no_bufs;
  7317. };
  7318. /*
  7319. * TXBF MU/SU packets and NDPA statistics
  7320. * NB: all the fields must be defined in 4 octets size.
  7321. */
  7322. struct rx_txbf_musu_ndpa_pkts_stats {
  7323. /* number of TXBF MU packets received */
  7324. A_UINT32 number_mu_pkts;
  7325. /* number of TXBF SU packets received */
  7326. A_UINT32 number_su_pkts;
  7327. /* number of TXBF directed NDPA */
  7328. A_UINT32 txbf_directed_ndpa_count;
  7329. /* number of TXBF retried NDPA */
  7330. A_UINT32 txbf_ndpa_retry_count;
  7331. /* total number of TXBF NDPA */
  7332. A_UINT32 txbf_total_ndpa_count;
  7333. /* must be set to 0x0 */
  7334. A_UINT32 reserved[3];
  7335. };
  7336. /*
  7337. * htt_dbg_stats_status -
  7338. * present - The requested stats have been delivered in full.
  7339. * This indicates that either the stats information was contained
  7340. * in its entirety within this message, or else this message
  7341. * completes the delivery of the requested stats info that was
  7342. * partially delivered through earlier STATS_CONF messages.
  7343. * partial - The requested stats have been delivered in part.
  7344. * One or more subsequent STATS_CONF messages with the same
  7345. * cookie value will be sent to deliver the remainder of the
  7346. * information.
  7347. * error - The requested stats could not be delivered, for example due
  7348. * to a shortage of memory to construct a message holding the
  7349. * requested stats.
  7350. * invalid - The requested stat type is either not recognized, or the
  7351. * target is configured to not gather the stats type in question.
  7352. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7353. * series_done - This special value indicates that no further stats info
  7354. * elements are present within a series of stats info elems
  7355. * (within a stats upload confirmation message).
  7356. */
  7357. enum htt_dbg_stats_status {
  7358. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7359. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7360. HTT_DBG_STATS_STATUS_ERROR = 2,
  7361. HTT_DBG_STATS_STATUS_INVALID = 3,
  7362. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7363. };
  7364. /**
  7365. * @brief target -> host statistics upload
  7366. *
  7367. * @details
  7368. * The following field definitions describe the format of the HTT target
  7369. * to host stats upload confirmation message.
  7370. * The message contains a cookie echoed from the HTT host->target stats
  7371. * upload request, which identifies which request the confirmation is
  7372. * for, and a series of tag-length-value stats information elements.
  7373. * The tag-length header for each stats info element also includes a
  7374. * status field, to indicate whether the request for the stat type in
  7375. * question was fully met, partially met, unable to be met, or invalid
  7376. * (if the stat type in question is disabled in the target).
  7377. * A special value of all 1's in this status field is used to indicate
  7378. * the end of the series of stats info elements.
  7379. *
  7380. *
  7381. * |31 16|15 8|7 5|4 0|
  7382. * |------------------------------------------------------------|
  7383. * | reserved | msg type |
  7384. * |------------------------------------------------------------|
  7385. * | cookie LSBs |
  7386. * |------------------------------------------------------------|
  7387. * | cookie MSBs |
  7388. * |------------------------------------------------------------|
  7389. * | stats entry length | reserved | S |stat type|
  7390. * |------------------------------------------------------------|
  7391. * | |
  7392. * | type-specific stats info |
  7393. * | |
  7394. * |------------------------------------------------------------|
  7395. * | stats entry length | reserved | S |stat type|
  7396. * |------------------------------------------------------------|
  7397. * | |
  7398. * | type-specific stats info |
  7399. * | |
  7400. * |------------------------------------------------------------|
  7401. * | n/a | reserved | 111 | n/a |
  7402. * |------------------------------------------------------------|
  7403. * Header fields:
  7404. * - MSG_TYPE
  7405. * Bits 7:0
  7406. * Purpose: identifies this is a statistics upload confirmation message
  7407. * Value: 0x9
  7408. * - COOKIE_LSBS
  7409. * Bits 31:0
  7410. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7411. * message with its preceding host->target stats request message.
  7412. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7413. * - COOKIE_MSBS
  7414. * Bits 31:0
  7415. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7416. * message with its preceding host->target stats request message.
  7417. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7418. *
  7419. * Stats Information Element tag-length header fields:
  7420. * - STAT_TYPE
  7421. * Bits 4:0
  7422. * Purpose: identifies the type of statistics info held in the
  7423. * following information element
  7424. * Value: htt_dbg_stats_type
  7425. * - STATUS
  7426. * Bits 7:5
  7427. * Purpose: indicate whether the requested stats are present
  7428. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7429. * the completion of the stats entry series
  7430. * - LENGTH
  7431. * Bits 31:16
  7432. * Purpose: indicate the stats information size
  7433. * Value: This field specifies the number of bytes of stats information
  7434. * that follows the element tag-length header.
  7435. * It is expected but not required that this length is a multiple of
  7436. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7437. * subsequent stats entry header will begin on a 4-byte aligned
  7438. * boundary.
  7439. */
  7440. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7441. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7442. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7443. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7444. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7445. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7446. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7447. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7448. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7449. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7450. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7451. do { \
  7452. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7453. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7454. } while (0)
  7455. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7456. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7457. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7458. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7461. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7462. } while (0)
  7463. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7464. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7465. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7466. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7467. do { \
  7468. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7469. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7470. } while (0)
  7471. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7472. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7473. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7474. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7475. #define HTT_MAX_AGGR 64
  7476. #define HTT_HL_MAX_AGGR 18
  7477. /**
  7478. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7479. *
  7480. * @details
  7481. * The following field definitions describe the format of the HTT host
  7482. * to target frag_desc/msdu_ext bank configuration message.
  7483. * The message contains the based address and the min and max id of the
  7484. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7485. * MSDU_EXT/FRAG_DESC.
  7486. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7487. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7488. * the hardware does the mapping/translation.
  7489. *
  7490. * Total banks that can be configured is configured to 16.
  7491. *
  7492. * This should be called before any TX has be initiated by the HTT
  7493. *
  7494. * |31 16|15 8|7 5|4 0|
  7495. * |------------------------------------------------------------|
  7496. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7497. * |------------------------------------------------------------|
  7498. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7499. #if HTT_PADDR64
  7500. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7501. #endif
  7502. * |------------------------------------------------------------|
  7503. * | ... |
  7504. * |------------------------------------------------------------|
  7505. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7506. #if HTT_PADDR64
  7507. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7508. #endif
  7509. * |------------------------------------------------------------|
  7510. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7511. * |------------------------------------------------------------|
  7512. * | ... |
  7513. * |------------------------------------------------------------|
  7514. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7515. * |------------------------------------------------------------|
  7516. * Header fields:
  7517. * - MSG_TYPE
  7518. * Bits 7:0
  7519. * Value: 0x6
  7520. * for systems with 64-bit format for bus addresses:
  7521. * - BANKx_BASE_ADDRESS_LO
  7522. * Bits 31:0
  7523. * Purpose: Provide a mechanism to specify the base address of the
  7524. * MSDU_EXT bank physical/bus address.
  7525. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  7526. * - BANKx_BASE_ADDRESS_HI
  7527. * Bits 31:0
  7528. * Purpose: Provide a mechanism to specify the base address of the
  7529. * MSDU_EXT bank physical/bus address.
  7530. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  7531. * for systems with 32-bit format for bus addresses:
  7532. * - BANKx_BASE_ADDRESS
  7533. * Bits 31:0
  7534. * Purpose: Provide a mechanism to specify the base address of the
  7535. * MSDU_EXT bank physical/bus address.
  7536. * Value: MSDU_EXT bank physical / bus address
  7537. * - BANKx_MIN_ID
  7538. * Bits 15:0
  7539. * Purpose: Provide a mechanism to specify the min index that needs to
  7540. * mapped.
  7541. * - BANKx_MAX_ID
  7542. * Bits 31:16
  7543. * Purpose: Provide a mechanism to specify the max index that needs to
  7544. * mapped.
  7545. *
  7546. */
  7547. /** @todo Compress the fields to fit MAX HTT Message size, until then
  7548. * configure to a safe value.
  7549. * @note MAX supported banks is 16.
  7550. */
  7551. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  7552. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  7553. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  7554. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  7555. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  7556. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  7557. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  7558. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  7559. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  7560. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  7561. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  7562. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  7563. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  7564. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  7565. do { \
  7566. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  7567. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  7568. } while (0)
  7569. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  7570. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  7571. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  7572. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  7575. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  7576. } while (0)
  7577. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  7578. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  7579. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  7580. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  7581. do { \
  7582. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  7583. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  7584. } while (0)
  7585. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  7586. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  7587. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  7588. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  7591. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  7592. } while (0)
  7593. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  7594. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  7595. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  7596. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  7597. do { \
  7598. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  7599. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  7600. } while (0)
  7601. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  7602. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  7603. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  7604. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  7605. do { \
  7606. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  7607. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  7608. } while (0)
  7609. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  7610. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  7611. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  7612. /*
  7613. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  7614. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  7615. * addresses are stored in a XXX-bit field.
  7616. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  7617. * htt_tx_frag_desc64_bank_cfg_t structs.
  7618. */
  7619. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  7620. _paddr_bits_, \
  7621. _paddr__bank_base_address_) \
  7622. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  7623. /** word 0 \
  7624. * msg_type: 8, \
  7625. * pdev_id: 2, \
  7626. * swap: 1, \
  7627. * reserved0: 5, \
  7628. * num_banks: 8, \
  7629. * desc_size: 8; \
  7630. */ \
  7631. A_UINT32 word0; \
  7632. /* \
  7633. * If bank_base_address is 64 bits, the upper / lower
  7634. * halves are stored \
  7635. * in little-endian order (bytes 0-3 in the first A_UINT32,
  7636. * bytes 4-7 in the second A_UINT32). \
  7637. */ \
  7638. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7639. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7640. } POSTPACK
  7641. /* define htt_tx_frag_desc32_bank_cfg_t */
  7642. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  7643. /* define htt_tx_frag_desc64_bank_cfg_t */
  7644. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  7645. /*
  7646. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  7647. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  7648. */
  7649. #if HTT_PADDR64
  7650. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  7651. #else
  7652. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  7653. #endif
  7654. /**
  7655. * @brief target -> host HTT TX Credit total count update message definition
  7656. *
  7657. *|31 16|15|14 9| 8 |7 0 |
  7658. *|---------------------+--+----------+-------+----------|
  7659. *|cur htt credit delta | Q| reserved | sign | msg type |
  7660. *|------------------------------------------------------|
  7661. *
  7662. * Header fields:
  7663. * - MSG_TYPE
  7664. * Bits 7:0
  7665. * Purpose: identifies this as a htt tx credit delta update message
  7666. * Value: 0xe
  7667. * - SIGN
  7668. * Bits 8
  7669. * identifies whether credit delta is positive or negative
  7670. * Value:
  7671. * - 0x0: credit delta is positive, rebalance in some buffers
  7672. * - 0x1: credit delta is negative, rebalance out some buffers
  7673. * - reserved
  7674. * Bits 14:9
  7675. * Value: 0x0
  7676. * - TXQ_GRP
  7677. * Bit 15
  7678. * Purpose: indicates whether any tx queue group information elements
  7679. * are appended to the tx credit update message
  7680. * Value: 0 -> no tx queue group information element is present
  7681. * 1 -> a tx queue group information element immediately follows
  7682. * - DELTA_COUNT
  7683. * Bits 31:16
  7684. * Purpose: Specify current htt credit delta absolute count
  7685. */
  7686. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  7687. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  7688. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  7689. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  7690. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  7691. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  7692. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  7695. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  7696. } while (0)
  7697. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  7698. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  7699. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  7702. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  7703. } while (0)
  7704. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  7705. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  7706. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  7709. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  7710. } while (0)
  7711. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  7712. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  7713. #define HTT_TX_CREDIT_MSG_BYTES 4
  7714. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  7715. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  7716. /**
  7717. * @brief HTT WDI_IPA Operation Response Message
  7718. *
  7719. * @details
  7720. * HTT WDI_IPA Operation Response message is sent by target
  7721. * to host confirming suspend or resume operation.
  7722. * |31 24|23 16|15 8|7 0|
  7723. * |----------------+----------------+----------------+----------------|
  7724. * | op_code | Rsvd | msg_type |
  7725. * |-------------------------------------------------------------------|
  7726. * | Rsvd | Response len |
  7727. * |-------------------------------------------------------------------|
  7728. * | |
  7729. * | Response-type specific info |
  7730. * | |
  7731. * | |
  7732. * |-------------------------------------------------------------------|
  7733. * Header fields:
  7734. * - MSG_TYPE
  7735. * Bits 7:0
  7736. * Purpose: Identifies this as WDI_IPA Operation Response message
  7737. * value: = 0x13
  7738. * - OP_CODE
  7739. * Bits 31:16
  7740. * Purpose: Identifies the operation target is responding to
  7741. * (e.g. TX suspend)
  7742. * value: = enum htt_wdi_ipa_op_code
  7743. * - RSP_LEN
  7744. * Bits 16:0
  7745. * Purpose: length for the response-type specific info
  7746. * value: = length in bytes for response-type specific info
  7747. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  7748. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  7749. */
  7750. PREPACK struct htt_wdi_ipa_op_response_t {
  7751. /* DWORD 0: flags and meta-data */
  7752. A_UINT32
  7753. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  7754. reserved1:8,
  7755. op_code:16;
  7756. A_UINT32
  7757. rsp_len:16,
  7758. reserved2:16;
  7759. } POSTPACK;
  7760. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  7761. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  7762. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  7763. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  7764. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  7765. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  7766. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  7767. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  7768. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  7769. do { \
  7770. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  7771. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  7772. } while (0)
  7773. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  7774. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  7775. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  7776. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  7777. do { \
  7778. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  7779. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  7780. } while (0)
  7781. enum htt_phy_mode {
  7782. htt_phy_mode_11a = 0,
  7783. htt_phy_mode_11g = 1,
  7784. htt_phy_mode_11b = 2,
  7785. htt_phy_mode_11g_only = 3,
  7786. htt_phy_mode_11na_ht20 = 4,
  7787. htt_phy_mode_11ng_ht20 = 5,
  7788. htt_phy_mode_11na_ht40 = 6,
  7789. htt_phy_mode_11ng_ht40 = 7,
  7790. htt_phy_mode_11ac_vht20 = 8,
  7791. htt_phy_mode_11ac_vht40 = 9,
  7792. htt_phy_mode_11ac_vht80 = 10,
  7793. htt_phy_mode_11ac_vht20_2g = 11,
  7794. htt_phy_mode_11ac_vht40_2g = 12,
  7795. htt_phy_mode_11ac_vht80_2g = 13,
  7796. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  7797. htt_phy_mode_11ac_vht160 = 15,
  7798. htt_phy_mode_max,
  7799. };
  7800. /**
  7801. * @brief target -> host HTT channel change indication
  7802. * @details
  7803. * Specify when a channel change occurs.
  7804. * This allows the host to precisely determine which rx frames arrived
  7805. * on the old channel and which rx frames arrived on the new channel.
  7806. *
  7807. *|31 |7 0 |
  7808. *|-------------------------------------------+----------|
  7809. *| reserved | msg type |
  7810. *|------------------------------------------------------|
  7811. *| primary_chan_center_freq_mhz |
  7812. *|------------------------------------------------------|
  7813. *| contiguous_chan1_center_freq_mhz |
  7814. *|------------------------------------------------------|
  7815. *| contiguous_chan2_center_freq_mhz |
  7816. *|------------------------------------------------------|
  7817. *| phy_mode |
  7818. *|------------------------------------------------------|
  7819. *
  7820. * Header fields:
  7821. * - MSG_TYPE
  7822. * Bits 7:0
  7823. * Purpose: identifies this as a htt channel change indication message
  7824. * Value: 0x15
  7825. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  7826. * Bits 31:0
  7827. * Purpose: identify the (center of the) new 20 MHz primary channel
  7828. * Value: center frequency of the 20 MHz primary channel, in MHz units
  7829. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  7830. * Bits 31:0
  7831. * Purpose: identify the (center of the) contiguous frequency range
  7832. * comprising the new channel.
  7833. * For example, if the new channel is a 80 MHz channel extending
  7834. * 60 MHz beyond the primary channel, this field would be 30 larger
  7835. * than the primary channel center frequency field.
  7836. * Value: center frequency of the contiguous frequency range comprising
  7837. * the full channel in MHz units
  7838. * (80+80 channels also use the CONTIG_CHAN2 field)
  7839. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  7840. * Bits 31:0
  7841. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  7842. * within a VHT 80+80 channel.
  7843. * This field is only relevant for VHT 80+80 channels.
  7844. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  7845. * channel (arbitrary value for cases besides VHT 80+80)
  7846. * - PHY_MODE
  7847. * Bits 31:0
  7848. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  7849. * and band
  7850. * Value: htt_phy_mode enum value
  7851. */
  7852. PREPACK struct htt_chan_change_t {
  7853. /* DWORD 0: flags and meta-data */
  7854. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  7855. reserved1:24;
  7856. A_UINT32 primary_chan_center_freq_mhz;
  7857. A_UINT32 contig_chan1_center_freq_mhz;
  7858. A_UINT32 contig_chan2_center_freq_mhz;
  7859. A_UINT32 phy_mode;
  7860. } POSTPACK;
  7861. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  7862. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  7863. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  7864. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  7865. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  7866. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  7867. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  7868. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  7869. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  7870. do { \
  7871. HTT_CHECK_SET_VAL( \
  7872. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  7873. (word) |= (value) << \
  7874. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  7875. } while (0)
  7876. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  7877. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  7878. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  7879. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  7880. do { \
  7881. HTT_CHECK_SET_VAL( \
  7882. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  7883. (word) |= (value) << \
  7884. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  7885. } while (0)
  7886. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  7887. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  7888. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  7889. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  7890. do { \
  7891. HTT_CHECK_SET_VAL( \
  7892. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  7893. (word) |= (value) << \
  7894. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  7895. } while (0)
  7896. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  7897. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  7898. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  7899. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  7900. do { \
  7901. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  7902. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  7903. } while (0)
  7904. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  7905. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  7906. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  7907. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  7908. /**
  7909. * @brief rx offload packet error message
  7910. *
  7911. * @details
  7912. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  7913. * of target payload like mic err.
  7914. *
  7915. * |31 24|23 16|15 8|7 0|
  7916. * |----------------+----------------+----------------+----------------|
  7917. * | tid | vdev_id | msg_sub_type | msg_type |
  7918. * |-------------------------------------------------------------------|
  7919. * : (sub-type dependent content) :
  7920. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  7921. * Header fields:
  7922. * - msg_type
  7923. * Bits 7:0
  7924. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  7925. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  7926. * - msg_sub_type
  7927. * Bits 15:8
  7928. * Purpose: Identifies which type of rx error is reported by this message
  7929. * value: htt_rx_ofld_pkt_err_type
  7930. * - vdev_id
  7931. * Bits 23:16
  7932. * Purpose: Identifies which vdev received the erroneous rx frame
  7933. * value:
  7934. * - tid
  7935. * Bits 31:24
  7936. * Purpose: Identifies the traffic type of the rx frame
  7937. * value:
  7938. *
  7939. * - The payload fields used if the sub-type == MIC error are shown below.
  7940. * Note - MIC err is per MSDU, while PN is per MPDU.
  7941. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  7942. * with MIC err in A-MSDU case, so FW will send only one HTT message
  7943. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  7944. * instead of sending separate HTT messages for each wrong MSDU within
  7945. * the MPDU.
  7946. *
  7947. * |31 24|23 16|15 8|7 0|
  7948. * |----------------+----------------+----------------+----------------|
  7949. * | Rsvd | key_id | peer_id |
  7950. * |-------------------------------------------------------------------|
  7951. * | receiver MAC addr 31:0 |
  7952. * |-------------------------------------------------------------------|
  7953. * | Rsvd | receiver MAC addr 47:32 |
  7954. * |-------------------------------------------------------------------|
  7955. * | transmitter MAC addr 31:0 |
  7956. * |-------------------------------------------------------------------|
  7957. * | Rsvd | transmitter MAC addr 47:32 |
  7958. * |-------------------------------------------------------------------|
  7959. * | PN 31:0 |
  7960. * |-------------------------------------------------------------------|
  7961. * | Rsvd | PN 47:32 |
  7962. * |-------------------------------------------------------------------|
  7963. * - peer_id
  7964. * Bits 15:0
  7965. * Purpose: identifies which peer is frame is from
  7966. * value:
  7967. * - key_id
  7968. * Bits 23:16
  7969. * Purpose: identifies key_id of rx frame
  7970. * value:
  7971. * - RA_31_0 (receiver MAC addr 31:0)
  7972. * Bits 31:0
  7973. * Purpose: identifies by MAC address which vdev received the frame
  7974. * value: MAC address lower 4 bytes
  7975. * - RA_47_32 (receiver MAC addr 47:32)
  7976. * Bits 15:0
  7977. * Purpose: identifies by MAC address which vdev received the frame
  7978. * value: MAC address upper 2 bytes
  7979. * - TA_31_0 (transmitter MAC addr 31:0)
  7980. * Bits 31:0
  7981. * Purpose: identifies by MAC address which peer transmitted the frame
  7982. * value: MAC address lower 4 bytes
  7983. * - TA_47_32 (transmitter MAC addr 47:32)
  7984. * Bits 15:0
  7985. * Purpose: identifies by MAC address which peer transmitted the frame
  7986. * value: MAC address upper 2 bytes
  7987. * - PN_31_0
  7988. * Bits 31:0
  7989. * Purpose: Identifies pn of rx frame
  7990. * value: PN lower 4 bytes
  7991. * - PN_47_32
  7992. * Bits 15:0
  7993. * Purpose: Identifies pn of rx frame
  7994. * value:
  7995. * TKIP or CCMP: PN upper 2 bytes
  7996. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  7997. */
  7998. enum htt_rx_ofld_pkt_err_type {
  7999. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8000. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8001. };
  8002. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8003. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8004. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8005. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8006. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8007. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8008. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8009. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8010. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8011. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8012. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8013. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8014. do { \
  8015. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8016. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8017. } while (0)
  8018. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8019. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  8020. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8021. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8024. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8025. } while (0)
  8026. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8027. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8028. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8031. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8032. } while (0)
  8033. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8034. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8035. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8036. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8037. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8038. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8039. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8040. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8041. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8042. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8043. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8044. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8045. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8047. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8048. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8049. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8050. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8051. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8052. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8053. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8055. do { \
  8056. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8057. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8058. } while (0)
  8059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8060. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8061. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8065. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8066. } while (0)
  8067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8068. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8069. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8071. do { \
  8072. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8073. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8074. } while (0)
  8075. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8076. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8077. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8079. do { \
  8080. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8081. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8082. } while (0)
  8083. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8084. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8085. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8086. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8087. do { \
  8088. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8089. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8090. } while (0)
  8091. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8092. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8093. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8094. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8095. do { \
  8096. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8097. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8098. } while (0)
  8099. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8100. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8101. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8102. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8103. do { \
  8104. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8105. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8106. } while (0)
  8107. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8108. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8109. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8110. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8111. do { \
  8112. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8113. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8114. } while (0)
  8115. /**
  8116. * @brief peer rate report message
  8117. *
  8118. * @details
  8119. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8120. * justified rate of all the peers.
  8121. *
  8122. * |31 24|23 16|15 8|7 0|
  8123. * |----------------+----------------+----------------+----------------|
  8124. * | peer_count | | msg_type |
  8125. * |-------------------------------------------------------------------|
  8126. * : Payload (variant number of peer rate report) :
  8127. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8128. * Header fields:
  8129. * - msg_type
  8130. * Bits 7:0
  8131. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8132. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8133. * - reserved
  8134. * Bits 15:8
  8135. * Purpose:
  8136. * value:
  8137. * - peer_count
  8138. * Bits 31:16
  8139. * Purpose: Specify how many peer rate report elements are present in the payload.
  8140. * value:
  8141. *
  8142. * Payload:
  8143. * There are variant number of peer rate report follow the first 32 bits.
  8144. * The peer rate report is defined as follows.
  8145. *
  8146. * |31 20|19 16|15 0|
  8147. * |-----------------------+---------+---------------------------------|-
  8148. * | reserved | phy | peer_id | \
  8149. * |-------------------------------------------------------------------| -> report #0
  8150. * | rate | /
  8151. * |-----------------------+---------+---------------------------------|-
  8152. * | reserved | phy | peer_id | \
  8153. * |-------------------------------------------------------------------| -> report #1
  8154. * | rate | /
  8155. * |-----------------------+---------+---------------------------------|-
  8156. * | reserved | phy | peer_id | \
  8157. * |-------------------------------------------------------------------| -> report #2
  8158. * | rate | /
  8159. * |-------------------------------------------------------------------|-
  8160. * : :
  8161. * : :
  8162. * : :
  8163. * :-------------------------------------------------------------------:
  8164. *
  8165. * - peer_id
  8166. * Bits 15:0
  8167. * Purpose: identify the peer
  8168. * value:
  8169. * - phy
  8170. * Bits 19:16
  8171. * Purpose: identify which phy is in use
  8172. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8173. * Please see enum htt_peer_report_phy_type for detail.
  8174. * - reserved
  8175. * Bits 31:20
  8176. * Purpose:
  8177. * value:
  8178. * - rate
  8179. * Bits 31:0
  8180. * Purpose: represent the justified rate of the peer specified by peer_id
  8181. * value:
  8182. */
  8183. enum htt_peer_rate_report_phy_type {
  8184. HTT_PEER_RATE_REPORT_11B = 0,
  8185. HTT_PEER_RATE_REPORT_11A_G,
  8186. HTT_PEER_RATE_REPORT_11N,
  8187. HTT_PEER_RATE_REPORT_11AC,
  8188. };
  8189. #define HTT_PEER_RATE_REPORT_SIZE 8
  8190. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8191. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8192. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8193. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8194. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8195. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8196. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8197. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8198. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8199. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8200. do { \
  8201. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8202. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8203. } while (0)
  8204. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8205. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8206. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8207. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8208. do { \
  8209. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8210. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8211. } while (0)
  8212. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8213. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8214. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8215. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8216. do { \
  8217. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8218. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8219. } while (0)
  8220. /**
  8221. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8222. *
  8223. * @details
  8224. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8225. * a flow of descriptors.
  8226. *
  8227. * This message is in TLV format and indicates the parameters to be setup a
  8228. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8229. * receive descriptors from a specified pool.
  8230. *
  8231. * The message would appear as follows:
  8232. *
  8233. * |31 24|23 16|15 8|7 0|
  8234. * |----------------+----------------+----------------+----------------|
  8235. * header | reserved | num_flows | msg_type |
  8236. * |-------------------------------------------------------------------|
  8237. * | |
  8238. * : payload :
  8239. * | |
  8240. * |-------------------------------------------------------------------|
  8241. *
  8242. * The header field is one DWORD long and is interpreted as follows:
  8243. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8244. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8245. * this message
  8246. * b'16-31 - reserved: These bits are reserved for future use
  8247. *
  8248. * Payload:
  8249. * The payload would contain multiple objects of the following structure. Each
  8250. * object represents a flow.
  8251. *
  8252. * |31 24|23 16|15 8|7 0|
  8253. * |----------------+----------------+----------------+----------------|
  8254. * header | reserved | num_flows | msg_type |
  8255. * |-------------------------------------------------------------------|
  8256. * payload0| flow_type |
  8257. * |-------------------------------------------------------------------|
  8258. * | flow_id |
  8259. * |-------------------------------------------------------------------|
  8260. * | reserved0 | flow_pool_id |
  8261. * |-------------------------------------------------------------------|
  8262. * | reserved1 | flow_pool_size |
  8263. * |-------------------------------------------------------------------|
  8264. * | reserved2 |
  8265. * |-------------------------------------------------------------------|
  8266. * payload1| flow_type |
  8267. * |-------------------------------------------------------------------|
  8268. * | flow_id |
  8269. * |-------------------------------------------------------------------|
  8270. * | reserved0 | flow_pool_id |
  8271. * |-------------------------------------------------------------------|
  8272. * | reserved1 | flow_pool_size |
  8273. * |-------------------------------------------------------------------|
  8274. * | reserved2 |
  8275. * |-------------------------------------------------------------------|
  8276. * | . |
  8277. * | . |
  8278. * | . |
  8279. * |-------------------------------------------------------------------|
  8280. *
  8281. * Each payload is 5 DWORDS long and is interpreted as follows:
  8282. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8283. * this flow is associated. It can be VDEV, peer,
  8284. * or tid (AC). Based on enum htt_flow_type.
  8285. *
  8286. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8287. * object. For flow_type vdev it is set to the
  8288. * vdevid, for peer it is peerid and for tid, it is
  8289. * tid_num.
  8290. *
  8291. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8292. * in the host for this flow
  8293. * b'16:31 - reserved0: This field in reserved for the future. In case
  8294. * we have a hierarchical implementation (HCM) of
  8295. * pools, it can be used to indicate the ID of the
  8296. * parent-pool.
  8297. *
  8298. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8299. * Descriptors for this flow will be
  8300. * allocated from this pool in the host.
  8301. * b'16:31 - reserved1: This field in reserved for the future. In case
  8302. * we have a hierarchical implementation of pools,
  8303. * it can be used to indicate the max number of
  8304. * descriptors in the pool. The b'0:15 can be used
  8305. * to indicate min number of descriptors in the
  8306. * HCM scheme.
  8307. *
  8308. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8309. * we have a hierarchical implementation of pools,
  8310. * b'0:15 can be used to indicate the
  8311. * priority-based borrowing (PBB) threshold of
  8312. * the flow's pool. The b'16:31 are still left
  8313. * reserved.
  8314. */
  8315. enum htt_flow_type {
  8316. FLOW_TYPE_VDEV = 0,
  8317. /* Insert new flow types above this line */
  8318. };
  8319. PREPACK struct htt_flow_pool_map_payload_t {
  8320. A_UINT32 flow_type;
  8321. A_UINT32 flow_id;
  8322. A_UINT32 flow_pool_id:16,
  8323. reserved0:16;
  8324. A_UINT32 flow_pool_size:16,
  8325. reserved1:16;
  8326. A_UINT32 reserved2;
  8327. } POSTPACK;
  8328. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8329. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8330. (sizeof(struct htt_flow_pool_map_payload_t))
  8331. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8332. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8333. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8334. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8335. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8336. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8337. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8338. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8339. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8340. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8341. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8342. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8343. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8344. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8345. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8346. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8347. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8348. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8349. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8350. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8351. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8352. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8353. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8356. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8357. } while (0)
  8358. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8359. do { \
  8360. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8361. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8362. } while (0)
  8363. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8364. do { \
  8365. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8366. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8367. } while (0)
  8368. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8369. do { \
  8370. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8371. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8372. } while (0)
  8373. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8374. do { \
  8375. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8376. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8377. } while (0)
  8378. /**
  8379. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8380. *
  8381. * @details
  8382. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8383. * down a flow of descriptors.
  8384. * This message indicates that for the flow (whose ID is provided) is wanting
  8385. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8386. * pool of descriptors from where descriptors are being allocated for this
  8387. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8388. * be unmapped by the host.
  8389. *
  8390. * The message would appear as follows:
  8391. *
  8392. * |31 24|23 16|15 8|7 0|
  8393. * |----------------+----------------+----------------+----------------|
  8394. * | reserved0 | msg_type |
  8395. * |-------------------------------------------------------------------|
  8396. * | flow_type |
  8397. * |-------------------------------------------------------------------|
  8398. * | flow_id |
  8399. * |-------------------------------------------------------------------|
  8400. * | reserved1 | flow_pool_id |
  8401. * |-------------------------------------------------------------------|
  8402. *
  8403. * The message is interpreted as follows:
  8404. * dword0 - b'0:7 - msg_type: This will be set to
  8405. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8406. * b'8:31 - reserved0: Reserved for future use
  8407. *
  8408. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8409. * this flow is associated. It can be VDEV, peer,
  8410. * or tid (AC). Based on enum htt_flow_type.
  8411. *
  8412. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8413. * object. For flow_type vdev it is set to the
  8414. * vdevid, for peer it is peerid and for tid, it is
  8415. * tid_num.
  8416. *
  8417. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8418. * used in the host for this flow
  8419. * b'16:31 - reserved0: This field in reserved for the future.
  8420. *
  8421. */
  8422. PREPACK struct htt_flow_pool_unmap_t {
  8423. A_UINT32 msg_type:8,
  8424. reserved0:24;
  8425. A_UINT32 flow_type;
  8426. A_UINT32 flow_id;
  8427. A_UINT32 flow_pool_id:16,
  8428. reserved1:16;
  8429. } POSTPACK;
  8430. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8431. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8432. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8433. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8434. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8435. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8436. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8437. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8438. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8439. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8440. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8441. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8442. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8443. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8444. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8445. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8446. do { \
  8447. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8448. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8449. } while (0)
  8450. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8451. do { \
  8452. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8453. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8454. } while (0)
  8455. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8456. do { \
  8457. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8458. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8459. } while (0)
  8460. /**
  8461. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8462. *
  8463. * @details
  8464. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8465. * SRNG ring setup is done
  8466. *
  8467. * This message indicates whether the last setup operation is successful.
  8468. * It will be sent to host when host set respose_required bit in
  8469. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8470. * The message would appear as follows:
  8471. *
  8472. * |31 24|23 16|15 8|7 0|
  8473. * |--------------- +----------------+----------------+----------------|
  8474. * | setup_status | ring_id | pdev_id | msg_type |
  8475. * |-------------------------------------------------------------------|
  8476. *
  8477. * The message is interpreted as follows:
  8478. * dword0 - b'0:7 - msg_type: This will be set to
  8479. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8480. * b'8:15 - pdev_id:
  8481. * 0 (for rings at SOC/UMAC level),
  8482. * 1/2/3 mac id (for rings at LMAC level)
  8483. * b'16:23 - ring_id: Identify the ring which is set up
  8484. * More details can be got from enum htt_srng_ring_id
  8485. * b'24:31 - setup_status: Indicate status of setup operation
  8486. * Refer to htt_ring_setup_status
  8487. */
  8488. PREPACK struct htt_sring_setup_done_t {
  8489. A_UINT32 msg_type: 8,
  8490. pdev_id: 8,
  8491. ring_id: 8,
  8492. setup_status: 8;
  8493. } POSTPACK;
  8494. enum htt_ring_setup_status {
  8495. htt_ring_setup_status_ok = 0,
  8496. htt_ring_setup_status_error,
  8497. };
  8498. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8499. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8500. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8501. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8502. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8503. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8504. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8505. do { \
  8506. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8507. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8508. } while (0)
  8509. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8510. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8511. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8512. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8513. HTT_SRING_SETUP_DONE_RING_ID_S)
  8514. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8515. do { \
  8516. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8517. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8518. } while (0)
  8519. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8520. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8521. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8522. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8523. HTT_SRING_SETUP_DONE_STATUS_S)
  8524. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8525. do { \
  8526. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8527. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8528. } while (0)
  8529. /**
  8530. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8531. *
  8532. * @details
  8533. * HTT TX map flow entry with tqm flow pointer
  8534. * Sent from firmware to host to add tqm flow pointer in corresponding
  8535. * flow search entry. Flow metadata is replayed back to host as part of this
  8536. * struct to enable host to find the specific flow search entry
  8537. *
  8538. * The message would appear as follows:
  8539. *
  8540. * |31 28|27 18|17 14|13 8|7 0|
  8541. * |-------+------------------------------------------+----------------|
  8542. * | rsvd0 | fse_hsh_idx | msg_type |
  8543. * |-------------------------------------------------------------------|
  8544. * | rsvd1 | tid | peer_id |
  8545. * |-------------------------------------------------------------------|
  8546. * | tqm_flow_pntr_lo |
  8547. * |-------------------------------------------------------------------|
  8548. * | tqm_flow_pntr_hi |
  8549. * |-------------------------------------------------------------------|
  8550. * | fse_meta_data |
  8551. * |-------------------------------------------------------------------|
  8552. *
  8553. * The message is interpreted as follows:
  8554. *
  8555. * dword0 - b'0:7 - msg_type: This will be set to
  8556. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  8557. *
  8558. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  8559. * for this flow entry
  8560. *
  8561. * dword0 - b'28:31 - rsvd0: Reserved for future use
  8562. *
  8563. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  8564. *
  8565. * dword1 - b'14:17 - tid
  8566. *
  8567. * dword1 - b'18:31 - rsvd1: Reserved for future use
  8568. *
  8569. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  8570. *
  8571. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  8572. *
  8573. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  8574. * given by host
  8575. */
  8576. PREPACK struct htt_tx_map_flow_info {
  8577. A_UINT32
  8578. msg_type: 8,
  8579. fse_hsh_idx: 20,
  8580. rsvd0: 4;
  8581. A_UINT32
  8582. peer_id: 14,
  8583. tid: 4,
  8584. rsvd1: 14;
  8585. A_UINT32 tqm_flow_pntr_lo;
  8586. A_UINT32 tqm_flow_pntr_hi;
  8587. struct htt_tx_flow_metadata fse_meta_data;
  8588. } POSTPACK;
  8589. /* DWORD 0 */
  8590. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  8591. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  8592. /* DWORD 1 */
  8593. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  8594. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  8595. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  8596. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  8597. /* DWORD 0 */
  8598. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  8599. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  8600. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  8601. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  8602. do { \
  8603. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  8604. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  8605. } while (0)
  8606. /* DWORD 1 */
  8607. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  8608. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  8609. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  8610. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  8613. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  8614. } while (0)
  8615. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  8616. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  8617. HTT_TX_MAP_FLOW_INFO_TID_S)
  8618. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  8621. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  8622. } while (0)
  8623. #endif