htt.h 1007 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. * 3.116 Add HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE flag.
  238. * 3.117 Add HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND def.
  239. * 3.118 Add HTT_T2H_MSG_TYPE_RX_DATA_IND and _SOFT_UMAC_TX_COMPL_IND defs.
  240. * 3.119 Add RX_PEER_META_DATA V1A and V1B defs.
  241. * 3.120 Add HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND, _RESP defs.
  242. * 3.121 Add HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND def.
  243. * 3.122 Add is_umac_hang flag in H2T UMAC_HANG_RECOVERY_SOC_START_PRE_RESET msg
  244. * 3.123 Add HTT_OPTION_TLV_TCL_METADATA_V21 def.
  245. */
  246. #define HTT_CURRENT_VERSION_MAJOR 3
  247. #define HTT_CURRENT_VERSION_MINOR 123
  248. #define HTT_NUM_TX_FRAG_DESC 1024
  249. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  250. #define HTT_CHECK_SET_VAL(field, val) \
  251. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  252. /* macros to assist in sign-extending fields from HTT messages */
  253. #define HTT_SIGN_BIT_MASK(field) \
  254. ((field ## _M + (1 << field ## _S)) >> 1)
  255. #define HTT_SIGN_BIT(_val, field) \
  256. (_val & HTT_SIGN_BIT_MASK(field))
  257. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  258. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  259. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  260. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  261. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  262. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  263. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  264. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  265. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  266. /*
  267. * TEMPORARY:
  268. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  269. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  270. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  271. * updated.
  272. */
  273. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  274. /*
  275. * TEMPORARY:
  276. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  277. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  278. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  279. * updated.
  280. */
  281. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  282. /**
  283. * htt_dbg_stats_type -
  284. * bit positions for each stats type within a stats type bitmask
  285. * The bitmask contains 24 bits.
  286. */
  287. enum htt_dbg_stats_type {
  288. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  289. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  290. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  291. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  292. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  293. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  294. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  295. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  296. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  297. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  298. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  299. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  300. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  301. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  302. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  303. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  304. /* bits 16-23 currently reserved */
  305. /* keep this last */
  306. HTT_DBG_NUM_STATS
  307. };
  308. /*=== HTT option selection TLVs ===
  309. * Certain HTT messages have alternatives or options.
  310. * For such cases, the host and target need to agree on which option to use.
  311. * Option specification TLVs can be appended to the VERSION_REQ and
  312. * VERSION_CONF messages to select options other than the default.
  313. * These TLVs are entirely optional - if they are not provided, there is a
  314. * well-defined default for each option. If they are provided, they can be
  315. * provided in any order. Each TLV can be present or absent independent of
  316. * the presence / absence of other TLVs.
  317. *
  318. * The HTT option selection TLVs use the following format:
  319. * |31 16|15 8|7 0|
  320. * |---------------------------------+----------------+----------------|
  321. * | value (payload) | length | tag |
  322. * |-------------------------------------------------------------------|
  323. * The value portion need not be only 2 bytes; it can be extended by any
  324. * integer number of 4-byte units. The total length of the TLV, including
  325. * the tag and length fields, must be a multiple of 4 bytes. The length
  326. * field specifies the total TLV size in 4-byte units. Thus, the typical
  327. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  328. * field, would store 0x1 in its length field, to show that the TLV occupies
  329. * a single 4-byte unit.
  330. */
  331. /*--- TLV header format - applies to all HTT option TLVs ---*/
  332. enum HTT_OPTION_TLV_TAGS {
  333. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  334. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  335. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  336. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  337. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  338. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  339. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  340. };
  341. #define HTT_TCL_METADATA_VER_SZ 4
  342. PREPACK struct htt_option_tlv_header_t {
  343. A_UINT8 tag;
  344. A_UINT8 length;
  345. } POSTPACK;
  346. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  347. #define HTT_OPTION_TLV_TAG_S 0
  348. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  349. #define HTT_OPTION_TLV_LENGTH_S 8
  350. /*
  351. * value0 - 16 bit value field stored in word0
  352. * The TLV's value field may be longer than 2 bytes, in which case
  353. * the remainder of the value is stored in word1, word2, etc.
  354. */
  355. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  356. #define HTT_OPTION_TLV_VALUE0_S 16
  357. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_TAG_GET(word) \
  363. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  364. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  365. do { \
  366. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  367. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  368. } while (0)
  369. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  370. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  371. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  372. do { \
  373. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  374. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  375. } while (0)
  376. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  377. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  378. /*--- format of specific HTT option TLVs ---*/
  379. /*
  380. * HTT option TLV for specifying LL bus address size
  381. * Some chips require bus addresses used by the target to access buffers
  382. * within the host's memory to be 32 bits; others require bus addresses
  383. * used by the target to access buffers within the host's memory to be
  384. * 64 bits.
  385. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  386. * a suffix to the VERSION_CONF message to specify which bus address format
  387. * the target requires.
  388. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  389. * default to providing bus addresses to the target in 32-bit format.
  390. */
  391. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  392. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  393. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  394. };
  395. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  396. struct htt_option_tlv_header_t hdr;
  397. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  398. } POSTPACK;
  399. /*
  400. * HTT option TLV for specifying whether HL systems should indicate
  401. * over-the-air tx completion for individual frames, or should instead
  402. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  403. * requests an OTA tx completion for a particular tx frame.
  404. * This option does not apply to LL systems, where the TX_COMPL_IND
  405. * is mandatory.
  406. * This option is primarily intended for HL systems in which the tx frame
  407. * downloads over the host --> target bus are as slow as or slower than
  408. * the transmissions over the WLAN PHY. For cases where the bus is faster
  409. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  410. * and consequently will send one TX_COMPL_IND message that covers several
  411. * tx frames. For cases where the WLAN PHY is faster than the bus,
  412. * the target will end up transmitting very short A-MPDUs, and consequently
  413. * sending many TX_COMPL_IND messages, which each cover a very small number
  414. * of tx frames.
  415. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  416. * a suffix to the VERSION_REQ message to request whether the host desires to
  417. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  418. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  419. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  420. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  421. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  422. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  423. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  424. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  425. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  426. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  427. * TLV.
  428. */
  429. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  430. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  431. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  432. };
  433. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  434. struct htt_option_tlv_header_t hdr;
  435. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  436. } POSTPACK;
  437. /*
  438. * HTT option TLV for specifying how many tx queue groups the target
  439. * may establish.
  440. * This TLV specifies the maximum value the target may send in the
  441. * txq_group_id field of any TXQ_GROUP information elements sent by
  442. * the target to the host. This allows the host to pre-allocate an
  443. * appropriate number of tx queue group structs.
  444. *
  445. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  446. * a suffix to the VERSION_REQ message to specify whether the host supports
  447. * tx queue groups at all, and if so if there is any limit on the number of
  448. * tx queue groups that the host supports.
  449. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  450. * a suffix to the VERSION_CONF message. If the host has specified in the
  451. * VER_REQ message a limit on the number of tx queue groups the host can
  452. * support, the target shall limit its specification of the maximum tx groups
  453. * to be no larger than this host-specified limit.
  454. *
  455. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  456. * shall preallocate 4 tx queue group structs, and the target shall not
  457. * specify a txq_group_id larger than 3.
  458. */
  459. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  460. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  461. /*
  462. * values 1 through N specify the max number of tx queue groups
  463. * the sender supports
  464. */
  465. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  466. };
  467. /* TEMPORARY backwards-compatibility alias for a typo fix -
  468. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  469. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  470. * to support the old name (with the typo) until all references to the
  471. * old name are replaced with the new name.
  472. */
  473. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  474. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  475. struct htt_option_tlv_header_t hdr;
  476. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  477. } POSTPACK;
  478. /*
  479. * HTT option TLV for specifying whether the target supports an extended
  480. * version of the HTT tx descriptor. If the target provides this TLV
  481. * and specifies in the TLV that the target supports an extended version
  482. * of the HTT tx descriptor, the target must check the "extension" bit in
  483. * the HTT tx descriptor, and if the extension bit is set, to expect a
  484. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  485. * descriptor. Furthermore, the target must provide room for the HTT
  486. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  487. * This option is intended for systems where the host needs to explicitly
  488. * control the transmission parameters such as tx power for individual
  489. * tx frames.
  490. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  491. * as a suffix to the VERSION_CONF message to explicitly specify whether
  492. * the target supports the HTT tx MSDU extension descriptor.
  493. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  494. * by the host as lack of target support for the HTT tx MSDU extension
  495. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  496. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  497. * the HTT tx MSDU extension descriptor.
  498. * The host is not required to provide the HTT tx MSDU extension descriptor
  499. * just because the target supports it; the target must check the
  500. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  501. * extension descriptor is present.
  502. */
  503. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  504. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  505. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  506. };
  507. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  508. struct htt_option_tlv_header_t hdr;
  509. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  510. } POSTPACK;
  511. /*
  512. * For the tcl data command V2 and higher support added a new
  513. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  514. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  515. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  516. * HTT option TLV for specifying which version of the TCL metadata struct
  517. * should be used:
  518. * V1 -> use htt_tx_tcl_metadata struct
  519. * V2 -> use htt_tx_tcl_metadata_v2 struct
  520. * Old FW will only support V1.
  521. * New FW will support V2. New FW will still support V1, at least during
  522. * a transition period.
  523. * Similarly, old host will only support V1, and new host will support V1 + V2.
  524. *
  525. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  526. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  527. * of TCL metadata the host supports. If the host doesn't provide a
  528. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  529. * is implicitly understood that the host only supports V1.
  530. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  531. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  532. * the host shall use. The target shall only select one of the versions
  533. * supported by the host. If the target doesn't provide a
  534. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  535. * is implicitly understood that the V1 TCL metadata shall be used.
  536. *
  537. * Feb 2023: Added version HTT_OPTION_TLV_TCL_METADATA_V21 = 21
  538. * read as version 2.1. We added support for Dynamic AST Index Allocation
  539. * for Alder+Pine in version 2.1. For HTT_OPTION_TLV_TCL_METADATA_V2 = 2
  540. * we will retain older behavior of making sure the AST Index for SAWF
  541. * in Pine is allocated using wifitool ath2 setUnitTestCmd 0x48 2 536 1
  542. * and the FW will crash in wal_tx_de_fast.c. For version 2.1 and
  543. * above we will use htt_tx_tcl_svc_class_id_metadata.ast_index
  544. * in TCLV2 command and do the dynamic AST allocations.
  545. */
  546. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  547. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  548. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  549. /* values 3-20 reserved */
  550. HTT_OPTION_TLV_TCL_METADATA_V21 = 21,
  551. };
  552. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  553. struct htt_option_tlv_header_t hdr;
  554. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  555. } POSTPACK;
  556. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  557. HTT_OPTION_TLV_VALUE0_SET(word, value)
  558. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  559. HTT_OPTION_TLV_VALUE0_GET(word)
  560. typedef struct {
  561. union {
  562. /* BIT [11 : 0] :- tag
  563. * BIT [23 : 12] :- length
  564. * BIT [31 : 24] :- reserved
  565. */
  566. A_UINT32 tag__length;
  567. /*
  568. * The following struct is not endian-portable.
  569. * It is suitable for use within the target, which is known to be
  570. * little-endian.
  571. * The host should use the above endian-portable macros to access
  572. * the tag and length bitfields in an endian-neutral manner.
  573. */
  574. struct {
  575. A_UINT32 tag : 12, /* BIT [11 : 0] */
  576. length : 12, /* BIT [23 : 12] */
  577. reserved : 8; /* BIT [31 : 24] */
  578. };
  579. };
  580. } htt_tlv_hdr_t;
  581. /** HTT stats TLV tag values */
  582. typedef enum {
  583. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  584. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  585. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  586. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  587. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  588. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  589. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  590. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  591. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  592. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  593. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  594. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  595. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  596. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  597. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  598. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  599. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  600. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  601. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  602. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  603. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  604. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  605. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  606. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  607. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  608. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  610. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  611. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  612. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  613. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  614. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  615. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  616. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  617. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  618. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  619. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  620. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  621. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  622. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  623. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  624. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  625. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  626. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  627. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  628. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  629. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  630. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  631. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  632. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  633. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  634. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  635. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  636. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  637. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  638. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  639. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  640. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  641. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  642. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  643. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  644. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  645. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  646. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  647. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  648. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  649. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  650. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  651. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  652. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  653. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  654. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  655. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  656. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  657. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  658. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  659. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  660. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  661. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  662. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  663. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  664. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  665. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  666. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  667. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  668. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  669. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  670. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  671. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  672. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  673. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  674. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  675. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  676. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  677. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  678. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  679. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  680. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  681. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  682. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  683. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  684. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  685. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  686. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  687. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  688. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  689. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  690. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  692. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  693. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  694. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  696. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  697. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  698. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  699. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  700. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  701. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  702. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  703. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  704. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  705. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  706. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  707. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  708. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  709. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  710. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  711. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  712. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  713. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  714. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  715. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  716. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  717. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  718. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  719. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  720. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  721. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  722. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  723. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  724. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  725. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  726. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  727. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  728. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  729. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  730. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  731. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  732. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  733. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  734. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  735. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  736. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  737. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  738. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  739. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  740. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  741. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  742. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  743. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  744. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  745. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  746. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  747. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  748. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  749. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  750. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  751. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  752. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  753. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  754. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  755. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  756. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  757. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  758. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  759. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  760. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  761. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  762. HTT_STATS_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  763. HTT_STATS_PEER_BE_OFDMA_STATS_TAG = 180, /* htt_peer_be_ofdma_stats_tlv */
  764. HTT_STATS_MAX_TAG,
  765. } htt_stats_tlv_tag_t;
  766. /* retain deprecated enum name as an alias for the current enum name */
  767. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  768. #define HTT_STATS_TLV_TAG_M 0x00000fff
  769. #define HTT_STATS_TLV_TAG_S 0
  770. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  771. #define HTT_STATS_TLV_LENGTH_S 12
  772. #define HTT_STATS_TLV_TAG_GET(_var) \
  773. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  774. HTT_STATS_TLV_TAG_S)
  775. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  776. do { \
  777. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  778. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  779. } while (0)
  780. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  781. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  782. HTT_STATS_TLV_LENGTH_S)
  783. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  784. do { \
  785. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  786. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  787. } while (0)
  788. /*=== host -> target messages ===============================================*/
  789. enum htt_h2t_msg_type {
  790. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  791. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  792. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  793. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  794. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  795. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  796. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  797. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  798. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  799. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  800. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  801. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  802. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  803. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  804. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  805. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  806. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  807. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  808. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  809. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  810. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  811. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  812. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  813. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  814. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  815. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  816. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  817. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  818. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  819. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  820. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  821. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  822. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  823. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  824. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  825. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  826. HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP = 0x24,
  827. /* keep this last */
  828. HTT_H2T_NUM_MSGS
  829. };
  830. /*
  831. * HTT host to target message type -
  832. * stored in bits 7:0 of the first word of the message
  833. */
  834. #define HTT_H2T_MSG_TYPE_M 0xff
  835. #define HTT_H2T_MSG_TYPE_S 0
  836. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  837. do { \
  838. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  839. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  840. } while (0)
  841. #define HTT_H2T_MSG_TYPE_GET(word) \
  842. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  843. /**
  844. * @brief host -> target version number request message definition
  845. *
  846. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  847. *
  848. *
  849. * |31 24|23 16|15 8|7 0|
  850. * |----------------+----------------+----------------+----------------|
  851. * | reserved | msg type |
  852. * |-------------------------------------------------------------------|
  853. * : option request TLV (optional) |
  854. * :...................................................................:
  855. *
  856. * The VER_REQ message may consist of a single 4-byte word, or may be
  857. * extended with TLVs that specify which HTT options the host is requesting
  858. * from the target.
  859. * The following option TLVs may be appended to the VER_REQ message:
  860. * - HL_SUPPRESS_TX_COMPL_IND
  861. * - HL_MAX_TX_QUEUE_GROUPS
  862. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  863. * may be appended to the VER_REQ message (but only one TLV of each type).
  864. *
  865. * Header fields:
  866. * - MSG_TYPE
  867. * Bits 7:0
  868. * Purpose: identifies this as a version number request message
  869. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  870. */
  871. #define HTT_VER_REQ_BYTES 4
  872. /* TBDXXX: figure out a reasonable number */
  873. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  874. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  875. /**
  876. * @brief HTT tx MSDU descriptor
  877. *
  878. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  879. *
  880. * @details
  881. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  882. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  883. * the target firmware needs for the FW's tx processing, particularly
  884. * for creating the HW msdu descriptor.
  885. * The same HTT tx descriptor is used for HL and LL systems, though
  886. * a few fields within the tx descriptor are used only by LL or
  887. * only by HL.
  888. * The HTT tx descriptor is defined in two manners: by a struct with
  889. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  890. * definitions.
  891. * The target should use the struct def, for simplicitly and clarity,
  892. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  893. * neutral. Specifically, the host shall use the get/set macros built
  894. * around the mask + shift defs.
  895. */
  896. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  897. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  898. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  899. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  900. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  901. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  902. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  903. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  904. #define HTT_TX_VDEV_ID_WORD 0
  905. #define HTT_TX_VDEV_ID_MASK 0x3f
  906. #define HTT_TX_VDEV_ID_SHIFT 16
  907. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  908. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  909. #define HTT_TX_MSDU_LEN_DWORD 1
  910. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  911. /*
  912. * HTT_VAR_PADDR macros
  913. * Allow physical / bus addresses to be either a single 32-bit value,
  914. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  915. */
  916. #define HTT_VAR_PADDR32(var_name) \
  917. A_UINT32 var_name
  918. #define HTT_VAR_PADDR64_LE(var_name) \
  919. struct { \
  920. /* little-endian: lo precedes hi */ \
  921. A_UINT32 lo; \
  922. A_UINT32 hi; \
  923. } var_name
  924. /*
  925. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  926. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  927. * addresses are stored in a XXX-bit field.
  928. * This macro is used to define both htt_tx_msdu_desc32_t and
  929. * htt_tx_msdu_desc64_t structs.
  930. */
  931. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  932. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  933. { \
  934. /* DWORD 0: flags and meta-data */ \
  935. A_UINT32 \
  936. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  937. \
  938. /* pkt_subtype - \
  939. * Detailed specification of the tx frame contents, extending the \
  940. * general specification provided by pkt_type. \
  941. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  942. * pkt_type | pkt_subtype \
  943. * ============================================================== \
  944. * 802.3 | bit 0:3 - Reserved \
  945. * | bit 4: 0x0 - Copy-Engine Classification Results \
  946. * | not appended to the HTT message \
  947. * | 0x1 - Copy-Engine Classification Results \
  948. * | appended to the HTT message in the \
  949. * | format: \
  950. * | [HTT tx desc, frame header, \
  951. * | CE classification results] \
  952. * | The CE classification results begin \
  953. * | at the next 4-byte boundary after \
  954. * | the frame header. \
  955. * ------------+------------------------------------------------- \
  956. * Eth2 | bit 0:3 - Reserved \
  957. * | bit 4: 0x0 - Copy-Engine Classification Results \
  958. * | not appended to the HTT message \
  959. * | 0x1 - Copy-Engine Classification Results \
  960. * | appended to the HTT message. \
  961. * | See the above specification of the \
  962. * | CE classification results location. \
  963. * ------------+------------------------------------------------- \
  964. * native WiFi | bit 0:3 - Reserved \
  965. * | bit 4: 0x0 - Copy-Engine Classification Results \
  966. * | not appended to the HTT message \
  967. * | 0x1 - Copy-Engine Classification Results \
  968. * | appended to the HTT message. \
  969. * | See the above specification of the \
  970. * | CE classification results location. \
  971. * ------------+------------------------------------------------- \
  972. * mgmt | 0x0 - 802.11 MAC header absent \
  973. * | 0x1 - 802.11 MAC header present \
  974. * ------------+------------------------------------------------- \
  975. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  976. * | 0x1 - 802.11 MAC header present \
  977. * | bit 1: 0x0 - allow aggregation \
  978. * | 0x1 - don't allow aggregation \
  979. * | bit 2: 0x0 - perform encryption \
  980. * | 0x1 - don't perform encryption \
  981. * | bit 3: 0x0 - perform tx classification / queuing \
  982. * | 0x1 - don't perform tx classification; \
  983. * | insert the frame into the "misc" \
  984. * | tx queue \
  985. * | bit 4: 0x0 - Copy-Engine Classification Results \
  986. * | not appended to the HTT message \
  987. * | 0x1 - Copy-Engine Classification Results \
  988. * | appended to the HTT message. \
  989. * | See the above specification of the \
  990. * | CE classification results location. \
  991. */ \
  992. pkt_subtype: 5, \
  993. \
  994. /* pkt_type - \
  995. * General specification of the tx frame contents. \
  996. * The htt_pkt_type enum should be used to specify and check the \
  997. * value of this field. \
  998. */ \
  999. pkt_type: 3, \
  1000. \
  1001. /* vdev_id - \
  1002. * ID for the vdev that is sending this tx frame. \
  1003. * For certain non-standard packet types, e.g. pkt_type == raw \
  1004. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  1005. * This field is used primarily for determining where to queue \
  1006. * broadcast and multicast frames. \
  1007. */ \
  1008. vdev_id: 6, \
  1009. /* ext_tid - \
  1010. * The extended traffic ID. \
  1011. * If the TID is unknown, the extended TID is set to \
  1012. * HTT_TX_EXT_TID_INVALID. \
  1013. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  1014. * value of the QoS TID. \
  1015. * If the tx frame is non-QoS data, then the extended TID is set to \
  1016. * HTT_TX_EXT_TID_NON_QOS. \
  1017. * If the tx frame is multicast or broadcast, then the extended TID \
  1018. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1019. */ \
  1020. ext_tid: 5, \
  1021. \
  1022. /* postponed - \
  1023. * This flag indicates whether the tx frame has been downloaded to \
  1024. * the target before but discarded by the target, and now is being \
  1025. * downloaded again; or if this is a new frame that is being \
  1026. * downloaded for the first time. \
  1027. * This flag allows the target to determine the correct order for \
  1028. * transmitting new vs. old frames. \
  1029. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1030. * This flag only applies to HL systems, since in LL systems, \
  1031. * the tx flow control is handled entirely within the target. \
  1032. */ \
  1033. postponed: 1, \
  1034. \
  1035. /* extension - \
  1036. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1037. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1038. * \
  1039. * 0x0 - no extension MSDU descriptor is present \
  1040. * 0x1 - an extension MSDU descriptor immediately follows the \
  1041. * regular MSDU descriptor \
  1042. */ \
  1043. extension: 1, \
  1044. \
  1045. /* cksum_offload - \
  1046. * This flag indicates whether checksum offload is enabled or not \
  1047. * for this frame. Target FW use this flag to turn on HW checksumming \
  1048. * 0x0 - No checksum offload \
  1049. * 0x1 - L3 header checksum only \
  1050. * 0x2 - L4 checksum only \
  1051. * 0x3 - L3 header checksum + L4 checksum \
  1052. */ \
  1053. cksum_offload: 2, \
  1054. \
  1055. /* tx_comp_req - \
  1056. * This flag indicates whether Tx Completion \
  1057. * from fw is required or not. \
  1058. * This flag is only relevant if tx completion is not \
  1059. * universally enabled. \
  1060. * For all LL systems, tx completion is mandatory, \
  1061. * so this flag will be irrelevant. \
  1062. * For HL systems tx completion is optional, but HL systems in which \
  1063. * the bus throughput exceeds the WLAN throughput will \
  1064. * probably want to always use tx completion, and thus \
  1065. * would not check this flag. \
  1066. * This flag is required when tx completions are not used universally, \
  1067. * but are still required for certain tx frames for which \
  1068. * an OTA delivery acknowledgment is needed by the host. \
  1069. * In practice, this would be for HL systems in which the \
  1070. * bus throughput is less than the WLAN throughput. \
  1071. * \
  1072. * 0x0 - Tx Completion Indication from Fw not required \
  1073. * 0x1 - Tx Completion Indication from Fw is required \
  1074. */ \
  1075. tx_compl_req: 1; \
  1076. \
  1077. \
  1078. /* DWORD 1: MSDU length and ID */ \
  1079. A_UINT32 \
  1080. len: 16, /* MSDU length, in bytes */ \
  1081. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1082. * and this id is used to calculate fragmentation \
  1083. * descriptor pointer inside the target based on \
  1084. * the base address, configured inside the target. \
  1085. */ \
  1086. \
  1087. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1088. /* frags_desc_ptr - \
  1089. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1090. * where the tx frame's fragments reside in memory. \
  1091. * This field only applies to LL systems, since in HL systems the \
  1092. * (degenerate single-fragment) fragmentation descriptor is created \
  1093. * within the target. \
  1094. */ \
  1095. _paddr__frags_desc_ptr_; \
  1096. \
  1097. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1098. /* \
  1099. * Peer ID : Target can use this value to know which peer-id packet \
  1100. * destined to. \
  1101. * It's intended to be specified by host in case of NAWDS. \
  1102. */ \
  1103. A_UINT16 peerid; \
  1104. \
  1105. /* \
  1106. * Channel frequency: This identifies the desired channel \
  1107. * frequency (in mhz) for tx frames. This is used by FW to help \
  1108. * determine when it is safe to transmit or drop frames for \
  1109. * off-channel operation. \
  1110. * The default value of zero indicates to FW that the corresponding \
  1111. * VDEV's home channel (if there is one) is the desired channel \
  1112. * frequency. \
  1113. */ \
  1114. A_UINT16 chanfreq; \
  1115. \
  1116. /* Reason reserved is commented is increasing the htt structure size \
  1117. * leads to some weird issues. \
  1118. * A_UINT32 reserved_dword3_bits0_31; \
  1119. */ \
  1120. } POSTPACK
  1121. /* define a htt_tx_msdu_desc32_t type */
  1122. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1123. /* define a htt_tx_msdu_desc64_t type */
  1124. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1125. /*
  1126. * Make htt_tx_msdu_desc_t be an alias for either
  1127. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1128. */
  1129. #if HTT_PADDR64
  1130. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1131. #else
  1132. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1133. #endif
  1134. /* decriptor information for Management frame*/
  1135. /*
  1136. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1137. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1138. */
  1139. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1140. extern A_UINT32 mgmt_hdr_len;
  1141. PREPACK struct htt_mgmt_tx_desc_t {
  1142. A_UINT32 msg_type;
  1143. #if HTT_PADDR64
  1144. A_UINT64 frag_paddr; /* DMAble address of the data */
  1145. #else
  1146. A_UINT32 frag_paddr; /* DMAble address of the data */
  1147. #endif
  1148. A_UINT32 desc_id; /* returned to host during completion
  1149. * to free the meory*/
  1150. A_UINT32 len; /* Fragment length */
  1151. A_UINT32 vdev_id; /* virtual device ID*/
  1152. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1153. } POSTPACK;
  1154. PREPACK struct htt_mgmt_tx_compl_ind {
  1155. A_UINT32 desc_id;
  1156. A_UINT32 status;
  1157. } POSTPACK;
  1158. /*
  1159. * This SDU header size comes from the summation of the following:
  1160. * 1. Max of:
  1161. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1162. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1163. * b. 802.11 header, for raw frames: 36 bytes
  1164. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1165. * QoS header, HT header)
  1166. * c. 802.3 header, for ethernet frames: 14 bytes
  1167. * (destination address, source address, ethertype / length)
  1168. * 2. Max of:
  1169. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1170. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1171. * 3. 802.1Q VLAN header: 4 bytes
  1172. * 4. LLC/SNAP header: 8 bytes
  1173. */
  1174. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1175. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1176. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1177. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1178. A_COMPILE_TIME_ASSERT(
  1179. htt_encap_hdr_size_max_check_nwifi,
  1180. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1181. A_COMPILE_TIME_ASSERT(
  1182. htt_encap_hdr_size_max_check_enet,
  1183. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1184. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1185. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1186. #define HTT_TX_HDR_SIZE_802_1Q 4
  1187. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1188. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1189. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1190. HTT_TX_HDR_SIZE_802_1Q + \
  1191. HTT_TX_HDR_SIZE_LLC_SNAP)
  1192. #define HTT_HL_TX_FRM_HDR_LEN \
  1193. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1194. #define HTT_LL_TX_FRM_HDR_LEN \
  1195. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1196. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1197. /* dword 0 */
  1198. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1199. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1200. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1201. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1202. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1203. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1204. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1205. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1206. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1207. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1208. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1209. #define HTT_TX_DESC_PKT_TYPE_S 13
  1210. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1211. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1212. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1213. #define HTT_TX_DESC_VDEV_ID_S 16
  1214. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1215. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1216. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1217. #define HTT_TX_DESC_EXT_TID_S 22
  1218. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1219. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1220. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1221. #define HTT_TX_DESC_POSTPONED_S 27
  1222. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1223. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1224. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1225. #define HTT_TX_DESC_EXTENSION_S 28
  1226. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1227. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1228. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1229. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1230. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1231. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1232. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1233. #define HTT_TX_DESC_TX_COMP_S 31
  1234. /* dword 1 */
  1235. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1236. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1237. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1238. #define HTT_TX_DESC_FRM_LEN_S 0
  1239. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1240. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1241. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1242. #define HTT_TX_DESC_FRM_ID_S 16
  1243. /* dword 2 */
  1244. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1245. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1246. /* for systems using 64-bit format for bus addresses */
  1247. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1248. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1249. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1250. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1251. /* for systems using 32-bit format for bus addresses */
  1252. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1253. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1254. /* dword 3 */
  1255. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1256. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1257. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1258. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1259. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1260. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1261. #if HTT_PADDR64
  1262. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1263. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1264. #else
  1265. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1266. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1267. #endif
  1268. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1269. #define HTT_TX_DESC_PEER_ID_S 0
  1270. /*
  1271. * TEMPORARY:
  1272. * The original definitions for the PEER_ID fields contained typos
  1273. * (with _DESC_PADDR appended to this PEER_ID field name).
  1274. * Retain deprecated original names for PEER_ID fields until all code that
  1275. * refers to them has been updated.
  1276. */
  1277. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1278. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1279. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1280. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1281. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1282. HTT_TX_DESC_PEER_ID_M
  1283. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1284. HTT_TX_DESC_PEER_ID_S
  1285. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1286. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1287. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1288. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1289. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1290. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1291. #if HTT_PADDR64
  1292. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1293. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1294. #else
  1295. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1296. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1297. #endif
  1298. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1299. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1300. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1302. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1309. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1316. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1323. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1330. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1334. } while (0)
  1335. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1336. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1337. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1341. } while (0)
  1342. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1343. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1344. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1348. } while (0)
  1349. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1350. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1351. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1355. } while (0)
  1356. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1357. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1358. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1362. } while (0)
  1363. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1364. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1365. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1369. } while (0)
  1370. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1371. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1372. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1373. do { \
  1374. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1375. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1376. } while (0)
  1377. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1378. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1379. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1380. do { \
  1381. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1382. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1383. } while (0)
  1384. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1385. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1386. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1390. } while (0)
  1391. /* enums used in the HTT tx MSDU extension descriptor */
  1392. enum {
  1393. htt_tx_guard_interval_regular = 0,
  1394. htt_tx_guard_interval_short = 1,
  1395. };
  1396. enum {
  1397. htt_tx_preamble_type_ofdm = 0,
  1398. htt_tx_preamble_type_cck = 1,
  1399. htt_tx_preamble_type_ht = 2,
  1400. htt_tx_preamble_type_vht = 3,
  1401. };
  1402. enum {
  1403. htt_tx_bandwidth_5MHz = 0,
  1404. htt_tx_bandwidth_10MHz = 1,
  1405. htt_tx_bandwidth_20MHz = 2,
  1406. htt_tx_bandwidth_40MHz = 3,
  1407. htt_tx_bandwidth_80MHz = 4,
  1408. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1409. };
  1410. /**
  1411. * @brief HTT tx MSDU extension descriptor
  1412. * @details
  1413. * If the target supports HTT tx MSDU extension descriptors, the host has
  1414. * the option of appending the following struct following the regular
  1415. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1416. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1417. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1418. * tx specs for each frame.
  1419. */
  1420. PREPACK struct htt_tx_msdu_desc_ext_t {
  1421. /* DWORD 0: flags */
  1422. A_UINT32
  1423. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1424. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1425. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1426. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1427. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1428. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1429. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1430. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1431. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1432. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1433. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1434. /* DWORD 1: tx power, tx rate, tx BW */
  1435. A_UINT32
  1436. /* pwr -
  1437. * Specify what power the tx frame needs to be transmitted at.
  1438. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1439. * The value needs to be appropriately sign-extended when extracting
  1440. * the value from the message and storing it in a variable that is
  1441. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1442. * automatically handles this sign-extension.)
  1443. * If the transmission uses multiple tx chains, this power spec is
  1444. * the total transmit power, assuming incoherent combination of
  1445. * per-chain power to produce the total power.
  1446. */
  1447. pwr: 8,
  1448. /* mcs_mask -
  1449. * Specify the allowable values for MCS index (modulation and coding)
  1450. * to use for transmitting the frame.
  1451. *
  1452. * For HT / VHT preamble types, this mask directly corresponds to
  1453. * the HT or VHT MCS indices that are allowed. For each bit N set
  1454. * within the mask, MCS index N is allowed for transmitting the frame.
  1455. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1456. * rates versus OFDM rates, so the host has the option of specifying
  1457. * that the target must transmit the frame with CCK or OFDM rates
  1458. * (not HT or VHT), but leaving the decision to the target whether
  1459. * to use CCK or OFDM.
  1460. *
  1461. * For CCK and OFDM, the bits within this mask are interpreted as
  1462. * follows:
  1463. * bit 0 -> CCK 1 Mbps rate is allowed
  1464. * bit 1 -> CCK 2 Mbps rate is allowed
  1465. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1466. * bit 3 -> CCK 11 Mbps rate is allowed
  1467. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1468. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1469. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1470. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1471. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1472. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1473. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1474. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1475. *
  1476. * The MCS index specification needs to be compatible with the
  1477. * bandwidth mask specification. For example, a MCS index == 9
  1478. * specification is inconsistent with a preamble type == VHT,
  1479. * Nss == 1, and channel bandwidth == 20 MHz.
  1480. *
  1481. * Furthermore, the host has only a limited ability to specify to
  1482. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1483. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1484. */
  1485. mcs_mask: 12,
  1486. /* nss_mask -
  1487. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1488. * Each bit in this mask corresponds to a Nss value:
  1489. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1490. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1491. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1492. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1493. * The values in the Nss mask must be suitable for the recipient, e.g.
  1494. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1495. * recipient which only supports 2x2 MIMO.
  1496. */
  1497. nss_mask: 4,
  1498. /* guard_interval -
  1499. * Specify a htt_tx_guard_interval enum value to indicate whether
  1500. * the transmission should use a regular guard interval or a
  1501. * short guard interval.
  1502. */
  1503. guard_interval: 1,
  1504. /* preamble_type_mask -
  1505. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1506. * may choose from for transmitting this frame.
  1507. * The bits in this mask correspond to the values in the
  1508. * htt_tx_preamble_type enum. For example, to allow the target
  1509. * to transmit the frame as either CCK or OFDM, this field would
  1510. * be set to
  1511. * (1 << htt_tx_preamble_type_ofdm) |
  1512. * (1 << htt_tx_preamble_type_cck)
  1513. */
  1514. preamble_type_mask: 4,
  1515. reserved1_31_29: 3; /* unused, set to 0x0 */
  1516. /* DWORD 2: tx chain mask, tx retries */
  1517. A_UINT32
  1518. /* chain_mask - specify which chains to transmit from */
  1519. chain_mask: 4,
  1520. /* retry_limit -
  1521. * Specify the maximum number of transmissions, including the
  1522. * initial transmission, to attempt before giving up if no ack
  1523. * is received.
  1524. * If the tx rate is specified, then all retries shall use the
  1525. * same rate as the initial transmission.
  1526. * If no tx rate is specified, the target can choose whether to
  1527. * retain the original rate during the retransmissions, or to
  1528. * fall back to a more robust rate.
  1529. */
  1530. retry_limit: 4,
  1531. /* bandwidth_mask -
  1532. * Specify what channel widths may be used for the transmission.
  1533. * A value of zero indicates "don't care" - the target may choose
  1534. * the transmission bandwidth.
  1535. * The bits within this mask correspond to the htt_tx_bandwidth
  1536. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1537. * The bandwidth_mask must be consistent with the preamble_type_mask
  1538. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1539. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1540. */
  1541. bandwidth_mask: 6,
  1542. reserved2_31_14: 18; /* unused, set to 0x0 */
  1543. /* DWORD 3: tx expiry time (TSF) LSBs */
  1544. A_UINT32 expire_tsf_lo;
  1545. /* DWORD 4: tx expiry time (TSF) MSBs */
  1546. A_UINT32 expire_tsf_hi;
  1547. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1548. } POSTPACK;
  1549. /* DWORD 0 */
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1551. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1556. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1559. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1570. /* DWORD 1 */
  1571. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1572. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1573. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1574. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1575. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1576. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1577. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1578. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1579. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1580. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1581. /* DWORD 2 */
  1582. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1583. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1584. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1585. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1586. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1587. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1588. /* DWORD 0 */
  1589. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1590. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1591. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1592. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1593. do { \
  1594. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1595. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1600. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1603. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1607. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1608. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL( \
  1611. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1612. ((_var) |= ((_val) \
  1613. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL( \
  1621. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1622. ((_var) |= ((_val) \
  1623. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1624. } while (0)
  1625. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1627. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1628. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1635. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1636. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1651. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1652. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1659. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1660. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1664. } while (0)
  1665. /* DWORD 1 */
  1666. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1668. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1669. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1670. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1671. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1672. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1673. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1674. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1675. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1677. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1678. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1685. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1686. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1693. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1694. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1701. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1702. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1706. } while (0)
  1707. /* DWORD 2 */
  1708. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1710. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1711. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1718. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1719. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1726. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1727. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1730. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1731. } while (0)
  1732. typedef enum {
  1733. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1734. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1735. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1736. } htt_11ax_ltf_subtype_t;
  1737. typedef enum {
  1738. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1739. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1740. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1741. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1742. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1743. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1744. } htt_tx_ext2_preamble_type_t;
  1745. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1746. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1747. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1748. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1749. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1750. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1751. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1752. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1753. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1754. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1755. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1756. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1757. /**
  1758. * @brief HTT tx MSDU extension descriptor v2
  1759. * @details
  1760. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1761. * is received as tcl_exit_base->host_meta_info in firmware.
  1762. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1763. * are already part of tcl_exit_base.
  1764. */
  1765. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1766. /* DWORD 0: flags */
  1767. A_UINT32
  1768. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1769. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1770. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1771. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1772. valid_retries : 1, /* if set, tx retries spec is valid */
  1773. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1774. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1775. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1776. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1777. valid_key_flags : 1, /* if set, key flags is valid */
  1778. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1779. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1780. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1781. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1782. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1783. 1 = ENCRYPT,
  1784. 2 ~ 3 - Reserved */
  1785. /* retry_limit -
  1786. * Specify the maximum number of transmissions, including the
  1787. * initial transmission, to attempt before giving up if no ack
  1788. * is received.
  1789. * If the tx rate is specified, then all retries shall use the
  1790. * same rate as the initial transmission.
  1791. * If no tx rate is specified, the target can choose whether to
  1792. * retain the original rate during the retransmissions, or to
  1793. * fall back to a more robust rate.
  1794. */
  1795. retry_limit : 4,
  1796. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1797. * Valid only for 11ax preamble types HE_SU
  1798. * and HE_EXT_SU
  1799. */
  1800. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1801. * Valid only for 11ax preamble types HE_SU
  1802. * and HE_EXT_SU
  1803. */
  1804. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1805. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1806. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1807. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1808. */
  1809. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1810. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1811. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1812. * Use cases:
  1813. * Any time firmware uses TQM-BYPASS for Data
  1814. * TID, firmware expect host to set this bit.
  1815. */
  1816. /* DWORD 1: tx power, tx rate */
  1817. A_UINT32
  1818. power : 8, /* unit of the power field is 0.5 dbm
  1819. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1820. * signed value ranging from -64dbm to 63.5 dbm
  1821. */
  1822. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1823. * Setting more than one MCS isn't currently
  1824. * supported by the target (but is supported
  1825. * in the interface in case in the future
  1826. * the target supports specifications of
  1827. * a limited set of MCS values.
  1828. */
  1829. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1830. * Setting more than one Nss isn't currently
  1831. * supported by the target (but is supported
  1832. * in the interface in case in the future
  1833. * the target supports specifications of
  1834. * a limited set of Nss values.
  1835. */
  1836. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1837. update_peer_cache : 1; /* When set these custom values will be
  1838. * used for all packets, until the next
  1839. * update via this ext header.
  1840. * This is to make sure not all packets
  1841. * need to include this header.
  1842. */
  1843. /* DWORD 2: tx chain mask, tx retries */
  1844. A_UINT32
  1845. /* chain_mask - specify which chains to transmit from */
  1846. chain_mask : 8,
  1847. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1848. * TODO: Update Enum values for key_flags
  1849. */
  1850. /*
  1851. * Channel frequency: This identifies the desired channel
  1852. * frequency (in MHz) for tx frames. This is used by FW to help
  1853. * determine when it is safe to transmit or drop frames for
  1854. * off-channel operation.
  1855. * The default value of zero indicates to FW that the corresponding
  1856. * VDEV's home channel (if there is one) is the desired channel
  1857. * frequency.
  1858. */
  1859. chanfreq : 16;
  1860. /* DWORD 3: tx expiry time (TSF) LSBs */
  1861. A_UINT32 expire_tsf_lo;
  1862. /* DWORD 4: tx expiry time (TSF) MSBs */
  1863. A_UINT32 expire_tsf_hi;
  1864. /* DWORD 5: flags to control routing / processing of the MSDU */
  1865. A_UINT32
  1866. /* learning_frame
  1867. * When this flag is set, this frame will be dropped by FW
  1868. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1869. */
  1870. learning_frame : 1,
  1871. /* send_as_standalone
  1872. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1873. * i.e. with no A-MSDU or A-MPDU aggregation.
  1874. * The scope is extended to other use-cases.
  1875. */
  1876. send_as_standalone : 1,
  1877. /* is_host_opaque_valid
  1878. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1879. * with valid information.
  1880. */
  1881. is_host_opaque_valid : 1,
  1882. traffic_end_indication: 1,
  1883. rsvd0 : 28;
  1884. /* DWORD 6 : Host opaque cookie for special frames */
  1885. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1886. rsvd1 : 16;
  1887. /*
  1888. * This structure can be expanded further up to 40 bytes
  1889. * by adding further DWORDs as needed.
  1890. */
  1891. } POSTPACK;
  1892. /* DWORD 0 */
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1919. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1920. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1921. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1922. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1923. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1924. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1925. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1926. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1927. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1928. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1929. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1930. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1931. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1932. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1933. /* DWORD 1 */
  1934. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1935. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1936. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1937. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1938. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1939. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1940. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1941. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1942. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1943. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1944. /* DWORD 2 */
  1945. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1946. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1947. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1948. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1949. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1950. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1951. /* DWORD 5 */
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1955. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1958. /* DWORD 6 */
  1959. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1960. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1961. /* DWORD 0 */
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1985. } while (0)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1987. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1988. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1989. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL( \
  1992. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1993. ((_var) |= ((_val) \
  1994. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL( \
  2018. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2019. ((_var) |= ((_val) \
  2020. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2021. } while (0)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2023. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2024. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2025. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2029. } while (0)
  2030. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2031. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2032. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2033. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2034. do { \
  2035. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2036. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2037. } while (0)
  2038. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2039. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2040. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2041. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2042. do { \
  2043. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2044. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2045. } while (0)
  2046. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2047. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2048. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2049. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2050. do { \
  2051. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2052. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2053. } while (0)
  2054. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2061. } while (0)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2077. } while (0)
  2078. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2079. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2080. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2081. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2085. } while (0)
  2086. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2087. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2088. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2089. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2093. } while (0)
  2094. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2095. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2096. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2097. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2098. do { \
  2099. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2100. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2101. } while (0)
  2102. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2103. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2104. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2105. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2108. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2109. } while (0)
  2110. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2117. } while (0)
  2118. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2125. } while (0)
  2126. /* DWORD 1 */
  2127. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2128. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2129. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2130. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2131. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2132. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2133. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2134. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2135. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2136. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2137. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2138. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2139. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2140. do { \
  2141. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2142. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2143. } while (0)
  2144. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2145. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2146. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2147. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2151. } while (0)
  2152. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2153. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2154. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2155. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2159. } while (0)
  2160. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2162. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2163. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2167. } while (0)
  2168. /* DWORD 2 */
  2169. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2170. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2171. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2172. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2173. do { \
  2174. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2175. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2176. } while (0)
  2177. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2178. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2179. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2180. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2184. } while (0)
  2185. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2186. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2187. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2188. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2189. do { \
  2190. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2191. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2192. } while (0)
  2193. /* DWORD 5 */
  2194. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2195. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2196. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2197. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2198. do { \
  2199. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2200. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2201. } while (0)
  2202. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2203. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2204. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2205. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2206. do { \
  2207. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2208. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2209. } while (0)
  2210. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2211. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2212. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2213. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2214. do { \
  2215. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2216. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2217. } while (0)
  2218. /* DWORD 6 */
  2219. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2220. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2221. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2222. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2223. do { \
  2224. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2225. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2226. } while (0)
  2227. typedef enum {
  2228. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2229. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2230. } htt_tcl_metadata_type;
  2231. /**
  2232. * @brief HTT TCL command number format
  2233. * @details
  2234. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2235. * available to firmware as tcl_exit_base->tcl_status_number.
  2236. * For regular / multicast packets host will send vdev and mac id and for
  2237. * NAWDS packets, host will send peer id.
  2238. * A_UINT32 is used to avoid endianness conversion problems.
  2239. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2240. */
  2241. typedef struct {
  2242. A_UINT32
  2243. type: 1, /* vdev_id based or peer_id based */
  2244. rsvd: 31;
  2245. } htt_tx_tcl_vdev_or_peer_t;
  2246. typedef struct {
  2247. A_UINT32
  2248. type: 1, /* vdev_id based or peer_id based */
  2249. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2250. vdev_id: 8,
  2251. pdev_id: 2,
  2252. host_inspected:1,
  2253. rsvd: 19;
  2254. } htt_tx_tcl_vdev_metadata;
  2255. typedef struct {
  2256. A_UINT32
  2257. type: 1, /* vdev_id based or peer_id based */
  2258. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2259. peer_id: 14,
  2260. rsvd: 16;
  2261. } htt_tx_tcl_peer_metadata;
  2262. PREPACK struct htt_tx_tcl_metadata {
  2263. union {
  2264. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2265. htt_tx_tcl_vdev_metadata vdev_meta;
  2266. htt_tx_tcl_peer_metadata peer_meta;
  2267. };
  2268. } POSTPACK;
  2269. /* DWORD 0 */
  2270. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2271. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2272. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2273. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2274. /* VDEV metadata */
  2275. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2276. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2277. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2278. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2279. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2280. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2281. /* PEER metadata */
  2282. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2283. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2284. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2285. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2286. HTT_TX_TCL_METADATA_TYPE_S)
  2287. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2291. } while (0)
  2292. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2293. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2294. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2295. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2296. do { \
  2297. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2298. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2299. } while (0)
  2300. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2301. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2302. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2303. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2304. do { \
  2305. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2306. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2307. } while (0)
  2308. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2309. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2310. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2311. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2312. do { \
  2313. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2314. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2315. } while (0)
  2316. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2317. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2318. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2319. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2320. do { \
  2321. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2322. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2323. } while (0)
  2324. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2325. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2326. HTT_TX_TCL_METADATA_PEER_ID_S)
  2327. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2328. do { \
  2329. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2330. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2331. } while (0)
  2332. /*------------------------------------------------------------------
  2333. * V2 Version of TCL Data Command
  2334. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2335. * MLO global_seq all flavours of TCL Data Cmd.
  2336. *-----------------------------------------------------------------*/
  2337. typedef enum {
  2338. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2339. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2340. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2341. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2342. } htt_tcl_metadata_type_v2;
  2343. /**
  2344. * @brief HTT TCL command number format
  2345. * @details
  2346. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2347. * available to firmware as tcl_exit_base->tcl_status_number.
  2348. * A_UINT32 is used to avoid endianness conversion problems.
  2349. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2350. */
  2351. typedef struct {
  2352. A_UINT32
  2353. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2354. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2355. vdev_id: 8,
  2356. pdev_id: 2,
  2357. host_inspected:1,
  2358. rsvd: 2,
  2359. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2360. } htt_tx_tcl_vdev_metadata_v2;
  2361. typedef struct {
  2362. A_UINT32
  2363. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2364. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2365. peer_id: 13,
  2366. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2367. } htt_tx_tcl_peer_metadata_v2;
  2368. typedef struct {
  2369. A_UINT32
  2370. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2371. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2372. svc_class_id: 8,
  2373. ast_index: 3, /* Indicates to firmware the AST index to be used for Pine for AST Override */
  2374. rsvd: 2,
  2375. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2376. } htt_tx_tcl_svc_class_id_metadata;
  2377. typedef struct {
  2378. A_UINT32
  2379. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2380. host_inspected: 1,
  2381. global_seq_no: 12,
  2382. rsvd: 1,
  2383. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2384. } htt_tx_tcl_global_seq_metadata;
  2385. PREPACK struct htt_tx_tcl_metadata_v2 {
  2386. union {
  2387. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2388. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2389. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2390. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2391. };
  2392. } POSTPACK;
  2393. /* DWORD 0 */
  2394. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2395. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2396. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2397. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2398. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2399. /* VDEV V2 metadata */
  2400. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2401. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2402. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2403. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2404. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2405. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2406. /* PEER V2 metadata */
  2407. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2408. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2409. /* SVC_CLASS_ID metadata */
  2410. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2411. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2412. /* Global Seq no metadata */
  2413. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2414. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2415. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2416. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2417. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2418. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2419. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2420. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2421. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2422. do { \
  2423. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2424. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2425. } while (0)
  2426. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2427. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2428. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2429. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2430. do { \
  2431. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2432. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2433. } while (0)
  2434. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2435. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2436. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2437. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2438. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2442. } while (0)
  2443. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2444. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2445. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2446. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2450. } while (0)
  2451. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2452. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2453. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2454. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2458. } while (0)
  2459. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2460. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2461. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2462. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2463. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2466. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2467. } while (0)
  2468. /*----- Get and Set V2 type field in Service Class fields ----*/
  2469. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2470. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2471. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2472. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2473. do { \
  2474. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2475. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2476. } while (0)
  2477. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2478. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2479. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2480. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2481. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2484. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2485. } while (0)
  2486. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2487. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2488. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2489. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2492. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2493. } while (0)
  2494. /*------------------------------------------------------------------
  2495. * End V2 Version of TCL Data Command
  2496. *-----------------------------------------------------------------*/
  2497. typedef enum {
  2498. HTT_TX_FW2WBM_TX_STATUS_OK,
  2499. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2500. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2501. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2502. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2503. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2504. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2505. HTT_TX_FW2WBM_TX_STATUS_MAX
  2506. } htt_tx_fw2wbm_tx_status_t;
  2507. typedef enum {
  2508. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2509. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2510. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2511. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2512. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2513. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2514. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2515. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2516. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2517. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2518. } htt_tx_fw2wbm_reinject_reason_t;
  2519. /**
  2520. * @brief HTT TX WBM Completion from firmware to host
  2521. * @details
  2522. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2523. * DWORD 3 and 4 for software based completions (Exception frames and
  2524. * TQM bypass frames)
  2525. * For software based completions, wbm_release_ring->release_source_module will
  2526. * be set to release_source_fw
  2527. */
  2528. PREPACK struct htt_tx_wbm_completion {
  2529. A_UINT32
  2530. sch_cmd_id: 24,
  2531. exception_frame: 1, /* If set, this packet was queued via exception path */
  2532. rsvd0_31_25: 7;
  2533. A_UINT32
  2534. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2535. * reception of an ACK or BA, this field indicates
  2536. * the RSSI of the received ACK or BA frame.
  2537. * When the frame is removed as result of a direct
  2538. * remove command from the SW, this field is set
  2539. * to 0x0 (which is never a valid value when real
  2540. * RSSI is available).
  2541. * Units: dB w.r.t noise floor
  2542. */
  2543. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2544. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2545. rsvd1_31_16: 16;
  2546. } POSTPACK;
  2547. /* DWORD 0 */
  2548. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2549. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2550. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2551. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2552. /* DWORD 1 */
  2553. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2554. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2555. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2556. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2557. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2558. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2559. /* DWORD 0 */
  2560. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2561. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2562. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2563. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2564. do { \
  2565. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2566. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2567. } while (0)
  2568. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2569. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2570. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2571. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2574. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2575. } while (0)
  2576. /* DWORD 1 */
  2577. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2578. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2579. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2580. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2581. do { \
  2582. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2583. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2584. } while (0)
  2585. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2586. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2587. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2588. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2589. do { \
  2590. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2591. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2592. } while (0)
  2593. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2594. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2595. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2596. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2597. do { \
  2598. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2599. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2600. } while (0)
  2601. /**
  2602. * @brief HTT TX WBM Completion from firmware to host
  2603. * @details
  2604. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2605. * (WBM) offload HW.
  2606. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2607. * For software based completions, release_source_module will
  2608. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2609. * struct wbm_release_ring and then switch to this after looking at
  2610. * release_source_module.
  2611. */
  2612. PREPACK struct htt_tx_wbm_completion_v2 {
  2613. A_UINT32
  2614. used_by_hw0; /* Refer to struct wbm_release_ring */
  2615. A_UINT32
  2616. used_by_hw1; /* Refer to struct wbm_release_ring */
  2617. A_UINT32
  2618. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2619. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2620. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2621. exception_frame: 1,
  2622. rsvd0: 12, /* For future use */
  2623. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2624. rsvd1: 1; /* For future use */
  2625. A_UINT32
  2626. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2627. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2628. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2629. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2630. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2631. */
  2632. A_UINT32
  2633. data1: 32;
  2634. A_UINT32
  2635. data2: 32;
  2636. A_UINT32
  2637. used_by_hw3; /* Refer to struct wbm_release_ring */
  2638. } POSTPACK;
  2639. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2640. /* DWORD 3 */
  2641. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2642. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2643. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2644. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2645. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2646. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2647. /* DWORD 3 */
  2648. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2649. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2650. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2651. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2652. do { \
  2653. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2654. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2655. } while (0)
  2656. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2657. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2658. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2659. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2660. do { \
  2661. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2662. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2663. } while (0)
  2664. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2665. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2666. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2667. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2668. do { \
  2669. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2670. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2671. } while (0)
  2672. /**
  2673. * @brief HTT TX WBM Completion from firmware to host (V3)
  2674. * @details
  2675. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2676. * (WBM) offload HW.
  2677. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2678. * For software based completions, release_source_module will
  2679. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2680. * struct wbm_release_ring and then switch to this after looking at
  2681. * release_source_module.
  2682. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2683. * by new generations of targets.
  2684. */
  2685. PREPACK struct htt_tx_wbm_completion_v3 {
  2686. A_UINT32
  2687. used_by_hw0; /* Refer to struct wbm_release_ring */
  2688. A_UINT32
  2689. used_by_hw1; /* Refer to struct wbm_release_ring */
  2690. A_UINT32
  2691. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2692. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2693. used_by_hw3: 15;
  2694. A_UINT32
  2695. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2696. exception_frame: 1,
  2697. rsvd0: 27; /* For future use */
  2698. A_UINT32
  2699. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2700. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2701. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2702. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2703. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2704. */
  2705. A_UINT32
  2706. data1: 32;
  2707. A_UINT32
  2708. data2: 32;
  2709. A_UINT32
  2710. rsvd1: 20,
  2711. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2712. } POSTPACK;
  2713. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2714. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2715. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2716. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2717. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2718. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2719. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2720. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2721. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2722. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2723. do { \
  2724. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2725. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2726. } while (0)
  2727. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2728. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2729. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2730. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2731. do { \
  2732. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2733. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2734. } while (0)
  2735. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2736. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2737. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2738. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2739. do { \
  2740. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2741. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2742. } while (0)
  2743. typedef enum {
  2744. TX_FRAME_TYPE_UNDEFINED = 0,
  2745. TX_FRAME_TYPE_EAPOL = 1,
  2746. } htt_tx_wbm_status_frame_type;
  2747. /**
  2748. * @brief HTT TX WBM transmit status from firmware to host
  2749. * @details
  2750. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2751. * (WBM) offload HW.
  2752. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2753. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2754. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2755. */
  2756. PREPACK struct htt_tx_wbm_transmit_status {
  2757. A_UINT32
  2758. sch_cmd_id: 24,
  2759. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2760. * reception of an ACK or BA, this field indicates
  2761. * the RSSI of the received ACK or BA frame.
  2762. * When the frame is removed as result of a direct
  2763. * remove command from the SW, this field is set
  2764. * to 0x0 (which is never a valid value when real
  2765. * RSSI is available).
  2766. * Units: dB w.r.t noise floor
  2767. */
  2768. A_UINT32
  2769. sw_peer_id: 16,
  2770. tid_num: 5,
  2771. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2772. * and tid_num fields contain valid data.
  2773. * If this "valid" flag is not set, the
  2774. * sw_peer_id and tid_num fields must be ignored.
  2775. */
  2776. mcast: 1,
  2777. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2778. * contains valid data.
  2779. */
  2780. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2781. reserved: 4;
  2782. A_UINT32
  2783. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2784. * packets in the wbm completion path
  2785. */
  2786. } POSTPACK;
  2787. /* DWORD 4 */
  2788. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2789. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2790. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2791. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2792. /* DWORD 5 */
  2793. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2794. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2795. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2796. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2797. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2798. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2799. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2800. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2801. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2802. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2803. /* DWORD 4 */
  2804. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2805. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2806. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2807. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2808. do { \
  2809. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2810. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2811. } while (0)
  2812. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2813. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2814. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2815. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2816. do { \
  2817. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2818. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2819. } while (0)
  2820. /* DWORD 5 */
  2821. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2822. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2823. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2824. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2827. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2828. } while (0)
  2829. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2830. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2831. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2832. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2835. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2836. } while (0)
  2837. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2838. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2839. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2840. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2843. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2844. } while (0)
  2845. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2846. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2847. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2848. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2851. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2852. } while (0)
  2853. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2854. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2855. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2856. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2859. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2860. } while (0)
  2861. /**
  2862. * @brief HTT TX WBM reinject status from firmware to host
  2863. * @details
  2864. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2865. * (WBM) offload HW.
  2866. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2867. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2868. */
  2869. PREPACK struct htt_tx_wbm_reinject_status {
  2870. A_UINT32
  2871. reserved0: 32;
  2872. A_UINT32
  2873. reserved1: 32;
  2874. A_UINT32
  2875. reserved2: 32;
  2876. } POSTPACK;
  2877. /**
  2878. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2879. * @details
  2880. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2881. * (WBM) offload HW.
  2882. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2883. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2884. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2885. * STA side.
  2886. */
  2887. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2888. A_UINT32
  2889. mec_sa_addr_31_0;
  2890. A_UINT32
  2891. mec_sa_addr_47_32: 16,
  2892. sa_ast_index: 16;
  2893. A_UINT32
  2894. vdev_id: 8,
  2895. reserved0: 24;
  2896. } POSTPACK;
  2897. /* DWORD 4 - mec_sa_addr_31_0 */
  2898. /* DWORD 5 */
  2899. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2900. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2901. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2902. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2903. /* DWORD 6 */
  2904. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2905. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2906. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2907. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2908. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2909. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2910. do { \
  2911. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2912. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2913. } while (0)
  2914. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2915. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2916. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2917. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2918. do { \
  2919. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2920. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2921. } while (0)
  2922. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2923. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2924. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2925. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2926. do { \
  2927. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2928. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2929. } while (0)
  2930. typedef enum {
  2931. TX_FLOW_PRIORITY_BE,
  2932. TX_FLOW_PRIORITY_HIGH,
  2933. TX_FLOW_PRIORITY_LOW,
  2934. } htt_tx_flow_priority_t;
  2935. typedef enum {
  2936. TX_FLOW_LATENCY_SENSITIVE,
  2937. TX_FLOW_LATENCY_INSENSITIVE,
  2938. } htt_tx_flow_latency_t;
  2939. typedef enum {
  2940. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2941. TX_FLOW_INTERACTIVE_TRAFFIC,
  2942. TX_FLOW_PERIODIC_TRAFFIC,
  2943. TX_FLOW_BURSTY_TRAFFIC,
  2944. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2945. } htt_tx_flow_traffic_pattern_t;
  2946. /**
  2947. * @brief HTT TX Flow search metadata format
  2948. * @details
  2949. * Host will set this metadata in flow table's flow search entry along with
  2950. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2951. * firmware and TQM ring if the flow search entry wins.
  2952. * This metadata is available to firmware in that first MSDU's
  2953. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2954. * to one of the available flows for specific tid and returns the tqm flow
  2955. * pointer as part of htt_tx_map_flow_info message.
  2956. */
  2957. PREPACK struct htt_tx_flow_metadata {
  2958. A_UINT32
  2959. rsvd0_1_0: 2,
  2960. tid: 4,
  2961. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2962. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2963. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2964. * Else choose final tid based on latency, priority.
  2965. */
  2966. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2967. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2968. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2969. } POSTPACK;
  2970. /* DWORD 0 */
  2971. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2972. #define HTT_TX_FLOW_METADATA_TID_S 2
  2973. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2974. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2975. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2976. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2977. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2978. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2979. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2980. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2981. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2982. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2983. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2984. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2985. /* DWORD 0 */
  2986. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2987. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2988. HTT_TX_FLOW_METADATA_TID_S)
  2989. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2990. do { \
  2991. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2992. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2993. } while (0)
  2994. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2995. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2996. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2997. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  3000. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  3001. } while (0)
  3002. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  3003. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  3004. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  3005. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  3008. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  3009. } while (0)
  3010. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  3011. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  3012. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  3013. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  3014. do { \
  3015. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  3016. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  3017. } while (0)
  3018. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  3019. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3020. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3021. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3024. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3025. } while (0)
  3026. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3027. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3028. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3029. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3032. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3033. } while (0)
  3034. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3035. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3036. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3037. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3040. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3041. } while (0)
  3042. /**
  3043. * @brief host -> target ADD WDS Entry
  3044. *
  3045. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3046. *
  3047. * @brief host -> target DELETE WDS Entry
  3048. *
  3049. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3050. *
  3051. * @details
  3052. * HTT wds entry from source port learning
  3053. * Host will learn wds entries from rx and send this message to firmware
  3054. * to enable firmware to configure/delete AST entries for wds clients.
  3055. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3056. * and when SA's entry is deleted, firmware removes this AST entry
  3057. *
  3058. * The message would appear as follows:
  3059. *
  3060. * |31 30|29 |17 16|15 8|7 0|
  3061. * |----------------+----------------+----------------+----------------|
  3062. * | rsvd0 |PDVID| vdev_id | msg_type |
  3063. * |-------------------------------------------------------------------|
  3064. * | sa_addr_31_0 |
  3065. * |-------------------------------------------------------------------|
  3066. * | | ta_peer_id | sa_addr_47_32 |
  3067. * |-------------------------------------------------------------------|
  3068. * Where PDVID = pdev_id
  3069. *
  3070. * The message is interpreted as follows:
  3071. *
  3072. * dword0 - b'0:7 - msg_type: This will be set to
  3073. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3074. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3075. *
  3076. * dword0 - b'8:15 - vdev_id
  3077. *
  3078. * dword0 - b'16:17 - pdev_id
  3079. *
  3080. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3081. *
  3082. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3083. *
  3084. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3085. *
  3086. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3087. */
  3088. PREPACK struct htt_wds_entry {
  3089. A_UINT32
  3090. msg_type: 8,
  3091. vdev_id: 8,
  3092. pdev_id: 2,
  3093. rsvd0: 14;
  3094. A_UINT32 sa_addr_31_0;
  3095. A_UINT32
  3096. sa_addr_47_32: 16,
  3097. ta_peer_id: 14,
  3098. rsvd2: 2;
  3099. } POSTPACK;
  3100. /* DWORD 0 */
  3101. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3102. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3103. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3104. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3105. /* DWORD 2 */
  3106. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3107. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3108. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3109. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3110. /* DWORD 0 */
  3111. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3112. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3113. HTT_WDS_ENTRY_VDEV_ID_S)
  3114. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3117. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3118. } while (0)
  3119. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3120. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3121. HTT_WDS_ENTRY_PDEV_ID_S)
  3122. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3123. do { \
  3124. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3125. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3126. } while (0)
  3127. /* DWORD 2 */
  3128. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3129. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3130. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3131. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3134. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3135. } while (0)
  3136. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3137. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3138. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3139. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3142. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3143. } while (0)
  3144. /**
  3145. * @brief MAC DMA rx ring setup specification
  3146. *
  3147. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3148. *
  3149. * @details
  3150. * To allow for dynamic rx ring reconfiguration and to avoid race
  3151. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3152. * it uses. Instead, it sends this message to the target, indicating how
  3153. * the rx ring used by the host should be set up and maintained.
  3154. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3155. * specifications.
  3156. *
  3157. * |31 16|15 8|7 0|
  3158. * |---------------------------------------------------------------|
  3159. * header: | reserved | num rings | msg type |
  3160. * |---------------------------------------------------------------|
  3161. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3162. #if HTT_PADDR64
  3163. * | FW_IDX shadow register physical address (bits 63:32) |
  3164. #endif
  3165. * |---------------------------------------------------------------|
  3166. * | rx ring base physical address (bits 31:0) |
  3167. #if HTT_PADDR64
  3168. * | rx ring base physical address (bits 63:32) |
  3169. #endif
  3170. * |---------------------------------------------------------------|
  3171. * | rx ring buffer size | rx ring length |
  3172. * |---------------------------------------------------------------|
  3173. * | FW_IDX initial value | enabled flags |
  3174. * |---------------------------------------------------------------|
  3175. * | MSDU payload offset | 802.11 header offset |
  3176. * |---------------------------------------------------------------|
  3177. * | PPDU end offset | PPDU start offset |
  3178. * |---------------------------------------------------------------|
  3179. * | MPDU end offset | MPDU start offset |
  3180. * |---------------------------------------------------------------|
  3181. * | MSDU end offset | MSDU start offset |
  3182. * |---------------------------------------------------------------|
  3183. * | frag info offset | rx attention offset |
  3184. * |---------------------------------------------------------------|
  3185. * payload 2, if present, has the same format as payload 1
  3186. * Header fields:
  3187. * - MSG_TYPE
  3188. * Bits 7:0
  3189. * Purpose: identifies this as an rx ring configuration message
  3190. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3191. * - NUM_RINGS
  3192. * Bits 15:8
  3193. * Purpose: indicates whether the host is setting up one rx ring or two
  3194. * Value: 1 or 2
  3195. * Payload:
  3196. * for systems using 64-bit format for bus addresses:
  3197. * - IDX_SHADOW_REG_PADDR_LO
  3198. * Bits 31:0
  3199. * Value: lower 4 bytes of physical address of the host's
  3200. * FW_IDX shadow register
  3201. * - IDX_SHADOW_REG_PADDR_HI
  3202. * Bits 31:0
  3203. * Value: upper 4 bytes of physical address of the host's
  3204. * FW_IDX shadow register
  3205. * - RING_BASE_PADDR_LO
  3206. * Bits 31:0
  3207. * Value: lower 4 bytes of physical address of the host's rx ring
  3208. * - RING_BASE_PADDR_HI
  3209. * Bits 31:0
  3210. * Value: uppper 4 bytes of physical address of the host's rx ring
  3211. * for systems using 32-bit format for bus addresses:
  3212. * - IDX_SHADOW_REG_PADDR
  3213. * Bits 31:0
  3214. * Value: physical address of the host's FW_IDX shadow register
  3215. * - RING_BASE_PADDR
  3216. * Bits 31:0
  3217. * Value: physical address of the host's rx ring
  3218. * - RING_LEN
  3219. * Bits 15:0
  3220. * Value: number of elements in the rx ring
  3221. * - RING_BUF_SZ
  3222. * Bits 31:16
  3223. * Value: size of the buffers referenced by the rx ring, in byte units
  3224. * - ENABLED_FLAGS
  3225. * Bits 15:0
  3226. * Value: 1-bit flags to show whether different rx fields are enabled
  3227. * bit 0: 802.11 header enabled (1) or disabled (0)
  3228. * bit 1: MSDU payload enabled (1) or disabled (0)
  3229. * bit 2: PPDU start enabled (1) or disabled (0)
  3230. * bit 3: PPDU end enabled (1) or disabled (0)
  3231. * bit 4: MPDU start enabled (1) or disabled (0)
  3232. * bit 5: MPDU end enabled (1) or disabled (0)
  3233. * bit 6: MSDU start enabled (1) or disabled (0)
  3234. * bit 7: MSDU end enabled (1) or disabled (0)
  3235. * bit 8: rx attention enabled (1) or disabled (0)
  3236. * bit 9: frag info enabled (1) or disabled (0)
  3237. * bit 10: unicast rx enabled (1) or disabled (0)
  3238. * bit 11: multicast rx enabled (1) or disabled (0)
  3239. * bit 12: ctrl rx enabled (1) or disabled (0)
  3240. * bit 13: mgmt rx enabled (1) or disabled (0)
  3241. * bit 14: null rx enabled (1) or disabled (0)
  3242. * bit 15: phy data rx enabled (1) or disabled (0)
  3243. * - IDX_INIT_VAL
  3244. * Bits 31:16
  3245. * Purpose: Specify the initial value for the FW_IDX.
  3246. * Value: the number of buffers initially present in the host's rx ring
  3247. * - OFFSET_802_11_HDR
  3248. * Bits 15:0
  3249. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3250. * - OFFSET_MSDU_PAYLOAD
  3251. * Bits 31:16
  3252. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3253. * - OFFSET_PPDU_START
  3254. * Bits 15:0
  3255. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3256. * - OFFSET_PPDU_END
  3257. * Bits 31:16
  3258. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3259. * - OFFSET_MPDU_START
  3260. * Bits 15:0
  3261. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3262. * - OFFSET_MPDU_END
  3263. * Bits 31:16
  3264. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3265. * - OFFSET_MSDU_START
  3266. * Bits 15:0
  3267. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3268. * - OFFSET_MSDU_END
  3269. * Bits 31:16
  3270. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3271. * - OFFSET_RX_ATTN
  3272. * Bits 15:0
  3273. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3274. * - OFFSET_FRAG_INFO
  3275. * Bits 31:16
  3276. * Value: offset in QUAD-bytes of frag info table
  3277. */
  3278. /* header fields */
  3279. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3280. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3281. /* payload fields */
  3282. /* for systems using a 64-bit format for bus addresses */
  3283. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3284. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3285. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3286. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3287. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3288. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3289. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3290. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3291. /* for systems using a 32-bit format for bus addresses */
  3292. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3293. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3294. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3295. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3296. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3297. #define HTT_RX_RING_CFG_LEN_S 0
  3298. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3299. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3300. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3301. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3302. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3303. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3304. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3305. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3306. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3307. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3308. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3309. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3310. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3311. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3312. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3313. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3314. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3315. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3316. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3317. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3318. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3319. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3320. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3321. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3322. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3323. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3324. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3325. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3326. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3327. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3328. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3329. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3330. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3331. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3332. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3333. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3334. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3335. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3336. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3337. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3338. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3339. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3340. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3341. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3342. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3343. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3344. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3345. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3346. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3347. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3348. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3349. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3350. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3351. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3352. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3353. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3354. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3355. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3356. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3357. #if HTT_PADDR64
  3358. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3359. #else
  3360. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3361. #endif
  3362. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3363. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3364. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3365. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3366. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3367. do { \
  3368. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3369. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3370. } while (0)
  3371. /* degenerate case for 32-bit fields */
  3372. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3373. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3374. ((_var) = (_val))
  3375. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3376. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3377. ((_var) = (_val))
  3378. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3379. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3380. ((_var) = (_val))
  3381. /* degenerate case for 32-bit fields */
  3382. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3383. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3384. ((_var) = (_val))
  3385. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3386. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3387. ((_var) = (_val))
  3388. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3389. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3390. ((_var) = (_val))
  3391. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3392. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3393. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3396. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3397. } while (0)
  3398. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3399. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3400. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3407. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3408. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3415. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3416. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3423. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3424. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3431. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3432. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3439. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3440. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3447. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3448. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3455. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3456. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3460. } while (0)
  3461. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3462. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3463. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3464. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3467. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3468. } while (0)
  3469. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3470. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3471. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3472. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3475. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3476. } while (0)
  3477. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3478. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3479. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3480. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3483. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3484. } while (0)
  3485. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3486. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3487. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3488. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3491. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3492. } while (0)
  3493. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3494. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3495. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3496. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3499. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3500. } while (0)
  3501. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3502. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3503. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3504. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3507. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3508. } while (0)
  3509. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3510. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3511. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3512. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3515. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3516. } while (0)
  3517. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3518. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3519. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3520. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3523. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3524. } while (0)
  3525. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3526. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3527. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3528. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3531. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3532. } while (0)
  3533. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3534. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3535. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3536. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3539. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3540. } while (0)
  3541. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3542. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3543. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3544. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3547. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3548. } while (0)
  3549. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3550. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3551. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3552. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3555. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3556. } while (0)
  3557. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3558. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3559. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3560. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3563. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3564. } while (0)
  3565. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3566. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3567. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3568. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3571. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3572. } while (0)
  3573. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3574. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3575. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3576. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3579. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3580. } while (0)
  3581. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3582. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3583. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3584. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3587. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3588. } while (0)
  3589. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3590. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3591. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3592. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3593. do { \
  3594. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3595. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3596. } while (0)
  3597. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3598. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3599. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3600. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3601. do { \
  3602. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3603. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3604. } while (0)
  3605. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3606. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3607. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3608. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3609. do { \
  3610. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3611. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3612. } while (0)
  3613. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3614. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3615. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3616. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3617. do { \
  3618. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3619. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3620. } while (0)
  3621. /**
  3622. * @brief host -> target FW statistics retrieve
  3623. *
  3624. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3625. *
  3626. * @details
  3627. * The following field definitions describe the format of the HTT host
  3628. * to target FW stats retrieve message. The message specifies the type of
  3629. * stats host wants to retrieve.
  3630. *
  3631. * |31 24|23 16|15 8|7 0|
  3632. * |-----------------------------------------------------------|
  3633. * | stats types request bitmask | msg type |
  3634. * |-----------------------------------------------------------|
  3635. * | stats types reset bitmask | reserved |
  3636. * |-----------------------------------------------------------|
  3637. * | stats type | config value |
  3638. * |-----------------------------------------------------------|
  3639. * | cookie LSBs |
  3640. * |-----------------------------------------------------------|
  3641. * | cookie MSBs |
  3642. * |-----------------------------------------------------------|
  3643. * Header fields:
  3644. * - MSG_TYPE
  3645. * Bits 7:0
  3646. * Purpose: identifies this is a stats upload request message
  3647. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3648. * - UPLOAD_TYPES
  3649. * Bits 31:8
  3650. * Purpose: identifies which types of FW statistics to upload
  3651. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3652. * - RESET_TYPES
  3653. * Bits 31:8
  3654. * Purpose: identifies which types of FW statistics to reset
  3655. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3656. * - CFG_VAL
  3657. * Bits 23:0
  3658. * Purpose: give an opaque configuration value to the specified stats type
  3659. * Value: stats-type specific configuration value
  3660. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3661. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3662. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3663. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3664. * - CFG_STAT_TYPE
  3665. * Bits 31:24
  3666. * Purpose: specify which stats type (if any) the config value applies to
  3667. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3668. * a valid configuration specification
  3669. * - COOKIE_LSBS
  3670. * Bits 31:0
  3671. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3672. * message with its preceding host->target stats request message.
  3673. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3674. * - COOKIE_MSBS
  3675. * Bits 31:0
  3676. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3677. * message with its preceding host->target stats request message.
  3678. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3679. */
  3680. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3681. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3682. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3683. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3684. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3685. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3686. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3687. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3688. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3689. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3690. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3691. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3692. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3693. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3696. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3697. } while (0)
  3698. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3699. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3700. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3701. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3704. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3705. } while (0)
  3706. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3707. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3708. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3709. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3712. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3713. } while (0)
  3714. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3715. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3716. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3717. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3720. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3721. } while (0)
  3722. /**
  3723. * @brief host -> target HTT out-of-band sync request
  3724. *
  3725. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3726. *
  3727. * @details
  3728. * The HTT SYNC tells the target to suspend processing of subsequent
  3729. * HTT host-to-target messages until some other target agent locally
  3730. * informs the target HTT FW that the current sync counter is equal to
  3731. * or greater than (in a modulo sense) the sync counter specified in
  3732. * the SYNC message.
  3733. * This allows other host-target components to synchronize their operation
  3734. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3735. * security key has been downloaded to and activated by the target.
  3736. * In the absence of any explicit synchronization counter value
  3737. * specification, the target HTT FW will use zero as the default current
  3738. * sync value.
  3739. *
  3740. * |31 24|23 16|15 8|7 0|
  3741. * |-----------------------------------------------------------|
  3742. * | reserved | sync count | msg type |
  3743. * |-----------------------------------------------------------|
  3744. * Header fields:
  3745. * - MSG_TYPE
  3746. * Bits 7:0
  3747. * Purpose: identifies this as a sync message
  3748. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3749. * - SYNC_COUNT
  3750. * Bits 15:8
  3751. * Purpose: specifies what sync value the HTT FW will wait for from
  3752. * an out-of-band specification to resume its operation
  3753. * Value: in-band sync counter value to compare against the out-of-band
  3754. * counter spec.
  3755. * The HTT target FW will suspend its host->target message processing
  3756. * as long as
  3757. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3758. */
  3759. #define HTT_H2T_SYNC_MSG_SZ 4
  3760. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3761. #define HTT_H2T_SYNC_COUNT_S 8
  3762. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3763. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3764. HTT_H2T_SYNC_COUNT_S)
  3765. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3768. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3769. } while (0)
  3770. /**
  3771. * @brief host -> target HTT aggregation configuration
  3772. *
  3773. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3774. */
  3775. #define HTT_AGGR_CFG_MSG_SZ 4
  3776. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3777. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3778. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3779. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3780. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3781. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3782. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3783. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3784. do { \
  3785. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3786. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3787. } while (0)
  3788. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3789. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3790. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3791. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3792. do { \
  3793. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3794. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3795. } while (0)
  3796. /**
  3797. * @brief host -> target HTT configure max amsdu info per vdev
  3798. *
  3799. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3800. *
  3801. * @details
  3802. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3803. *
  3804. * |31 21|20 16|15 8|7 0|
  3805. * |-----------------------------------------------------------|
  3806. * | reserved | vdev id | max amsdu | msg type |
  3807. * |-----------------------------------------------------------|
  3808. * Header fields:
  3809. * - MSG_TYPE
  3810. * Bits 7:0
  3811. * Purpose: identifies this as a aggr cfg ex message
  3812. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3813. * - MAX_NUM_AMSDU_SUBFRM
  3814. * Bits 15:8
  3815. * Purpose: max MSDUs per A-MSDU
  3816. * - VDEV_ID
  3817. * Bits 20:16
  3818. * Purpose: ID of the vdev to which this limit is applied
  3819. */
  3820. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3821. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3822. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3823. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3824. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3825. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3826. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3827. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3828. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3829. do { \
  3830. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3831. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3832. } while (0)
  3833. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3834. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3835. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3836. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3837. do { \
  3838. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3839. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3840. } while (0)
  3841. /**
  3842. * @brief HTT WDI_IPA Config Message
  3843. *
  3844. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3845. *
  3846. * @details
  3847. * The HTT WDI_IPA config message is created/sent by host at driver
  3848. * init time. It contains information about data structures used on
  3849. * WDI_IPA TX and RX path.
  3850. * TX CE ring is used for pushing packet metadata from IPA uC
  3851. * to WLAN FW
  3852. * TX Completion ring is used for generating TX completions from
  3853. * WLAN FW to IPA uC
  3854. * RX Indication ring is used for indicating RX packets from FW
  3855. * to IPA uC
  3856. * RX Ring2 is used as either completion ring or as second
  3857. * indication ring. when Ring2 is used as completion ring, IPA uC
  3858. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3859. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3860. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3861. * indicated in RX Indication ring. Please see WDI_IPA specification
  3862. * for more details.
  3863. * |31 24|23 16|15 8|7 0|
  3864. * |----------------+----------------+----------------+----------------|
  3865. * | tx pkt pool size | Rsvd | msg_type |
  3866. * |-------------------------------------------------------------------|
  3867. * | tx comp ring base (bits 31:0) |
  3868. #if HTT_PADDR64
  3869. * | tx comp ring base (bits 63:32) |
  3870. #endif
  3871. * |-------------------------------------------------------------------|
  3872. * | tx comp ring size |
  3873. * |-------------------------------------------------------------------|
  3874. * | tx comp WR_IDX physical address (bits 31:0) |
  3875. #if HTT_PADDR64
  3876. * | tx comp WR_IDX physical address (bits 63:32) |
  3877. #endif
  3878. * |-------------------------------------------------------------------|
  3879. * | tx CE WR_IDX physical address (bits 31:0) |
  3880. #if HTT_PADDR64
  3881. * | tx CE WR_IDX physical address (bits 63:32) |
  3882. #endif
  3883. * |-------------------------------------------------------------------|
  3884. * | rx indication ring base (bits 31:0) |
  3885. #if HTT_PADDR64
  3886. * | rx indication ring base (bits 63:32) |
  3887. #endif
  3888. * |-------------------------------------------------------------------|
  3889. * | rx indication ring size |
  3890. * |-------------------------------------------------------------------|
  3891. * | rx ind RD_IDX physical address (bits 31:0) |
  3892. #if HTT_PADDR64
  3893. * | rx ind RD_IDX physical address (bits 63:32) |
  3894. #endif
  3895. * |-------------------------------------------------------------------|
  3896. * | rx ind WR_IDX physical address (bits 31:0) |
  3897. #if HTT_PADDR64
  3898. * | rx ind WR_IDX physical address (bits 63:32) |
  3899. #endif
  3900. * |-------------------------------------------------------------------|
  3901. * |-------------------------------------------------------------------|
  3902. * | rx ring2 base (bits 31:0) |
  3903. #if HTT_PADDR64
  3904. * | rx ring2 base (bits 63:32) |
  3905. #endif
  3906. * |-------------------------------------------------------------------|
  3907. * | rx ring2 size |
  3908. * |-------------------------------------------------------------------|
  3909. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3910. #if HTT_PADDR64
  3911. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3912. #endif
  3913. * |-------------------------------------------------------------------|
  3914. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3915. #if HTT_PADDR64
  3916. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3917. #endif
  3918. * |-------------------------------------------------------------------|
  3919. *
  3920. * Header fields:
  3921. * Header fields:
  3922. * - MSG_TYPE
  3923. * Bits 7:0
  3924. * Purpose: Identifies this as WDI_IPA config message
  3925. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3926. * - TX_PKT_POOL_SIZE
  3927. * Bits 15:0
  3928. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3929. * WDI_IPA TX path
  3930. * For systems using 32-bit format for bus addresses:
  3931. * - TX_COMP_RING_BASE_ADDR
  3932. * Bits 31:0
  3933. * Purpose: TX Completion Ring base address in DDR
  3934. * - TX_COMP_RING_SIZE
  3935. * Bits 31:0
  3936. * Purpose: TX Completion Ring size (must be power of 2)
  3937. * - TX_COMP_WR_IDX_ADDR
  3938. * Bits 31:0
  3939. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3940. * updates the Write Index for WDI_IPA TX completion ring
  3941. * - TX_CE_WR_IDX_ADDR
  3942. * Bits 31:0
  3943. * Purpose: DDR address where IPA uC
  3944. * updates the WR Index for TX CE ring
  3945. * (needed for fusion platforms)
  3946. * - RX_IND_RING_BASE_ADDR
  3947. * Bits 31:0
  3948. * Purpose: RX Indication Ring base address in DDR
  3949. * - RX_IND_RING_SIZE
  3950. * Bits 31:0
  3951. * Purpose: RX Indication Ring size
  3952. * - RX_IND_RD_IDX_ADDR
  3953. * Bits 31:0
  3954. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3955. * RX indication ring
  3956. * - RX_IND_WR_IDX_ADDR
  3957. * Bits 31:0
  3958. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3959. * updates the Write Index for WDI_IPA RX indication ring
  3960. * - RX_RING2_BASE_ADDR
  3961. * Bits 31:0
  3962. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3963. * - RX_RING2_SIZE
  3964. * Bits 31:0
  3965. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3966. * - RX_RING2_RD_IDX_ADDR
  3967. * Bits 31:0
  3968. * Purpose: If Second RX ring is Indication ring, DDR address where
  3969. * IPA uC updates the Read Index for Ring2.
  3970. * If Second RX ring is completion ring, this is NOT used
  3971. * - RX_RING2_WR_IDX_ADDR
  3972. * Bits 31:0
  3973. * Purpose: If Second RX ring is Indication ring, DDR address where
  3974. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3975. * If second RX ring is completion ring, DDR address where
  3976. * IPA uC updates the Write Index for Ring 2.
  3977. * For systems using 64-bit format for bus addresses:
  3978. * - TX_COMP_RING_BASE_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3981. * - TX_COMP_RING_BASE_ADDR_HI
  3982. * Bits 31:0
  3983. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3984. * - TX_COMP_RING_SIZE
  3985. * Bits 31:0
  3986. * Purpose: TX Completion Ring size (must be power of 2)
  3987. * - TX_COMP_WR_IDX_ADDR_LO
  3988. * Bits 31:0
  3989. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3990. * Lower 4 bytes of DDR address where WIFI FW
  3991. * updates the Write Index for WDI_IPA TX completion ring
  3992. * - TX_COMP_WR_IDX_ADDR_HI
  3993. * Bits 31:0
  3994. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3995. * Higher 4 bytes of DDR address where WIFI FW
  3996. * updates the Write Index for WDI_IPA TX completion ring
  3997. * - TX_CE_WR_IDX_ADDR_LO
  3998. * Bits 31:0
  3999. * Purpose: Lower 4 bytes of DDR address where IPA uC
  4000. * updates the WR Index for TX CE ring
  4001. * (needed for fusion platforms)
  4002. * - TX_CE_WR_IDX_ADDR_HI
  4003. * Bits 31:0
  4004. * Purpose: Higher 4 bytes of DDR address where IPA uC
  4005. * updates the WR Index for TX CE ring
  4006. * (needed for fusion platforms)
  4007. * - RX_IND_RING_BASE_ADDR_LO
  4008. * Bits 31:0
  4009. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  4010. * - RX_IND_RING_BASE_ADDR_HI
  4011. * Bits 31:0
  4012. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  4013. * - RX_IND_RING_SIZE
  4014. * Bits 31:0
  4015. * Purpose: RX Indication Ring size
  4016. * - RX_IND_RD_IDX_ADDR_LO
  4017. * Bits 31:0
  4018. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  4019. * for WDI_IPA RX indication ring
  4020. * - RX_IND_RD_IDX_ADDR_HI
  4021. * Bits 31:0
  4022. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4023. * for WDI_IPA RX indication ring
  4024. * - RX_IND_WR_IDX_ADDR_LO
  4025. * Bits 31:0
  4026. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4027. * Lower 4 bytes of DDR address where WIFI FW
  4028. * updates the Write Index for WDI_IPA RX indication ring
  4029. * - RX_IND_WR_IDX_ADDR_HI
  4030. * Bits 31:0
  4031. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4032. * Higher 4 bytes of DDR address where WIFI FW
  4033. * updates the Write Index for WDI_IPA RX indication ring
  4034. * - RX_RING2_BASE_ADDR_LO
  4035. * Bits 31:0
  4036. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4037. * - RX_RING2_BASE_ADDR_HI
  4038. * Bits 31:0
  4039. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4040. * - RX_RING2_SIZE
  4041. * Bits 31:0
  4042. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4043. * - RX_RING2_RD_IDX_ADDR_LO
  4044. * Bits 31:0
  4045. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4046. * DDR address where IPA uC updates the Read Index for Ring2.
  4047. * If Second RX ring is completion ring, this is NOT used
  4048. * - RX_RING2_RD_IDX_ADDR_HI
  4049. * Bits 31:0
  4050. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4051. * DDR address where IPA uC updates the Read Index for Ring2.
  4052. * If Second RX ring is completion ring, this is NOT used
  4053. * - RX_RING2_WR_IDX_ADDR_LO
  4054. * Bits 31:0
  4055. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4056. * DDR address where WIFI FW updates the Write Index
  4057. * for WDI_IPA RX ring2
  4058. * If second RX ring is completion ring, lower 4 bytes of
  4059. * DDR address where IPA uC updates the Write Index for Ring 2.
  4060. * - RX_RING2_WR_IDX_ADDR_HI
  4061. * Bits 31:0
  4062. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4063. * DDR address where WIFI FW updates the Write Index
  4064. * for WDI_IPA RX ring2
  4065. * If second RX ring is completion ring, higher 4 bytes of
  4066. * DDR address where IPA uC updates the Write Index for Ring 2.
  4067. */
  4068. #if HTT_PADDR64
  4069. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4070. #else
  4071. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4072. #endif
  4073. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4074. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4075. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4077. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4081. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4083. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4089. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4091. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4093. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4109. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4110. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4111. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4112. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4113. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4114. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4115. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4116. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4117. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4118. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4119. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4120. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4121. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4122. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4123. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4124. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4125. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4126. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4127. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4128. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4129. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4130. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4131. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4132. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4133. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4134. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4135. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4136. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4137. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4140. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4141. } while (0)
  4142. /* for systems using 32-bit format for bus addr */
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4144. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4148. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4149. } while (0)
  4150. /* for systems using 64-bit format for bus addr */
  4151. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4152. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4153. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4156. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4157. } while (0)
  4158. /* for systems using 64-bit format for bus addr */
  4159. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4160. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4161. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4164. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4165. } while (0)
  4166. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4167. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4168. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4171. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4172. } while (0)
  4173. /* for systems using 32-bit format for bus addr */
  4174. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4175. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4176. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4179. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4180. } while (0)
  4181. /* for systems using 64-bit format for bus addr */
  4182. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4183. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4184. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4187. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4188. } while (0)
  4189. /* for systems using 64-bit format for bus addr */
  4190. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4191. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4192. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4193. do { \
  4194. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4195. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4196. } while (0)
  4197. /* for systems using 32-bit format for bus addr */
  4198. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4199. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4200. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4203. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4204. } while (0)
  4205. /* for systems using 64-bit format for bus addr */
  4206. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4207. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4208. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4211. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4212. } while (0)
  4213. /* for systems using 64-bit format for bus addr */
  4214. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4215. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4216. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4219. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4220. } while (0)
  4221. /* for systems using 32-bit format for bus addr */
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4223. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4227. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4228. } while (0)
  4229. /* for systems using 64-bit format for bus addr */
  4230. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4231. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4232. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4235. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4236. } while (0)
  4237. /* for systems using 64-bit format for bus addr */
  4238. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4239. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4240. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4243. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4244. } while (0)
  4245. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4246. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4247. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4248. do { \
  4249. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4250. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4251. } while (0)
  4252. /* for systems using 32-bit format for bus addr */
  4253. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4254. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4255. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4258. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4259. } while (0)
  4260. /* for systems using 64-bit format for bus addr */
  4261. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4262. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4263. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4267. } while (0)
  4268. /* for systems using 64-bit format for bus addr */
  4269. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4270. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4271. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4274. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4275. } while (0)
  4276. /* for systems using 32-bit format for bus addr */
  4277. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4278. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4279. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4282. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4283. } while (0)
  4284. /* for systems using 64-bit format for bus addr */
  4285. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4286. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4287. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4288. do { \
  4289. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4290. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4291. } while (0)
  4292. /* for systems using 64-bit format for bus addr */
  4293. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4294. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4295. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4298. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4299. } while (0)
  4300. /* for systems using 32-bit format for bus addr */
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4302. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4306. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4307. } while (0)
  4308. /* for systems using 64-bit format for bus addr */
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4310. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4314. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4315. } while (0)
  4316. /* for systems using 64-bit format for bus addr */
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4318. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4322. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4323. } while (0)
  4324. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4325. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4326. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4329. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4330. } while (0)
  4331. /* for systems using 32-bit format for bus addr */
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4333. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4334. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4335. do { \
  4336. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4337. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4338. } while (0)
  4339. /* for systems using 64-bit format for bus addr */
  4340. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4341. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4342. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4343. do { \
  4344. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4345. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4346. } while (0)
  4347. /* for systems using 64-bit format for bus addr */
  4348. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4349. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4350. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4351. do { \
  4352. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4353. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4354. } while (0)
  4355. /* for systems using 32-bit format for bus addr */
  4356. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4357. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4358. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4359. do { \
  4360. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4361. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4362. } while (0)
  4363. /* for systems using 64-bit format for bus addr */
  4364. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4365. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4366. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4367. do { \
  4368. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4369. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4370. } while (0)
  4371. /* for systems using 64-bit format for bus addr */
  4372. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4373. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4374. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4375. do { \
  4376. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4377. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4378. } while (0)
  4379. /*
  4380. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4381. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4382. * addresses are stored in a XXX-bit field.
  4383. * This macro is used to define both htt_wdi_ipa_config32_t and
  4384. * htt_wdi_ipa_config64_t structs.
  4385. */
  4386. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4387. _paddr__tx_comp_ring_base_addr_, \
  4388. _paddr__tx_comp_wr_idx_addr_, \
  4389. _paddr__tx_ce_wr_idx_addr_, \
  4390. _paddr__rx_ind_ring_base_addr_, \
  4391. _paddr__rx_ind_rd_idx_addr_, \
  4392. _paddr__rx_ind_wr_idx_addr_, \
  4393. _paddr__rx_ring2_base_addr_,\
  4394. _paddr__rx_ring2_rd_idx_addr_,\
  4395. _paddr__rx_ring2_wr_idx_addr_) \
  4396. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4397. { \
  4398. /* DWORD 0: flags and meta-data */ \
  4399. A_UINT32 \
  4400. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4401. reserved: 8, \
  4402. tx_pkt_pool_size: 16;\
  4403. /* DWORD 1 */\
  4404. _paddr__tx_comp_ring_base_addr_;\
  4405. /* DWORD 2 (or 3)*/\
  4406. A_UINT32 tx_comp_ring_size;\
  4407. /* DWORD 3 (or 4)*/\
  4408. _paddr__tx_comp_wr_idx_addr_;\
  4409. /* DWORD 4 (or 6)*/\
  4410. _paddr__tx_ce_wr_idx_addr_;\
  4411. /* DWORD 5 (or 8)*/\
  4412. _paddr__rx_ind_ring_base_addr_;\
  4413. /* DWORD 6 (or 10)*/\
  4414. A_UINT32 rx_ind_ring_size;\
  4415. /* DWORD 7 (or 11)*/\
  4416. _paddr__rx_ind_rd_idx_addr_;\
  4417. /* DWORD 8 (or 13)*/\
  4418. _paddr__rx_ind_wr_idx_addr_;\
  4419. /* DWORD 9 (or 15)*/\
  4420. _paddr__rx_ring2_base_addr_;\
  4421. /* DWORD 10 (or 17) */\
  4422. A_UINT32 rx_ring2_size;\
  4423. /* DWORD 11 (or 18) */\
  4424. _paddr__rx_ring2_rd_idx_addr_;\
  4425. /* DWORD 12 (or 20) */\
  4426. _paddr__rx_ring2_wr_idx_addr_;\
  4427. } POSTPACK
  4428. /* define a htt_wdi_ipa_config32_t type */
  4429. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  4430. /* define a htt_wdi_ipa_config64_t type */
  4431. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  4432. #if HTT_PADDR64
  4433. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4434. #else
  4435. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4436. #endif
  4437. enum htt_wdi_ipa_op_code {
  4438. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4439. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4440. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4441. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4442. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4443. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4444. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4445. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4446. /* keep this last */
  4447. HTT_WDI_IPA_OPCODE_MAX
  4448. };
  4449. /**
  4450. * @brief HTT WDI_IPA Operation Request Message
  4451. *
  4452. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4453. *
  4454. * @details
  4455. * HTT WDI_IPA Operation Request message is sent by host
  4456. * to either suspend or resume WDI_IPA TX or RX path.
  4457. * |31 24|23 16|15 8|7 0|
  4458. * |----------------+----------------+----------------+----------------|
  4459. * | op_code | Rsvd | msg_type |
  4460. * |-------------------------------------------------------------------|
  4461. *
  4462. * Header fields:
  4463. * - MSG_TYPE
  4464. * Bits 7:0
  4465. * Purpose: Identifies this as WDI_IPA Operation Request message
  4466. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4467. * - OP_CODE
  4468. * Bits 31:16
  4469. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4470. * value: = enum htt_wdi_ipa_op_code
  4471. */
  4472. PREPACK struct htt_wdi_ipa_op_request_t
  4473. {
  4474. /* DWORD 0: flags and meta-data */
  4475. A_UINT32
  4476. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4477. reserved: 8,
  4478. op_code: 16;
  4479. } POSTPACK;
  4480. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4481. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4482. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4483. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4484. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4485. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4486. do { \
  4487. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4488. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4489. } while (0)
  4490. /*
  4491. * @brief host -> target HTT_MSI_SETUP message
  4492. *
  4493. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4494. *
  4495. * @details
  4496. * After target is booted up, host can send MSI setup message so that
  4497. * target sets up HW registers based on setup message.
  4498. *
  4499. * The message would appear as follows:
  4500. * |31 24|23 16|15|14 8|7 0|
  4501. * |---------------+-----------------+-----------------+-----------------|
  4502. * | reserved | msi_type | pdev_id | msg_type |
  4503. * |---------------------------------------------------------------------|
  4504. * | msi_addr_lo |
  4505. * |---------------------------------------------------------------------|
  4506. * | msi_addr_hi |
  4507. * |---------------------------------------------------------------------|
  4508. * | msi_data |
  4509. * |---------------------------------------------------------------------|
  4510. *
  4511. * The message is interpreted as follows:
  4512. * dword0 - b'0:7 - msg_type: This will be set to
  4513. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4514. * b'8:15 - pdev_id:
  4515. * 0 (for rings at SOC/UMAC level),
  4516. * 1/2/3 mac id (for rings at LMAC level)
  4517. * b'16:23 - msi_type: identify which msi registers need to be setup
  4518. * more details can be got from enum htt_msi_setup_type
  4519. * b'24:31 - reserved
  4520. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4521. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4522. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4523. */
  4524. PREPACK struct htt_msi_setup_t {
  4525. A_UINT32 msg_type: 8,
  4526. pdev_id: 8,
  4527. msi_type: 8,
  4528. reserved: 8;
  4529. A_UINT32 msi_addr_lo;
  4530. A_UINT32 msi_addr_hi;
  4531. A_UINT32 msi_data;
  4532. } POSTPACK;
  4533. enum htt_msi_setup_type {
  4534. HTT_PPDU_END_MSI_SETUP_TYPE,
  4535. /* Insert new types here*/
  4536. };
  4537. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4538. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4539. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4540. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4541. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4542. HTT_MSI_SETUP_PDEV_ID_S)
  4543. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4544. do { \
  4545. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4546. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4547. } while (0)
  4548. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4549. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4550. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4551. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4552. HTT_MSI_SETUP_MSI_TYPE_S)
  4553. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4554. do { \
  4555. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4556. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4557. } while (0)
  4558. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4559. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4560. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4561. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4562. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4563. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4564. do { \
  4565. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4566. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4567. } while (0)
  4568. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4569. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4570. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4571. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4572. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4573. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4574. do { \
  4575. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4576. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4577. } while (0)
  4578. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4579. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4580. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4581. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4582. HTT_MSI_SETUP_MSI_DATA_S)
  4583. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4584. do { \
  4585. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4586. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4587. } while (0)
  4588. /*
  4589. * @brief host -> target HTT_SRING_SETUP message
  4590. *
  4591. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4592. *
  4593. * @details
  4594. * After target is booted up, Host can send SRING setup message for
  4595. * each host facing LMAC SRING. Target setups up HW registers based
  4596. * on setup message and confirms back to Host if response_required is set.
  4597. * Host should wait for confirmation message before sending new SRING
  4598. * setup message
  4599. *
  4600. * The message would appear as follows:
  4601. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4602. * |--------------- +-----------------+-----------------+-----------------|
  4603. * | ring_type | ring_id | pdev_id | msg_type |
  4604. * |----------------------------------------------------------------------|
  4605. * | ring_base_addr_lo |
  4606. * |----------------------------------------------------------------------|
  4607. * | ring_base_addr_hi |
  4608. * |----------------------------------------------------------------------|
  4609. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4610. * |----------------------------------------------------------------------|
  4611. * | ring_head_offset32_remote_addr_lo |
  4612. * |----------------------------------------------------------------------|
  4613. * | ring_head_offset32_remote_addr_hi |
  4614. * |----------------------------------------------------------------------|
  4615. * | ring_tail_offset32_remote_addr_lo |
  4616. * |----------------------------------------------------------------------|
  4617. * | ring_tail_offset32_remote_addr_hi |
  4618. * |----------------------------------------------------------------------|
  4619. * | ring_msi_addr_lo |
  4620. * |----------------------------------------------------------------------|
  4621. * | ring_msi_addr_hi |
  4622. * |----------------------------------------------------------------------|
  4623. * | ring_msi_data |
  4624. * |----------------------------------------------------------------------|
  4625. * | intr_timer_th |IM| intr_batch_counter_th |
  4626. * |----------------------------------------------------------------------|
  4627. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4628. * |----------------------------------------------------------------------|
  4629. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4630. * |----------------------------------------------------------------------|
  4631. * Where
  4632. * IM = sw_intr_mode
  4633. * RR = response_required
  4634. * PTCF = prefetch_timer_cfg
  4635. * IP = IPA drop flag
  4636. *
  4637. * The message is interpreted as follows:
  4638. * dword0 - b'0:7 - msg_type: This will be set to
  4639. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4640. * b'8:15 - pdev_id:
  4641. * 0 (for rings at SOC/UMAC level),
  4642. * 1/2/3 mac id (for rings at LMAC level)
  4643. * b'16:23 - ring_id: identify which ring is to setup,
  4644. * more details can be got from enum htt_srng_ring_id
  4645. * b'24:31 - ring_type: identify type of host rings,
  4646. * more details can be got from enum htt_srng_ring_type
  4647. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4648. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4649. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4650. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4651. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4652. * SW_TO_HW_RING.
  4653. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4654. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4655. * Lower 32 bits of memory address of the remote variable
  4656. * storing the 4-byte word offset that identifies the head
  4657. * element within the ring.
  4658. * (The head offset variable has type A_UINT32.)
  4659. * Valid for HW_TO_SW and SW_TO_SW rings.
  4660. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4661. * Upper 32 bits of memory address of the remote variable
  4662. * storing the 4-byte word offset that identifies the head
  4663. * element within the ring.
  4664. * (The head offset variable has type A_UINT32.)
  4665. * Valid for HW_TO_SW and SW_TO_SW rings.
  4666. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4667. * Lower 32 bits of memory address of the remote variable
  4668. * storing the 4-byte word offset that identifies the tail
  4669. * element within the ring.
  4670. * (The tail offset variable has type A_UINT32.)
  4671. * Valid for HW_TO_SW and SW_TO_SW rings.
  4672. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4673. * Upper 32 bits of memory address of the remote variable
  4674. * storing the 4-byte word offset that identifies the tail
  4675. * element within the ring.
  4676. * (The tail offset variable has type A_UINT32.)
  4677. * Valid for HW_TO_SW and SW_TO_SW rings.
  4678. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4679. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4680. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4681. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4682. * dword10 - b'0:31 - ring_msi_data: MSI data
  4683. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4684. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4685. * dword11 - b'0:14 - intr_batch_counter_th:
  4686. * batch counter threshold is in units of 4-byte words.
  4687. * HW internally maintains and increments batch count.
  4688. * (see SRING spec for detail description).
  4689. * When batch count reaches threshold value, an interrupt
  4690. * is generated by HW.
  4691. * b'15 - sw_intr_mode:
  4692. * This configuration shall be static.
  4693. * Only programmed at power up.
  4694. * 0: generate pulse style sw interrupts
  4695. * 1: generate level style sw interrupts
  4696. * b'16:31 - intr_timer_th:
  4697. * The timer init value when timer is idle or is
  4698. * initialized to start downcounting.
  4699. * In 8us units (to cover a range of 0 to 524 ms)
  4700. * dword12 - b'0:15 - intr_low_threshold:
  4701. * Used only by Consumer ring to generate ring_sw_int_p.
  4702. * Ring entries low threshold water mark, that is used
  4703. * in combination with the interrupt timer as well as
  4704. * the the clearing of the level interrupt.
  4705. * b'16:18 - prefetch_timer_cfg:
  4706. * Used only by Consumer ring to set timer mode to
  4707. * support Application prefetch handling.
  4708. * The external tail offset/pointer will be updated
  4709. * at following intervals:
  4710. * 3'b000: (Prefetch feature disabled; used only for debug)
  4711. * 3'b001: 1 usec
  4712. * 3'b010: 4 usec
  4713. * 3'b011: 8 usec (default)
  4714. * 3'b100: 16 usec
  4715. * Others: Reserved
  4716. * b'19 - response_required:
  4717. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4718. * b'20 - ipa_drop_flag:
  4719. Indicates that host will config ipa drop threshold percentage
  4720. * b'21:31 - reserved: reserved for future use
  4721. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4722. * b'8:15 - ipa drop high threshold percentage:
  4723. * b'16:31 - Reserved
  4724. */
  4725. PREPACK struct htt_sring_setup_t {
  4726. A_UINT32 msg_type: 8,
  4727. pdev_id: 8,
  4728. ring_id: 8,
  4729. ring_type: 8;
  4730. A_UINT32 ring_base_addr_lo;
  4731. A_UINT32 ring_base_addr_hi;
  4732. A_UINT32 ring_size: 16,
  4733. ring_entry_size: 8,
  4734. ring_misc_cfg_flag: 8;
  4735. A_UINT32 ring_head_offset32_remote_addr_lo;
  4736. A_UINT32 ring_head_offset32_remote_addr_hi;
  4737. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4738. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4739. A_UINT32 ring_msi_addr_lo;
  4740. A_UINT32 ring_msi_addr_hi;
  4741. A_UINT32 ring_msi_data;
  4742. A_UINT32 intr_batch_counter_th: 15,
  4743. sw_intr_mode: 1,
  4744. intr_timer_th: 16;
  4745. A_UINT32 intr_low_threshold: 16,
  4746. prefetch_timer_cfg: 3,
  4747. response_required: 1,
  4748. ipa_drop_flag: 1,
  4749. reserved1: 11;
  4750. A_UINT32 ipa_drop_low_threshold: 8,
  4751. ipa_drop_high_threshold: 8,
  4752. reserved: 16;
  4753. } POSTPACK;
  4754. enum htt_srng_ring_type {
  4755. HTT_HW_TO_SW_RING = 0,
  4756. HTT_SW_TO_HW_RING,
  4757. HTT_SW_TO_SW_RING,
  4758. /* Insert new ring types above this line */
  4759. };
  4760. enum htt_srng_ring_id {
  4761. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4762. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4763. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4764. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4765. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4766. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4767. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4768. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4769. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4770. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4771. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4772. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4773. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4774. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4775. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4776. /* Add Other SRING which can't be directly configured by host software above this line */
  4777. };
  4778. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4779. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4780. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4781. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4783. HTT_SRING_SETUP_PDEV_ID_S)
  4784. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4788. } while (0)
  4789. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4790. #define HTT_SRING_SETUP_RING_ID_S 16
  4791. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4792. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4793. HTT_SRING_SETUP_RING_ID_S)
  4794. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4795. do { \
  4796. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4797. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4798. } while (0)
  4799. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4800. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4801. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4802. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4803. HTT_SRING_SETUP_RING_TYPE_S)
  4804. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4805. do { \
  4806. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4807. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4808. } while (0)
  4809. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4810. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4811. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4812. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4813. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4814. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4815. do { \
  4816. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4817. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4818. } while (0)
  4819. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4820. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4821. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4822. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4823. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4824. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4825. do { \
  4826. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4827. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4828. } while (0)
  4829. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4830. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4831. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4832. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4833. HTT_SRING_SETUP_RING_SIZE_S)
  4834. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4837. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4838. } while (0)
  4839. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4840. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4841. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4842. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4843. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4844. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4847. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4848. } while (0)
  4849. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4850. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4851. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4852. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4853. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4854. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4855. do { \
  4856. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4857. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4858. } while (0)
  4859. /* This control bit is applicable to only Producer, which updates Ring ID field
  4860. * of each descriptor before pushing into the ring.
  4861. * 0: updates ring_id(default)
  4862. * 1: ring_id updating disabled */
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4867. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4872. } while (0)
  4873. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4874. * of each descriptor before pushing into the ring.
  4875. * 0: updates Loopcnt(default)
  4876. * 1: Loopcnt updating disabled */
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4880. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4881. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4885. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4886. } while (0)
  4887. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4888. * into security_id port of GXI/AXI. */
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4892. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4893. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4895. do { \
  4896. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4897. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4898. } while (0)
  4899. /* During MSI write operation, SRNG drives value of this register bit into
  4900. * swap bit of GXI/AXI. */
  4901. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4902. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4903. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4904. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4905. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4906. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4909. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4910. } while (0)
  4911. /* During Pointer write operation, SRNG drives value of this register bit into
  4912. * swap bit of GXI/AXI. */
  4913. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4914. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4915. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4916. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4917. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4918. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4919. do { \
  4920. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4921. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4922. } while (0)
  4923. /* During any data or TLV write operation, SRNG drives value of this register
  4924. * bit into swap bit of GXI/AXI. */
  4925. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4926. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4927. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4928. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4929. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4930. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4933. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4934. } while (0)
  4935. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4936. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4937. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4938. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4939. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4940. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4941. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4942. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4945. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4946. } while (0)
  4947. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4948. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4949. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4950. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4951. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4952. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4955. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4956. } while (0)
  4957. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4958. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4959. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4960. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4961. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4962. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4965. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4966. } while (0)
  4967. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4968. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4969. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4970. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4971. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4972. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4975. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4976. } while (0)
  4977. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4978. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4979. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4980. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4981. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4982. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4983. do { \
  4984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4985. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4986. } while (0)
  4987. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4988. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4989. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4990. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4991. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4992. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4995. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4996. } while (0)
  4997. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4998. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4999. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  5000. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  5001. HTT_SRING_SETUP_RING_MSI_DATA_S)
  5002. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  5003. do { \
  5004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  5005. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  5006. } while (0)
  5007. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  5008. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  5009. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  5010. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  5011. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  5012. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  5013. do { \
  5014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  5015. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  5016. } while (0)
  5017. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  5018. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  5019. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5020. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5021. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5022. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5023. do { \
  5024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5025. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5026. } while (0)
  5027. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5028. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5029. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5030. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5031. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5032. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5033. do { \
  5034. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5035. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5036. } while (0)
  5037. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5038. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5039. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5040. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5041. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5042. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5043. do { \
  5044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5045. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5046. } while (0)
  5047. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5048. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5049. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5050. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5051. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5052. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5053. do { \
  5054. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5055. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5056. } while (0)
  5057. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5058. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5059. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5060. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5061. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5062. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5063. do { \
  5064. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5065. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5066. } while (0)
  5067. /**
  5068. * @brief host -> target RX ring selection config message
  5069. *
  5070. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5071. *
  5072. * @details
  5073. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5074. * configure RXDMA rings.
  5075. * The configuration is per ring based and includes both packet subtypes
  5076. * and PPDU/MPDU TLVs.
  5077. *
  5078. * The message would appear as follows:
  5079. *
  5080. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5081. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5082. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5083. * |-----------------------+-----+-----+--------------------------------|
  5084. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5085. * |--------------------------------------------------------------------|
  5086. * | packet_type_enable_flags_0 |
  5087. * |--------------------------------------------------------------------|
  5088. * | packet_type_enable_flags_1 |
  5089. * |--------------------------------------------------------------------|
  5090. * | packet_type_enable_flags_2 |
  5091. * |--------------------------------------------------------------------|
  5092. * | packet_type_enable_flags_3 |
  5093. * |--------------------------------------------------------------------|
  5094. * | tlv_filter_in_flags |
  5095. * |-----------------------------------+--------------------------------|
  5096. * | rx_header_offset | rx_packet_offset |
  5097. * |-----------------------------------+--------------------------------|
  5098. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5099. * |-----------------------------------+--------------------------------|
  5100. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5101. * |-----------------------------------+--------------------------------|
  5102. * | rsvd3 | rx_attention_offset |
  5103. * |--------------------------------------------------------------------|
  5104. * | rsvd4 | mo| fp| rx_drop_threshold |
  5105. * | |ndp|ndp| |
  5106. * |--------------------------------------------------------------------|
  5107. * Where:
  5108. * PS = pkt_swap
  5109. * SS = status_swap
  5110. * OV = rx_offsets_valid
  5111. * DT = drop_thresh_valid
  5112. * CLM = config_length_mgmt
  5113. * CLC = config_length_ctrl
  5114. * CLD = config_length_data
  5115. * RXHDL = rx_hdr_len
  5116. * RX = rxpcu_filter_enable_flag
  5117. * The message is interpreted as follows:
  5118. * dword0 - b'0:7 - msg_type: This will be set to
  5119. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5120. * b'8:15 - pdev_id:
  5121. * 0 (for rings at SOC/UMAC level),
  5122. * 1/2/3 mac id (for rings at LMAC level)
  5123. * b'16:23 - ring_id : Identify the ring to configure.
  5124. * More details can be got from enum htt_srng_ring_id
  5125. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5126. * BUF_RING_CFG_0 defs within HW .h files,
  5127. * e.g. wmac_top_reg_seq_hwioreg.h
  5128. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5129. * BUF_RING_CFG_0 defs within HW .h files,
  5130. * e.g. wmac_top_reg_seq_hwioreg.h
  5131. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5132. * configuration fields are valid
  5133. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5134. * rx_drop_threshold field is valid
  5135. * b'28 - rx_mon_global_en: Enable/Disable global register
  5136. 8 configuration in Rx monitor module.
  5137. * b'29:31 - rsvd1: reserved for future use
  5138. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5139. * in byte units.
  5140. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5141. * b'16:18 - config_length_mgmt (MGMT):
  5142. * Represents the length of mpdu bytes for mgmt pkt.
  5143. * valid values:
  5144. * 001 - 64bytes
  5145. * 010 - 128bytes
  5146. * 100 - 256bytes
  5147. * 111 - Full mpdu bytes
  5148. * b'19:21 - config_length_ctrl (CTRL):
  5149. * Represents the length of mpdu bytes for ctrl pkt.
  5150. * valid values:
  5151. * 001 - 64bytes
  5152. * 010 - 128bytes
  5153. * 100 - 256bytes
  5154. * 111 - Full mpdu bytes
  5155. * b'22:24 - config_length_data (DATA):
  5156. * Represents the length of mpdu bytes for data pkt.
  5157. * valid values:
  5158. * 001 - 64bytes
  5159. * 010 - 128bytes
  5160. * 100 - 256bytes
  5161. * 111 - Full mpdu bytes
  5162. * b'25:26 - rx_hdr_len:
  5163. * Specifies the number of bytes of recvd packet to copy
  5164. * into the rx_hdr tlv.
  5165. * supported values for now by host:
  5166. * 01 - 64bytes
  5167. * 10 - 128bytes
  5168. * 11 - 256bytes
  5169. * default - 128 bytes
  5170. * b'27 - rxpcu_filter_enable_flag
  5171. * For Scan Radio Host CPU utilization is very high.
  5172. * In order to reduce CPU utilization we need to filter out
  5173. * certain configured MAC frames.
  5174. * To filter out configured MAC address frames, RxPCU should
  5175. * be zero which means allow all frames for MD at RxOLE
  5176. * host wil fiter out frames.
  5177. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5178. * b'28:31 - rsvd2: Reserved for future use
  5179. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5180. * Enable MGMT packet from 0b0000 to 0b1001
  5181. * bits from low to high: FP, MD, MO - 3 bits
  5182. * FP: Filter_Pass
  5183. * MD: Monitor_Direct
  5184. * MO: Monitor_Other
  5185. * 10 mgmt subtypes * 3 bits -> 30 bits
  5186. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5187. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5188. * Enable MGMT packet from 0b1010 to 0b1111
  5189. * bits from low to high: FP, MD, MO - 3 bits
  5190. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5191. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5192. * Enable CTRL packet from 0b0000 to 0b1001
  5193. * bits from low to high: FP, MD, MO - 3 bits
  5194. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5195. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5196. * Enable CTRL packet from 0b1010 to 0b1111,
  5197. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5198. * bits from low to high: FP, MD, MO - 3 bits
  5199. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5200. * dword6 - b'0:31 - tlv_filter_in_flags:
  5201. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5202. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5203. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5204. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5205. * A value of 0 will be considered as ignore this config.
  5206. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5207. * e.g. wmac_top_reg_seq_hwioreg.h
  5208. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5209. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5210. * A value of 0 will be considered as ignore this config.
  5211. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5212. * e.g. wmac_top_reg_seq_hwioreg.h
  5213. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5214. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5215. * A value of 0 will be considered as ignore this config.
  5216. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5217. * e.g. wmac_top_reg_seq_hwioreg.h
  5218. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5219. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5220. * A value of 0 will be considered as ignore this config.
  5221. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5222. * e.g. wmac_top_reg_seq_hwioreg.h
  5223. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5224. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5225. * A value of 0 will be considered as ignore this config.
  5226. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5227. * e.g. wmac_top_reg_seq_hwioreg.h
  5228. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5229. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5230. * A value of 0 will be considered as ignore this config.
  5231. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5232. * e.g. wmac_top_reg_seq_hwioreg.h
  5233. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5234. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5235. * A value of 0 will be considered as ignore this config.
  5236. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5237. * e.g. wmac_top_reg_seq_hwioreg.h
  5238. * - b'16:31 - rsvd3 for future use
  5239. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5240. * to source rings. Consumer drops packets if the available
  5241. * words in the ring falls below the configured threshold
  5242. * value.
  5243. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5244. * by host. 1 -> subscribed
  5245. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5246. * by host. 1 -> subscribed
  5247. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5248. * subscribed by host. 1 -> subscribed
  5249. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5250. * selection for the FP PHY ERR status tlv.
  5251. * 0 - wbm2rxdma_buf_source_ring
  5252. * 1 - fw2rxdma_buf_source_ring
  5253. * 2 - sw2rxdma_buf_source_ring
  5254. * 3 - no_buffer_ring
  5255. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5256. * selection for the FP PHY ERR status tlv.
  5257. * 0 - rxdma_release_ring
  5258. * 1 - rxdma2fw_ring
  5259. * 2 - rxdma2sw_ring
  5260. * 3 - rxdma2reo_ring
  5261. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5262. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5263. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5264. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5265. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5266. * 0: MSDU level logging
  5267. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5268. * 0: MSDU level logging
  5269. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5270. * 0: MSDU level logging
  5271. * - b'23 - word_mask_compaction: enable/disable word mask for
  5272. * mpdu/msdu start/end tlvs
  5273. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5274. * manager override
  5275. * - b'25:28 - rbm_override_val: return buffer manager override value
  5276. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5277. * which have to be posted to host from phy.
  5278. * Corresponding to errors defined in
  5279. * phyrx_abort_request_reason enums 0 to 31.
  5280. * Refer to RXPCU register definition header files for the
  5281. * phyrx_abort_request_reason enum definition.
  5282. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5283. * errors which have to be posted to host from phy.
  5284. * Corresponding to errors defined in
  5285. * phyrx_abort_request_reason enums 32 to 63.
  5286. * Refer to RXPCU register definition header files for the
  5287. * phyrx_abort_request_reason enum definition.
  5288. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5289. * applicable if word mask enabled
  5290. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5291. * applicable if word mask enabled
  5292. * - b'19:31 - rsvd7
  5293. * dword15- b'0:16 - rx_msdu_end_word_mask
  5294. * - b'17:31 - rsvd5
  5295. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5296. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5297. * buffer
  5298. * 1: RX_PKT TLV logging at specified offset for the
  5299. * subsequent buffer
  5300. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5301. */
  5302. PREPACK struct htt_rx_ring_selection_cfg_t {
  5303. A_UINT32 msg_type: 8,
  5304. pdev_id: 8,
  5305. ring_id: 8,
  5306. status_swap: 1,
  5307. pkt_swap: 1,
  5308. rx_offsets_valid: 1,
  5309. drop_thresh_valid: 1,
  5310. rx_mon_global_en: 1,
  5311. rsvd1: 3;
  5312. A_UINT32 ring_buffer_size: 16,
  5313. config_length_mgmt:3,
  5314. config_length_ctrl:3,
  5315. config_length_data:3,
  5316. rx_hdr_len: 2,
  5317. rxpcu_filter_enable_flag:1,
  5318. rsvd2: 4;
  5319. A_UINT32 packet_type_enable_flags_0;
  5320. A_UINT32 packet_type_enable_flags_1;
  5321. A_UINT32 packet_type_enable_flags_2;
  5322. A_UINT32 packet_type_enable_flags_3;
  5323. A_UINT32 tlv_filter_in_flags;
  5324. A_UINT32 rx_packet_offset: 16,
  5325. rx_header_offset: 16;
  5326. A_UINT32 rx_mpdu_end_offset: 16,
  5327. rx_mpdu_start_offset: 16;
  5328. A_UINT32 rx_msdu_end_offset: 16,
  5329. rx_msdu_start_offset: 16;
  5330. A_UINT32 rx_attn_offset: 16,
  5331. rsvd3: 16;
  5332. A_UINT32 rx_drop_threshold: 10,
  5333. fp_ndp: 1,
  5334. mo_ndp: 1,
  5335. fp_phy_err: 1,
  5336. fp_phy_err_buf_src: 2,
  5337. fp_phy_err_buf_dest: 2,
  5338. pkt_type_enable_msdu_or_mpdu_logging:3,
  5339. dma_mpdu_mgmt: 1,
  5340. dma_mpdu_ctrl: 1,
  5341. dma_mpdu_data: 1,
  5342. word_mask_compaction_enable:1,
  5343. rbm_override_enable: 1,
  5344. rbm_override_val: 4,
  5345. rsvd4: 3;
  5346. A_UINT32 phy_err_mask;
  5347. A_UINT32 phy_err_mask_cont;
  5348. A_UINT32 rx_mpdu_start_word_mask:16,
  5349. rx_mpdu_end_word_mask: 3,
  5350. rsvd7: 13;
  5351. A_UINT32 rx_msdu_end_word_mask: 17,
  5352. rsvd5: 15;
  5353. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5354. rx_pkt_tlv_offset: 15,
  5355. rsvd6: 16;
  5356. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5357. rx_mpdu_end_word_mask_v2: 8,
  5358. rsvd8: 4;
  5359. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5360. rsvd9: 12;
  5361. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5362. rsvd10: 12;
  5363. A_UINT32 packet_type_enable_fpmo_flags0;
  5364. A_UINT32 packet_type_enable_fpmo_flags1;
  5365. } POSTPACK;
  5366. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5367. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5368. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5369. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5370. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5371. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5372. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5373. do { \
  5374. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5375. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5376. } while (0)
  5377. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5378. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5379. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5380. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5381. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5382. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5383. do { \
  5384. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5385. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5386. } while (0)
  5387. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5388. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5389. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5390. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5391. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5392. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5393. do { \
  5394. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5395. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5396. } while (0)
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5398. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5399. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5400. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5401. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5402. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5403. do { \
  5404. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5405. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5406. } while (0)
  5407. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5410. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5411. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5412. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5413. do { \
  5414. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5415. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5416. } while (0)
  5417. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5418. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5419. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5420. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5421. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5422. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5423. do { \
  5424. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5425. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5426. } while (0)
  5427. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5428. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5429. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5430. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5431. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5432. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5433. do { \
  5434. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5435. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5436. } while (0)
  5437. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5438. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5439. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5440. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5441. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5442. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5443. do { \
  5444. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5445. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5446. } while (0)
  5447. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5448. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5449. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5450. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5451. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5452. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5453. do { \
  5454. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5455. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5456. } while (0)
  5457. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5458. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5459. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5460. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5461. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5462. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5463. do { \
  5464. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5465. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5466. } while (0)
  5467. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5468. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5469. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5470. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5471. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5472. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5473. do { \
  5474. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5475. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5476. } while (0)
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5480. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5481. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5482. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5483. do { \
  5484. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5485. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5486. } while(0)
  5487. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5488. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5489. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5490. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5491. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5492. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5495. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5496. } while(0)
  5497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5500. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5501. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5505. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5506. } while (0)
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5510. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5511. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5513. do { \
  5514. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5515. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5516. } while (0)
  5517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5520. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5521. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5525. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5526. } while (0)
  5527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5530. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5531. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5535. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5536. } while (0)
  5537. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5538. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5539. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5540. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5541. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5542. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5543. do { \
  5544. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5545. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5546. } while (0)
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5550. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5551. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5552. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5553. do { \
  5554. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5555. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5556. } while (0)
  5557. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5560. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5561. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5562. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5565. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5566. } while (0)
  5567. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5570. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5571. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5572. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5573. do { \
  5574. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5575. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5576. } while (0)
  5577. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5580. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5581. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5582. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5585. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5586. } while (0)
  5587. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5590. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5591. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5592. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5593. do { \
  5594. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5595. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5596. } while (0)
  5597. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5598. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5600. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5601. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5602. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5603. do { \
  5604. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5605. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5606. } while (0)
  5607. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5608. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5609. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5610. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5611. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5612. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5613. do { \
  5614. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5615. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5616. } while (0)
  5617. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5618. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5619. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5620. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5621. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5622. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5623. do { \
  5624. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5625. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5626. } while (0)
  5627. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5630. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5631. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5632. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5633. do { \
  5634. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5635. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5636. } while (0)
  5637. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5638. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5639. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5640. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5641. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5642. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5643. do { \
  5644. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5645. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5646. } while (0)
  5647. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5648. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5649. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5650. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5651. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5652. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5653. do { \
  5654. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5655. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5656. } while (0)
  5657. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5658. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5659. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5660. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5661. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5662. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5665. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5666. } while (0)
  5667. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5668. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5669. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5670. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5671. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5672. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5673. do { \
  5674. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5675. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5676. } while (0)
  5677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5680. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5681. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5686. } while (0)
  5687. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5688. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5689. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5690. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5691. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5692. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5695. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5696. } while (0)
  5697. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5698. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5699. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5700. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5701. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5702. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5703. do { \
  5704. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5705. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5706. } while (0)
  5707. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5708. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5709. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5710. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5711. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5712. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5715. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5716. } while (0)
  5717. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5718. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5719. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5720. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5721. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5722. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5725. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5726. } while (0)
  5727. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5728. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5729. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5730. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5731. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5732. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5733. do { \
  5734. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5735. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5736. } while (0)
  5737. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5738. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5739. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5740. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5741. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5742. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5743. do { \
  5744. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5745. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5746. } while (0)
  5747. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5748. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5749. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5750. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5751. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5752. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5753. do { \
  5754. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5755. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5756. } while (0)
  5757. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5758. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5759. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5760. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5761. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5762. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5763. do { \
  5764. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5765. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5766. } while (0)
  5767. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5769. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5770. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5771. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5772. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5773. do { \
  5774. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5775. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5776. } while (0)
  5777. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5778. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5779. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5780. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5781. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5782. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5783. do { \
  5784. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5785. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5786. } while (0)
  5787. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5790. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5791. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5792. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5793. do { \
  5794. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5795. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5796. } while (0)
  5797. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5798. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5799. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5800. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5801. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5802. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5803. do { \
  5804. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5805. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5806. } while (0)
  5807. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5808. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5810. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5811. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5812. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5813. do { \
  5814. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5815. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5816. } while (0)
  5817. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5820. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5821. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5822. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5823. do { \
  5824. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5825. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5826. } while (0)
  5827. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5828. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5829. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5830. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5831. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5832. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5833. do { \
  5834. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5835. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5836. } while (0)
  5837. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5838. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5839. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5840. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5841. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5842. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5845. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5846. } while (0)
  5847. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5848. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5849. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5850. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5851. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5852. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5853. do { \
  5854. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5855. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5856. } while (0)
  5857. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5858. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5859. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5860. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5861. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5862. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5863. do { \
  5864. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5865. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5866. } while (0)
  5867. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5868. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5869. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5870. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5871. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5872. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5873. do { \
  5874. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5875. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5876. } while (0)
  5877. /*
  5878. * Subtype based MGMT frames enable bits.
  5879. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5880. */
  5881. /* association request */
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5888. /* association response */
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5895. /* Reassociation request */
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5902. /* Reassociation response */
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5909. /* Probe request */
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5916. /* Probe response */
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5923. /* Timing Advertisement */
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5930. /* Reserved */
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5937. /* Beacon */
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5944. /* ATIM */
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5951. /* Disassociation */
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5958. /* Authentication */
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5965. /* Deauthentication */
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5972. /* Action */
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5979. /* Action No Ack */
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5986. /* Reserved */
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5993. /*
  5994. * Subtype based CTRL frames enable bits.
  5995. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5996. */
  5997. /* Reserved */
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  6004. /* Reserved */
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  6011. /* Reserved */
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  6018. /* Reserved */
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6025. /* Reserved */
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6032. /* Reserved */
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6039. /* Reserved */
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6046. /* Control Wrapper */
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6053. /* Block Ack Request */
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6060. /* Block Ack*/
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6067. /* PS-POLL */
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6074. /* RTS */
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6081. /* CTS */
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6088. /* ACK */
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6095. /* CF-END */
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6102. /* CF-END + CF-ACK */
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6109. /* Multicast data */
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6116. /* Unicast data */
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6123. /* NULL data */
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6130. /* FPMO mode flags */
  6131. /* MGMT */
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6164. /* CTRL */
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6197. /* DATA */
  6198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6209. do { \
  6210. HTT_CHECK_SET_VAL(httsym, value); \
  6211. (word) |= (value) << httsym##_S; \
  6212. } while (0)
  6213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6214. (((word) & httsym##_M) >> httsym##_S)
  6215. #define htt_rx_ring_pkt_enable_subtype_set( \
  6216. word, flag, mode, type, subtype, val) \
  6217. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6218. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6219. #define htt_rx_ring_pkt_enable_subtype_get( \
  6220. word, flag, mode, type, subtype) \
  6221. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6222. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6223. /* Definition to filter in TLVs */
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6234. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6235. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6252. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6253. do { \
  6254. HTT_CHECK_SET_VAL(httsym, enable); \
  6255. (word) |= (enable) << httsym##_S; \
  6256. } while (0)
  6257. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6258. (((word) & httsym##_M) >> httsym##_S)
  6259. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6260. HTT_RX_RING_TLV_ENABLE_SET( \
  6261. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6262. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6263. HTT_RX_RING_TLV_ENABLE_GET( \
  6264. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6265. /**
  6266. * @brief host -> target TX monitor config message
  6267. *
  6268. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6269. *
  6270. * @details
  6271. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6272. * configure RXDMA rings.
  6273. * The configuration is per ring based and includes both packet types
  6274. * and PPDU/MPDU TLVs.
  6275. *
  6276. * The message would appear as follows:
  6277. *
  6278. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  6279. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6280. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6281. * |-----------+--------+--------+-----+------------------------------------|
  6282. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6283. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6284. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6285. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6286. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6287. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6288. * |------------------------------------------------------------------------|
  6289. * | tlv_filter_mask_in0 |
  6290. * |------------------------------------------------------------------------|
  6291. * | tlv_filter_mask_in1 |
  6292. * |------------------------------------------------------------------------|
  6293. * | tlv_filter_mask_in2 |
  6294. * |------------------------------------------------------------------------|
  6295. * | tlv_filter_mask_in3 |
  6296. * |-----------------+-----------------+---------------------+--------------|
  6297. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6298. * |------------------------------------------------------------------------|
  6299. * | pcu_ppdu_setup_word_mask |
  6300. * |--------------------+--+--+--+-----+---------------------+--------------|
  6301. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6302. * |------------------------------------------------------------------------|
  6303. *
  6304. * Where:
  6305. * PS = pkt_swap
  6306. * SS = status_swap
  6307. * The message is interpreted as follows:
  6308. * dword0 - b'0:7 - msg_type: This will be set to
  6309. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6310. * b'8:15 - pdev_id:
  6311. * 0 (for rings at SOC level),
  6312. * 1/2/3 mac id (for rings at LMAC level)
  6313. * b'16:23 - ring_id : Identify the ring to configure.
  6314. * More details can be got from enum htt_srng_ring_id
  6315. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6316. * BUF_RING_CFG_0 defs within HW .h files,
  6317. * e.g. wmac_top_reg_seq_hwioreg.h
  6318. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6319. * BUF_RING_CFG_0 defs within HW .h files,
  6320. * e.g. wmac_top_reg_seq_hwioreg.h
  6321. * b'26 - tx_mon_global_en: Enable/Disable global register
  6322. * configuration in Tx monitor module.
  6323. * b'27:31 - rsvd1: reserved for future use
  6324. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6325. * in byte units.
  6326. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6327. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6328. * 64, 128, 256.
  6329. * If all 3 bits are set config length is > 256.
  6330. * if val is '0', then ignore this field.
  6331. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6332. * 64, 128, 256.
  6333. * If all 3 bits are set config length is > 256.
  6334. * if val is '0', then ignore this field.
  6335. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6336. * 64, 128, 256.
  6337. * If all 3 bits are set config length is > 256.
  6338. * If val is '0', then ignore this field.
  6339. * - b'25:31 - rsvd2: Reserved for future use
  6340. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6341. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6342. * If packet_type_enable_flags is '1' for MGMT type,
  6343. * monitor will ignore this bit and allow this TLV.
  6344. * If packet_type_enable_flags is '0' for MGMT type,
  6345. * monitor will use this bit to enable/disable logging
  6346. * of this TLV.
  6347. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6348. * If packet_type_enable_flags is '1' for CTRL type,
  6349. * monitor will ignore this bit and allow this TLV.
  6350. * If packet_type_enable_flags is '0' for CTRL type,
  6351. * monitor will use this bit to enable/disable logging
  6352. * of this TLV.
  6353. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6354. * If packet_type_enable_flags is '1' for DATA type,
  6355. * monitor will ignore this bit and allow this TLV.
  6356. * If packet_type_enable_flags is '0' for DATA type,
  6357. * monitor will use this bit to enable/disable logging
  6358. * of this TLV.
  6359. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6360. * If packet_type_enable_flags is '1' for MGMT type,
  6361. * monitor will ignore this bit and allow this TLV.
  6362. * If packet_type_enable_flags is '0' for MGMT type,
  6363. * monitor will use this bit to enable/disable logging
  6364. * of this TLV.
  6365. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6366. * If packet_type_enable_flags is '1' for CTRL type,
  6367. * monitor will ignore this bit and allow this TLV.
  6368. * If packet_type_enable_flags is '0' for CTRL type,
  6369. * monitor will use this bit to enable/disable logging
  6370. * of this TLV.
  6371. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6372. * If packet_type_enable_flags is '1' for DATA type,
  6373. * monitor will ignore this bit and allow this TLV.
  6374. * If packet_type_enable_flags is '0' for DATA type,
  6375. * monitor will use this bit to enable/disable logging
  6376. * of this TLV.
  6377. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6378. * If packet_type_enable_flags is '1' for MGMT type,
  6379. * monitor will ignore this bit and allow this TLV.
  6380. * If packet_type_enable_flags is '0' for MGMT type,
  6381. * monitor will use this bit to enable/disable logging
  6382. * of this TLV.
  6383. * If filter_in_TX_MPDU_START = 1 it is recommended
  6384. * to set this bit.
  6385. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6386. * If packet_type_enable_flags is '1' for CTRL type,
  6387. * monitor will ignore this bit and allow this TLV.
  6388. * If packet_type_enable_flags is '0' for CTRL type,
  6389. * monitor will use this bit to enable/disable logging
  6390. * of this TLV.
  6391. * If filter_in_TX_MPDU_START = 1 it is recommended
  6392. * to set this bit.
  6393. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6394. * If packet_type_enable_flags is '1' for DATA type,
  6395. * monitor will ignore this bit and allow this TLV.
  6396. * If packet_type_enable_flags is '0' for DATA type,
  6397. * monitor will use this bit to enable/disable logging
  6398. * of this TLV.
  6399. * If filter_in_TX_MPDU_START = 1 it is recommended
  6400. * to set this bit.
  6401. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6402. * If packet_type_enable_flags is '1' for MGMT type,
  6403. * monitor will ignore this bit and allow this TLV.
  6404. * If packet_type_enable_flags is '0' for MGMT type,
  6405. * monitor will use this bit to enable/disable logging
  6406. * of this TLV.
  6407. * If filter_in_TX_MSDU_START = 1 it is recommended
  6408. * to set this bit.
  6409. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6410. * If packet_type_enable_flags is '1' for CTRL type,
  6411. * monitor will ignore this bit and allow this TLV.
  6412. * If packet_type_enable_flags is '0' for CTRL type,
  6413. * monitor will use this bit to enable/disable logging
  6414. * of this TLV.
  6415. * If filter_in_TX_MSDU_START = 1 it is recommended
  6416. * to set this bit.
  6417. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6418. * If packet_type_enable_flags is '1' for DATA type,
  6419. * monitor will ignore this bit and allow this TLV.
  6420. * If packet_type_enable_flags is '0' for DATA type,
  6421. * monitor will use this bit to enable/disable logging
  6422. * of this TLV.
  6423. * If filter_in_TX_MSDU_START = 1 it is recommended
  6424. * to set this bit.
  6425. * b'15:31 - rsvd3: Reserved for future use
  6426. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6427. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6428. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6429. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6430. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6431. * - b'8:15 - tx_peer_entry_word_mask:
  6432. * - b'16:23 - tx_queue_ext_word_mask:
  6433. * - b'24:31 - tx_msdu_start_word_mask:
  6434. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6435. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6436. * - b'8:15 - rxpcu_user_setup_word_mask:
  6437. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6438. * MGMT, CTRL, DATA
  6439. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6440. * 0 -> MSDU level logging is enabled
  6441. * (valid only if bit is set in
  6442. * pkt_type_enable_msdu_or_mpdu_logging)
  6443. * 1 -> MPDU level logging is enabled
  6444. * (valid only if bit is set in
  6445. * pkt_type_enable_msdu_or_mpdu_logging)
  6446. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6447. * 0 -> MSDU level logging is enabled
  6448. * (valid only if bit is set in
  6449. * pkt_type_enable_msdu_or_mpdu_logging)
  6450. * 1 -> MPDU level logging is enabled
  6451. * (valid only if bit is set in
  6452. * pkt_type_enable_msdu_or_mpdu_logging)
  6453. * - b'21 - dma_mpdu_data(D) : For DATA
  6454. * 0 -> MSDU level logging is enabled
  6455. * (valid only if bit is set in
  6456. * pkt_type_enable_msdu_or_mpdu_logging)
  6457. * 1 -> MPDU level logging is enabled
  6458. * (valid only if bit is set in
  6459. * pkt_type_enable_msdu_or_mpdu_logging)
  6460. * - b'22:31 - rsvd4 for future use
  6461. */
  6462. PREPACK struct htt_tx_monitor_cfg_t {
  6463. A_UINT32 msg_type: 8,
  6464. pdev_id: 8,
  6465. ring_id: 8,
  6466. status_swap: 1,
  6467. pkt_swap: 1,
  6468. tx_mon_global_en: 1,
  6469. rsvd1: 5;
  6470. A_UINT32 ring_buffer_size: 16,
  6471. config_length_mgmt: 3,
  6472. config_length_ctrl: 3,
  6473. config_length_data: 3,
  6474. rsvd2: 7;
  6475. A_UINT32 pkt_type_enable_flags: 3,
  6476. filter_in_tx_mpdu_start_mgmt: 1,
  6477. filter_in_tx_mpdu_start_ctrl: 1,
  6478. filter_in_tx_mpdu_start_data: 1,
  6479. filter_in_tx_msdu_start_mgmt: 1,
  6480. filter_in_tx_msdu_start_ctrl: 1,
  6481. filter_in_tx_msdu_start_data: 1,
  6482. filter_in_tx_mpdu_end_mgmt: 1,
  6483. filter_in_tx_mpdu_end_ctrl: 1,
  6484. filter_in_tx_mpdu_end_data: 1,
  6485. filter_in_tx_msdu_end_mgmt: 1,
  6486. filter_in_tx_msdu_end_ctrl: 1,
  6487. filter_in_tx_msdu_end_data: 1,
  6488. word_mask_compaction_enable: 1,
  6489. rsvd3: 16;
  6490. A_UINT32 tlv_filter_mask_in0;
  6491. A_UINT32 tlv_filter_mask_in1;
  6492. A_UINT32 tlv_filter_mask_in2;
  6493. A_UINT32 tlv_filter_mask_in3;
  6494. A_UINT32 tx_fes_setup_word_mask: 8,
  6495. tx_peer_entry_word_mask: 8,
  6496. tx_queue_ext_word_mask: 8,
  6497. tx_msdu_start_word_mask: 8;
  6498. A_UINT32 pcu_ppdu_setup_word_mask;
  6499. A_UINT32 tx_mpdu_start_word_mask: 8,
  6500. rxpcu_user_setup_word_mask: 8,
  6501. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6502. dma_mpdu_mgmt: 1,
  6503. dma_mpdu_ctrl: 1,
  6504. dma_mpdu_data: 1,
  6505. rsvd4: 10;
  6506. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6507. tx_peer_entry_v2_word_mask: 12,
  6508. rsvd5: 8;
  6509. A_UINT32 fes_status_end_word_mask: 16,
  6510. response_end_status_word_mask: 16;
  6511. A_UINT32 fes_status_prot_word_mask: 11,
  6512. rsvd6: 21;
  6513. } POSTPACK;
  6514. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6515. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6516. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6517. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6519. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6520. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6526. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6527. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6529. HTT_TX_MONITOR_CFG_RING_ID_S)
  6530. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6536. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6537. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6539. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6540. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6546. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6547. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6549. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6550. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6556. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6557. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6559. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6560. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6566. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6567. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6569. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6570. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6576. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6577. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6579. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6580. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6586. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6587. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6589. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6590. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6596. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6597. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6599. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6600. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6606. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6607. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6609. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6619. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6629. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6634. } while (0)
  6635. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6638. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6639. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6643. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6648. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6649. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6653. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6658. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6659. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6663. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6664. } while (0)
  6665. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6668. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6669. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6673. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6674. } while (0)
  6675. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6678. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6679. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6683. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6684. } while (0)
  6685. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6688. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6689. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6691. do { \
  6692. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6693. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6694. } while (0)
  6695. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6698. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6699. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6703. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6704. } while (0)
  6705. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6707. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6708. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6709. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6710. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6713. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6714. } while (0)
  6715. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6716. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6717. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6718. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6719. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6720. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6723. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6724. } while (0)
  6725. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6726. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6727. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6728. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6729. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6730. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6731. do { \
  6732. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6733. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6734. } while (0)
  6735. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6736. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6737. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6738. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6739. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6740. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6743. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6744. } while (0)
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6748. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6749. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6751. do { \
  6752. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6753. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6754. } while (0)
  6755. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6756. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6757. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6758. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6759. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6760. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6761. do { \
  6762. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6763. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6764. } while (0)
  6765. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6766. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6767. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6768. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6769. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6770. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6771. do { \
  6772. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6773. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6774. } while (0)
  6775. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6776. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6777. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6778. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6779. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6780. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6783. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6784. } while (0)
  6785. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6786. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6787. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6788. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6789. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6790. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6793. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6794. } while (0)
  6795. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6796. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6797. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6798. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6799. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6800. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6803. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6804. } while (0)
  6805. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6806. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6807. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6808. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6809. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6810. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6813. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6814. } while (0)
  6815. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6816. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6817. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6818. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6819. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6820. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6821. do { \
  6822. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6823. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6824. } while (0)
  6825. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6826. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6827. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6828. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6829. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6830. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6833. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6834. } while (0)
  6835. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6836. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6837. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6838. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6839. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6840. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6841. do { \
  6842. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6843. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6844. } while (0)
  6845. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6846. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6847. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6848. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6849. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6850. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6851. do { \
  6852. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6853. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6854. } while (0)
  6855. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6856. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6857. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6858. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6859. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6860. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6861. do { \
  6862. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6863. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6864. } while (0)
  6865. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6866. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6867. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6868. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6869. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6870. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6873. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6874. } while (0)
  6875. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6876. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6877. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6878. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6879. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6880. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6881. do { \
  6882. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6883. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6884. } while (0)
  6885. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6886. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6887. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6888. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6889. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6890. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6893. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6894. } while (0)
  6895. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6896. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6897. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6898. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6899. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6900. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6901. do { \
  6902. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6903. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6904. } while (0)
  6905. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6906. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6907. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6908. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6909. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6910. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6911. do { \
  6912. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6913. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6914. } while (0)
  6915. /*
  6916. * pkt_type_enable_flags
  6917. */
  6918. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6919. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6920. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6921. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6922. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6923. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6924. /*
  6925. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6926. */
  6927. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6928. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6929. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6930. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6931. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6932. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6933. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6934. do { \
  6935. HTT_CHECK_SET_VAL(httsym, value); \
  6936. (word) |= (value) << httsym##_S; \
  6937. } while (0)
  6938. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6939. (((word) & httsym##_M) >> httsym##_S)
  6940. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6941. * type -> MGMT, CTRL, DATA*/
  6942. #define htt_tx_ring_pkt_type_set( \
  6943. word, mode, type, val) \
  6944. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6945. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6946. #define htt_tx_ring_pkt_type_get( \
  6947. word, mode, type) \
  6948. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6949. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6950. /* Definition to filter in TLVs */
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  7015. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  7016. do { \
  7017. HTT_CHECK_SET_VAL(httsym, enable); \
  7018. (word) |= (enable) << httsym##_S; \
  7019. } while (0)
  7020. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7021. (((word) & httsym##_M) >> httsym##_S)
  7022. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7023. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7024. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7025. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7026. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7027. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7092. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7093. do { \
  7094. HTT_CHECK_SET_VAL(httsym, enable); \
  7095. (word) |= (enable) << httsym##_S; \
  7096. } while (0)
  7097. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7098. (((word) & httsym##_M) >> httsym##_S)
  7099. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7100. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7101. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7102. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7103. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7104. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7169. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7170. do { \
  7171. HTT_CHECK_SET_VAL(httsym, enable); \
  7172. (word) |= (enable) << httsym##_S; \
  7173. } while (0)
  7174. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7175. (((word) & httsym##_M) >> httsym##_S)
  7176. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7177. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7178. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7179. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7180. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7181. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7212. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7215. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7216. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7217. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7218. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7219. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7220. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7221. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7226. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7227. do { \
  7228. HTT_CHECK_SET_VAL(httsym, enable); \
  7229. (word) |= (enable) << httsym##_S; \
  7230. } while (0)
  7231. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7232. (((word) & httsym##_M) >> httsym##_S)
  7233. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7234. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7235. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7236. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7237. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7238. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7239. /**
  7240. * @brief host --> target Receive Flow Steering configuration message definition
  7241. *
  7242. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7243. *
  7244. * host --> target Receive Flow Steering configuration message definition.
  7245. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7246. * The reason for this is we want RFS to be configured and ready before MAC
  7247. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7248. *
  7249. * |31 24|23 16|15 9|8|7 0|
  7250. * |----------------+----------------+----------------+----------------|
  7251. * | reserved |E| msg type |
  7252. * |-------------------------------------------------------------------|
  7253. * Where E = RFS enable flag
  7254. *
  7255. * The RFS_CONFIG message consists of a single 4-byte word.
  7256. *
  7257. * Header fields:
  7258. * - MSG_TYPE
  7259. * Bits 7:0
  7260. * Purpose: identifies this as a RFS config msg
  7261. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7262. * - RFS_CONFIG
  7263. * Bit 8
  7264. * Purpose: Tells target whether to enable (1) or disable (0)
  7265. * flow steering feature when sending rx indication messages to host
  7266. */
  7267. #define HTT_H2T_RFS_CONFIG_M 0x100
  7268. #define HTT_H2T_RFS_CONFIG_S 8
  7269. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7270. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7271. HTT_H2T_RFS_CONFIG_S)
  7272. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7275. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7276. } while (0)
  7277. #define HTT_RFS_CFG_REQ_BYTES 4
  7278. /**
  7279. * @brief host -> target FW extended statistics request
  7280. *
  7281. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7282. *
  7283. * @details
  7284. * The following field definitions describe the format of the HTT host
  7285. * to target FW extended stats retrieve message.
  7286. * The message specifies the type of stats the host wants to retrieve.
  7287. *
  7288. * |31 24|23 16|15 8|7 0|
  7289. * |-----------------------------------------------------------|
  7290. * | reserved | stats type | pdev_mask | msg type |
  7291. * |-----------------------------------------------------------|
  7292. * | config param [0] |
  7293. * |-----------------------------------------------------------|
  7294. * | config param [1] |
  7295. * |-----------------------------------------------------------|
  7296. * | config param [2] |
  7297. * |-----------------------------------------------------------|
  7298. * | config param [3] |
  7299. * |-----------------------------------------------------------|
  7300. * | reserved |
  7301. * |-----------------------------------------------------------|
  7302. * | cookie LSBs |
  7303. * |-----------------------------------------------------------|
  7304. * | cookie MSBs |
  7305. * |-----------------------------------------------------------|
  7306. * Header fields:
  7307. * - MSG_TYPE
  7308. * Bits 7:0
  7309. * Purpose: identifies this is a extended stats upload request message
  7310. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7311. * - PDEV_MASK
  7312. * Bits 8:15
  7313. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7314. * Value: This is a overloaded field, refer to usage and interpretation of
  7315. * PDEV in interface document.
  7316. * Bit 8 : Reserved for SOC stats
  7317. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7318. * Indicates MACID_MASK in DBS
  7319. * - STATS_TYPE
  7320. * Bits 23:16
  7321. * Purpose: identifies which FW statistics to upload
  7322. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7323. * - Reserved
  7324. * Bits 31:24
  7325. * - CONFIG_PARAM [0]
  7326. * Bits 31:0
  7327. * Purpose: give an opaque configuration value to the specified stats type
  7328. * Value: stats-type specific configuration value
  7329. * Refer to htt_stats.h for interpretation for each stats sub_type
  7330. * - CONFIG_PARAM [1]
  7331. * Bits 31:0
  7332. * Purpose: give an opaque configuration value to the specified stats type
  7333. * Value: stats-type specific configuration value
  7334. * Refer to htt_stats.h for interpretation for each stats sub_type
  7335. * - CONFIG_PARAM [2]
  7336. * Bits 31:0
  7337. * Purpose: give an opaque configuration value to the specified stats type
  7338. * Value: stats-type specific configuration value
  7339. * Refer to htt_stats.h for interpretation for each stats sub_type
  7340. * - CONFIG_PARAM [3]
  7341. * Bits 31:0
  7342. * Purpose: give an opaque configuration value to the specified stats type
  7343. * Value: stats-type specific configuration value
  7344. * Refer to htt_stats.h for interpretation for each stats sub_type
  7345. * - Reserved [31:0] for future use.
  7346. * - COOKIE_LSBS
  7347. * Bits 31:0
  7348. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7349. * message with its preceding host->target stats request message.
  7350. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7351. * - COOKIE_MSBS
  7352. * Bits 31:0
  7353. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7354. * message with its preceding host->target stats request message.
  7355. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7356. */
  7357. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7358. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7359. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7360. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7361. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7362. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7363. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7364. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7365. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7366. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7367. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7368. do { \
  7369. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7370. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7371. } while (0)
  7372. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7373. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7374. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7375. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7376. do { \
  7377. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7378. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7379. } while (0)
  7380. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7381. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7382. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7383. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7384. do { \
  7385. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7386. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7387. } while (0)
  7388. /**
  7389. * @brief host -> target FW streaming statistics request
  7390. *
  7391. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7392. *
  7393. * @details
  7394. * The following field definitions describe the format of the HTT host
  7395. * to target message that requests the target to start or stop producing
  7396. * ongoing stats of the specified type.
  7397. *
  7398. * |31|30 |23 16|15 8|7 0|
  7399. * |-----------------------------------------------------------|
  7400. * |EN| reserved | stats type | reserved | msg type |
  7401. * |-----------------------------------------------------------|
  7402. * | config param [0] |
  7403. * |-----------------------------------------------------------|
  7404. * | config param [1] |
  7405. * |-----------------------------------------------------------|
  7406. * | config param [2] |
  7407. * |-----------------------------------------------------------|
  7408. * | config param [3] |
  7409. * |-----------------------------------------------------------|
  7410. * Where:
  7411. * - EN is an enable/disable flag
  7412. * Header fields:
  7413. * - MSG_TYPE
  7414. * Bits 7:0
  7415. * Purpose: identifies this is a streaming stats upload request message
  7416. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7417. * - STATS_TYPE
  7418. * Bits 23:16
  7419. * Purpose: identifies which FW statistics to upload
  7420. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7421. * Only the htt_dbg_ext_stats_type values identified as streaming
  7422. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7423. * - ENABLE
  7424. * Bit 31
  7425. * Purpose: enable/disable the target's ongoing stats of the specified type
  7426. * Value:
  7427. * 0 - disable ongoing production of the specified stats type
  7428. * 1 - enable ongoing production of the specified stats type
  7429. * - CONFIG_PARAM [0]
  7430. * Bits 31:0
  7431. * Purpose: give an opaque configuration value to the specified stats type
  7432. * Value: stats-type specific configuration value
  7433. * Refer to htt_stats.h for interpretation for each stats sub_type
  7434. * - CONFIG_PARAM [1]
  7435. * Bits 31:0
  7436. * Purpose: give an opaque configuration value to the specified stats type
  7437. * Value: stats-type specific configuration value
  7438. * Refer to htt_stats.h for interpretation for each stats sub_type
  7439. * - CONFIG_PARAM [2]
  7440. * Bits 31:0
  7441. * Purpose: give an opaque configuration value to the specified stats type
  7442. * Value: stats-type specific configuration value
  7443. * Refer to htt_stats.h for interpretation for each stats sub_type
  7444. * - CONFIG_PARAM [3]
  7445. * Bits 31:0
  7446. * Purpose: give an opaque configuration value to the specified stats type
  7447. * Value: stats-type specific configuration value
  7448. * Refer to htt_stats.h for interpretation for each stats sub_type
  7449. */
  7450. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7451. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7452. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7453. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7454. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7455. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7456. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7457. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7458. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7461. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7462. } while (0)
  7463. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7464. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7465. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7466. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7467. do { \
  7468. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7469. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7470. } while (0)
  7471. /**
  7472. * @brief host -> target FW PPDU_STATS request message
  7473. *
  7474. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7475. *
  7476. * @details
  7477. * The following field definitions describe the format of the HTT host
  7478. * to target FW for PPDU_STATS_CFG msg.
  7479. * The message allows the host to configure the PPDU_STATS_IND messages
  7480. * produced by the target.
  7481. *
  7482. * |31 24|23 16|15 8|7 0|
  7483. * |-----------------------------------------------------------|
  7484. * | REQ bit mask | pdev_mask | msg type |
  7485. * |-----------------------------------------------------------|
  7486. * Header fields:
  7487. * - MSG_TYPE
  7488. * Bits 7:0
  7489. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7490. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7491. * - PDEV_MASK
  7492. * Bits 8:15
  7493. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7494. * Value: This is a overloaded field, refer to usage and interpretation of
  7495. * PDEV in interface document.
  7496. * Bit 8 : Reserved for SOC stats
  7497. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7498. * Indicates MACID_MASK in DBS
  7499. * - REQ_TLV_BIT_MASK
  7500. * Bits 16:31
  7501. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7502. * needs to be included in the target's PPDU_STATS_IND messages.
  7503. * Value: refer htt_ppdu_stats_tlv_tag_t
  7504. *
  7505. */
  7506. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7507. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7508. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7509. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7510. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7511. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7512. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7513. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7514. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7515. do { \
  7516. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7517. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7518. } while (0)
  7519. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7520. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7521. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7522. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7523. do { \
  7524. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7525. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7526. } while (0)
  7527. /**
  7528. * @brief Host-->target HTT RX FSE setup message
  7529. *
  7530. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7531. *
  7532. * @details
  7533. * Through this message, the host will provide details of the flow tables
  7534. * in host DDR along with hash keys.
  7535. * This message can be sent per SOC or per PDEV, which is differentiated
  7536. * by pdev id values.
  7537. * The host will allocate flow search table and sends table size,
  7538. * physical DMA address of flow table, and hash keys to firmware to
  7539. * program into the RXOLE FSE HW block.
  7540. *
  7541. * The following field definitions describe the format of the RX FSE setup
  7542. * message sent from the host to target
  7543. *
  7544. * Header fields:
  7545. * dword0 - b'7:0 - msg_type: This will be set to
  7546. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7547. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7548. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7549. * pdev's LMAC ring.
  7550. * b'31:16 - reserved : Reserved for future use
  7551. * dword1 - b'19:0 - number of records: This field indicates the number of
  7552. * entries in the flow table. For example: 8k number of
  7553. * records is equivalent to
  7554. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7555. * b'27:20 - max search: This field specifies the skid length to FSE
  7556. * parser HW module whenever match is not found at the
  7557. * exact index pointed by hash.
  7558. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7559. * Refer htt_ip_da_sa_prefix below for more details.
  7560. * b'31:30 - reserved: Reserved for future use
  7561. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7562. * table allocated by host in DDR
  7563. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7564. * table allocated by host in DDR
  7565. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7566. * entry hashing
  7567. *
  7568. *
  7569. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7570. * |---------------------------------------------------------------|
  7571. * | reserved | pdev_id | MSG_TYPE |
  7572. * |---------------------------------------------------------------|
  7573. * |resvd|IPDSA| max_search | Number of records |
  7574. * |---------------------------------------------------------------|
  7575. * | base address lo |
  7576. * |---------------------------------------------------------------|
  7577. * | base address high |
  7578. * |---------------------------------------------------------------|
  7579. * | toeplitz key 31_0 |
  7580. * |---------------------------------------------------------------|
  7581. * | toeplitz key 63_32 |
  7582. * |---------------------------------------------------------------|
  7583. * | toeplitz key 95_64 |
  7584. * |---------------------------------------------------------------|
  7585. * | toeplitz key 127_96 |
  7586. * |---------------------------------------------------------------|
  7587. * | toeplitz key 159_128 |
  7588. * |---------------------------------------------------------------|
  7589. * | toeplitz key 191_160 |
  7590. * |---------------------------------------------------------------|
  7591. * | toeplitz key 223_192 |
  7592. * |---------------------------------------------------------------|
  7593. * | toeplitz key 255_224 |
  7594. * |---------------------------------------------------------------|
  7595. * | toeplitz key 287_256 |
  7596. * |---------------------------------------------------------------|
  7597. * | reserved | toeplitz key 314_288(26:0 bits) |
  7598. * |---------------------------------------------------------------|
  7599. * where:
  7600. * IPDSA = ip_da_sa
  7601. */
  7602. /**
  7603. * @brief: htt_ip_da_sa_prefix
  7604. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7605. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7606. * documentation per RFC3849
  7607. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7608. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7609. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7610. */
  7611. enum htt_ip_da_sa_prefix {
  7612. HTT_RX_IPV6_20010db8,
  7613. HTT_RX_IPV4_MAPPED_IPV6,
  7614. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7615. HTT_RX_IPV6_64FF9B,
  7616. };
  7617. /**
  7618. * @brief Host-->target HTT RX FISA configure and enable
  7619. *
  7620. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7621. *
  7622. * @details
  7623. * The host will send this command down to configure and enable the FISA
  7624. * operational params.
  7625. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7626. * register.
  7627. * Should configure both the MACs.
  7628. *
  7629. * dword0 - b'7:0 - msg_type:
  7630. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7631. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7632. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7633. * pdev's LMAC ring.
  7634. * b'31:16 - reserved : Reserved for future use
  7635. *
  7636. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7637. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7638. * packets. 1 flow search will be skipped
  7639. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7640. * tcp,udp packets
  7641. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7642. * calculation
  7643. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7644. * calculation
  7645. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7646. * calculation
  7647. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7648. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7649. * length
  7650. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7651. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7652. * length
  7653. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7654. * num jump
  7655. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7656. * num jump
  7657. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7658. * data type switch has happened for MPDU Sequence num jump
  7659. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7660. * for MPDU Sequence num jump
  7661. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7662. * for decrypt errors
  7663. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7664. * while aggregating a msdu
  7665. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7666. * The aggregation is done until (number of MSDUs aggregated
  7667. * < LIMIT + 1)
  7668. * b'31:18 - Reserved
  7669. *
  7670. * fisa_control_value - 32bit value FW can write to register
  7671. *
  7672. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7673. * Threshold value for FISA timeout (units are microseconds).
  7674. * When the global timestamp exceeds this threshold, FISA
  7675. * aggregation will be restarted.
  7676. * A value of 0 means timeout is disabled.
  7677. * Compare the threshold register with timestamp field in
  7678. * flow entry to generate timeout for the flow.
  7679. *
  7680. * |31 18 |17 16|15 8|7 0|
  7681. * |-------------------------------------------------------------|
  7682. * | reserved | pdev_mask | msg type |
  7683. * |-------------------------------------------------------------|
  7684. * | reserved | FISA_CTRL |
  7685. * |-------------------------------------------------------------|
  7686. * | FISA_TIMEOUT_THRESH |
  7687. * |-------------------------------------------------------------|
  7688. */
  7689. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7690. A_UINT32 msg_type:8,
  7691. pdev_id:8,
  7692. reserved0:16;
  7693. /**
  7694. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7695. * [17:0]
  7696. */
  7697. union {
  7698. /*
  7699. * fisa_control_bits structure is deprecated.
  7700. * Please use fisa_control_bits_v2 going forward.
  7701. */
  7702. struct {
  7703. A_UINT32 fisa_enable: 1,
  7704. ipsec_skip_search: 1,
  7705. nontcp_skip_search: 1,
  7706. add_ipv4_fixed_hdr_len: 1,
  7707. add_ipv6_fixed_hdr_len: 1,
  7708. add_tcp_fixed_hdr_len: 1,
  7709. add_udp_hdr_len: 1,
  7710. chksum_cum_ip_len_en: 1,
  7711. disable_tid_check: 1,
  7712. disable_ta_check: 1,
  7713. disable_qos_check: 1,
  7714. disable_raw_check: 1,
  7715. disable_decrypt_err_check: 1,
  7716. disable_msdu_drop_check: 1,
  7717. fisa_aggr_limit: 4,
  7718. reserved: 14;
  7719. } fisa_control_bits;
  7720. struct {
  7721. A_UINT32 fisa_enable: 1,
  7722. fisa_aggr_limit: 4,
  7723. reserved: 27;
  7724. } fisa_control_bits_v2;
  7725. A_UINT32 fisa_control_value;
  7726. } u_fisa_control;
  7727. /**
  7728. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7729. * timeout threshold for aggregation. Unit in usec.
  7730. * [31:0]
  7731. */
  7732. A_UINT32 fisa_timeout_threshold;
  7733. } POSTPACK;
  7734. /* DWord 0: pdev-ID */
  7735. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7736. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7737. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7738. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7739. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7740. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7743. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7744. } while (0)
  7745. /* Dword 1: fisa_control_value fisa config */
  7746. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7747. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7748. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7749. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7750. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7751. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7754. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7755. } while (0)
  7756. /* Dword 1: fisa_control_value ipsec_skip_search */
  7757. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7758. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7759. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7760. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7761. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7762. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7763. do { \
  7764. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7765. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7766. } while (0)
  7767. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7768. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7769. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7770. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7771. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7772. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7773. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7774. do { \
  7775. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7776. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7777. } while (0)
  7778. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7779. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7780. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7781. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7782. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7783. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7784. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7785. do { \
  7786. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7787. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7788. } while (0)
  7789. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7790. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7791. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7792. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7793. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7794. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7795. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7798. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7799. } while (0)
  7800. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7801. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7802. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7803. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7804. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7805. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7806. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7807. do { \
  7808. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7809. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7810. } while (0)
  7811. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7812. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7813. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7814. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7815. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7816. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7817. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7818. do { \
  7819. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7820. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7821. } while (0)
  7822. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7823. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7824. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7825. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7826. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7827. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7828. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7829. do { \
  7830. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7831. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7832. } while (0)
  7833. /* Dword 1: fisa_control_value disable_tid_check */
  7834. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7835. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7836. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7837. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7838. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7840. do { \
  7841. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7842. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7843. } while (0)
  7844. /* Dword 1: fisa_control_value disable_ta_check */
  7845. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7846. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7847. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7848. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7849. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7851. do { \
  7852. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7853. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7854. } while (0)
  7855. /* Dword 1: fisa_control_value disable_qos_check */
  7856. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7857. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7858. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7859. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7860. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7861. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7862. do { \
  7863. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7864. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7865. } while (0)
  7866. /* Dword 1: fisa_control_value disable_raw_check */
  7867. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7868. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7869. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7870. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7871. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7872. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7873. do { \
  7874. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7875. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7876. } while (0)
  7877. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7878. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7879. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7880. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7881. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7882. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7883. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7886. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7887. } while (0)
  7888. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7889. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7890. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7891. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7892. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7893. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7894. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7895. do { \
  7896. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7897. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7898. } while (0)
  7899. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7900. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7901. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7902. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7903. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7904. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7905. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7906. do { \
  7907. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7908. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7909. } while (0)
  7910. /* Dword 1: fisa_control_value fisa config */
  7911. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7912. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7913. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7914. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7915. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7916. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7917. do { \
  7918. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7919. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7920. } while (0)
  7921. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7922. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7923. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7924. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7925. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7926. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7927. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7928. do { \
  7929. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7930. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7931. } while (0)
  7932. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7933. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7934. pdev_id:8,
  7935. reserved0:16;
  7936. A_UINT32 num_records:20,
  7937. max_search:8,
  7938. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7939. reserved1:2;
  7940. A_UINT32 base_addr_lo;
  7941. A_UINT32 base_addr_hi;
  7942. A_UINT32 toeplitz31_0;
  7943. A_UINT32 toeplitz63_32;
  7944. A_UINT32 toeplitz95_64;
  7945. A_UINT32 toeplitz127_96;
  7946. A_UINT32 toeplitz159_128;
  7947. A_UINT32 toeplitz191_160;
  7948. A_UINT32 toeplitz223_192;
  7949. A_UINT32 toeplitz255_224;
  7950. A_UINT32 toeplitz287_256;
  7951. A_UINT32 toeplitz314_288:27,
  7952. reserved2:5;
  7953. } POSTPACK;
  7954. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7955. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7956. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7957. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7958. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7959. /* DWORD 0: Pdev ID */
  7960. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7961. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7962. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7963. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7964. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7965. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7966. do { \
  7967. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7968. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7969. } while (0)
  7970. /* DWORD 1:num of records */
  7971. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7972. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7973. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7974. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7975. HTT_RX_FSE_SETUP_NUM_REC_S)
  7976. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7977. do { \
  7978. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7979. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7980. } while (0)
  7981. /* DWORD 1:max_search */
  7982. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7983. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7984. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7985. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7986. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7987. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7988. do { \
  7989. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7990. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7991. } while (0)
  7992. /* DWORD 1:ip_da_sa prefix */
  7993. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7994. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7995. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7996. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7997. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7998. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7999. do { \
  8000. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  8001. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  8002. } while (0)
  8003. /* DWORD 2: Base Address LO */
  8004. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  8005. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  8006. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  8007. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  8008. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  8009. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  8010. do { \
  8011. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  8012. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  8013. } while (0)
  8014. /* DWORD 3: Base Address High */
  8015. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  8016. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  8017. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  8018. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  8019. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8020. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8021. do { \
  8022. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8023. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8024. } while (0)
  8025. /* DWORD 4-12: Hash Value */
  8026. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8027. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8028. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8029. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8030. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8031. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8032. do { \
  8033. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8034. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8035. } while (0)
  8036. /* DWORD 13: Hash Value 314:288 bits */
  8037. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8038. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8039. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8040. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8041. do { \
  8042. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8043. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8044. } while (0)
  8045. /**
  8046. * @brief Host-->target HTT RX FSE operation message
  8047. *
  8048. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8049. *
  8050. * @details
  8051. * The host will send this Flow Search Engine (FSE) operation message for
  8052. * every flow add/delete operation.
  8053. * The FSE operation includes FSE full cache invalidation or individual entry
  8054. * invalidation.
  8055. * This message can be sent per SOC or per PDEV which is differentiated
  8056. * by pdev id values.
  8057. *
  8058. * |31 16|15 8|7 1|0|
  8059. * |-------------------------------------------------------------|
  8060. * | reserved | pdev_id | MSG_TYPE |
  8061. * |-------------------------------------------------------------|
  8062. * | reserved | operation |I|
  8063. * |-------------------------------------------------------------|
  8064. * | ip_src_addr_31_0 |
  8065. * |-------------------------------------------------------------|
  8066. * | ip_src_addr_63_32 |
  8067. * |-------------------------------------------------------------|
  8068. * | ip_src_addr_95_64 |
  8069. * |-------------------------------------------------------------|
  8070. * | ip_src_addr_127_96 |
  8071. * |-------------------------------------------------------------|
  8072. * | ip_dst_addr_31_0 |
  8073. * |-------------------------------------------------------------|
  8074. * | ip_dst_addr_63_32 |
  8075. * |-------------------------------------------------------------|
  8076. * | ip_dst_addr_95_64 |
  8077. * |-------------------------------------------------------------|
  8078. * | ip_dst_addr_127_96 |
  8079. * |-------------------------------------------------------------|
  8080. * | l4_dst_port | l4_src_port |
  8081. * | (32-bit SPI incase of IPsec) |
  8082. * |-------------------------------------------------------------|
  8083. * | reserved | l4_proto |
  8084. * |-------------------------------------------------------------|
  8085. *
  8086. * where I is 1-bit ipsec_valid.
  8087. *
  8088. * The following field definitions describe the format of the RX FSE operation
  8089. * message sent from the host to target for every add/delete flow entry to flow
  8090. * table.
  8091. *
  8092. * Header fields:
  8093. * dword0 - b'7:0 - msg_type: This will be set to
  8094. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8095. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8096. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8097. * specified pdev's LMAC ring.
  8098. * b'31:16 - reserved : Reserved for future use
  8099. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8100. * (Internet Protocol Security).
  8101. * IPsec describes the framework for providing security at
  8102. * IP layer. IPsec is defined for both versions of IP:
  8103. * IPV4 and IPV6.
  8104. * Please refer to htt_rx_flow_proto enumeration below for
  8105. * more info.
  8106. * ipsec_valid = 1 for IPSEC packets
  8107. * ipsec_valid = 0 for IP Packets
  8108. * b'7:1 - operation: This indicates types of FSE operation.
  8109. * Refer to htt_rx_fse_operation enumeration:
  8110. * 0 - No Cache Invalidation required
  8111. * 1 - Cache invalidate only one entry given by IP
  8112. * src/dest address at DWORD[2:9]
  8113. * 2 - Complete FSE Cache Invalidation
  8114. * 3 - FSE Disable
  8115. * 4 - FSE Enable
  8116. * b'31:8 - reserved: Reserved for future use
  8117. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8118. * for per flow addition/deletion
  8119. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8120. * and the subsequent 3 A_UINT32 will be padding bytes.
  8121. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8122. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8123. * from 0 to 65535 but only 0 to 1023 are designated as
  8124. * well-known ports. Refer to [RFC1700] for more details.
  8125. * This field is valid only if
  8126. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8127. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8128. * range from 0 to 65535 but only 0 to 1023 are designated
  8129. * as well-known ports. Refer to [RFC1700] for more details.
  8130. * This field is valid only if
  8131. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8132. * - SPI (31:0): Security Parameters Index is an
  8133. * identification tag added to the header while using IPsec
  8134. * for tunneling the IP traffici.
  8135. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8136. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8137. * Assigned Internet Protocol Numbers.
  8138. * l4_proto numbers for standard protocol like UDP/TCP
  8139. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8140. * l4_proto = 17 for UDP etc.
  8141. * b'31:8 - reserved: Reserved for future use.
  8142. *
  8143. */
  8144. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8145. A_UINT32 msg_type:8,
  8146. pdev_id:8,
  8147. reserved0:16;
  8148. A_UINT32 ipsec_valid:1,
  8149. operation:7,
  8150. reserved1:24;
  8151. A_UINT32 ip_src_addr_31_0;
  8152. A_UINT32 ip_src_addr_63_32;
  8153. A_UINT32 ip_src_addr_95_64;
  8154. A_UINT32 ip_src_addr_127_96;
  8155. A_UINT32 ip_dest_addr_31_0;
  8156. A_UINT32 ip_dest_addr_63_32;
  8157. A_UINT32 ip_dest_addr_95_64;
  8158. A_UINT32 ip_dest_addr_127_96;
  8159. union {
  8160. A_UINT32 spi;
  8161. struct {
  8162. A_UINT32 l4_src_port:16,
  8163. l4_dest_port:16;
  8164. } ip;
  8165. } u;
  8166. A_UINT32 l4_proto:8,
  8167. reserved:24;
  8168. } POSTPACK;
  8169. /**
  8170. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8171. *
  8172. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8173. *
  8174. * @details
  8175. * The host will send this Full monitor mode register configuration message.
  8176. * This message can be sent per SOC or per PDEV which is differentiated
  8177. * by pdev id values.
  8178. *
  8179. * |31 16|15 11|10 8|7 3|2|1|0|
  8180. * |-------------------------------------------------------------|
  8181. * | reserved | pdev_id | MSG_TYPE |
  8182. * |-------------------------------------------------------------|
  8183. * | reserved |Release Ring |N|Z|E|
  8184. * |-------------------------------------------------------------|
  8185. *
  8186. * where E is 1-bit full monitor mode enable/disable.
  8187. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8188. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8189. *
  8190. * The following field definitions describe the format of the full monitor
  8191. * mode configuration message sent from the host to target for each pdev.
  8192. *
  8193. * Header fields:
  8194. * dword0 - b'7:0 - msg_type: This will be set to
  8195. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8196. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8197. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8198. * specified pdev's LMAC ring.
  8199. * b'31:16 - reserved : Reserved for future use.
  8200. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8201. * monitor mode rxdma register is to be enabled or disabled.
  8202. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8203. * additional descriptors at ppdu end for zero mpdus
  8204. * enabled or disabled.
  8205. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8206. * additional descriptors at ppdu end for non zero mpdus
  8207. * enabled or disabled.
  8208. * b'10:3 - release_ring: This indicates the destination ring
  8209. * selection for the descriptor at the end of PPDU
  8210. * 0 - REO ring select
  8211. * 1 - FW ring select
  8212. * 2 - SW ring select
  8213. * 3 - Release ring select
  8214. * Refer to htt_rx_full_mon_release_ring.
  8215. * b'31:11 - reserved for future use
  8216. */
  8217. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8218. A_UINT32 msg_type:8,
  8219. pdev_id:8,
  8220. reserved0:16;
  8221. A_UINT32 full_monitor_mode_enable:1,
  8222. addnl_descs_zero_mpdus_end:1,
  8223. addnl_descs_non_zero_mpdus_end:1,
  8224. release_ring:8,
  8225. reserved1:21;
  8226. } POSTPACK;
  8227. /**
  8228. * Enumeration for full monitor mode destination ring select
  8229. * 0 - REO destination ring select
  8230. * 1 - FW destination ring select
  8231. * 2 - SW destination ring select
  8232. * 3 - Release destination ring select
  8233. */
  8234. enum htt_rx_full_mon_release_ring {
  8235. HTT_RX_MON_RING_REO,
  8236. HTT_RX_MON_RING_FW,
  8237. HTT_RX_MON_RING_SW,
  8238. HTT_RX_MON_RING_RELEASE,
  8239. };
  8240. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8241. /* DWORD 0: Pdev ID */
  8242. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8243. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8244. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8245. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8246. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8247. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8248. do { \
  8249. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8250. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8251. } while (0)
  8252. /* DWORD 1:ENABLE */
  8253. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8254. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8255. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8258. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8259. } while (0)
  8260. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8261. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8262. /* DWORD 1:ZERO_MPDU */
  8263. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8264. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8265. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8268. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8269. } while (0)
  8270. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8271. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8272. /* DWORD 1:NON_ZERO_MPDU */
  8273. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8274. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8275. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8276. do { \
  8277. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8278. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8279. } while (0)
  8280. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8281. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8282. /* DWORD 1:RELEASE_RINGS */
  8283. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8284. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8285. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8286. do { \
  8287. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8288. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8289. } while (0)
  8290. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8291. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8292. /**
  8293. * Enumeration for IP Protocol or IPSEC Protocol
  8294. * IPsec describes the framework for providing security at IP layer.
  8295. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8296. */
  8297. enum htt_rx_flow_proto {
  8298. HTT_RX_FLOW_IP_PROTO,
  8299. HTT_RX_FLOW_IPSEC_PROTO,
  8300. };
  8301. /**
  8302. * Enumeration for FSE Cache Invalidation
  8303. * 0 - No Cache Invalidation required
  8304. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8305. * 2 - Complete FSE Cache Invalidation
  8306. * 3 - FSE Disable
  8307. * 4 - FSE Enable
  8308. */
  8309. enum htt_rx_fse_operation {
  8310. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8311. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8312. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8313. HTT_RX_FSE_DISABLE,
  8314. HTT_RX_FSE_ENABLE,
  8315. };
  8316. /* DWORD 0: Pdev ID */
  8317. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8318. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8319. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8320. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8321. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8322. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8325. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8326. } while (0)
  8327. /* DWORD 1:IP PROTO or IPSEC */
  8328. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8329. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8330. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8331. do { \
  8332. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8333. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8334. } while (0)
  8335. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8336. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8337. /* DWORD 1:FSE Operation */
  8338. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8339. #define HTT_RX_FSE_OPERATION_S 1
  8340. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8341. do { \
  8342. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8343. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8344. } while (0)
  8345. #define HTT_RX_FSE_OPERATION_GET(word) \
  8346. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8347. /* DWORD 2-9:IP Address */
  8348. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8349. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8350. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8351. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8352. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8353. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8356. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8357. } while (0)
  8358. /* DWORD 10:Source Port Number */
  8359. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8360. #define HTT_RX_FSE_SOURCEPORT_S 0
  8361. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8362. do { \
  8363. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8364. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8365. } while (0)
  8366. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8367. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8368. /* DWORD 11:Destination Port Number */
  8369. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8370. #define HTT_RX_FSE_DESTPORT_S 16
  8371. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8374. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8375. } while (0)
  8376. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8377. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8378. /* DWORD 10-11:SPI (In case of IPSEC) */
  8379. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8380. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8381. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8382. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8383. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8384. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8385. do { \
  8386. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8387. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8388. } while (0)
  8389. /* DWORD 12:L4 PROTO */
  8390. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8391. #define HTT_RX_FSE_L4_PROTO_S 0
  8392. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8395. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8396. } while (0)
  8397. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8398. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8399. /**
  8400. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8401. *
  8402. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8403. *
  8404. * |31 24|23 |15 8|7 2|1|0|
  8405. * |----------------+----------------+----------------+----------------|
  8406. * | reserved | pdev_id | msg_type |
  8407. * |---------------------------------+----------------+----------------|
  8408. * | reserved |E|F|
  8409. * |---------------------------------+----------------+----------------|
  8410. * Where E = Configure the target to provide the 3-tuple hash value in
  8411. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8412. * F = Configure the target to provide the 3-tuple hash value in
  8413. * flow_id_toeplitz field of rx_msdu_start tlv
  8414. *
  8415. * The following field definitions describe the format of the 3 tuple hash value
  8416. * message sent from the host to target as part of initialization sequence.
  8417. *
  8418. * Header fields:
  8419. * dword0 - b'7:0 - msg_type: This will be set to
  8420. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8421. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8422. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8423. * specified pdev's LMAC ring.
  8424. * b'31:16 - reserved : Reserved for future use
  8425. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8426. * b'1 - toeplitz_hash_2_or_4_field_enable
  8427. * b'31:2 - reserved : Reserved for future use
  8428. * ---------+------+----------------------------------------------------------
  8429. * bit1 | bit0 | Functionality
  8430. * ---------+------+----------------------------------------------------------
  8431. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8432. * | | in flow_id_toeplitz field
  8433. * ---------+------+----------------------------------------------------------
  8434. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8435. * | | in toeplitz_hash_2_or_4 field
  8436. * ---------+------+----------------------------------------------------------
  8437. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8438. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8439. * ---------+------+----------------------------------------------------------
  8440. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8441. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8442. * | | toeplitz_hash_2_or_4 field
  8443. *----------------------------------------------------------------------------
  8444. */
  8445. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8446. A_UINT32 msg_type :8,
  8447. pdev_id :8,
  8448. reserved0 :16;
  8449. A_UINT32 flow_id_toeplitz_field_enable :1,
  8450. toeplitz_hash_2_or_4_field_enable :1,
  8451. reserved1 :30;
  8452. } POSTPACK;
  8453. /* DWORD0 : pdev_id configuration Macros */
  8454. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8455. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8456. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8457. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8458. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8459. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8462. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8463. } while (0)
  8464. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8465. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8466. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8467. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8468. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8469. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8470. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8471. do { \
  8472. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8473. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8474. } while (0)
  8475. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8476. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8477. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8478. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8479. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8480. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8481. do { \
  8482. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8483. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8484. } while (0)
  8485. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8486. /**
  8487. * @brief host --> target Host PA Address Size
  8488. *
  8489. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8490. *
  8491. * @details
  8492. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8493. * provide the physical start address and size of each of the memory
  8494. * areas within host DDR that the target FW may need to access.
  8495. *
  8496. * For example, the host can use this message to allow the target FW
  8497. * to set up access to the host's pools of TQM link descriptors.
  8498. * The message would appear as follows:
  8499. *
  8500. * |31 24|23 16|15 8|7 0|
  8501. * |----------------+----------------+----------------+----------------|
  8502. * | reserved | num_entries | msg_type |
  8503. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8504. * | mem area 0 size |
  8505. * |----------------+----------------+----------------+----------------|
  8506. * | mem area 0 physical_address_lo |
  8507. * |----------------+----------------+----------------+----------------|
  8508. * | mem area 0 physical_address_hi |
  8509. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8510. * | mem area 1 size |
  8511. * |----------------+----------------+----------------+----------------|
  8512. * | mem area 1 physical_address_lo |
  8513. * |----------------+----------------+----------------+----------------|
  8514. * | mem area 1 physical_address_hi |
  8515. * |----------------+----------------+----------------+----------------|
  8516. * ...
  8517. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8518. * | mem area N size |
  8519. * |----------------+----------------+----------------+----------------|
  8520. * | mem area N physical_address_lo |
  8521. * |----------------+----------------+----------------+----------------|
  8522. * | mem area N physical_address_hi |
  8523. * |----------------+----------------+----------------+----------------|
  8524. *
  8525. * The message is interpreted as follows:
  8526. * dword0 - b'0:7 - msg_type: This will be set to
  8527. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8528. * b'8:15 - number_entries: Indicated the number of host memory
  8529. * areas specified within the remainder of the message
  8530. * b'16:31 - reserved.
  8531. * dword1 - b'0:31 - memory area 0 size in bytes
  8532. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8533. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8534. * and similar for memory area 1 through memory area N.
  8535. */
  8536. PREPACK struct htt_h2t_host_paddr_size {
  8537. A_UINT32 msg_type: 8,
  8538. num_entries: 8,
  8539. reserved: 16;
  8540. } POSTPACK;
  8541. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8542. A_UINT32 size;
  8543. A_UINT32 physical_address_lo;
  8544. A_UINT32 physical_address_hi;
  8545. } POSTPACK;
  8546. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8547. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8548. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8549. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8550. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8551. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8552. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8553. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8554. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8555. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8556. do { \
  8557. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8558. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8559. } while (0)
  8560. /**
  8561. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8562. *
  8563. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8564. *
  8565. * @details
  8566. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8567. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8568. *
  8569. * The message would appear as follows:
  8570. *
  8571. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8572. * |---------------------------------+---+---+----------+-+-----------|
  8573. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8574. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8575. *
  8576. *
  8577. * The message is interpreted as follows:
  8578. * dword0 - b'0:7 - msg_type: This will be set to
  8579. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8580. * b'8 - override bit to drive MSDUs to PPE ring
  8581. * b'9:13 - REO destination ring indication
  8582. * b'14 - Multi buffer msdu override enable bit
  8583. * b'15 - Intra BSS override
  8584. * b'16 - Decap raw override
  8585. * b'17 - Decap Native wifi override
  8586. * b'18 - IP frag override
  8587. * b'19:31 - reserved
  8588. */
  8589. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8590. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8591. override: 1,
  8592. reo_destination_indication: 5,
  8593. multi_buffer_msdu_override_en: 1,
  8594. intra_bss_override: 1,
  8595. decap_raw_override: 1,
  8596. decap_nwifi_override: 1,
  8597. ip_frag_override: 1,
  8598. reserved: 13;
  8599. } POSTPACK;
  8600. /* DWORD 0: Override */
  8601. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8602. #define HTT_PPE_CFG_OVERRIDE_S 8
  8603. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8604. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8605. HTT_PPE_CFG_OVERRIDE_S)
  8606. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8607. do { \
  8608. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8609. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8610. } while (0)
  8611. /* DWORD 0: REO Destination Indication*/
  8612. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8613. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8614. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8615. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8616. HTT_PPE_CFG_REO_DEST_IND_S)
  8617. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8618. do { \
  8619. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8620. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8621. } while (0)
  8622. /* DWORD 0: Multi buffer MSDU override */
  8623. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8624. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8625. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8626. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8627. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8628. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8631. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8632. } while (0)
  8633. /* DWORD 0: Intra BSS override */
  8634. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8635. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8636. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8637. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8638. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8639. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8640. do { \
  8641. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8642. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8643. } while (0)
  8644. /* DWORD 0: Decap RAW override */
  8645. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8646. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8647. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8648. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8649. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8650. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8651. do { \
  8652. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8653. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8654. } while (0)
  8655. /* DWORD 0: Decap NWIFI override */
  8656. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8657. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8658. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8659. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8660. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8661. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8662. do { \
  8663. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8664. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8665. } while (0)
  8666. /* DWORD 0: IP frag override */
  8667. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8668. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8669. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8670. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8671. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8672. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8673. do { \
  8674. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8675. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8676. } while (0)
  8677. /*
  8678. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8679. *
  8680. * @details
  8681. * The following field definitions describe the format of the HTT host
  8682. * to target FW VDEV TX RX stats retrieve message.
  8683. * The message specifies the type of stats the host wants to retrieve.
  8684. *
  8685. * |31 27|26 25|24 17|16|15 8|7 0|
  8686. * |-----------------------------------------------------------|
  8687. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8688. * |-----------------------------------------------------------|
  8689. * | vdev_id lower bitmask |
  8690. * |-----------------------------------------------------------|
  8691. * | vdev_id upper bitmask |
  8692. * |-----------------------------------------------------------|
  8693. * Header fields:
  8694. * Where:
  8695. * dword0 - b'7:0 - msg_type: This will be set to
  8696. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8697. * b'15:8 - pdev id
  8698. * b'16(E) - Enable/Disable the vdev HW stats
  8699. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8700. * b'25:26(R) - Reset stats bits
  8701. * 0: don't reset stats
  8702. * 1: reset stats once
  8703. * 2: reset stats at the start of each periodic interval
  8704. * b'27:31 - reserved for future use
  8705. * dword1 - b'0:31 - vdev_id lower bitmask
  8706. * dword2 - b'0:31 - vdev_id upper bitmask
  8707. */
  8708. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8709. A_UINT32 msg_type :8,
  8710. pdev_id :8,
  8711. enable :1,
  8712. periodic_interval :8,
  8713. reset_stats_bits :2,
  8714. reserved0 :5;
  8715. A_UINT32 vdev_id_lower_bitmask;
  8716. A_UINT32 vdev_id_upper_bitmask;
  8717. } POSTPACK;
  8718. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8719. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8720. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8721. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8722. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8723. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8726. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8727. } while (0)
  8728. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8729. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8730. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8731. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8732. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8733. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8736. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8737. } while (0)
  8738. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8739. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8740. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8741. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8742. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8743. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8744. do { \
  8745. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8746. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8747. } while (0)
  8748. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8749. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8750. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8751. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8752. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8753. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8754. do { \
  8755. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8756. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8757. } while (0)
  8758. /*
  8759. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8760. *
  8761. * @details
  8762. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8763. * the default MSDU queues for one of the TIDs within the specified peer
  8764. * to the specified service class.
  8765. * The TID is indirectly specified - each service class is associated
  8766. * with a TID. All default MSDU queues for this peer-TID will be
  8767. * linked to the service class in question.
  8768. *
  8769. * |31 16|15 8|7 0|
  8770. * |------------------------------+--------------+--------------|
  8771. * | peer ID | svc class ID | msg type |
  8772. * |------------------------------------------------------------|
  8773. * Header fields:
  8774. * dword0 - b'7:0 - msg_type: This will be set to
  8775. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8776. * b'15:8 - service class ID
  8777. * b'31:16 - peer ID
  8778. */
  8779. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8780. A_UINT32 msg_type :8,
  8781. svc_class_id :8,
  8782. peer_id :16;
  8783. } POSTPACK;
  8784. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8785. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8786. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8787. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8788. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8789. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8790. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8791. do { \
  8792. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8793. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8794. } while (0)
  8795. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8796. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8797. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8798. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8799. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8800. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8801. do { \
  8802. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8803. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8804. } while (0)
  8805. /*
  8806. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8807. *
  8808. * @details
  8809. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8810. * remove the linkage of the specified peer-TID's MSDU queues to
  8811. * service classes.
  8812. *
  8813. * |31 16|15 8|7 0|
  8814. * |------------------------------+--------------+--------------|
  8815. * | peer ID | svc class ID | msg type |
  8816. * |------------------------------------------------------------|
  8817. * Header fields:
  8818. * dword0 - b'7:0 - msg_type: This will be set to
  8819. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8820. * b'15:8 - service class ID
  8821. * b'31:16 - peer ID
  8822. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8823. * value for peer ID indicates that the target should
  8824. * apply the UNMAP_REQ to all peers.
  8825. */
  8826. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8827. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8828. A_UINT32 msg_type :8,
  8829. svc_class_id :8,
  8830. peer_id :16;
  8831. } POSTPACK;
  8832. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8833. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8834. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8835. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8836. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8837. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8838. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8839. do { \
  8840. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8841. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8842. } while (0)
  8843. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8844. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8845. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8846. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8847. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8848. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8851. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8852. } while (0)
  8853. /*
  8854. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8855. *
  8856. * @details
  8857. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8858. * request the target to report what service class the default MSDU queues
  8859. * of the specified TIDs within the peer are linked to.
  8860. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8861. * to report what service class (if any) the default MSDU queues for
  8862. * each of the specified TIDs are linked to.
  8863. *
  8864. * |31 16|15 8|7 1| 0|
  8865. * |------------------------------+--------------+--------------|
  8866. * | peer ID | TID mask | msg type |
  8867. * |------------------------------------------------------------|
  8868. * | reserved |ETO|
  8869. * |------------------------------------------------------------|
  8870. * Header fields:
  8871. * dword0 - b'7:0 - msg_type: This will be set to
  8872. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8873. * b'15:8 - TID mask
  8874. * b'31:16 - peer ID
  8875. * dword1 - b'0 - "Existing Tids Only" flag
  8876. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8877. * message generated by this REQ will only show the
  8878. * mapping for TIDs that actually exist in the target's
  8879. * peer object.
  8880. * Any TIDs that are covered by a MAP_REQ but which
  8881. * do not actually exist will be shown as being
  8882. * unmapped (i.e. svc class ID 0xff).
  8883. * If this flag is cleared, the MAP_REPORT_CONF message
  8884. * will consider not only the mapping of TIDs currently
  8885. * existing in the peer, but also the mapping that will
  8886. * be applied for any TID objects created within this
  8887. * peer in the future.
  8888. * b'31:1 - reserved for future use
  8889. */
  8890. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8891. A_UINT32 msg_type :8,
  8892. tid_mask :8,
  8893. peer_id :16;
  8894. A_UINT32 existing_tids_only:1,
  8895. reserved :31;
  8896. } POSTPACK;
  8897. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8898. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8899. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8900. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8901. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8902. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8903. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8904. do { \
  8905. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8906. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8907. } while (0)
  8908. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8909. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8910. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8911. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8912. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8913. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8914. do { \
  8915. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8916. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8917. } while (0)
  8918. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8919. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8920. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8921. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8922. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8923. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8924. do { \
  8925. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8926. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8927. } while (0)
  8928. /**
  8929. * @brief Format of shared memory between Host and Target
  8930. * for UMAC recovery feature messaging.
  8931. * @details
  8932. * This is shared memory between Host and Target allocated
  8933. * and used in chips where UMAC recovery feature is supported.
  8934. * This shared memory is allocated per SOC level by Host since each
  8935. * SOC's target Q6FW needs to communicate independently to the Host
  8936. * through its own shared memory.
  8937. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8938. * then host interprets it as a new message from target.
  8939. * Host clears that particular read bit in t2h_msg after each read
  8940. * operation. It is vice versa for h2t_msg. At any given point
  8941. * of time there is expected to be only one bit set
  8942. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8943. *
  8944. * The message is interpreted as follows:
  8945. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8946. * added for debuggability purpose.
  8947. * dword1 - b'0 - do_pre_reset
  8948. * b'1 - do_post_reset_start
  8949. * b'2 - do_post_reset_complete
  8950. * b'3 - initiate_umac_recovery
  8951. * b'4 - initiate_target_recovery_sync_using_umac
  8952. * b'5:31 - rsvd_t2h
  8953. * dword2 - b'0 - pre_reset_done
  8954. * b'1 - post_reset_start_done
  8955. * b'2 - post_reset_complete_done
  8956. * b'3 - start_pre_reset (deprecated)
  8957. * b'4:31 - rsvd_h2t
  8958. */
  8959. PREPACK typedef struct {
  8960. /** Magic number added for debuggability. */
  8961. A_UINT32 magic_num;
  8962. union {
  8963. /*
  8964. * BIT [0] :- T2H msg to do pre-reset
  8965. * BIT [1] :- T2H msg to do post-reset start
  8966. * BIT [2] :- T2H msg to do post-reset complete
  8967. * BIT [3] :- T2H msg to indicate to Host that
  8968. * a trigger request for MLO UMAC Recovery
  8969. * is received for UMAC hang.
  8970. * BIT [4] :- T2H msg to indicate to Host that
  8971. * a trigger request for MLO UMAC Recovery
  8972. * is received for Mode-1 Target Recovery.
  8973. * BIT [31 : 5] :- reserved
  8974. */
  8975. A_UINT32 t2h_msg;
  8976. struct {
  8977. A_UINT32
  8978. do_pre_reset: 1, /* BIT [0] */
  8979. do_post_reset_start: 1, /* BIT [1] */
  8980. do_post_reset_complete: 1, /* BIT [2] */
  8981. initiate_umac_recovery: 1, /* BIT [3] */
  8982. initiate_target_recovery_sync_using_umac: 1, /* BIT [4] */
  8983. rsvd_t2h: 27; /* BIT [31:5] */
  8984. };
  8985. };
  8986. union {
  8987. /*
  8988. * BIT [0] :- H2T msg to send pre-reset done
  8989. * BIT [1] :- H2T msg to send post-reset start done
  8990. * BIT [2] :- H2T msg to send post-reset complete done
  8991. * BIT [3] :- H2T msg to start pre-reset. This is deprecated.
  8992. * BIT [31 : 4] :- reserved
  8993. */
  8994. A_UINT32 h2t_msg;
  8995. struct {
  8996. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8997. post_reset_start_done : 1, /* BIT [1] */
  8998. post_reset_complete_done : 1, /* BIT [2] */
  8999. start_pre_reset : 1, /* BIT [3] */
  9000. rsvd_h2t : 28; /* BIT [31 : 4] */
  9001. };
  9002. };
  9003. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  9004. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  9005. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  9006. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  9007. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  9008. /* dword1 - b'0 - do_pre_reset */
  9009. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  9012. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  9013. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  9014. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  9015. do { \
  9016. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  9017. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  9018. } while (0)
  9019. /* dword1 - b'1 - do_post_reset_start */
  9020. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9023. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9024. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9025. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9026. do { \
  9027. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9028. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9029. } while (0)
  9030. /* dword1 - b'2 - do_post_reset_complete */
  9031. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9034. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9035. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9036. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9037. do { \
  9038. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9039. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9040. } while (0)
  9041. /* dword1 - b'3 - initiate_umac_recovery */
  9042. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9045. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9046. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9047. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9048. do { \
  9049. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9050. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9051. } while (0)
  9052. /* dword1 - b'4 - initiate_target_recovery_sync_using_umac */
  9053. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M 0x00000010
  9054. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S 4
  9055. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_GET(word1) \
  9056. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M) >> \
  9057. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S)
  9058. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_SET(word1, _val) \
  9059. do { \
  9060. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC, _val); \
  9061. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S));\
  9062. } while (0)
  9063. /* dword2 - b'0 - pre_reset_done */
  9064. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9065. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9066. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9067. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9068. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9069. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9070. do { \
  9071. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9072. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9073. } while (0)
  9074. /* dword2 - b'1 - post_reset_start_done */
  9075. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9076. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9077. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9078. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9079. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9080. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9081. do { \
  9082. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9083. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9084. } while (0)
  9085. /* dword2 - b'2 - post_reset_complete_done */
  9086. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9087. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9088. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9089. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9090. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9091. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9092. do { \
  9093. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9094. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9095. } while (0)
  9096. /* dword2 - b'3 - start_pre_reset */
  9097. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9098. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9099. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9100. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9101. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9102. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9103. do { \
  9104. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9105. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9106. } while (0)
  9107. /**
  9108. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9109. *
  9110. * @details
  9111. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9112. * by the host to provide prerequisite info to target for the UMAC hang
  9113. * recovery feature.
  9114. * The info sent in this H2T message are T2H message method, H2T message
  9115. * method, T2H MSI interrupt number and physical start address, size of
  9116. * the shared memory (refers to the shared memory dedicated for messaging
  9117. * between host and target when the DUT is in UMAC hang recovery mode).
  9118. * This H2T message is expected to be only sent if the WMI service bit
  9119. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9120. *
  9121. * |31 16|15 12|11 8|7 0|
  9122. * |-------------------------------+--------------+--------------+------------|
  9123. * | reserved |h2t msg method|t2h msg method| msg_type |
  9124. * |--------------------------------------------------------------------------|
  9125. * | t2h msi interrupt number |
  9126. * |--------------------------------------------------------------------------|
  9127. * | shared memory area size |
  9128. * |--------------------------------------------------------------------------|
  9129. * | shared memory area physical address low |
  9130. * |--------------------------------------------------------------------------|
  9131. * | shared memory area physical address high |
  9132. * |--------------------------------------------------------------------------|
  9133. *
  9134. * The message is interpreted as follows:
  9135. * dword0 - b'0:7 - msg_type
  9136. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9137. * b'8:11 - t2h_msg_method: indicates method to be used for
  9138. * T2H communication in UMAC hang recovery mode.
  9139. * Value zero indicates MSI interrupt (default method).
  9140. * Refer to htt_umac_hang_recovery_msg_method enum.
  9141. * b'12:15 - h2t_msg_method: indicates method to be used for
  9142. * H2T communication in UMAC hang recovery mode.
  9143. * Value zero indicates polling by target for this h2t msg
  9144. * during UMAC hang recovery mode.
  9145. * Refer to htt_umac_hang_recovery_msg_method enum.
  9146. * b'16:31 - reserved.
  9147. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9148. * T2H communication in UMAC hang recovery mode.
  9149. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9150. * only when in UMAC hang recovery mode.
  9151. * This refers to size in bytes.
  9152. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9153. * of the shared memory dedicated for messaging only when
  9154. * in UMAC hang recovery mode.
  9155. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9156. * of the shared memory dedicated for messaging only when
  9157. * in UMAC hang recovery mode.
  9158. */
  9159. /* t2h_msg_method and h2t_msg_method */
  9160. enum htt_umac_hang_recovery_msg_method {
  9161. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9162. };
  9163. PREPACK typedef struct {
  9164. A_UINT32 msg_type : 8,
  9165. t2h_msg_method : 4,
  9166. h2t_msg_method : 4,
  9167. reserved : 16;
  9168. A_UINT32 t2h_msi_data;
  9169. /* size bytes and physical address of shared memory. */
  9170. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9171. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9172. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9173. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9174. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9175. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9176. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9177. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9178. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9179. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9180. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9181. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9182. do { \
  9183. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9184. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9185. } while (0)
  9186. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9187. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9188. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9189. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9190. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9191. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9192. do { \
  9193. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9194. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9195. } while (0)
  9196. /**
  9197. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9198. *
  9199. * @details
  9200. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9201. * HTT message sent by the host to indicate that the target needs to start the
  9202. * UMAC hang recovery feature from the point of pre-reset routine.
  9203. * The purpose of this H2T message is to have host synchronize and trigger
  9204. * UMAC recovery across all targets.
  9205. * The info sent in this H2T message is the flag to indicate whether the
  9206. * target needs to execute UMAC-recovery in context of the Initiator or
  9207. * Non-Initiator.
  9208. * This H2T message is expected to be sent as response to the
  9209. * initiate_umac_recovery indication from the Initiator target attached to
  9210. * this same host.
  9211. * This H2T message is expected to be only sent if the WMI service bit
  9212. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9213. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9214. * beforehand.
  9215. *
  9216. * |31 10|9|8|7 0|
  9217. * |-----------------------------------------------------------|
  9218. * | reserved |U|I| msg_type |
  9219. * |-----------------------------------------------------------|
  9220. * Where:
  9221. * I = is_initiator
  9222. * U = is_umac_hang
  9223. *
  9224. * The message is interpreted as follows:
  9225. * dword0 - b'0:7 - msg_type
  9226. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9227. * b'8 - is_initiator: indicates whether the target needs to
  9228. * execute the UMAC-recovery in context of the Initiator or
  9229. * Non-Initiator.
  9230. * The value zero indicates this target is Non-Initiator.
  9231. * b'9 - is_umac_hang: indicates whether MLO UMAC recovery
  9232. * executed in context of UMAC hang or Target recovery.
  9233. * b'10:31 - reserved.
  9234. */
  9235. PREPACK typedef struct {
  9236. A_UINT32 msg_type : 8,
  9237. is_initiator : 1,
  9238. is_umac_hang : 1,
  9239. reserved : 22;
  9240. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9241. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9242. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9243. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9244. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9245. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9246. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9247. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9248. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9249. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9250. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9251. do { \
  9252. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9253. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9254. } while (0)
  9255. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M 0x00000200
  9256. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S 9
  9257. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_GET(word0) \
  9258. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M) >> \
  9259. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S)
  9260. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_SET(word0, _val) \
  9261. do { \
  9262. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG, _val); \
  9263. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S));\
  9264. } while (0)
  9265. /*
  9266. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9267. *
  9268. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9269. *
  9270. * @details
  9271. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9272. * install or uninstall rx cce super rules to match certain kind of packets
  9273. * with specific parameters. Target sets up HW registers based on setup message
  9274. * and always confirms back to Host.
  9275. *
  9276. * The message would appear as follows:
  9277. * |31 24|23 16|15 8|7 0|
  9278. * |-----------------+-----------------+-----------------+-----------------|
  9279. * | reserved | operation | pdev_id | msg_type |
  9280. * |-----------------------------------------------------------------------|
  9281. * | cce_super_rule_param[0] |
  9282. * |-----------------------------------------------------------------------|
  9283. * | cce_super_rule_param[1] |
  9284. * |-----------------------------------------------------------------------|
  9285. *
  9286. * The message is interpreted as follows:
  9287. * dword0 - b'0:7 - msg_type: This will be set to
  9288. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9289. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is for
  9290. * b'16:23 - operation: Identify operation to be taken,
  9291. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9292. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9293. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9294. * b'24:31 - reserved
  9295. * dword1~10 - cce_super_rule_param[0]:
  9296. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9297. * dword11~20 - cce_super_rule_param[1]:
  9298. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9299. *
  9300. * Each cce_super_rule_param structure would appear as follows:
  9301. * |31 24|23 16|15 8|7 0|
  9302. * |-----------------+-----------------+-----------------+-----------------|
  9303. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9304. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9305. * |-----------------------------------------------------------------------|
  9306. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9307. * |-----------------------------------------------------------------------|
  9308. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9309. * |-----------------------------------------------------------------------|
  9310. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9311. * |-----------------------------------------------------------------------|
  9312. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9313. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9314. * |-----------------------------------------------------------------------|
  9315. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9316. * |-----------------------------------------------------------------------|
  9317. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9318. * |-----------------------------------------------------------------------|
  9319. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9320. * |-----------------------------------------------------------------------|
  9321. * | is_valid | l4_type | l3_type |
  9322. * |-----------------------------------------------------------------------|
  9323. * | l4_dst_port | l4_src_port |
  9324. * |-----------------------------------------------------------------------|
  9325. *
  9326. * The cce_super_rule_param[0] structure is interpreted as follows:
  9327. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9328. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9329. * in case of ipv4)
  9330. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9331. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9332. * in case of ipv4)
  9333. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9334. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9335. * in case of ipv4)
  9336. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9337. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9338. * in case of ipv4)
  9339. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9340. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9341. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9342. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9343. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9344. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9345. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9346. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9347. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9348. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9349. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9350. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9351. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9352. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9353. * ipv4 address, in case of ipv4)
  9354. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9355. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9356. * ipv4 address, in case of ipv4)
  9357. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9358. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9359. * ipv4 address, in case of ipv4)
  9360. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9361. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9362. * ipv4 address, in case of ipv4)
  9363. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9364. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9365. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9366. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9367. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9368. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9369. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9370. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9371. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9372. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9373. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9374. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9375. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9376. * 0x0008: ipv4
  9377. * 0xdd86: ipv6
  9378. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9379. * 6: TCP
  9380. * 17: UDP
  9381. * b'24:31 - is_valid: indicate whether this parameter is valid
  9382. * 0: invalid
  9383. * 1: valid
  9384. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9385. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9386. *
  9387. * The cce_super_rule_param[1] structure is similar.
  9388. */
  9389. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9390. enum htt_rx_cce_super_rule_setup_operation {
  9391. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9392. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9393. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9394. /* All operation should be before this */
  9395. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9396. };
  9397. typedef struct {
  9398. union {
  9399. A_UINT8 src_ipv4_addr[4];
  9400. A_UINT8 src_ipv6_addr[16];
  9401. };
  9402. union {
  9403. A_UINT8 dst_ipv4_addr[4];
  9404. A_UINT8 dst_ipv6_addr[16];
  9405. };
  9406. A_UINT32 l3_type: 16,
  9407. l4_type: 8,
  9408. is_valid: 8;
  9409. A_UINT32 l4_src_port: 16,
  9410. l4_dst_port: 16;
  9411. } htt_rx_cce_super_rule_param_t;
  9412. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9413. A_UINT32 msg_type: 8,
  9414. pdev_id: 8,
  9415. operation: 8,
  9416. reserved: 8;
  9417. htt_rx_cce_super_rule_param_t
  9418. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9419. } POSTPACK;
  9420. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9421. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9422. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M 0x0000ff00
  9423. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S 8
  9424. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_GET(_var) \
  9425. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M) >> \
  9426. HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)
  9427. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_SET(_var, _val) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID, _val); \
  9430. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)); \
  9431. } while (0)
  9432. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9433. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9434. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9435. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9436. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9437. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9438. do { \
  9439. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9440. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9441. } while (0)
  9442. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9443. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9444. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9445. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9446. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9447. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9448. do { \
  9449. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9450. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9451. } while (0)
  9452. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9453. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9454. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9455. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9456. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9457. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9458. do { \
  9459. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9460. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9461. } while (0)
  9462. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9463. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9464. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9465. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9466. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9467. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9470. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9471. } while (0)
  9472. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9473. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9474. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9475. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9476. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9477. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9478. do { \
  9479. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9480. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9481. } while (0)
  9482. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9483. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9484. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9485. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9486. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9487. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9488. do { \
  9489. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9490. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9491. } while (0)
  9492. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9493. do { \
  9494. A_MEMCPY(_array, _ptr, 4); \
  9495. } while (0)
  9496. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9497. do { \
  9498. A_MEMCPY(_ptr, _array, 4); \
  9499. } while (0)
  9500. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9501. do { \
  9502. A_MEMCPY(_array, _ptr, 16); \
  9503. } while (0)
  9504. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9505. do { \
  9506. A_MEMCPY(_ptr, _array, 16); \
  9507. } while (0)
  9508. /**
  9509. * htt_h2t_primary_link_peer_status_type -
  9510. * Unique number for each status or reasons
  9511. * The status reasons can go up to 255 max
  9512. */
  9513. enum htt_h2t_primary_link_peer_status_type {
  9514. /* Host Primary Link Peer migration Success */
  9515. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_OK = 0,
  9516. /* keep this last */
  9517. /* Host Primary Link Peer migration Fail */
  9518. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_FAIL = 254,
  9519. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_NUM_STATUS = 255
  9520. };
  9521. /**
  9522. * @brief host -> Primary peer migration completion message from host
  9523. *
  9524. * MSG_TYPE => HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP
  9525. *
  9526. * @details
  9527. * HTT_H2T_MSG_TYPE_PRIMARY_PEER_MIGRATE_RESP message is sent by host to
  9528. * target Confirming that primary link peer migration has completed,
  9529. * in response to a HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  9530. * message from the target.
  9531. *
  9532. * The message would appear as follows:
  9533. *
  9534. * |31 25|24|23 16|15 12|11 8|7 0|
  9535. * |----------------------------+----------+---------+--------------|
  9536. * | vdev ID | pdev ID | chip ID | msg type |
  9537. * |----------------------------+----------+---------+--------------|
  9538. * | ML peer ID | SW peer ID |
  9539. * |------------+--+------------+--------------------+--------------|
  9540. * | reserved |SV| src_info | status |
  9541. * |------------+--+---------------------------------+--------------|
  9542. * Where:
  9543. * SV = src_info_valid flag
  9544. *
  9545. * The message is interpreted as follows:
  9546. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  9547. * (HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP)
  9548. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  9549. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  9550. * as primary
  9551. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  9552. * as primary
  9553. *
  9554. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  9555. * chosen as primary
  9556. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  9557. * primary peer belongs.
  9558. * dword2 - b'0:7 - status: Indicates the status of Rx/TCL migration
  9559. * b'8:23 - src_info: Indicates New Virtual port number through
  9560. * which Rx Pipe connects to the correct PPE.
  9561. * b'24 - src_info_valid: Indicates src_info is valid.
  9562. */
  9563. typedef struct {
  9564. A_UINT32 msg_type: 8, /* bits 7:0 */
  9565. chip_id: 4, /* bits 11:8 */
  9566. pdev_id: 4, /* bits 15:12 */
  9567. vdev_id: 16; /* bits 31:16 */
  9568. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  9569. ml_peer_id: 16; /* bits 31:16 */
  9570. A_UINT32 status: 8, /* bits 7:0 */
  9571. src_info: 16, /* bits 23:8 */
  9572. src_info_valid: 1, /* bit 24 */
  9573. reserved: 7; /* bits 31:25 */
  9574. } htt_h2t_primary_link_peer_migrate_resp_t;
  9575. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  9576. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  9577. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  9578. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  9579. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  9580. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  9581. do { \
  9582. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  9583. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  9584. } while (0)
  9585. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  9586. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  9587. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  9588. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  9589. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  9590. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  9591. do { \
  9592. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  9593. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  9594. } while (0)
  9595. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  9596. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  9597. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  9598. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  9599. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  9600. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  9601. do { \
  9602. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  9603. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  9604. } while (0)
  9605. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  9606. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  9607. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  9608. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  9609. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  9610. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  9611. do { \
  9612. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  9613. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  9614. } while (0)
  9615. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  9616. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  9617. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  9618. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  9619. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  9620. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  9621. do { \
  9622. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  9623. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  9624. } while (0)
  9625. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M 0x000000FF
  9626. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S 0
  9627. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_GET(_var) \
  9628. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M) >> \
  9629. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S)
  9630. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_SET(_var, _val) \
  9631. do { \
  9632. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS, _val); \
  9633. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S));\
  9634. } while (0)
  9635. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M 0x00FFFF00
  9636. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S 8
  9637. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_GET(_var) \
  9638. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M) >> \
  9639. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S)
  9640. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_SET(_var, _val) \
  9641. do { \
  9642. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO, _val); \
  9643. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S));\
  9644. } while (0)
  9645. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M 0x01000000
  9646. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S 24
  9647. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_GET(_var) \
  9648. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M) >> \
  9649. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S)
  9650. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_SET(_var, _val) \
  9651. do { \
  9652. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID, _val); \
  9653. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S));\
  9654. } while (0)
  9655. /*=== target -> host messages ===============================================*/
  9656. enum htt_t2h_msg_type {
  9657. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9658. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9659. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9660. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9661. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9662. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9663. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9664. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9665. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9666. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9667. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9668. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9669. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9670. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9671. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9672. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9673. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9674. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9675. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9676. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9677. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9678. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9679. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9680. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9681. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9682. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9683. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9684. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9685. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9686. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9687. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9688. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9689. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9690. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9691. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9692. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9693. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9694. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9695. /* TX_OFFLOAD_DELIVER_IND:
  9696. * Forward the target's locally-generated packets to the host,
  9697. * to provide to the monitor mode interface.
  9698. */
  9699. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9700. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9701. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9702. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9703. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9704. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9705. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9706. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9707. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9708. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9709. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9710. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9711. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9712. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9713. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9714. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9715. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9716. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9717. HTT_T2H_MSG_TYPE_RX_DATA_IND = 0x35,
  9718. HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND = 0x36,
  9719. HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND = 0x37,
  9720. HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND = 0x38,
  9721. HTT_T2H_MSG_TYPE_TEST,
  9722. /* keep this last */
  9723. HTT_T2H_NUM_MSGS
  9724. };
  9725. /*
  9726. * HTT target to host message type -
  9727. * stored in bits 7:0 of the first word of the message
  9728. */
  9729. #define HTT_T2H_MSG_TYPE_M 0xff
  9730. #define HTT_T2H_MSG_TYPE_S 0
  9731. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9732. do { \
  9733. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9734. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9735. } while (0)
  9736. #define HTT_T2H_MSG_TYPE_GET(word) \
  9737. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9738. /**
  9739. * @brief target -> host version number confirmation message definition
  9740. *
  9741. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9742. *
  9743. * |31 24|23 16|15 8|7 0|
  9744. * |----------------+----------------+----------------+----------------|
  9745. * | reserved | major number | minor number | msg type |
  9746. * |-------------------------------------------------------------------|
  9747. * : option request TLV (optional) |
  9748. * :...................................................................:
  9749. *
  9750. * The VER_CONF message may consist of a single 4-byte word, or may be
  9751. * extended with TLVs that specify HTT options selected by the target.
  9752. * The following option TLVs may be appended to the VER_CONF message:
  9753. * - LL_BUS_ADDR_SIZE
  9754. * - HL_SUPPRESS_TX_COMPL_IND
  9755. * - MAX_TX_QUEUE_GROUPS
  9756. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9757. * may be appended to the VER_CONF message (but only one TLV of each type).
  9758. *
  9759. * Header fields:
  9760. * - MSG_TYPE
  9761. * Bits 7:0
  9762. * Purpose: identifies this as a version number confirmation message
  9763. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9764. * - VER_MINOR
  9765. * Bits 15:8
  9766. * Purpose: Specify the minor number of the HTT message library version
  9767. * in use by the target firmware.
  9768. * The minor number specifies the specific revision within a range
  9769. * of fundamentally compatible HTT message definition revisions.
  9770. * Compatible revisions involve adding new messages or perhaps
  9771. * adding new fields to existing messages, in a backwards-compatible
  9772. * manner.
  9773. * Incompatible revisions involve changing the message type values,
  9774. * or redefining existing messages.
  9775. * Value: minor number
  9776. * - VER_MAJOR
  9777. * Bits 15:8
  9778. * Purpose: Specify the major number of the HTT message library version
  9779. * in use by the target firmware.
  9780. * The major number specifies the family of minor revisions that are
  9781. * fundamentally compatible with each other, but not with prior or
  9782. * later families.
  9783. * Value: major number
  9784. */
  9785. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9786. #define HTT_VER_CONF_MINOR_S 8
  9787. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9788. #define HTT_VER_CONF_MAJOR_S 16
  9789. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9790. do { \
  9791. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9792. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9793. } while (0)
  9794. #define HTT_VER_CONF_MINOR_GET(word) \
  9795. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9796. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9797. do { \
  9798. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9799. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9800. } while (0)
  9801. #define HTT_VER_CONF_MAJOR_GET(word) \
  9802. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9803. #define HTT_VER_CONF_BYTES 4
  9804. /**
  9805. * @brief - target -> host HTT Rx In order indication message
  9806. *
  9807. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9808. *
  9809. * @details
  9810. *
  9811. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9812. * |----------------+-------------------+---------------------+---------------|
  9813. * | peer ID | P| F| O| ext TID | msg type |
  9814. * |--------------------------------------------------------------------------|
  9815. * | MSDU count | Reserved | vdev id |
  9816. * |--------------------------------------------------------------------------|
  9817. * | MSDU 0 bus address (bits 31:0) |
  9818. #if HTT_PADDR64
  9819. * | MSDU 0 bus address (bits 63:32) |
  9820. #endif
  9821. * |--------------------------------------------------------------------------|
  9822. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9823. * |--------------------------------------------------------------------------|
  9824. * | MSDU 1 bus address (bits 31:0) |
  9825. #if HTT_PADDR64
  9826. * | MSDU 1 bus address (bits 63:32) |
  9827. #endif
  9828. * |--------------------------------------------------------------------------|
  9829. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9830. * |--------------------------------------------------------------------------|
  9831. */
  9832. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9833. *
  9834. * @details
  9835. * bits
  9836. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9837. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9838. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9839. * | | frag | | | | fail |chksum fail|
  9840. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9841. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9842. */
  9843. struct htt_rx_in_ord_paddr_ind_hdr_t
  9844. {
  9845. A_UINT32 /* word 0 */
  9846. msg_type: 8,
  9847. ext_tid: 5,
  9848. offload: 1,
  9849. frag: 1,
  9850. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9851. peer_id: 16;
  9852. A_UINT32 /* word 1 */
  9853. vap_id: 8,
  9854. /* NOTE:
  9855. * This reserved_1 field is not truly reserved - certain targets use
  9856. * this field internally to store debug information, and do not zero
  9857. * out the contents of the field before uploading the message to the
  9858. * host. Thus, any host-target communication supported by this field
  9859. * is limited to using values that are never used by the debug
  9860. * information stored by certain targets in the reserved_1 field.
  9861. * In particular, the targets in question don't use the value 0x3
  9862. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9863. * so this previously-unused value within these bits is available to
  9864. * use as the host / target PKT_CAPTURE_MODE flag.
  9865. */
  9866. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9867. /* if pkt_capture_mode == 0x3, host should
  9868. * send rx frames to monitor mode interface
  9869. */
  9870. msdu_cnt: 16;
  9871. };
  9872. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9873. {
  9874. A_UINT32 dma_addr;
  9875. A_UINT32
  9876. length: 16,
  9877. fw_desc: 8,
  9878. msdu_info:8;
  9879. };
  9880. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9881. {
  9882. A_UINT32 dma_addr_lo;
  9883. A_UINT32 dma_addr_hi;
  9884. A_UINT32
  9885. length: 16,
  9886. fw_desc: 8,
  9887. msdu_info:8;
  9888. };
  9889. #if HTT_PADDR64
  9890. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9891. #else
  9892. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9893. #endif
  9894. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9895. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9896. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9897. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9898. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9899. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9900. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9901. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9902. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9903. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9904. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9905. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9906. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9907. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9908. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9909. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9910. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9911. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9912. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9913. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9914. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9915. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9916. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9917. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9918. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9919. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9920. /* for systems using 64-bit format for bus addresses */
  9921. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9922. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9923. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9924. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9925. /* for systems using 32-bit format for bus addresses */
  9926. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9927. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9928. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9929. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9930. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9931. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9932. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9933. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9934. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9935. do { \
  9936. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9937. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9938. } while (0)
  9939. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9940. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9941. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9942. do { \
  9943. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9944. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9945. } while (0)
  9946. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9947. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9948. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9949. do { \
  9950. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9951. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9952. } while (0)
  9953. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9954. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9955. /*
  9956. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9957. * deliver the rx frames to the monitor mode interface.
  9958. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9959. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9960. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9961. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9962. */
  9963. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9964. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9967. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9968. } while (0)
  9969. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9970. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9971. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9972. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9973. do { \
  9974. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9975. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9976. } while (0)
  9977. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9978. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9979. /* for systems using 64-bit format for bus addresses */
  9980. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9981. do { \
  9982. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9983. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9984. } while (0)
  9985. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9986. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9987. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9988. do { \
  9989. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9990. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9991. } while (0)
  9992. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9993. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9994. /* for systems using 32-bit format for bus addresses */
  9995. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9998. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9999. } while (0)
  10000. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  10001. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  10002. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  10003. do { \
  10004. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  10005. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  10006. } while (0)
  10007. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  10008. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  10009. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  10010. do { \
  10011. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  10012. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  10013. } while (0)
  10014. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  10015. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  10016. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  10017. do { \
  10018. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  10019. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  10020. } while (0)
  10021. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  10022. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  10023. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  10024. do { \
  10025. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  10026. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  10027. } while (0)
  10028. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  10029. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  10030. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  10031. do { \
  10032. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  10033. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  10034. } while (0)
  10035. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  10036. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  10037. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  10038. do { \
  10039. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  10040. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  10041. } while (0)
  10042. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  10043. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  10044. /* definitions used within target -> host rx indication message */
  10045. PREPACK struct htt_rx_ind_hdr_prefix_t
  10046. {
  10047. A_UINT32 /* word 0 */
  10048. msg_type: 8,
  10049. ext_tid: 5,
  10050. release_valid: 1,
  10051. flush_valid: 1,
  10052. reserved0: 1,
  10053. peer_id: 16;
  10054. A_UINT32 /* word 1 */
  10055. flush_start_seq_num: 6,
  10056. flush_end_seq_num: 6,
  10057. release_start_seq_num: 6,
  10058. release_end_seq_num: 6,
  10059. num_mpdu_ranges: 8;
  10060. } POSTPACK;
  10061. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  10062. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  10063. #define HTT_TGT_RSSI_INVALID 0x80
  10064. PREPACK struct htt_rx_ppdu_desc_t
  10065. {
  10066. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  10067. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  10068. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  10069. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  10070. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  10071. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  10072. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  10073. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  10074. A_UINT32 /* word 0 */
  10075. rssi_cmb: 8,
  10076. timestamp_submicrosec: 8,
  10077. phy_err_code: 8,
  10078. phy_err: 1,
  10079. legacy_rate: 4,
  10080. legacy_rate_sel: 1,
  10081. end_valid: 1,
  10082. start_valid: 1;
  10083. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  10084. union {
  10085. A_UINT32 /* word 1 */
  10086. rssi0_pri20: 8,
  10087. rssi0_ext20: 8,
  10088. rssi0_ext40: 8,
  10089. rssi0_ext80: 8;
  10090. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  10091. } u0;
  10092. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  10093. union {
  10094. A_UINT32 /* word 2 */
  10095. rssi1_pri20: 8,
  10096. rssi1_ext20: 8,
  10097. rssi1_ext40: 8,
  10098. rssi1_ext80: 8;
  10099. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  10100. } u1;
  10101. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  10102. union {
  10103. A_UINT32 /* word 3 */
  10104. rssi2_pri20: 8,
  10105. rssi2_ext20: 8,
  10106. rssi2_ext40: 8,
  10107. rssi2_ext80: 8;
  10108. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  10109. } u2;
  10110. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  10111. union {
  10112. A_UINT32 /* word 4 */
  10113. rssi3_pri20: 8,
  10114. rssi3_ext20: 8,
  10115. rssi3_ext40: 8,
  10116. rssi3_ext80: 8;
  10117. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  10118. } u3;
  10119. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  10120. A_UINT32 tsf32; /* word 5 */
  10121. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  10122. A_UINT32 timestamp_microsec; /* word 6 */
  10123. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  10124. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  10125. A_UINT32 /* word 7 */
  10126. vht_sig_a1: 24,
  10127. preamble_type: 8;
  10128. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  10129. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  10130. A_UINT32 /* word 8 */
  10131. vht_sig_a2: 24,
  10132. /* sa_ant_matrix
  10133. * For cases where a single rx chain has options to be connected to
  10134. * different rx antennas, show which rx antennas were in use during
  10135. * receipt of a given PPDU.
  10136. * This sa_ant_matrix provides a bitmask of the antennas used while
  10137. * receiving this frame.
  10138. */
  10139. sa_ant_matrix: 8;
  10140. } POSTPACK;
  10141. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  10142. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  10143. PREPACK struct htt_rx_ind_hdr_suffix_t
  10144. {
  10145. A_UINT32 /* word 0 */
  10146. fw_rx_desc_bytes: 16,
  10147. reserved0: 16;
  10148. } POSTPACK;
  10149. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  10150. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  10151. PREPACK struct htt_rx_ind_hdr_t
  10152. {
  10153. struct htt_rx_ind_hdr_prefix_t prefix;
  10154. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  10155. struct htt_rx_ind_hdr_suffix_t suffix;
  10156. } POSTPACK;
  10157. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  10158. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  10159. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  10160. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  10161. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  10162. /*
  10163. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  10164. * the offset into the HTT rx indication message at which the
  10165. * FW rx PPDU descriptor resides
  10166. */
  10167. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  10168. /*
  10169. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  10170. * the offset into the HTT rx indication message at which the
  10171. * header suffix (FW rx MSDU byte count) resides
  10172. */
  10173. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  10174. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  10175. /*
  10176. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  10177. * the offset into the HTT rx indication message at which the per-MSDU
  10178. * information starts
  10179. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  10180. * per-MSDU information portion of the message. The per-MSDU info itself
  10181. * starts at byte 12.
  10182. */
  10183. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  10184. /**
  10185. * @brief target -> host rx indication message definition
  10186. *
  10187. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  10188. *
  10189. * @details
  10190. * The following field definitions describe the format of the rx indication
  10191. * message sent from the target to the host.
  10192. * The message consists of three major sections:
  10193. * 1. a fixed-length header
  10194. * 2. a variable-length list of firmware rx MSDU descriptors
  10195. * 3. one or more 4-octet MPDU range information elements
  10196. * The fixed length header itself has two sub-sections
  10197. * 1. the message meta-information, including identification of the
  10198. * sender and type of the received data, and a 4-octet flush/release IE
  10199. * 2. the firmware rx PPDU descriptor
  10200. *
  10201. * The format of the message is depicted below.
  10202. * in this depiction, the following abbreviations are used for information
  10203. * elements within the message:
  10204. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10205. * elements associated with the PPDU start are valid.
  10206. * Specifically, the following fields are valid only if SV is set:
  10207. * RSSI (all variants), L, legacy rate, preamble type, service,
  10208. * VHT-SIG-A
  10209. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10210. * elements associated with the PPDU end are valid.
  10211. * Specifically, the following fields are valid only if EV is set:
  10212. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10213. * - L - Legacy rate selector - if legacy rates are used, this flag
  10214. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10215. * (L == 0) PHY.
  10216. * - P - PHY error flag - boolean indication of whether the rx frame had
  10217. * a PHY error
  10218. *
  10219. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10220. * |----------------+-------------------+---------------------+---------------|
  10221. * | peer ID | |RV|FV| ext TID | msg type |
  10222. * |--------------------------------------------------------------------------|
  10223. * | num | release | release | flush | flush |
  10224. * | MPDU | end | start | end | start |
  10225. * | ranges | seq num | seq num | seq num | seq num |
  10226. * |==========================================================================|
  10227. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10228. * |V|V| | rate | | | timestamp | RSSI |
  10229. * |--------------------------------------------------------------------------|
  10230. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10231. * |--------------------------------------------------------------------------|
  10232. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10233. * |--------------------------------------------------------------------------|
  10234. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10235. * |--------------------------------------------------------------------------|
  10236. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10237. * |--------------------------------------------------------------------------|
  10238. * | TSF LSBs |
  10239. * |--------------------------------------------------------------------------|
  10240. * | microsec timestamp |
  10241. * |--------------------------------------------------------------------------|
  10242. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10243. * |--------------------------------------------------------------------------|
  10244. * | service | HT-SIG / VHT-SIG-A2 |
  10245. * |==========================================================================|
  10246. * | reserved | FW rx desc bytes |
  10247. * |--------------------------------------------------------------------------|
  10248. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10249. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10250. * |--------------------------------------------------------------------------|
  10251. * : : :
  10252. * |--------------------------------------------------------------------------|
  10253. * | alignment | MSDU Rx |
  10254. * | padding | desc Bn |
  10255. * |--------------------------------------------------------------------------|
  10256. * | reserved | MPDU range status | MPDU count |
  10257. * |--------------------------------------------------------------------------|
  10258. * : reserved : MPDU range status : MPDU count :
  10259. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10260. *
  10261. * Header fields:
  10262. * - MSG_TYPE
  10263. * Bits 7:0
  10264. * Purpose: identifies this as an rx indication message
  10265. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10266. * - EXT_TID
  10267. * Bits 12:8
  10268. * Purpose: identify the traffic ID of the rx data, including
  10269. * special "extended" TID values for multicast, broadcast, and
  10270. * non-QoS data frames
  10271. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10272. * - FLUSH_VALID (FV)
  10273. * Bit 13
  10274. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10275. * is valid
  10276. * Value:
  10277. * 1 -> flush IE is valid and needs to be processed
  10278. * 0 -> flush IE is not valid and should be ignored
  10279. * - REL_VALID (RV)
  10280. * Bit 13
  10281. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10282. * is valid
  10283. * Value:
  10284. * 1 -> release IE is valid and needs to be processed
  10285. * 0 -> release IE is not valid and should be ignored
  10286. * - PEER_ID
  10287. * Bits 31:16
  10288. * Purpose: Identify, by ID, which peer sent the rx data
  10289. * Value: ID of the peer who sent the rx data
  10290. * - FLUSH_SEQ_NUM_START
  10291. * Bits 5:0
  10292. * Purpose: Indicate the start of a series of MPDUs to flush
  10293. * Not all MPDUs within this series are necessarily valid - the host
  10294. * must check each sequence number within this range to see if the
  10295. * corresponding MPDU is actually present.
  10296. * This field is only valid if the FV bit is set.
  10297. * Value:
  10298. * The sequence number for the first MPDUs to check to flush.
  10299. * The sequence number is masked by 0x3f.
  10300. * - FLUSH_SEQ_NUM_END
  10301. * Bits 11:6
  10302. * Purpose: Indicate the end of a series of MPDUs to flush
  10303. * Value:
  10304. * The sequence number one larger than the sequence number of the
  10305. * last MPDU to check to flush.
  10306. * The sequence number is masked by 0x3f.
  10307. * Not all MPDUs within this series are necessarily valid - the host
  10308. * must check each sequence number within this range to see if the
  10309. * corresponding MPDU is actually present.
  10310. * This field is only valid if the FV bit is set.
  10311. * - REL_SEQ_NUM_START
  10312. * Bits 17:12
  10313. * Purpose: Indicate the start of a series of MPDUs to release.
  10314. * All MPDUs within this series are present and valid - the host
  10315. * need not check each sequence number within this range to see if
  10316. * the corresponding MPDU is actually present.
  10317. * This field is only valid if the RV bit is set.
  10318. * Value:
  10319. * The sequence number for the first MPDUs to check to release.
  10320. * The sequence number is masked by 0x3f.
  10321. * - REL_SEQ_NUM_END
  10322. * Bits 23:18
  10323. * Purpose: Indicate the end of a series of MPDUs to release.
  10324. * Value:
  10325. * The sequence number one larger than the sequence number of the
  10326. * last MPDU to check to release.
  10327. * The sequence number is masked by 0x3f.
  10328. * All MPDUs within this series are present and valid - the host
  10329. * need not check each sequence number within this range to see if
  10330. * the corresponding MPDU is actually present.
  10331. * This field is only valid if the RV bit is set.
  10332. * - NUM_MPDU_RANGES
  10333. * Bits 31:24
  10334. * Purpose: Indicate how many ranges of MPDUs are present.
  10335. * Each MPDU range consists of a series of contiguous MPDUs within the
  10336. * rx frame sequence which all have the same MPDU status.
  10337. * Value: 1-63 (typically a small number, like 1-3)
  10338. *
  10339. * Rx PPDU descriptor fields:
  10340. * - RSSI_CMB
  10341. * Bits 7:0
  10342. * Purpose: Combined RSSI from all active rx chains, across the active
  10343. * bandwidth.
  10344. * Value: RSSI dB units w.r.t. noise floor
  10345. * - TIMESTAMP_SUBMICROSEC
  10346. * Bits 15:8
  10347. * Purpose: high-resolution timestamp
  10348. * Value:
  10349. * Sub-microsecond time of PPDU reception.
  10350. * This timestamp ranges from [0,MAC clock MHz).
  10351. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10352. * to form a high-resolution, large range rx timestamp.
  10353. * - PHY_ERR_CODE
  10354. * Bits 23:16
  10355. * Purpose:
  10356. * If the rx frame processing resulted in a PHY error, indicate what
  10357. * type of rx PHY error occurred.
  10358. * Value:
  10359. * This field is valid if the "P" (PHY_ERR) flag is set.
  10360. * TBD: document/specify the values for this field
  10361. * - PHY_ERR
  10362. * Bit 24
  10363. * Purpose: indicate whether the rx PPDU had a PHY error
  10364. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10365. * - LEGACY_RATE
  10366. * Bits 28:25
  10367. * Purpose:
  10368. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10369. * specify which rate was used.
  10370. * Value:
  10371. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10372. * flag.
  10373. * If LEGACY_RATE_SEL is 0:
  10374. * 0x8: OFDM 48 Mbps
  10375. * 0x9: OFDM 24 Mbps
  10376. * 0xA: OFDM 12 Mbps
  10377. * 0xB: OFDM 6 Mbps
  10378. * 0xC: OFDM 54 Mbps
  10379. * 0xD: OFDM 36 Mbps
  10380. * 0xE: OFDM 18 Mbps
  10381. * 0xF: OFDM 9 Mbps
  10382. * If LEGACY_RATE_SEL is 1:
  10383. * 0x8: CCK 11 Mbps long preamble
  10384. * 0x9: CCK 5.5 Mbps long preamble
  10385. * 0xA: CCK 2 Mbps long preamble
  10386. * 0xB: CCK 1 Mbps long preamble
  10387. * 0xC: CCK 11 Mbps short preamble
  10388. * 0xD: CCK 5.5 Mbps short preamble
  10389. * 0xE: CCK 2 Mbps short preamble
  10390. * - LEGACY_RATE_SEL
  10391. * Bit 29
  10392. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10393. * Value:
  10394. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10395. * used a legacy rate.
  10396. * 0 -> OFDM, 1 -> CCK
  10397. * - END_VALID
  10398. * Bit 30
  10399. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10400. * the start of the PPDU are valid. Specifically, the following
  10401. * fields are only valid if END_VALID is set:
  10402. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10403. * TIMESTAMP_SUBMICROSEC
  10404. * Value:
  10405. * 0 -> rx PPDU desc end fields are not valid
  10406. * 1 -> rx PPDU desc end fields are valid
  10407. * - START_VALID
  10408. * Bit 31
  10409. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10410. * the end of the PPDU are valid. Specifically, the following
  10411. * fields are only valid if START_VALID is set:
  10412. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10413. * VHT-SIG-A
  10414. * Value:
  10415. * 0 -> rx PPDU desc start fields are not valid
  10416. * 1 -> rx PPDU desc start fields are valid
  10417. * - RSSI0_PRI20
  10418. * Bits 7:0
  10419. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10420. * Value: RSSI dB units w.r.t. noise floor
  10421. *
  10422. * - RSSI0_EXT20
  10423. * Bits 7:0
  10424. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10425. * (if the rx bandwidth was >= 40 MHz)
  10426. * Value: RSSI dB units w.r.t. noise floor
  10427. * - RSSI0_EXT40
  10428. * Bits 7:0
  10429. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10430. * (if the rx bandwidth was >= 80 MHz)
  10431. * Value: RSSI dB units w.r.t. noise floor
  10432. * - RSSI0_EXT80
  10433. * Bits 7:0
  10434. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10435. * (if the rx bandwidth was >= 160 MHz)
  10436. * Value: RSSI dB units w.r.t. noise floor
  10437. *
  10438. * - RSSI1_PRI20
  10439. * Bits 7:0
  10440. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10441. * Value: RSSI dB units w.r.t. noise floor
  10442. * - RSSI1_EXT20
  10443. * Bits 7:0
  10444. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10445. * (if the rx bandwidth was >= 40 MHz)
  10446. * Value: RSSI dB units w.r.t. noise floor
  10447. * - RSSI1_EXT40
  10448. * Bits 7:0
  10449. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10450. * (if the rx bandwidth was >= 80 MHz)
  10451. * Value: RSSI dB units w.r.t. noise floor
  10452. * - RSSI1_EXT80
  10453. * Bits 7:0
  10454. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10455. * (if the rx bandwidth was >= 160 MHz)
  10456. * Value: RSSI dB units w.r.t. noise floor
  10457. *
  10458. * - RSSI2_PRI20
  10459. * Bits 7:0
  10460. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10461. * Value: RSSI dB units w.r.t. noise floor
  10462. * - RSSI2_EXT20
  10463. * Bits 7:0
  10464. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10465. * (if the rx bandwidth was >= 40 MHz)
  10466. * Value: RSSI dB units w.r.t. noise floor
  10467. * - RSSI2_EXT40
  10468. * Bits 7:0
  10469. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10470. * (if the rx bandwidth was >= 80 MHz)
  10471. * Value: RSSI dB units w.r.t. noise floor
  10472. * - RSSI2_EXT80
  10473. * Bits 7:0
  10474. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10475. * (if the rx bandwidth was >= 160 MHz)
  10476. * Value: RSSI dB units w.r.t. noise floor
  10477. *
  10478. * - RSSI3_PRI20
  10479. * Bits 7:0
  10480. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10481. * Value: RSSI dB units w.r.t. noise floor
  10482. * - RSSI3_EXT20
  10483. * Bits 7:0
  10484. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10485. * (if the rx bandwidth was >= 40 MHz)
  10486. * Value: RSSI dB units w.r.t. noise floor
  10487. * - RSSI3_EXT40
  10488. * Bits 7:0
  10489. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10490. * (if the rx bandwidth was >= 80 MHz)
  10491. * Value: RSSI dB units w.r.t. noise floor
  10492. * - RSSI3_EXT80
  10493. * Bits 7:0
  10494. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10495. * (if the rx bandwidth was >= 160 MHz)
  10496. * Value: RSSI dB units w.r.t. noise floor
  10497. *
  10498. * - TSF32
  10499. * Bits 31:0
  10500. * Purpose: specify the time the rx PPDU was received, in TSF units
  10501. * Value: 32 LSBs of the TSF
  10502. * - TIMESTAMP_MICROSEC
  10503. * Bits 31:0
  10504. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10505. * Value: PPDU rx time, in microseconds
  10506. * - VHT_SIG_A1
  10507. * Bits 23:0
  10508. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10509. * from the rx PPDU
  10510. * Value:
  10511. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10512. * VHT-SIG-A1 data.
  10513. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10514. * first 24 bits of the HT-SIG data.
  10515. * Otherwise, this field is invalid.
  10516. * Refer to the the 802.11 protocol for the definition of the
  10517. * HT-SIG and VHT-SIG-A1 fields
  10518. * - VHT_SIG_A2
  10519. * Bits 23:0
  10520. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10521. * from the rx PPDU
  10522. * Value:
  10523. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10524. * VHT-SIG-A2 data.
  10525. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10526. * last 24 bits of the HT-SIG data.
  10527. * Otherwise, this field is invalid.
  10528. * Refer to the the 802.11 protocol for the definition of the
  10529. * HT-SIG and VHT-SIG-A2 fields
  10530. * - PREAMBLE_TYPE
  10531. * Bits 31:24
  10532. * Purpose: indicate the PHY format of the received burst
  10533. * Value:
  10534. * 0x4: Legacy (OFDM/CCK)
  10535. * 0x8: HT
  10536. * 0x9: HT with TxBF
  10537. * 0xC: VHT
  10538. * 0xD: VHT with TxBF
  10539. * - SERVICE
  10540. * Bits 31:24
  10541. * Purpose: TBD
  10542. * Value: TBD
  10543. *
  10544. * Rx MSDU descriptor fields:
  10545. * - FW_RX_DESC_BYTES
  10546. * Bits 15:0
  10547. * Purpose: Indicate how many bytes in the Rx indication are used for
  10548. * FW Rx descriptors
  10549. *
  10550. * Payload fields:
  10551. * - MPDU_COUNT
  10552. * Bits 7:0
  10553. * Purpose: Indicate how many sequential MPDUs share the same status.
  10554. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10555. * - MPDU_STATUS
  10556. * Bits 15:8
  10557. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10558. * received successfully.
  10559. * Value:
  10560. * 0x1: success
  10561. * 0x2: FCS error
  10562. * 0x3: duplicate error
  10563. * 0x4: replay error
  10564. * 0x5: invalid peer
  10565. */
  10566. /* header fields */
  10567. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10568. #define HTT_RX_IND_EXT_TID_S 8
  10569. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10570. #define HTT_RX_IND_FLUSH_VALID_S 13
  10571. #define HTT_RX_IND_REL_VALID_M 0x4000
  10572. #define HTT_RX_IND_REL_VALID_S 14
  10573. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10574. #define HTT_RX_IND_PEER_ID_S 16
  10575. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10576. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10577. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10578. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10579. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10580. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10581. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10582. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10583. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10584. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10585. /* rx PPDU descriptor fields */
  10586. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10587. #define HTT_RX_IND_RSSI_CMB_S 0
  10588. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10589. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10590. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10591. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10592. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10593. #define HTT_RX_IND_PHY_ERR_S 24
  10594. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10595. #define HTT_RX_IND_LEGACY_RATE_S 25
  10596. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10597. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10598. #define HTT_RX_IND_END_VALID_M 0x40000000
  10599. #define HTT_RX_IND_END_VALID_S 30
  10600. #define HTT_RX_IND_START_VALID_M 0x80000000
  10601. #define HTT_RX_IND_START_VALID_S 31
  10602. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10603. #define HTT_RX_IND_RSSI_PRI20_S 0
  10604. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10605. #define HTT_RX_IND_RSSI_EXT20_S 8
  10606. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10607. #define HTT_RX_IND_RSSI_EXT40_S 16
  10608. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10609. #define HTT_RX_IND_RSSI_EXT80_S 24
  10610. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10611. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10612. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10613. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10614. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10615. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10616. #define HTT_RX_IND_SERVICE_M 0xff000000
  10617. #define HTT_RX_IND_SERVICE_S 24
  10618. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10619. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10620. /* rx MSDU descriptor fields */
  10621. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10622. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10623. /* payload fields */
  10624. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10625. #define HTT_RX_IND_MPDU_COUNT_S 0
  10626. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10627. #define HTT_RX_IND_MPDU_STATUS_S 8
  10628. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10629. do { \
  10630. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10631. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10632. } while (0)
  10633. #define HTT_RX_IND_EXT_TID_GET(word) \
  10634. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10635. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10636. do { \
  10637. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10638. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10639. } while (0)
  10640. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10641. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10642. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10643. do { \
  10644. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10645. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10646. } while (0)
  10647. #define HTT_RX_IND_REL_VALID_GET(word) \
  10648. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10649. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10650. do { \
  10651. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10652. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10653. } while (0)
  10654. #define HTT_RX_IND_PEER_ID_GET(word) \
  10655. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10656. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10657. do { \
  10658. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10659. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10660. } while (0)
  10661. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10662. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10663. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10664. do { \
  10665. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10666. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10667. } while (0)
  10668. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10669. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10670. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10671. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10672. do { \
  10673. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10674. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10675. } while (0)
  10676. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10677. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10678. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10679. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10680. do { \
  10681. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10682. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10683. } while (0)
  10684. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10685. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10686. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10687. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10688. do { \
  10689. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10690. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10691. } while (0)
  10692. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10693. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10694. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10695. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10696. do { \
  10697. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10698. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10699. } while (0)
  10700. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10701. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10702. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10703. /* FW rx PPDU descriptor fields */
  10704. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10705. do { \
  10706. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10707. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10708. } while (0)
  10709. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10710. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10711. HTT_RX_IND_RSSI_CMB_S)
  10712. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10715. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10716. } while (0)
  10717. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10718. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10719. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10720. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10721. do { \
  10722. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10723. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10724. } while (0)
  10725. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10726. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10727. HTT_RX_IND_PHY_ERR_CODE_S)
  10728. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10729. do { \
  10730. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10731. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10732. } while (0)
  10733. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10734. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10735. HTT_RX_IND_PHY_ERR_S)
  10736. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10737. do { \
  10738. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10739. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10740. } while (0)
  10741. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10742. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10743. HTT_RX_IND_LEGACY_RATE_S)
  10744. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10745. do { \
  10746. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10747. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10748. } while (0)
  10749. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10750. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10751. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10752. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10753. do { \
  10754. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10755. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10756. } while (0)
  10757. #define HTT_RX_IND_END_VALID_GET(word) \
  10758. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10759. HTT_RX_IND_END_VALID_S)
  10760. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10761. do { \
  10762. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10763. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10764. } while (0)
  10765. #define HTT_RX_IND_START_VALID_GET(word) \
  10766. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10767. HTT_RX_IND_START_VALID_S)
  10768. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10769. do { \
  10770. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10771. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10772. } while (0)
  10773. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10774. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10775. HTT_RX_IND_RSSI_PRI20_S)
  10776. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10779. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10780. } while (0)
  10781. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10782. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10783. HTT_RX_IND_RSSI_EXT20_S)
  10784. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10785. do { \
  10786. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10787. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10788. } while (0)
  10789. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10790. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10791. HTT_RX_IND_RSSI_EXT40_S)
  10792. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10795. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10796. } while (0)
  10797. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10798. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10799. HTT_RX_IND_RSSI_EXT80_S)
  10800. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10801. do { \
  10802. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10803. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10804. } while (0)
  10805. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10806. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10807. HTT_RX_IND_VHT_SIG_A1_S)
  10808. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10809. do { \
  10810. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10811. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10812. } while (0)
  10813. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10814. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10815. HTT_RX_IND_VHT_SIG_A2_S)
  10816. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10819. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10820. } while (0)
  10821. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10822. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10823. HTT_RX_IND_PREAMBLE_TYPE_S)
  10824. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10827. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10828. } while (0)
  10829. #define HTT_RX_IND_SERVICE_GET(word) \
  10830. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10831. HTT_RX_IND_SERVICE_S)
  10832. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10833. do { \
  10834. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10835. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10836. } while (0)
  10837. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10838. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10839. HTT_RX_IND_SA_ANT_MATRIX_S)
  10840. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10841. do { \
  10842. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10843. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10844. } while (0)
  10845. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10846. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10847. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10848. do { \
  10849. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10850. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10851. } while (0)
  10852. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10853. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10854. #define HTT_RX_IND_HL_BYTES \
  10855. (HTT_RX_IND_HDR_BYTES + \
  10856. 4 /* single FW rx MSDU descriptor */ + \
  10857. 4 /* single MPDU range information element */)
  10858. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10859. /* Could we use one macro entry? */
  10860. #define HTT_WORD_SET(word, field, value) \
  10861. do { \
  10862. HTT_CHECK_SET_VAL(field, value); \
  10863. (word) |= ((value) << field ## _S); \
  10864. } while (0)
  10865. #define HTT_WORD_GET(word, field) \
  10866. (((word) & field ## _M) >> field ## _S)
  10867. PREPACK struct hl_htt_rx_ind_base {
  10868. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10869. } POSTPACK;
  10870. /*
  10871. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10872. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10873. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10874. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10875. * htt_rx_ind_hl_rx_desc_t.
  10876. */
  10877. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10878. struct htt_rx_ind_hl_rx_desc_t {
  10879. A_UINT8 ver;
  10880. A_UINT8 len;
  10881. struct {
  10882. A_UINT8
  10883. first_msdu: 1,
  10884. last_msdu: 1,
  10885. c3_failed: 1,
  10886. c4_failed: 1,
  10887. ipv6: 1,
  10888. tcp: 1,
  10889. udp: 1,
  10890. reserved: 1;
  10891. } flags;
  10892. /* NOTE: no reserved space - don't append any new fields here */
  10893. };
  10894. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10895. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10896. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10897. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10898. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10899. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10900. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10901. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10902. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10903. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10904. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10905. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10906. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10907. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10908. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10909. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10910. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10911. /* This structure is used in HL, the basic descriptor information
  10912. * used by host. the structure is translated by FW from HW desc
  10913. * or generated by FW. But in HL monitor mode, the host would use
  10914. * the same structure with LL.
  10915. */
  10916. PREPACK struct hl_htt_rx_desc_base {
  10917. A_UINT32
  10918. seq_num:12,
  10919. encrypted:1,
  10920. chan_info_present:1,
  10921. resv0:2,
  10922. mcast_bcast:1,
  10923. fragment:1,
  10924. key_id_oct:8,
  10925. resv1:6;
  10926. A_UINT32
  10927. pn_31_0;
  10928. union {
  10929. struct {
  10930. A_UINT16 pn_47_32;
  10931. A_UINT16 pn_63_48;
  10932. } pn16;
  10933. A_UINT32 pn_63_32;
  10934. } u0;
  10935. A_UINT32
  10936. pn_95_64;
  10937. A_UINT32
  10938. pn_127_96;
  10939. } POSTPACK;
  10940. /*
  10941. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10942. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10943. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10944. * Please see htt_chan_change_t for description of the fields.
  10945. */
  10946. PREPACK struct htt_chan_info_t
  10947. {
  10948. A_UINT32 primary_chan_center_freq_mhz: 16,
  10949. contig_chan1_center_freq_mhz: 16;
  10950. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10951. phy_mode: 8,
  10952. reserved: 8;
  10953. } POSTPACK;
  10954. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10955. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10956. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10957. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10958. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10959. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10960. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10961. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10962. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10963. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10964. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10965. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10966. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10967. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10968. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10969. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10970. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10971. /* Channel information */
  10972. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10973. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10974. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10975. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10976. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10977. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10978. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10979. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10980. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10981. do { \
  10982. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10983. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10984. } while (0)
  10985. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10986. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10987. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10988. do { \
  10989. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10990. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10991. } while (0)
  10992. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10993. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10994. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10997. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10998. } while (0)
  10999. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  11000. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  11001. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  11004. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  11005. } while (0)
  11006. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  11007. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  11008. /*
  11009. * @brief target -> host message definition for FW offloaded pkts
  11010. *
  11011. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  11012. *
  11013. * @details
  11014. * The following field definitions describe the format of the firmware
  11015. * offload deliver message sent from the target to the host.
  11016. *
  11017. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  11018. *
  11019. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  11020. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  11021. * | reserved_1 | msg type |
  11022. * |--------------------------------------------------------------------------|
  11023. * | phy_timestamp_l32 |
  11024. * |--------------------------------------------------------------------------|
  11025. * | WORD2 (see below) |
  11026. * |--------------------------------------------------------------------------|
  11027. * | seqno | framectrl |
  11028. * |--------------------------------------------------------------------------|
  11029. * | reserved_3 | vdev_id | tid_num|
  11030. * |--------------------------------------------------------------------------|
  11031. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  11032. * |--------------------------------------------------------------------------|
  11033. *
  11034. * where:
  11035. * STAT = status
  11036. * F = format (802.3 vs. 802.11)
  11037. *
  11038. * definition for word 2
  11039. *
  11040. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  11041. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  11042. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  11043. * |--------------------------------------------------------------------------|
  11044. *
  11045. * where:
  11046. * PR = preamble
  11047. * BF = beamformed
  11048. */
  11049. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  11050. {
  11051. A_UINT32 /* word 0 */
  11052. msg_type:8, /* [ 7: 0] */
  11053. reserved_1:24; /* [31: 8] */
  11054. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  11055. A_UINT32 /* word 2 */
  11056. /* preamble:
  11057. * 0-OFDM,
  11058. * 1-CCk,
  11059. * 2-HT,
  11060. * 3-VHT
  11061. */
  11062. preamble: 2, /* [1:0] */
  11063. /* mcs:
  11064. * In case of HT preamble interpret
  11065. * MCS along with NSS.
  11066. * Valid values for HT are 0 to 7.
  11067. * HT mcs 0 with NSS 2 is mcs 8.
  11068. * Valid values for VHT are 0 to 9.
  11069. */
  11070. mcs: 4, /* [5:2] */
  11071. /* rate:
  11072. * This is applicable only for
  11073. * CCK and OFDM preamble type
  11074. * rate 0: OFDM 48 Mbps,
  11075. * 1: OFDM 24 Mbps,
  11076. * 2: OFDM 12 Mbps
  11077. * 3: OFDM 6 Mbps
  11078. * 4: OFDM 54 Mbps
  11079. * 5: OFDM 36 Mbps
  11080. * 6: OFDM 18 Mbps
  11081. * 7: OFDM 9 Mbps
  11082. * rate 0: CCK 11 Mbps Long
  11083. * 1: CCK 5.5 Mbps Long
  11084. * 2: CCK 2 Mbps Long
  11085. * 3: CCK 1 Mbps Long
  11086. * 4: CCK 11 Mbps Short
  11087. * 5: CCK 5.5 Mbps Short
  11088. * 6: CCK 2 Mbps Short
  11089. */
  11090. rate : 3, /* [ 8: 6] */
  11091. rssi : 8, /* [16: 9] units=dBm */
  11092. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11093. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11094. stbc : 1, /* [22] */
  11095. sgi : 1, /* [23] */
  11096. ldpc : 1, /* [24] */
  11097. beamformed: 1, /* [25] */
  11098. reserved_2: 6; /* [31:26] */
  11099. A_UINT32 /* word 3 */
  11100. framectrl:16, /* [15: 0] */
  11101. seqno:16; /* [31:16] */
  11102. A_UINT32 /* word 4 */
  11103. tid_num:5, /* [ 4: 0] actual TID number */
  11104. vdev_id:8, /* [12: 5] */
  11105. reserved_3:19; /* [31:13] */
  11106. A_UINT32 /* word 5 */
  11107. /* status:
  11108. * 0: tx_ok
  11109. * 1: retry
  11110. * 2: drop
  11111. * 3: filtered
  11112. * 4: abort
  11113. * 5: tid delete
  11114. * 6: sw abort
  11115. * 7: dropped by peer migration
  11116. */
  11117. status:3, /* [2:0] */
  11118. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  11119. tx_mpdu_bytes:16, /* [19:4] */
  11120. /* Indicates retry count of offloaded/local generated Data tx frames */
  11121. tx_retry_cnt:6, /* [25:20] */
  11122. reserved_4:6; /* [31:26] */
  11123. } POSTPACK;
  11124. /* FW offload deliver ind message header fields */
  11125. /* DWORD one */
  11126. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  11127. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  11128. /* DWORD two */
  11129. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  11130. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  11131. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  11132. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  11133. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  11134. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  11135. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  11136. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  11137. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  11138. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  11139. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  11140. #define HTT_FW_OFFLOAD_IND_BW_S 19
  11141. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  11142. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  11143. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  11144. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  11145. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  11146. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  11147. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  11148. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  11149. /* DWORD three*/
  11150. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  11151. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  11152. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  11153. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  11154. /* DWORD four */
  11155. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  11156. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  11157. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  11158. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  11159. /* DWORD five */
  11160. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  11161. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  11162. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  11163. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  11164. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  11165. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  11166. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  11167. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  11168. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  11171. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  11172. } while (0)
  11173. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  11174. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  11175. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  11176. do { \
  11177. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  11178. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  11179. } while (0)
  11180. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  11181. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  11182. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  11183. do { \
  11184. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  11185. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  11186. } while (0)
  11187. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  11188. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  11189. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  11190. do { \
  11191. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  11192. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  11193. } while (0)
  11194. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  11195. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  11196. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11199. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11200. } while (0)
  11201. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11202. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11203. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11204. do { \
  11205. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11206. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11207. } while (0)
  11208. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11209. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11210. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11211. do { \
  11212. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11213. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11214. } while (0)
  11215. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11216. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11217. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11218. do { \
  11219. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11220. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11221. } while (0)
  11222. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11223. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11224. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11225. do { \
  11226. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11227. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11228. } while (0)
  11229. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11230. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11231. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11234. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11235. } while (0)
  11236. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11237. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11238. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11241. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11242. } while (0)
  11243. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11244. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11245. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11246. do { \
  11247. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11248. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11249. } while (0)
  11250. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11251. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11252. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11253. do { \
  11254. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11255. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11256. } while (0)
  11257. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11258. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11259. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11260. do { \
  11261. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11262. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11263. } while (0)
  11264. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11265. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11266. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11267. do { \
  11268. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11269. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11270. } while (0)
  11271. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11272. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11273. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11274. do { \
  11275. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11276. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11277. } while (0)
  11278. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11279. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11280. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11281. do { \
  11282. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11283. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11284. } while (0)
  11285. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11286. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11287. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11288. do { \
  11289. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11290. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11291. } while (0)
  11292. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11293. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11294. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11295. do { \
  11296. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11297. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11298. } while (0)
  11299. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11300. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11301. /*
  11302. * @brief target -> host rx reorder flush message definition
  11303. *
  11304. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11305. *
  11306. * @details
  11307. * The following field definitions describe the format of the rx flush
  11308. * message sent from the target to the host.
  11309. * The message consists of a 4-octet header, followed by one or more
  11310. * 4-octet payload information elements.
  11311. *
  11312. * |31 24|23 8|7 0|
  11313. * |--------------------------------------------------------------|
  11314. * | TID | peer ID | msg type |
  11315. * |--------------------------------------------------------------|
  11316. * | seq num end | seq num start | MPDU status | reserved |
  11317. * |--------------------------------------------------------------|
  11318. * First DWORD:
  11319. * - MSG_TYPE
  11320. * Bits 7:0
  11321. * Purpose: identifies this as an rx flush message
  11322. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11323. * - PEER_ID
  11324. * Bits 23:8 (only bits 18:8 actually used)
  11325. * Purpose: identify which peer's rx data is being flushed
  11326. * Value: (rx) peer ID
  11327. * - TID
  11328. * Bits 31:24 (only bits 27:24 actually used)
  11329. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11330. * Value: traffic identifier
  11331. * Second DWORD:
  11332. * - MPDU_STATUS
  11333. * Bits 15:8
  11334. * Purpose:
  11335. * Indicate whether the flushed MPDUs should be discarded or processed.
  11336. * Value:
  11337. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11338. * stages of rx processing
  11339. * other: discard the MPDUs
  11340. * It is anticipated that flush messages will always have
  11341. * MPDU status == 1, but the status flag is included for
  11342. * flexibility.
  11343. * - SEQ_NUM_START
  11344. * Bits 23:16
  11345. * Purpose:
  11346. * Indicate the start of a series of consecutive MPDUs being flushed.
  11347. * Not all MPDUs within this range are necessarily valid - the host
  11348. * must check each sequence number within this range to see if the
  11349. * corresponding MPDU is actually present.
  11350. * Value:
  11351. * The sequence number for the first MPDU in the sequence.
  11352. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11353. * - SEQ_NUM_END
  11354. * Bits 30:24
  11355. * Purpose:
  11356. * Indicate the end of a series of consecutive MPDUs being flushed.
  11357. * Value:
  11358. * The sequence number one larger than the sequence number of the
  11359. * last MPDU being flushed.
  11360. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11361. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11362. * are to be released for further rx processing.
  11363. * Not all MPDUs within this range are necessarily valid - the host
  11364. * must check each sequence number within this range to see if the
  11365. * corresponding MPDU is actually present.
  11366. */
  11367. /* first DWORD */
  11368. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11369. #define HTT_RX_FLUSH_PEER_ID_S 8
  11370. #define HTT_RX_FLUSH_TID_M 0xff000000
  11371. #define HTT_RX_FLUSH_TID_S 24
  11372. /* second DWORD */
  11373. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11374. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11375. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11376. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11377. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11378. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11379. #define HTT_RX_FLUSH_BYTES 8
  11380. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11381. do { \
  11382. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11383. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11384. } while (0)
  11385. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11386. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11387. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11388. do { \
  11389. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11390. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11391. } while (0)
  11392. #define HTT_RX_FLUSH_TID_GET(word) \
  11393. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11394. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11395. do { \
  11396. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11397. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11398. } while (0)
  11399. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11400. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11401. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11402. do { \
  11403. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11404. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11405. } while (0)
  11406. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11407. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11408. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11409. do { \
  11410. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11411. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11412. } while (0)
  11413. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11414. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11415. /*
  11416. * @brief target -> host rx pn check indication message
  11417. *
  11418. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11419. *
  11420. * @details
  11421. * The following field definitions describe the format of the Rx PN check
  11422. * indication message sent from the target to the host.
  11423. * The message consists of a 4-octet header, followed by the start and
  11424. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11425. * IE is one octet containing the sequence number that failed the PN
  11426. * check.
  11427. *
  11428. * |31 24|23 8|7 0|
  11429. * |--------------------------------------------------------------|
  11430. * | TID | peer ID | msg type |
  11431. * |--------------------------------------------------------------|
  11432. * | Reserved | PN IE count | seq num end | seq num start|
  11433. * |--------------------------------------------------------------|
  11434. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11435. * |--------------------------------------------------------------|
  11436. * First DWORD:
  11437. * - MSG_TYPE
  11438. * Bits 7:0
  11439. * Purpose: Identifies this as an rx pn check indication message
  11440. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11441. * - PEER_ID
  11442. * Bits 23:8 (only bits 18:8 actually used)
  11443. * Purpose: identify which peer
  11444. * Value: (rx) peer ID
  11445. * - TID
  11446. * Bits 31:24 (only bits 27:24 actually used)
  11447. * Purpose: identify traffic identifier
  11448. * Value: traffic identifier
  11449. * Second DWORD:
  11450. * - SEQ_NUM_START
  11451. * Bits 7:0
  11452. * Purpose:
  11453. * Indicates the starting sequence number of the MPDU in this
  11454. * series of MPDUs that went though PN check.
  11455. * Value:
  11456. * The sequence number for the first MPDU in the sequence.
  11457. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11458. * - SEQ_NUM_END
  11459. * Bits 15:8
  11460. * Purpose:
  11461. * Indicates the ending sequence number of the MPDU in this
  11462. * series of MPDUs that went though PN check.
  11463. * Value:
  11464. * The sequence number one larger then the sequence number of the last
  11465. * MPDU being flushed.
  11466. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11467. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11468. * for invalid PN numbers and are ready to be released for further processing.
  11469. * Not all MPDUs within this range are necessarily valid - the host
  11470. * must check each sequence number within this range to see if the
  11471. * corresponding MPDU is actually present.
  11472. * - PN_IE_COUNT
  11473. * Bits 23:16
  11474. * Purpose:
  11475. * Used to determine the variable number of PN information elements in this
  11476. * message
  11477. *
  11478. * PN information elements:
  11479. * - PN_IE_x-
  11480. * Purpose:
  11481. * Each PN information element contains the sequence number of the MPDU that
  11482. * has failed the target PN check.
  11483. * Value:
  11484. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11485. * that failed the PN check.
  11486. */
  11487. /* first DWORD */
  11488. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11489. #define HTT_RX_PN_IND_PEER_ID_S 8
  11490. #define HTT_RX_PN_IND_TID_M 0xff000000
  11491. #define HTT_RX_PN_IND_TID_S 24
  11492. /* second DWORD */
  11493. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11494. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11495. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11496. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11497. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11498. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11499. #define HTT_RX_PN_IND_BYTES 8
  11500. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11503. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11504. } while (0)
  11505. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11506. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11507. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11508. do { \
  11509. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11510. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11511. } while (0)
  11512. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11513. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11514. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11515. do { \
  11516. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11517. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11518. } while (0)
  11519. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11520. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11521. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11524. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11525. } while (0)
  11526. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11527. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11528. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11529. do { \
  11530. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11531. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11532. } while (0)
  11533. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11534. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11535. /*
  11536. * @brief target -> host rx offload deliver message for LL system
  11537. *
  11538. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11539. *
  11540. * @details
  11541. * In a low latency system this message is sent whenever the offload
  11542. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11543. * The DMA of the actual packets into host memory is done before sending out
  11544. * this message. This message indicates only how many MSDUs to reap. The
  11545. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11546. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11547. * DMA'd by the MAC directly into host memory these packets do not contain
  11548. * the MAC descriptors in the header portion of the packet. Instead they contain
  11549. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11550. * message, the packets are delivered directly to the NW stack without going
  11551. * through the regular reorder buffering and PN checking path since it has
  11552. * already been done in target.
  11553. *
  11554. * |31 24|23 16|15 8|7 0|
  11555. * |-----------------------------------------------------------------------|
  11556. * | Total MSDU count | reserved | msg type |
  11557. * |-----------------------------------------------------------------------|
  11558. *
  11559. * @brief target -> host rx offload deliver message for HL system
  11560. *
  11561. * @details
  11562. * In a high latency system this message is sent whenever the offload manager
  11563. * flushes out the packets it has coalesced in its coalescing buffer. The
  11564. * actual packets are also carried along with this message. When the host
  11565. * receives this message, it is expected to deliver these packets to the NW
  11566. * stack directly instead of routing them through the reorder buffering and
  11567. * PN checking path since it has already been done in target.
  11568. *
  11569. * |31 24|23 16|15 8|7 0|
  11570. * |-----------------------------------------------------------------------|
  11571. * | Total MSDU count | reserved | msg type |
  11572. * |-----------------------------------------------------------------------|
  11573. * | peer ID | MSDU length |
  11574. * |-----------------------------------------------------------------------|
  11575. * | MSDU payload | FW Desc | tid | vdev ID |
  11576. * |-----------------------------------------------------------------------|
  11577. * | MSDU payload contd. |
  11578. * |-----------------------------------------------------------------------|
  11579. * | peer ID | MSDU length |
  11580. * |-----------------------------------------------------------------------|
  11581. * | MSDU payload | FW Desc | tid | vdev ID |
  11582. * |-----------------------------------------------------------------------|
  11583. * | MSDU payload contd. |
  11584. * |-----------------------------------------------------------------------|
  11585. *
  11586. */
  11587. /* first DWORD */
  11588. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11589. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11590. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11591. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11592. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11593. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11594. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11595. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11596. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11597. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11598. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11599. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11600. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11601. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11602. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11603. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11604. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11605. do { \
  11606. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11607. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11608. } while (0)
  11609. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11610. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11611. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11612. do { \
  11613. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11614. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11615. } while (0)
  11616. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11617. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11618. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11619. do { \
  11620. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11621. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11622. } while (0)
  11623. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11624. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11625. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11626. do { \
  11627. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11628. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11629. } while (0)
  11630. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11631. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11632. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11633. do { \
  11634. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11635. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11636. } while (0)
  11637. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11638. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11639. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11640. do { \
  11641. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11642. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11643. } while (0)
  11644. /**
  11645. * @brief target -> host rx peer map/unmap message definition
  11646. *
  11647. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11648. *
  11649. * @details
  11650. * The following diagram shows the format of the rx peer map message sent
  11651. * from the target to the host. This layout assumes the target operates
  11652. * as little-endian.
  11653. *
  11654. * This message always contains a SW peer ID. The main purpose of the
  11655. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11656. * with, so that the host can use that peer ID to determine which peer
  11657. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11658. * other purposes, such as identifying during tx completions which peer
  11659. * the tx frames in question were transmitted to.
  11660. *
  11661. * In certain generations of chips, the peer map message also contains
  11662. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11663. * to identify which peer the frame needs to be forwarded to (i.e. the
  11664. * peer associated with the Destination MAC Address within the packet),
  11665. * and particularly which vdev needs to transmit the frame (for cases
  11666. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11667. * meaning as AST_INDEX_0.
  11668. * This DA-based peer ID that is provided for certain rx frames
  11669. * (the rx frames that need to be re-transmitted as tx frames)
  11670. * is the ID that the HW uses for referring to the peer in question,
  11671. * rather than the peer ID that the SW+FW use to refer to the peer.
  11672. *
  11673. *
  11674. * |31 24|23 16|15 8|7 0|
  11675. * |-----------------------------------------------------------------------|
  11676. * | SW peer ID | VDEV ID | msg type |
  11677. * |-----------------------------------------------------------------------|
  11678. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11679. * |-----------------------------------------------------------------------|
  11680. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11681. * |-----------------------------------------------------------------------|
  11682. *
  11683. *
  11684. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11685. *
  11686. * The following diagram shows the format of the rx peer unmap message sent
  11687. * from the target to the host.
  11688. *
  11689. * |31 24|23 16|15 8|7 0|
  11690. * |-----------------------------------------------------------------------|
  11691. * | SW peer ID | VDEV ID | msg type |
  11692. * |-----------------------------------------------------------------------|
  11693. *
  11694. * The following field definitions describe the format of the rx peer map
  11695. * and peer unmap messages sent from the target to the host.
  11696. * - MSG_TYPE
  11697. * Bits 7:0
  11698. * Purpose: identifies this as an rx peer map or peer unmap message
  11699. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11700. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11701. * - VDEV_ID
  11702. * Bits 15:8
  11703. * Purpose: Indicates which virtual device the peer is associated
  11704. * with.
  11705. * Value: vdev ID (used in the host to look up the vdev object)
  11706. * - PEER_ID (a.k.a. SW_PEER_ID)
  11707. * Bits 31:16
  11708. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11709. * freeing (unmap)
  11710. * Value: (rx) peer ID
  11711. * - MAC_ADDR_L32 (peer map only)
  11712. * Bits 31:0
  11713. * Purpose: Identifies which peer node the peer ID is for.
  11714. * Value: lower 4 bytes of peer node's MAC address
  11715. * - MAC_ADDR_U16 (peer map only)
  11716. * Bits 15:0
  11717. * Purpose: Identifies which peer node the peer ID is for.
  11718. * Value: upper 2 bytes of peer node's MAC address
  11719. * - HW_PEER_ID
  11720. * Bits 31:16
  11721. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11722. * address, so for rx frames marked for rx --> tx forwarding, the
  11723. * host can determine from the HW peer ID provided as meta-data with
  11724. * the rx frame which peer the frame is supposed to be forwarded to.
  11725. * Value: ID used by the MAC HW to identify the peer
  11726. */
  11727. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11728. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11729. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11730. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11731. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11732. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11733. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11734. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11735. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11736. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11737. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11738. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11739. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11740. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11741. do { \
  11742. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11743. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11744. } while (0)
  11745. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11746. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11747. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11748. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11749. do { \
  11750. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11751. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11752. } while (0)
  11753. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11754. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11755. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11756. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11757. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11758. do { \
  11759. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11760. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11761. } while (0)
  11762. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11763. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11764. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11765. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11766. #define HTT_RX_PEER_MAP_BYTES 12
  11767. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11768. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11769. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11770. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11771. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11772. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11773. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11774. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11775. #define HTT_RX_PEER_UNMAP_BYTES 4
  11776. /**
  11777. * @brief target -> host rx peer map V2 message definition
  11778. *
  11779. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11780. *
  11781. * @details
  11782. * The following diagram shows the format of the rx peer map v2 message sent
  11783. * from the target to the host. This layout assumes the target operates
  11784. * as little-endian.
  11785. *
  11786. * This message always contains a SW peer ID. The main purpose of the
  11787. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11788. * with, so that the host can use that peer ID to determine which peer
  11789. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11790. * other purposes, such as identifying during tx completions which peer
  11791. * the tx frames in question were transmitted to.
  11792. *
  11793. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11794. * is used during rx --> tx frame forwarding to identify which peer the
  11795. * frame needs to be forwarded to (i.e. the peer associated with the
  11796. * Destination MAC Address within the packet), and particularly which vdev
  11797. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11798. * This DA-based peer ID that is provided for certain rx frames
  11799. * (the rx frames that need to be re-transmitted as tx frames)
  11800. * is the ID that the HW uses for referring to the peer in question,
  11801. * rather than the peer ID that the SW+FW use to refer to the peer.
  11802. *
  11803. * The HW peer id here is the same meaning as AST_INDEX_0.
  11804. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11805. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11806. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11807. * AST is valid.
  11808. *
  11809. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11810. * |-------------------------------------------------------------------------|
  11811. * | SW peer ID | VDEV ID | msg type |
  11812. * |-------------------------------------------------------------------------|
  11813. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11814. * |-------------------------------------------------------------------------|
  11815. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11816. * |-------------------------------------------------------------------------|
  11817. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11818. * |-------------------------------------------------------------------------|
  11819. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11820. * |-------------------------------------------------------------------------|
  11821. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11822. * |-------------------------------------------------------------------------|
  11823. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11824. * |-------------------------------------------------------------------------|
  11825. * | Reserved_2 |
  11826. * |-------------------------------------------------------------------------|
  11827. * Where:
  11828. * NH = Next Hop
  11829. * ASTVM = AST valid mask
  11830. * OA = on-chip AST valid bit
  11831. * ASTFM = AST flow mask
  11832. *
  11833. * The following field definitions describe the format of the rx peer map v2
  11834. * messages sent from the target to the host.
  11835. * - MSG_TYPE
  11836. * Bits 7:0
  11837. * Purpose: identifies this as an rx peer map v2 message
  11838. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11839. * - VDEV_ID
  11840. * Bits 15:8
  11841. * Purpose: Indicates which virtual device the peer is associated with.
  11842. * Value: vdev ID (used in the host to look up the vdev object)
  11843. * - SW_PEER_ID
  11844. * Bits 31:16
  11845. * Purpose: The peer ID (index) that WAL is allocating
  11846. * Value: (rx) peer ID
  11847. * - MAC_ADDR_L32
  11848. * Bits 31:0
  11849. * Purpose: Identifies which peer node the peer ID is for.
  11850. * Value: lower 4 bytes of peer node's MAC address
  11851. * - MAC_ADDR_U16
  11852. * Bits 15:0
  11853. * Purpose: Identifies which peer node the peer ID is for.
  11854. * Value: upper 2 bytes of peer node's MAC address
  11855. * - HW_PEER_ID / AST_INDEX_0
  11856. * Bits 31:16
  11857. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11858. * address, so for rx frames marked for rx --> tx forwarding, the
  11859. * host can determine from the HW peer ID provided as meta-data with
  11860. * the rx frame which peer the frame is supposed to be forwarded to.
  11861. * Value: ID used by the MAC HW to identify the peer
  11862. * - AST_HASH_VALUE
  11863. * Bits 15:0
  11864. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11865. * override feature.
  11866. * - NEXT_HOP
  11867. * Bit 16
  11868. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11869. * (Wireless Distribution System).
  11870. * - AST_VALID_MASK
  11871. * Bits 19:17
  11872. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11873. * - ONCHIP_AST_VALID_FLAG
  11874. * Bit 20
  11875. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11876. * is valid.
  11877. * - AST_INDEX_1
  11878. * Bits 15:0
  11879. * Purpose: indicate the second AST index for this peer
  11880. * - AST_0_FLOW_MASK
  11881. * Bits 19:16
  11882. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11883. * - AST_1_FLOW_MASK
  11884. * Bits 23:20
  11885. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11886. * - AST_2_FLOW_MASK
  11887. * Bits 27:24
  11888. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11889. * - AST_3_FLOW_MASK
  11890. * Bits 31:28
  11891. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11892. * - AST_INDEX_2
  11893. * Bits 15:0
  11894. * Purpose: indicate the third AST index for this peer
  11895. * - TID_VALID_HI_PRI
  11896. * Bits 23:16
  11897. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11898. * - TID_VALID_LOW_PRI
  11899. * Bits 31:24
  11900. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11901. * - AST_INDEX_3
  11902. * Bits 15:0
  11903. * Purpose: indicate the fourth AST index for this peer
  11904. * - ONCHIP_AST_IDX / RESERVED
  11905. * Bits 31:16
  11906. * Purpose: This field is valid only when split AST feature is enabled.
  11907. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11908. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11909. * address, this ast_idx is used for LMAC modules for RXPCU.
  11910. * Value: ID used by the LMAC HW to identify the peer
  11911. */
  11912. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11913. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11914. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11915. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11916. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11917. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11918. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11919. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11920. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11921. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11922. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11923. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11924. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11925. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11926. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11927. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11928. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11929. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11930. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11931. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11932. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11933. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11934. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11935. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11936. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11937. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11938. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11939. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11940. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11941. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11942. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11943. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11944. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11945. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11946. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11947. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11948. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11949. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11950. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11951. do { \
  11952. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11953. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11954. } while (0)
  11955. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11956. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11957. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11958. do { \
  11959. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11960. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11961. } while (0)
  11962. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11963. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11964. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11965. do { \
  11966. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11967. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11968. } while (0)
  11969. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11970. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11971. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11972. do { \
  11973. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11974. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11975. } while (0)
  11976. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11977. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11978. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11979. do { \
  11980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11981. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11982. } while (0)
  11983. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11984. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11985. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11986. do { \
  11987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11988. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11989. } while (0)
  11990. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11991. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11992. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11993. do { \
  11994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11995. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11996. } while (0)
  11997. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11998. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11999. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12000. do { \
  12001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  12002. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  12003. } while (0)
  12004. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  12005. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  12006. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  12007. do { \
  12008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  12009. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  12010. } while (0)
  12011. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  12012. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  12013. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  12014. do { \
  12015. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  12016. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  12017. } while (0)
  12018. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  12019. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  12020. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  12021. do { \
  12022. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  12023. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  12024. } while (0)
  12025. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  12026. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  12027. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  12028. do { \
  12029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  12030. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  12031. } while (0)
  12032. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  12033. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  12034. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  12035. do { \
  12036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  12037. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  12038. } while (0)
  12039. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  12040. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  12041. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  12042. do { \
  12043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  12044. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  12045. } while (0)
  12046. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  12047. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  12048. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  12049. do { \
  12050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  12051. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  12052. } while (0)
  12053. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  12054. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  12055. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  12058. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  12059. } while (0)
  12060. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  12061. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  12062. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  12063. do { \
  12064. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  12065. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  12066. } while (0)
  12067. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  12068. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  12069. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12070. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  12071. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  12072. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  12073. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  12074. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  12075. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  12076. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  12077. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  12078. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  12079. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  12080. #define HTT_RX_PEER_MAP_V2_BYTES 32
  12081. /**
  12082. * @brief target -> host rx peer map V3 message definition
  12083. *
  12084. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  12085. *
  12086. * @details
  12087. * The following diagram shows the format of the rx peer map v3 message sent
  12088. * from the target to the host.
  12089. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  12090. * This layout assumes the target operates as little-endian.
  12091. *
  12092. * |31 24|23 20|19|18|17|16|15 8|7 0|
  12093. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  12094. * | SW peer ID | VDEV ID | msg type |
  12095. * |-----------------+--------------------+-----------------+-----------------|
  12096. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12097. * |-----------------+--------------------+-----------------+-----------------|
  12098. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  12099. * |-----------------+--------+-----------+-----------------+-----------------|
  12100. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  12101. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  12102. * | (8bits) | | (4bits) | |
  12103. * |-----------------+--------+--+--+--+--------------------------------------|
  12104. * | RESERVED |E |O | | |
  12105. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  12106. * | |V |V | | |
  12107. * |-----------------+--------------------+-----------------------------------|
  12108. * | HTT_MSDU_IDX_ | RESERVED | |
  12109. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  12110. * | (8bits) | | |
  12111. * |-----------------+--------------------+-----------------------------------|
  12112. * | Reserved_2 |
  12113. * |--------------------------------------------------------------------------|
  12114. * | Reserved_3 |
  12115. * |--------------------------------------------------------------------------|
  12116. *
  12117. * Where:
  12118. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  12119. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  12120. * NH = Next Hop
  12121. * The following field definitions describe the format of the rx peer map v3
  12122. * messages sent from the target to the host.
  12123. * - MSG_TYPE
  12124. * Bits 7:0
  12125. * Purpose: identifies this as a peer map v3 message
  12126. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  12127. * - VDEV_ID
  12128. * Bits 15:8
  12129. * Purpose: Indicates which virtual device the peer is associated with.
  12130. * - SW_PEER_ID
  12131. * Bits 31:16
  12132. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  12133. * - MAC_ADDR_L32
  12134. * Bits 31:0
  12135. * Purpose: Identifies which peer node the peer ID is for.
  12136. * Value: lower 4 bytes of peer node's MAC address
  12137. * - MAC_ADDR_U16
  12138. * Bits 15:0
  12139. * Purpose: Identifies which peer node the peer ID is for.
  12140. * Value: upper 2 bytes of peer node's MAC address
  12141. * - MULTICAST_SW_PEER_ID
  12142. * Bits 31:16
  12143. * Purpose: The multicast peer ID (index)
  12144. * Value: set to HTT_INVALID_PEER if not valid
  12145. * - HW_PEER_ID / AST_INDEX
  12146. * Bits 15:0
  12147. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  12148. * address, so for rx frames marked for rx --> tx forwarding, the
  12149. * host can determine from the HW peer ID provided as meta-data with
  12150. * the rx frame which peer the frame is supposed to be forwarded to.
  12151. * - CACHE_SET_NUM
  12152. * Bits 19:16
  12153. * Purpose: Cache Set Number for AST_INDEX
  12154. * Cache set number that should be used to cache the index based
  12155. * search results, for address and flow search.
  12156. * This value should be equal to LSB 4 bits of the hash value
  12157. * of match data, in case of search index points to an entry which
  12158. * may be used in content based search also. The value can be
  12159. * anything when the entry pointed by search index will not be
  12160. * used for content based search.
  12161. * - HTT_MSDU_IDX_VALID_MASK
  12162. * Bits 31:24
  12163. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  12164. * - ONCHIP_AST_IDX / RESERVED
  12165. * Bits 15:0
  12166. * Purpose: This field is valid only when split AST feature is enabled.
  12167. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  12168. * If valid, identifies the HW peer ID corresponding to the peer MAC
  12169. * address, this ast_idx is used for LMAC modules for RXPCU.
  12170. * - NEXT_HOP
  12171. * Bits 16
  12172. * Purpose: Flag indicates next_hop AST entry used for WDS
  12173. * (Wireless Distribution System).
  12174. * - ONCHIP_AST_VALID
  12175. * Bits 17
  12176. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  12177. * - EXT_AST_VALID
  12178. * Bits 18
  12179. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  12180. * - EXT_AST_INDEX
  12181. * Bits 15:0
  12182. * Purpose: This field describes Extended AST index
  12183. * Valid if EXT_AST_VALID flag set
  12184. * - HTT_MSDU_IDX_VALID_MASK_EXT
  12185. * Bits 31:24
  12186. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  12187. */
  12188. /* dword 0 */
  12189. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  12190. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  12191. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  12192. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  12193. /* dword 1 */
  12194. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  12195. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  12196. /* dword 2 */
  12197. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  12198. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12199. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12200. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12201. /* dword 3 */
  12202. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12203. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12204. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12205. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12206. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12207. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12208. /* dword 4 */
  12209. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12210. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12211. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12212. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12213. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12214. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12215. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12216. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12217. /* dword 5 */
  12218. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12219. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12220. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12221. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12222. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12223. do { \
  12224. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12225. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12226. } while (0)
  12227. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12228. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12229. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12230. do { \
  12231. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12232. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12233. } while (0)
  12234. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12235. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12236. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12237. do { \
  12238. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12239. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12240. } while (0)
  12241. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12242. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12243. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12244. do { \
  12245. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12246. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12247. } while (0)
  12248. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12249. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12250. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12251. do { \
  12252. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12253. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12254. } while (0)
  12255. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12256. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12257. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12258. do { \
  12259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12260. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12261. } while (0)
  12262. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12263. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12264. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12265. do { \
  12266. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12267. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12268. } while (0)
  12269. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12270. (((word) & HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S)
  12271. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12272. do { \
  12273. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12274. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12275. } while (0)
  12276. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12277. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12278. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12279. do { \
  12280. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12281. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12282. } while (0)
  12283. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12284. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12285. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12286. do { \
  12287. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12288. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12289. } while (0)
  12290. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12291. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12292. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12293. do { \
  12294. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12295. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12296. } while (0)
  12297. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12298. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12299. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12300. do { \
  12301. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12302. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12303. } while (0)
  12304. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12305. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12306. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12307. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12308. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12309. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12310. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12311. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12312. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12313. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12314. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12315. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12316. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12317. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12318. /**
  12319. * @brief target -> host rx peer unmap V2 message definition
  12320. *
  12321. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12322. *
  12323. * The following diagram shows the format of the rx peer unmap message sent
  12324. * from the target to the host.
  12325. *
  12326. * |31 24|23 16|15 8|7 0|
  12327. * |-----------------------------------------------------------------------|
  12328. * | SW peer ID | VDEV ID | msg type |
  12329. * |-----------------------------------------------------------------------|
  12330. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12331. * |-----------------------------------------------------------------------|
  12332. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12333. * |-----------------------------------------------------------------------|
  12334. * | Peer Delete Duration |
  12335. * |-----------------------------------------------------------------------|
  12336. * | Reserved_0 | WDS Free Count |
  12337. * |-----------------------------------------------------------------------|
  12338. * | Reserved_1 |
  12339. * |-----------------------------------------------------------------------|
  12340. * | Reserved_2 |
  12341. * |-----------------------------------------------------------------------|
  12342. *
  12343. *
  12344. * The following field definitions describe the format of the rx peer unmap
  12345. * messages sent from the target to the host.
  12346. * - MSG_TYPE
  12347. * Bits 7:0
  12348. * Purpose: identifies this as an rx peer unmap v2 message
  12349. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12350. * - VDEV_ID
  12351. * Bits 15:8
  12352. * Purpose: Indicates which virtual device the peer is associated
  12353. * with.
  12354. * Value: vdev ID (used in the host to look up the vdev object)
  12355. * - SW_PEER_ID
  12356. * Bits 31:16
  12357. * Purpose: The peer ID (index) that WAL is freeing
  12358. * Value: (rx) peer ID
  12359. * - MAC_ADDR_L32
  12360. * Bits 31:0
  12361. * Purpose: Identifies which peer node the peer ID is for.
  12362. * Value: lower 4 bytes of peer node's MAC address
  12363. * - MAC_ADDR_U16
  12364. * Bits 15:0
  12365. * Purpose: Identifies which peer node the peer ID is for.
  12366. * Value: upper 2 bytes of peer node's MAC address
  12367. * - NEXT_HOP
  12368. * Bits 16
  12369. * Purpose: Bit indicates next_hop AST entry used for WDS
  12370. * (Wireless Distribution System).
  12371. * - PEER_DELETE_DURATION
  12372. * Bits 31:0
  12373. * Purpose: Time taken to delete peer, in msec,
  12374. * Used for monitoring / debugging PEER delete response delay
  12375. * - PEER_WDS_FREE_COUNT
  12376. * Bits 15:0
  12377. * Purpose: Count of WDS entries deleted associated to peer deleted
  12378. */
  12379. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12380. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12381. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12382. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12383. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12384. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12385. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12386. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12387. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12388. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12389. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12390. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12391. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12392. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12393. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12394. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12395. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12396. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12397. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12398. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12399. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12400. do { \
  12401. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12402. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12403. } while (0)
  12404. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12405. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12406. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12407. do { \
  12408. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12409. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12410. } while (0)
  12411. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12412. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12413. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12414. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12415. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12416. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12417. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12418. /**
  12419. * @brief target -> host rx peer mlo map message definition
  12420. *
  12421. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12422. *
  12423. * @details
  12424. * The following diagram shows the format of the rx mlo peer map message sent
  12425. * from the target to the host. This layout assumes the target operates
  12426. * as little-endian.
  12427. *
  12428. * MCC:
  12429. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12430. *
  12431. * WIN:
  12432. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12433. * It will be sent on the Assoc Link.
  12434. *
  12435. * This message always contains a MLO peer ID. The main purpose of the
  12436. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12437. * with, so that the host can use that MLO peer ID to determine which peer
  12438. * transmitted the rx frame.
  12439. *
  12440. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12441. * |-------------------------------------------------------------------------|
  12442. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12443. * |-------------------------------------------------------------------------|
  12444. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12445. * |-------------------------------------------------------------------------|
  12446. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12447. * |-------------------------------------------------------------------------|
  12448. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12449. * |-------------------------------------------------------------------------|
  12450. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12451. * |-------------------------------------------------------------------------|
  12452. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12453. * |-------------------------------------------------------------------------|
  12454. * |RSVD |
  12455. * |-------------------------------------------------------------------------|
  12456. * |RSVD |
  12457. * |-------------------------------------------------------------------------|
  12458. * | htt_tlv_hdr_t |
  12459. * |-------------------------------------------------------------------------|
  12460. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12461. * |-------------------------------------------------------------------------|
  12462. * | htt_tlv_hdr_t |
  12463. * |-------------------------------------------------------------------------|
  12464. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12465. * |-------------------------------------------------------------------------|
  12466. * | htt_tlv_hdr_t |
  12467. * |-------------------------------------------------------------------------|
  12468. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12469. * |-------------------------------------------------------------------------|
  12470. *
  12471. * Where:
  12472. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12473. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12474. * V (valid) - 1 Bit Bit17
  12475. * CHIPID - 3 Bits
  12476. * TIDMASK - 8 Bits
  12477. * CACHE_SET_NUM - 8 Bits
  12478. *
  12479. * The following field definitions describe the format of the rx MLO peer map
  12480. * messages sent from the target to the host.
  12481. * - MSG_TYPE
  12482. * Bits 7:0
  12483. * Purpose: identifies this as an rx mlo peer map message
  12484. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12485. *
  12486. * - MLO_PEER_ID
  12487. * Bits 23:8
  12488. * Purpose: The MLO peer ID (index).
  12489. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12490. * Value: MLO peer ID
  12491. *
  12492. * - NUMLINK
  12493. * Bits: 26:24 (3Bits)
  12494. * Purpose: Indicate the max number of logical links supported per client.
  12495. * Value: number of logical links
  12496. *
  12497. * - PRC
  12498. * Bits: 29:27 (3Bits)
  12499. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12500. * if there is migration of the primary chip.
  12501. * Value: Primary REO CHIPID
  12502. *
  12503. * - MAC_ADDR_L32
  12504. * Bits 31:0
  12505. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12506. * Value: lower 4 bytes of peer node's MAC address
  12507. *
  12508. * - MAC_ADDR_U16
  12509. * Bits 15:0
  12510. * Purpose: Identifies which peer node the peer ID is for.
  12511. * Value: upper 2 bytes of peer node's MAC address
  12512. *
  12513. * - PRIMARY_TCL_AST_IDX
  12514. * Bits 15:0
  12515. * Purpose: Primary TCL AST index for this peer.
  12516. *
  12517. * - V
  12518. * 1 Bit Position 16
  12519. * Purpose: If the ast idx is valid.
  12520. *
  12521. * - CHIPID
  12522. * Bits 19:17
  12523. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12524. *
  12525. * - TIDMASK
  12526. * Bits 27:20
  12527. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12528. *
  12529. * - CACHE_SET_NUM
  12530. * Bits 31:28
  12531. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12532. * Cache set number that should be used to cache the index based
  12533. * search results, for address and flow search.
  12534. * This value should be equal to LSB four bits of the hash value
  12535. * of match data, in case of search index points to an entry which
  12536. * may be used in content based search also. The value can be
  12537. * anything when the entry pointed by search index will not be
  12538. * used for content based search.
  12539. *
  12540. * - htt_tlv_hdr_t
  12541. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12542. *
  12543. * Bits 11:0
  12544. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12545. *
  12546. * Bits 23:12
  12547. * Purpose: Length, Length of the value that follows the header
  12548. *
  12549. * Bits 31:28
  12550. * Purpose: Reserved.
  12551. *
  12552. *
  12553. * - SW_PEER_ID
  12554. * Bits 15:0
  12555. * Purpose: The peer ID (index) that WAL is allocating
  12556. * Value: (rx) peer ID
  12557. *
  12558. * - VDEV_ID
  12559. * Bits 23:16
  12560. * Purpose: Indicates which virtual device the peer is associated with.
  12561. * Value: vdev ID (used in the host to look up the vdev object)
  12562. *
  12563. * - CHIPID
  12564. * Bits 26:24
  12565. * Purpose: Indicates which Chip id the peer is associated with.
  12566. * Value: chip ID (Provided by Host as part of QMI exchange)
  12567. */
  12568. typedef enum {
  12569. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12570. } MLO_PEER_MAP_TLV_TAG_ID;
  12571. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12572. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12573. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12574. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12575. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12576. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12577. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12578. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12579. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12580. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12581. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12582. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12583. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12584. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12585. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12586. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12587. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12588. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12589. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12590. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12591. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12592. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12593. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12594. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12595. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12596. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12597. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12598. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12599. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12600. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12601. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12602. do { \
  12603. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12604. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12605. } while (0)
  12606. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12607. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12608. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12609. do { \
  12610. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12611. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12612. } while (0)
  12613. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12614. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12615. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12616. do { \
  12617. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12618. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12619. } while (0)
  12620. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12621. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12622. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12623. do { \
  12624. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12625. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12626. } while (0)
  12627. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12628. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12629. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12630. do { \
  12631. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12632. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12633. } while (0)
  12634. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12635. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12636. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12637. do { \
  12638. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12639. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12640. } while (0)
  12641. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12642. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12643. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12644. do { \
  12645. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12646. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12647. } while (0)
  12648. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12649. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12650. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12651. do { \
  12652. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12653. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12654. } while (0)
  12655. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12656. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12657. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12658. do { \
  12659. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12660. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12661. } while (0)
  12662. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12663. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12664. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12665. do { \
  12666. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12667. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12668. } while (0)
  12669. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12670. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12671. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12674. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12675. } while (0)
  12676. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12677. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12678. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12681. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12682. } while (0)
  12683. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12684. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12685. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12686. do { \
  12687. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12688. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12689. } while (0)
  12690. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12691. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12692. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12693. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12694. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12695. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12696. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12697. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12698. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12699. *
  12700. * The following diagram shows the format of the rx mlo peer unmap message sent
  12701. * from the target to the host.
  12702. *
  12703. * |31 24|23 16|15 8|7 0|
  12704. * |-----------------------------------------------------------------------|
  12705. * | RSVD_24_31 | MLO peer ID | msg type |
  12706. * |-----------------------------------------------------------------------|
  12707. */
  12708. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12709. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12710. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12711. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12712. /**
  12713. * @brief target -> host message specifying security parameters
  12714. *
  12715. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12716. *
  12717. * @details
  12718. * The following diagram shows the format of the security specification
  12719. * message sent from the target to the host.
  12720. * This security specification message tells the host whether a PN check is
  12721. * necessary on rx data frames, and if so, how large the PN counter is.
  12722. * This message also tells the host about the security processing to apply
  12723. * to defragmented rx frames - specifically, whether a Message Integrity
  12724. * Check is required, and the Michael key to use.
  12725. *
  12726. * |31 24|23 16|15|14 8|7 0|
  12727. * |-----------------------------------------------------------------------|
  12728. * | peer ID | U| security type | msg type |
  12729. * |-----------------------------------------------------------------------|
  12730. * | Michael Key K0 |
  12731. * |-----------------------------------------------------------------------|
  12732. * | Michael Key K1 |
  12733. * |-----------------------------------------------------------------------|
  12734. * | WAPI RSC Low0 |
  12735. * |-----------------------------------------------------------------------|
  12736. * | WAPI RSC Low1 |
  12737. * |-----------------------------------------------------------------------|
  12738. * | WAPI RSC Hi0 |
  12739. * |-----------------------------------------------------------------------|
  12740. * | WAPI RSC Hi1 |
  12741. * |-----------------------------------------------------------------------|
  12742. *
  12743. * The following field definitions describe the format of the security
  12744. * indication message sent from the target to the host.
  12745. * - MSG_TYPE
  12746. * Bits 7:0
  12747. * Purpose: identifies this as a security specification message
  12748. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12749. * - SEC_TYPE
  12750. * Bits 14:8
  12751. * Purpose: specifies which type of security applies to the peer
  12752. * Value: htt_sec_type enum value
  12753. * - UNICAST
  12754. * Bit 15
  12755. * Purpose: whether this security is applied to unicast or multicast data
  12756. * Value: 1 -> unicast, 0 -> multicast
  12757. * - PEER_ID
  12758. * Bits 31:16
  12759. * Purpose: The ID number for the peer the security specification is for
  12760. * Value: peer ID
  12761. * - MICHAEL_KEY_K0
  12762. * Bits 31:0
  12763. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12764. * Value: Michael Key K0 (if security type is TKIP)
  12765. * - MICHAEL_KEY_K1
  12766. * Bits 31:0
  12767. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12768. * Value: Michael Key K1 (if security type is TKIP)
  12769. * - WAPI_RSC_LOW0
  12770. * Bits 31:0
  12771. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12772. * Value: WAPI RSC Low0 (if security type is WAPI)
  12773. * - WAPI_RSC_LOW1
  12774. * Bits 31:0
  12775. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12776. * Value: WAPI RSC Low1 (if security type is WAPI)
  12777. * - WAPI_RSC_HI0
  12778. * Bits 31:0
  12779. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12780. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12781. * - WAPI_RSC_HI1
  12782. * Bits 31:0
  12783. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12784. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12785. */
  12786. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12787. #define HTT_SEC_IND_SEC_TYPE_S 8
  12788. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12789. #define HTT_SEC_IND_UNICAST_S 15
  12790. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12791. #define HTT_SEC_IND_PEER_ID_S 16
  12792. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12793. do { \
  12794. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12795. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12796. } while (0)
  12797. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12798. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12799. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12800. do { \
  12801. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12802. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12803. } while (0)
  12804. #define HTT_SEC_IND_UNICAST_GET(word) \
  12805. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12806. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12807. do { \
  12808. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12809. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12810. } while (0)
  12811. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12812. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12813. #define HTT_SEC_IND_BYTES 28
  12814. /**
  12815. * @brief target -> host rx ADDBA / DELBA message definitions
  12816. *
  12817. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12818. *
  12819. * @details
  12820. * The following diagram shows the format of the rx ADDBA message sent
  12821. * from the target to the host:
  12822. *
  12823. * |31 20|19 16|15 8|7 0|
  12824. * |---------------------------------------------------------------------|
  12825. * | peer ID | TID | window size | msg type |
  12826. * |---------------------------------------------------------------------|
  12827. *
  12828. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12829. *
  12830. * The following diagram shows the format of the rx DELBA message sent
  12831. * from the target to the host:
  12832. *
  12833. * |31 20|19 16|15 10|9 8|7 0|
  12834. * |---------------------------------------------------------------------|
  12835. * | peer ID | TID | window size | IR| msg type |
  12836. * |---------------------------------------------------------------------|
  12837. *
  12838. * The following field definitions describe the format of the rx ADDBA
  12839. * and DELBA messages sent from the target to the host.
  12840. * - MSG_TYPE
  12841. * Bits 7:0
  12842. * Purpose: identifies this as an rx ADDBA or DELBA message
  12843. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12844. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12845. * - IR (initiator / recipient)
  12846. * Bits 9:8 (DELBA only)
  12847. * Purpose: specify whether the DELBA handshake was initiated by the
  12848. * local STA/AP, or by the peer STA/AP
  12849. * Value:
  12850. * 0 - unspecified
  12851. * 1 - initiator (a.k.a. originator)
  12852. * 2 - recipient (a.k.a. responder)
  12853. * 3 - unused / reserved
  12854. * - WIN_SIZE
  12855. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12856. * Purpose: Specifies the length of the block ack window (max = 64).
  12857. * Value:
  12858. * block ack window length specified by the received ADDBA/DELBA
  12859. * management message.
  12860. * - TID
  12861. * Bits 19:16
  12862. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12863. * Value:
  12864. * TID specified by the received ADDBA or DELBA management message.
  12865. * - PEER_ID
  12866. * Bits 31:20
  12867. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12868. * Value:
  12869. * ID (hash value) used by the host for fast, direct lookup of
  12870. * host SW peer info, including rx reorder states.
  12871. */
  12872. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12873. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12874. #define HTT_RX_ADDBA_TID_M 0xf0000
  12875. #define HTT_RX_ADDBA_TID_S 16
  12876. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12877. #define HTT_RX_ADDBA_PEER_ID_S 20
  12878. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12879. do { \
  12880. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12881. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12882. } while (0)
  12883. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12884. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12885. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12886. do { \
  12887. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12888. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12889. } while (0)
  12890. #define HTT_RX_ADDBA_TID_GET(word) \
  12891. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12892. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12893. do { \
  12894. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12895. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12896. } while (0)
  12897. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12898. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12899. #define HTT_RX_ADDBA_BYTES 4
  12900. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12901. #define HTT_RX_DELBA_INITIATOR_S 8
  12902. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12903. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12904. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12905. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12906. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12907. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12908. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12909. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12910. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12911. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12912. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12913. do { \
  12914. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12915. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12916. } while (0)
  12917. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12918. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12919. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12920. do { \
  12921. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12922. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12923. } while (0)
  12924. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12925. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12926. #define HTT_RX_DELBA_BYTES 4
  12927. /**
  12928. * @brief target -> host rx ADDBA / DELBA message definitions
  12929. *
  12930. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12931. *
  12932. * @details
  12933. * The following diagram shows the format of the rx ADDBA extn message sent
  12934. * from the target to the host:
  12935. *
  12936. * |31 20|19 16|15 13|12 8|7 0|
  12937. * |---------------------------------------------------------------------|
  12938. * | peer ID | TID | reserved | msg type |
  12939. * |---------------------------------------------------------------------|
  12940. * | reserved | window size |
  12941. * |---------------------------------------------------------------------|
  12942. *
  12943. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12944. *
  12945. * The following diagram shows the format of the rx DELBA message sent
  12946. * from the target to the host:
  12947. *
  12948. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12949. * |---------------------------------------------------------------------|
  12950. * | peer ID | TID | reserved | IR| msg type |
  12951. * |---------------------------------------------------------------------|
  12952. * | reserved | window size |
  12953. * |---------------------------------------------------------------------|
  12954. *
  12955. * The following field definitions describe the format of the rx ADDBA
  12956. * and DELBA messages sent from the target to the host.
  12957. * - MSG_TYPE
  12958. * Bits 7:0
  12959. * Purpose: identifies this as an rx ADDBA or DELBA message
  12960. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12961. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12962. * - IR (initiator / recipient)
  12963. * Bits 9:8 (DELBA only)
  12964. * Purpose: specify whether the DELBA handshake was initiated by the
  12965. * local STA/AP, or by the peer STA/AP
  12966. * Value:
  12967. * 0 - unspecified
  12968. * 1 - initiator (a.k.a. originator)
  12969. * 2 - recipient (a.k.a. responder)
  12970. * 3 - unused / reserved
  12971. * Value:
  12972. * block ack window length specified by the received ADDBA/DELBA
  12973. * management message.
  12974. * - TID
  12975. * Bits 19:16
  12976. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12977. * Value:
  12978. * TID specified by the received ADDBA or DELBA management message.
  12979. * - PEER_ID
  12980. * Bits 31:20
  12981. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12982. * Value:
  12983. * ID (hash value) used by the host for fast, direct lookup of
  12984. * host SW peer info, including rx reorder states.
  12985. * == DWORD 1
  12986. * - WIN_SIZE
  12987. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12988. * Purpose: Specifies the length of the block ack window (max = 8191).
  12989. */
  12990. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12991. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12992. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12993. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12994. /*--- Dword 0 ---*/
  12995. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12996. do { \
  12997. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12998. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12999. } while (0)
  13000. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  13001. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  13002. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  13003. do { \
  13004. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  13005. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  13006. } while (0)
  13007. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  13008. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  13009. /*--- Dword 1 ---*/
  13010. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  13011. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  13012. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  13013. do { \
  13014. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  13015. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  13016. } while (0)
  13017. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  13018. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  13019. #define HTT_RX_ADDBA_EXTN_BYTES 8
  13020. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  13021. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  13022. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  13023. #define HTT_RX_DELBA_EXTN_TID_S 16
  13024. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  13025. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  13026. /*--- Dword 0 ---*/
  13027. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  13028. do { \
  13029. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  13030. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  13031. } while (0)
  13032. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  13033. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  13034. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  13035. do { \
  13036. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  13037. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  13038. } while (0)
  13039. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  13040. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  13041. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  13042. do { \
  13043. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  13044. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  13045. } while (0)
  13046. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  13047. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  13048. /*--- Dword 1 ---*/
  13049. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  13050. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  13051. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  13052. do { \
  13053. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  13054. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  13055. } while (0)
  13056. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  13057. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  13058. #define HTT_RX_DELBA_EXTN_BYTES 8
  13059. /**
  13060. * @brief tx queue group information element definition
  13061. *
  13062. * @details
  13063. * The following diagram shows the format of the tx queue group
  13064. * information element, which can be included in target --> host
  13065. * messages to specify the number of tx "credits" (tx descriptors
  13066. * for LL, or tx buffers for HL) available to a particular group
  13067. * of host-side tx queues, and which host-side tx queues belong to
  13068. * the group.
  13069. *
  13070. * |31|30 24|23 16|15|14|13 0|
  13071. * |------------------------------------------------------------------------|
  13072. * | X| reserved | tx queue grp ID | A| S| credit count |
  13073. * |------------------------------------------------------------------------|
  13074. * | vdev ID mask | AC mask |
  13075. * |------------------------------------------------------------------------|
  13076. *
  13077. * The following definitions describe the fields within the tx queue group
  13078. * information element:
  13079. * - credit_count
  13080. * Bits 13:1
  13081. * Purpose: specify how many tx credits are available to the tx queue group
  13082. * Value: An absolute or relative, positive or negative credit value
  13083. * The 'A' bit specifies whether the value is absolute or relative.
  13084. * The 'S' bit specifies whether the value is positive or negative.
  13085. * A negative value can only be relative, not absolute.
  13086. * An absolute value replaces any prior credit value the host has for
  13087. * the tx queue group in question.
  13088. * A relative value is added to the prior credit value the host has for
  13089. * the tx queue group in question.
  13090. * - sign
  13091. * Bit 14
  13092. * Purpose: specify whether the credit count is positive or negative
  13093. * Value: 0 -> positive, 1 -> negative
  13094. * - absolute
  13095. * Bit 15
  13096. * Purpose: specify whether the credit count is absolute or relative
  13097. * Value: 0 -> relative, 1 -> absolute
  13098. * - txq_group_id
  13099. * Bits 23:16
  13100. * Purpose: indicate which tx queue group's credit and/or membership are
  13101. * being specified
  13102. * Value: 0 to max_tx_queue_groups-1
  13103. * - reserved
  13104. * Bits 30:16
  13105. * Value: 0x0
  13106. * - eXtension
  13107. * Bit 31
  13108. * Purpose: specify whether another tx queue group info element follows
  13109. * Value: 0 -> no more tx queue group information elements
  13110. * 1 -> another tx queue group information element immediately follows
  13111. * - ac_mask
  13112. * Bits 15:0
  13113. * Purpose: specify which Access Categories belong to the tx queue group
  13114. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  13115. * the tx queue group.
  13116. * The AC bit-mask values are obtained by left-shifting by the
  13117. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  13118. * - vdev_id_mask
  13119. * Bits 31:16
  13120. * Purpose: specify which vdev's tx queues belong to the tx queue group
  13121. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  13122. * belong to the tx queue group.
  13123. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  13124. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  13125. */
  13126. PREPACK struct htt_txq_group {
  13127. A_UINT32
  13128. credit_count: 14,
  13129. sign: 1,
  13130. absolute: 1,
  13131. tx_queue_group_id: 8,
  13132. reserved0: 7,
  13133. extension: 1;
  13134. A_UINT32
  13135. ac_mask: 16,
  13136. vdev_id_mask: 16;
  13137. } POSTPACK;
  13138. /* first word */
  13139. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  13140. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  13141. #define HTT_TXQ_GROUP_SIGN_S 14
  13142. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  13143. #define HTT_TXQ_GROUP_ABS_S 15
  13144. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  13145. #define HTT_TXQ_GROUP_ID_S 16
  13146. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  13147. #define HTT_TXQ_GROUP_EXT_S 31
  13148. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  13149. /* second word */
  13150. #define HTT_TXQ_GROUP_AC_MASK_S 0
  13151. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  13152. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  13153. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  13154. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  13155. do { \
  13156. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  13157. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  13158. } while (0)
  13159. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  13160. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  13161. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  13162. do { \
  13163. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  13164. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  13165. } while (0)
  13166. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  13167. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  13168. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  13169. do { \
  13170. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  13171. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  13172. } while (0)
  13173. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  13174. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  13175. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  13176. do { \
  13177. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  13178. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  13179. } while (0)
  13180. #define HTT_TXQ_GROUP_ID_GET(_info) \
  13181. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  13182. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  13183. do { \
  13184. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  13185. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  13186. } while (0)
  13187. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  13188. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  13189. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  13190. do { \
  13191. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  13192. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  13193. } while (0)
  13194. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  13195. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  13196. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  13197. do { \
  13198. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13199. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13200. } while (0)
  13201. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13202. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13203. /**
  13204. * @brief target -> host TX completion indication message definition
  13205. *
  13206. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13207. *
  13208. * @details
  13209. * The following diagram shows the format of the TX completion indication sent
  13210. * from the target to the host
  13211. *
  13212. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13213. * |-------------------------------------------------------------------|
  13214. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13215. * |-------------------------------------------------------------------|
  13216. * payload:| MSDU1 ID | MSDU0 ID |
  13217. * |-------------------------------------------------------------------|
  13218. * : MSDU3 ID | MSDU2 ID :
  13219. * |-------------------------------------------------------------------|
  13220. * | struct htt_tx_compl_ind_append_retries |
  13221. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13222. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13223. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13224. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13225. * |-------------------------------------------------------------------|
  13226. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13227. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13228. * | MSDU0 tx_tsf64_low |
  13229. * |-------------------------------------------------------------------|
  13230. * | MSDU0 tx_tsf64_high |
  13231. * |-------------------------------------------------------------------|
  13232. * | MSDU1 tx_tsf64_low |
  13233. * |-------------------------------------------------------------------|
  13234. * | MSDU1 tx_tsf64_high |
  13235. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13236. * | phy_timestamp |
  13237. * |-------------------------------------------------------------------|
  13238. * | rate specs (see below) |
  13239. * |-------------------------------------------------------------------|
  13240. * | seqctrl | framectrl |
  13241. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13242. * Where:
  13243. * A0 = append (a.k.a. append0)
  13244. * A1 = append1
  13245. * TP = MSDU tx power presence
  13246. * A2 = append2
  13247. * A3 = append3
  13248. * A4 = append4
  13249. *
  13250. * The following field definitions describe the format of the TX completion
  13251. * indication sent from the target to the host
  13252. * Header fields:
  13253. * - msg_type
  13254. * Bits 7:0
  13255. * Purpose: identifies this as HTT TX completion indication
  13256. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13257. * - status
  13258. * Bits 10:8
  13259. * Purpose: the TX completion status of payload fragmentations descriptors
  13260. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13261. * - tid
  13262. * Bits 14:11
  13263. * Purpose: the tid associated with those fragmentation descriptors. It is
  13264. * valid or not, depending on the tid_invalid bit.
  13265. * Value: 0 to 15
  13266. * - tid_invalid
  13267. * Bits 15:15
  13268. * Purpose: this bit indicates whether the tid field is valid or not
  13269. * Value: 0 indicates valid; 1 indicates invalid
  13270. * - num
  13271. * Bits 23:16
  13272. * Purpose: the number of payload in this indication
  13273. * Value: 1 to 255
  13274. * - append (a.k.a. append0)
  13275. * Bits 24:24
  13276. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13277. * the number of tx retries for one MSDU at the end of this message
  13278. * Value: 0 indicates no appending; 1 indicates appending
  13279. * - append1
  13280. * Bits 25:25
  13281. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13282. * contains the timestamp info for each TX msdu id in payload.
  13283. * The order of the timestamps matches the order of the MSDU IDs.
  13284. * Note that a big-endian host needs to account for the reordering
  13285. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13286. * conversion) when determining which tx timestamp corresponds to
  13287. * which MSDU ID.
  13288. * Value: 0 indicates no appending; 1 indicates appending
  13289. * - msdu_tx_power_presence
  13290. * Bits 26:26
  13291. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13292. * for each MSDU referenced by the TX_COMPL_IND message.
  13293. * The tx power is reported in 0.5 dBm units.
  13294. * The order of the per-MSDU tx power reports matches the order
  13295. * of the MSDU IDs.
  13296. * Note that a big-endian host needs to account for the reordering
  13297. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13298. * conversion) when determining which Tx Power corresponds to
  13299. * which MSDU ID.
  13300. * Value: 0 indicates MSDU tx power reports are not appended,
  13301. * 1 indicates MSDU tx power reports are appended
  13302. * - append2
  13303. * Bits 27:27
  13304. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13305. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13306. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13307. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13308. * for each MSDU, for convenience.
  13309. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13310. * this append2 bit is set).
  13311. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13312. * dB above the noise floor.
  13313. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13314. * 1 indicates MSDU ACK RSSI values are appended.
  13315. * - append3
  13316. * Bits 28:28
  13317. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13318. * contains the tx tsf info based on wlan global TSF for
  13319. * each TX msdu id in payload.
  13320. * The order of the tx tsf matches the order of the MSDU IDs.
  13321. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13322. * values to indicate the the lower 32 bits and higher 32 bits of
  13323. * the tx tsf.
  13324. * The tx_tsf64 here represents the time MSDU was acked and the
  13325. * tx_tsf64 has microseconds units.
  13326. * Value: 0 indicates no appending; 1 indicates appending
  13327. * - append4
  13328. * Bits 29:29
  13329. * Purpose: Indicate whether data frame control fields and fields required
  13330. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13331. * message. The order of the this message matches the order of
  13332. * the MSDU IDs.
  13333. * Value: 0 indicates frame control fields and fields required for
  13334. * radio tap header values are not appended,
  13335. * 1 indicates frame control fields and fields required for
  13336. * radio tap header values are appended.
  13337. * Payload fields:
  13338. * - hmsdu_id
  13339. * Bits 15:0
  13340. * Purpose: this ID is used to track the Tx buffer in host
  13341. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13342. */
  13343. PREPACK struct htt_tx_data_hdr_information {
  13344. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13345. A_UINT32 /* word 1 */
  13346. /* preamble:
  13347. * 0-OFDM,
  13348. * 1-CCk,
  13349. * 2-HT,
  13350. * 3-VHT
  13351. */
  13352. preamble: 2, /* [1:0] */
  13353. /* mcs:
  13354. * In case of HT preamble interpret
  13355. * MCS along with NSS.
  13356. * Valid values for HT are 0 to 7.
  13357. * HT mcs 0 with NSS 2 is mcs 8.
  13358. * Valid values for VHT are 0 to 9.
  13359. */
  13360. mcs: 4, /* [5:2] */
  13361. /* rate:
  13362. * This is applicable only for
  13363. * CCK and OFDM preamble type
  13364. * rate 0: OFDM 48 Mbps,
  13365. * 1: OFDM 24 Mbps,
  13366. * 2: OFDM 12 Mbps
  13367. * 3: OFDM 6 Mbps
  13368. * 4: OFDM 54 Mbps
  13369. * 5: OFDM 36 Mbps
  13370. * 6: OFDM 18 Mbps
  13371. * 7: OFDM 9 Mbps
  13372. * rate 0: CCK 11 Mbps Long
  13373. * 1: CCK 5.5 Mbps Long
  13374. * 2: CCK 2 Mbps Long
  13375. * 3: CCK 1 Mbps Long
  13376. * 4: CCK 11 Mbps Short
  13377. * 5: CCK 5.5 Mbps Short
  13378. * 6: CCK 2 Mbps Short
  13379. */
  13380. rate : 3, /* [ 8: 6] */
  13381. rssi : 8, /* [16: 9] units=dBm */
  13382. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13383. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13384. stbc : 1, /* [22] */
  13385. sgi : 1, /* [23] */
  13386. ldpc : 1, /* [24] */
  13387. beamformed: 1, /* [25] */
  13388. /* tx_retry_cnt:
  13389. * Indicates retry count of data tx frames provided by the host.
  13390. */
  13391. tx_retry_cnt: 6; /* [31:26] */
  13392. A_UINT32 /* word 2 */
  13393. framectrl:16, /* [15: 0] */
  13394. seqno:16; /* [31:16] */
  13395. } POSTPACK;
  13396. #define HTT_TX_COMPL_IND_STATUS_S 8
  13397. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13398. #define HTT_TX_COMPL_IND_TID_S 11
  13399. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13400. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13401. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13402. #define HTT_TX_COMPL_IND_NUM_S 16
  13403. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13404. #define HTT_TX_COMPL_IND_APPEND_S 24
  13405. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13406. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13407. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13408. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13409. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13410. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13411. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13412. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13413. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13414. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13415. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13416. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13417. do { \
  13418. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13419. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13420. } while (0)
  13421. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13422. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13423. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13424. do { \
  13425. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13426. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13427. } while (0)
  13428. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13429. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13430. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13431. do { \
  13432. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13433. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13434. } while (0)
  13435. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13436. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13437. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13438. do { \
  13439. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13440. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13441. } while (0)
  13442. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13443. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13444. HTT_TX_COMPL_IND_TID_INV_S)
  13445. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13446. do { \
  13447. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13448. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13449. } while (0)
  13450. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13451. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13452. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13453. do { \
  13454. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13455. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13456. } while (0)
  13457. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13458. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13459. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13460. do { \
  13461. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13462. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13463. } while (0)
  13464. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13465. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13466. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13467. do { \
  13468. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13469. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13470. } while (0)
  13471. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13472. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13473. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13474. do { \
  13475. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13476. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13477. } while (0)
  13478. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13479. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13480. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13481. do { \
  13482. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13483. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13484. } while (0)
  13485. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13486. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13487. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13488. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13489. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13490. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13491. #define HTT_TX_COMPL_IND_STAT_OK 0
  13492. /* DISCARD:
  13493. * current meaning:
  13494. * MSDUs were queued for transmission but filtered by HW or SW
  13495. * without any over the air attempts
  13496. * legacy meaning (HL Rome):
  13497. * MSDUs were discarded by the target FW without any over the air
  13498. * attempts due to lack of space
  13499. */
  13500. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13501. /* NO_ACK:
  13502. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13503. */
  13504. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13505. /* POSTPONE:
  13506. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13507. * be downloaded again later (in the appropriate order), when they are
  13508. * deliverable.
  13509. */
  13510. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13511. /*
  13512. * The PEER_DEL tx completion status is used for HL cases
  13513. * where the peer the frame is for has been deleted.
  13514. * The host has already discarded its copy of the frame, but
  13515. * it still needs the tx completion to restore its credit.
  13516. */
  13517. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13518. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13519. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13520. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13521. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13522. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13523. PREPACK struct htt_tx_compl_ind_base {
  13524. A_UINT32 hdr;
  13525. A_UINT16 payload[1/*or more*/];
  13526. } POSTPACK;
  13527. PREPACK struct htt_tx_compl_ind_append_retries {
  13528. A_UINT16 msdu_id;
  13529. A_UINT8 tx_retries;
  13530. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13531. 0: this is the last append_retries struct */
  13532. } POSTPACK;
  13533. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13534. A_UINT32 timestamp[1/*or more*/];
  13535. } POSTPACK;
  13536. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13537. A_UINT32 tx_tsf64_low;
  13538. A_UINT32 tx_tsf64_high;
  13539. } POSTPACK;
  13540. /* htt_tx_data_hdr_information payload extension fields: */
  13541. /* DWORD zero */
  13542. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13543. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13544. /* DWORD one */
  13545. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13546. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13547. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13548. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13549. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13550. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13551. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13552. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13553. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13554. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13555. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13556. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13557. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13558. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13559. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13560. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13561. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13562. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13563. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13564. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13565. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13566. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13567. /* DWORD two */
  13568. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13569. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13570. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13571. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13572. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13573. do { \
  13574. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13575. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13576. } while (0)
  13577. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13578. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13579. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13580. do { \
  13581. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13582. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13583. } while (0)
  13584. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13585. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13586. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13587. do { \
  13588. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13589. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13590. } while (0)
  13591. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13592. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13593. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13594. do { \
  13595. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13596. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13597. } while (0)
  13598. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13599. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13600. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13601. do { \
  13602. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13603. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13604. } while (0)
  13605. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13606. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13607. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13608. do { \
  13609. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13610. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13611. } while (0)
  13612. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13613. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13614. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13615. do { \
  13616. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13617. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13618. } while (0)
  13619. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13620. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13621. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13622. do { \
  13623. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13624. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13625. } while (0)
  13626. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13627. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13628. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13629. do { \
  13630. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13631. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13632. } while (0)
  13633. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13634. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13635. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13636. do { \
  13637. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13638. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13639. } while (0)
  13640. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13641. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13642. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13643. do { \
  13644. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13645. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13646. } while (0)
  13647. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13648. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13649. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13650. do { \
  13651. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13652. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13653. } while (0)
  13654. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13655. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13656. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13657. do { \
  13658. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13659. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13660. } while (0)
  13661. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13662. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13663. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13664. do { \
  13665. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13666. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13667. } while (0)
  13668. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13669. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13670. /**
  13671. * @brief target -> host software UMAC TX completion indication message
  13672. *
  13673. * MSG_TYPE => HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND
  13674. *
  13675. * @details
  13676. * The following diagram shows the format of the soft UMAC TX completion
  13677. * indication sent from the target to the host
  13678. *
  13679. * |31 30|29|28|27|26 20|19 17|16|15 12|11|10| 9|8|7 4|3 1|0|
  13680. * |-------------------------------------+----------------+------------|
  13681. * hdr: | rsvd | msdu_cnt | msg_type |
  13682. * pyld: |===================================================================|
  13683. * MSDU 0| buf addr low (bits 31:0) |
  13684. * |-----------------------------------------------+------+------------|
  13685. * | SW buffer cookie | RS | buf addr hi|
  13686. * |--------+--+--+-------------+--------+---------+------+------------|
  13687. * | rsvd0 | M| V| tx count | TID | SW peer ID |
  13688. * |--------+--+--+-------------+--------+----------------------+------|
  13689. * | frametype | TQM status number | RELR |
  13690. * |-----+-----+-----------------------------------+--+-+-+-----+------|
  13691. * |rsvd1| buffer timestamp | A|L|F| ACK RSSI |
  13692. * |-----+--+-------------------------+--+------+-----+--+-+-----+---+-|
  13693. * | rsvd2 | tones in RU |OF|tx MCS|txSGI|LC|S|PKTYP|BW |I|
  13694. * |--------+-------------------------+--+------+-----+--+-+-----+---+-|
  13695. * | PPDU transmission TSF |
  13696. * |-------------------------------------------------------------------|
  13697. * | rsvd3 |
  13698. * |===================================================================|
  13699. * MSDU 1| buf addr low (bits 31:0) |
  13700. * : ... :
  13701. * | rsvd3 |
  13702. * |===================================================================|
  13703. * etc.
  13704. *
  13705. * Where:
  13706. * RS = release source
  13707. * V = valid
  13708. * M = multicast
  13709. * RELR = release reason
  13710. * F = first MSDU
  13711. * L = last MSDU
  13712. * A = MSDU is part of A-MSDU
  13713. * I = rate info valid
  13714. * PKTYP = packet type
  13715. * S = STBC
  13716. * LC = LDPC
  13717. * OF = OFDMA transmission
  13718. */
  13719. typedef enum {
  13720. /* 0 (REASON_FRAME_ACKED):
  13721. * Corresponds to tqm_release_reason = <enum 0 tqm_rr_frame_acked>;
  13722. * frame is removed because an ACK of BA for it was received.
  13723. */
  13724. HTT_TX_MSDU_RELEASE_REASON_FRAME_ACKED,
  13725. /* 1 (REASON_REMOVE_CMD_FW):
  13726. * Corresponds to tqm_release_reason = <enum 1 tqm_rr_rem_cmd_rem>;
  13727. * frame is removed because a remove command of type "Remove_mpdus"
  13728. * initiated by SW.
  13729. */
  13730. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_FW,
  13731. /* 2 (REASON_REMOVE_CMD_TX):
  13732. * Corresponds to tqm_release_reason = <enum 2 tqm_rr_rem_cmd_tx>;
  13733. * frame is removed because a remove command of type
  13734. * "Remove_transmitted_mpdus" initiated by SW.
  13735. */
  13736. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_TX,
  13737. /* 3 (REASON_REMOVE_CMD_NOTX):
  13738. * Corresponds to tqm_release_reason = <enum 3 tqm_rr_rem_cmd_notx>;
  13739. * frame is removed because a remove command of type
  13740. * "Remove_untransmitted_mpdus" initiated by SW.
  13741. */
  13742. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_NOTX,
  13743. /* 4 (REASON_REMOVE_CMD_AGED):
  13744. * Corresponds to tqm_release_reason = <enum 4 tqm_rr_rem_cmd_aged>;
  13745. * frame is removed because a remove command of type "Remove_aged_mpdus"
  13746. * or "Remove_aged_msdus" initiated by SW.
  13747. */
  13748. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_AGED,
  13749. /* 5 (RELEASE_FW_REASON1):
  13750. * Corresponds to tqm_release_reason = <enum 5 tqm_fw_reason1>;
  13751. * frame is removed because a remove command where fw indicated that
  13752. * remove reason is fw_reason1.
  13753. */
  13754. HTT_TX_MSDU_RELEASE_FW_REASON1,
  13755. /* 6 (RELEASE_FW_REASON2):
  13756. * Corresponds to tqm_release_reason = <enum 6 tqm_fw_reason2>;
  13757. * frame is removed because a remove command where fw indicated that
  13758. * remove reason is fw_reason1.
  13759. */
  13760. HTT_TX_MSDU_RELEASE_FW_REASON2,
  13761. /* 7 (RELEASE_FW_REASON3):
  13762. * Corresponds to tqm_release_reason = <enum 7 tqm_fw_reason3>;
  13763. * frame is removed because a remove command where fw indicated that
  13764. * remove reason is fw_reason1.
  13765. */
  13766. HTT_TX_MSDU_RELEASE_FW_REASON3,
  13767. /* 8 (REASON_REMOVE_CMD_DISABLEQ):
  13768. * Corresponds to tqm_release_reason = <enum 8 tqm_rr_rem_cmd_disable_queue>
  13769. * frame is removed because a remove command of type
  13770. * "remove_mpdus_and_disable_queue" or "remove_msdus_and_disable_flow"
  13771. * initiated by SW.
  13772. */
  13773. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_DISABLEQ,
  13774. /* 9 (REASON_DROP_MISC):
  13775. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13776. * any discard reason that is not categorized as MSDU TTL expired.
  13777. * Examples: TXDE ENQ layer dropped the packet due to peer delete,
  13778. * tid delete, no resource credit available.
  13779. */
  13780. HTT_TX_MSDU_RELEASE_REASON_DROP_MISC,
  13781. /* 10 (REASON_DROP_TTL):
  13782. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13783. * discard reason that frame is not transmitted due to MSDU TTL expired.
  13784. */
  13785. HTT_TX_MSDU_RELEASE_REASON_DROP_TTL,
  13786. /* 11 - available for use */
  13787. /* 12 - available for use */
  13788. /* 13 - available for use */
  13789. /* 14 - available for use */
  13790. /* 15 - available for use */
  13791. HTT_TX_MSDU_RELEASE_REASON_MAX = 16
  13792. } htt_t2h_tx_msdu_release_reason_e;
  13793. typedef enum {
  13794. /* 0 (RELEASE_SOURCE_FW):
  13795. * MSDU released by FW even before the frame was queued to TQM-L HW.
  13796. */
  13797. HTT_TX_MSDU_RELEASE_SOURCE_FW,
  13798. /* 1 (RELEASE_SOURCE_TQM_LITE):
  13799. * MSDU released by TQM-L HW.
  13800. */
  13801. HTT_TX_MSDU_RELEASE_SOURCE_TQM_LITE,
  13802. HTT_TX_MSDU_RELEASE_SOURCE_MAX = 8
  13803. } htt_t2h_tx_msdu_release_source_e;
  13804. struct htt_t2h_tx_buffer_addr_info { /* 2 words */
  13805. A_UINT32 buffer_addr_31_0 : 32; /* [31:0] */
  13806. A_UINT32 buffer_addr_39_32 : 8, /* [7:0] */
  13807. /* release_source:
  13808. * holds a htt_t2h_tx_msdu_release_source_e enum value
  13809. */
  13810. release_source : 3, /* [10:8] */
  13811. sw_buffer_cookie : 21; /* [31:11] */
  13812. /* NOTE:
  13813. * To preserve backwards compatibility,
  13814. * no new fields can be added in this struct.
  13815. */
  13816. };
  13817. /* member definitions of htt_t2h_tx_buffer_addr_info */
  13818. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M 0xFFFFFFFF
  13819. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S 0
  13820. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_SET(word, value) \
  13821. do { \
  13822. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0, value); \
  13823. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S; \
  13824. } while (0)
  13825. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_GET(word) \
  13826. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S)
  13827. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M 0x000000FF
  13828. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S 0
  13829. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_SET(word, value) \
  13830. do { \
  13831. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32, value); \
  13832. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S; \
  13833. } while (0)
  13834. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_GET(word) \
  13835. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S)
  13836. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M 0x00000700
  13837. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S 8
  13838. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_SET(word, value) \
  13839. do { \
  13840. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE, value); \
  13841. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S; \
  13842. } while (0)
  13843. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_GET(word) \
  13844. (((word) & HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M) >> HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S)
  13845. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M 0xFFFFF800
  13846. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S 11
  13847. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  13848. do { \
  13849. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE, value); \
  13850. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S; \
  13851. } while (0)
  13852. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_GET(word) \
  13853. (((word) & HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M) >> HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S)
  13854. struct htt_t2h_tx_rate_stats_info { /* 2 words */
  13855. /* word 0 */
  13856. A_UINT32
  13857. /* tx_rate_stats_info_valid:
  13858. * Indicates if the tx rate stats below are valid.
  13859. */
  13860. tx_rate_stats_info_valid : 1, /* [0] */
  13861. /* transmit_bw:
  13862. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13863. * Indicates the BW of the upcoming transmission that shall likely
  13864. * start in about 3 -4 us on the medium:
  13865. * <enum 0 transmit_bw_20_MHz>
  13866. * <enum 1 transmit_bw_40_MHz>
  13867. * <enum 2 transmit_bw_80_MHz>
  13868. * <enum 3 transmit_bw_160_MHz>
  13869. * <enum 4 transmit_bw_320_MHz>
  13870. */
  13871. transmit_bw : 3, /* [3:1] */
  13872. /* transmit_pkt_type:
  13873. * same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13874. * Field filled in by PDG.
  13875. * Not valid when in SW transmit mode
  13876. * The packet type
  13877. * <enum_type PKT_TYPE_ENUM>
  13878. * Type: enum Definition Name: PKT_TYPE_ENUM
  13879. * enum number enum name Description
  13880. * ------------------------------------
  13881. * 0 dot11a 802.11a PPDU type
  13882. * 1 dot11b 802.11b PPDU type
  13883. * 2 dot11n_mm 802.11n Mixed Mode PPDU type
  13884. * 3 dot11ac 802.11ac PPDU type
  13885. * 4 dot11ax 802.11ax PPDU type
  13886. * 5 dot11ba 802.11ba (WUR) PPDU type
  13887. * 6 dot11be 802.11be PPDU type
  13888. * 7 dot11az 802.11az (ranging) PPDU type
  13889. */
  13890. transmit_pkt_type : 4, /* [7:4] */
  13891. /* transmit_stbc:
  13892. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13893. * Field filled in by PDG.
  13894. * Not valid when in SW transmit mode
  13895. * When set, STBC transmission rate was used.
  13896. */
  13897. transmit_stbc : 1, /* [8] */
  13898. /* transmit_ldpc:
  13899. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13900. * Field filled in by PDG.
  13901. * Not valid when in SW transmit mode
  13902. * When set, use LDPC transmission rates
  13903. */
  13904. transmit_ldpc : 1, /* [9] */
  13905. /* transmit_sgi:
  13906. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13907. * Field filled in by PDG.
  13908. * Not valid when in SW transmit mode
  13909. * <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used for HE
  13910. * <enum 1 0_4_us_sgi > Legacy short GI. Can also be used for HE
  13911. * <enum 2 1_6_us_sgi > HE related GI
  13912. * <enum 3 3_2_us_sgi > HE related GI
  13913. * <legal 0 - 3>
  13914. */
  13915. transmit_sgi : 2, /* [11:10] */
  13916. /* transmit_mcs:
  13917. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13918. * Field filled in by PDG.
  13919. * Not valid when in SW transmit mode
  13920. *
  13921. * For details, refer to MCS_TYPE description
  13922. * <legal all>
  13923. * Pkt_type Related definition of MCS_TYPE
  13924. * dot11b This field is the rate:
  13925. * 0: CCK 11 Mbps Long
  13926. * 1: CCK 5.5 Mbps Long
  13927. * 2: CCK 2 Mbps Long
  13928. * 3: CCK 1 Mbps Long
  13929. * 4: CCK 11 Mbps Short
  13930. * 5: CCK 5.5 Mbps Short
  13931. * 6: CCK 2 Mbps Short
  13932. * NOTE: The numbering here is NOT the same as the as MAC gives
  13933. * in the "rate" field in the SIG given to the PHY.
  13934. * The MAC will do an internal translation.
  13935. *
  13936. * Dot11a This field is the rate:
  13937. * 0: OFDM 48 Mbps
  13938. * 1: OFDM 24 Mbps
  13939. * 2: OFDM 12 Mbps
  13940. * 3: OFDM 6 Mbps
  13941. * 4: OFDM 54 Mbps
  13942. * 5: OFDM 36 Mbps
  13943. * 6: OFDM 18 Mbps
  13944. * 7: OFDM 9 Mbps
  13945. * NOTE: The numbering here is NOT the same as the as MAC gives
  13946. * in the "rate" field in the SIG given to the PHY.
  13947. * The MAC will do an internal translation.
  13948. *
  13949. * Dot11n_mm (mixed mode) This field represends the MCS.
  13950. * 0: HT MCS 0 (BPSK 1/2)
  13951. * 1: HT MCS 1 (QPSK 1/2)
  13952. * 2: HT MCS 2 (QPSK 3/4)
  13953. * 3: HT MCS 3 (16-QAM 1/2)
  13954. * 4: HT MCS 4 (16-QAM 3/4)
  13955. * 5: HT MCS 5 (64-QAM 2/3)
  13956. * 6: HT MCS 6 (64-QAM 3/4)
  13957. * 7: HT MCS 7 (64-QAM 5/6)
  13958. * NOTE: To get higher MCS's use the nss field to indicate the
  13959. * number of spatial streams.
  13960. *
  13961. * Dot11ac This field represends the MCS.
  13962. * 0: VHT MCS 0 (BPSK 1/2)
  13963. * 1: VHT MCS 1 (QPSK 1/2)
  13964. * 2: VHT MCS 2 (QPSK 3/4)
  13965. * 3: VHT MCS 3 (16-QAM 1/2)
  13966. * 4: VHT MCS 4 (16-QAM 3/4)
  13967. * 5: VHT MCS 5 (64-QAM 2/3)
  13968. * 6: VHT MCS 6 (64-QAM 3/4)
  13969. * 7: VHT MCS 7 (64-QAM 5/6)
  13970. * 8: VHT MCS 8 (256-QAM 3/4)
  13971. * 9: VHT MCS 9 (256-QAM 5/6)
  13972. * 10: VHT MCS 10 (1024-QAM 3/4)
  13973. * 11: VHT MCS 11 (1024-QAM 5/6)
  13974. * NOTE: There are several illegal VHT rates due to fractional
  13975. * number of bits per symbol.
  13976. * Below are the illegal rates for 4 streams and lower:
  13977. * 20 MHz, 1 stream, MCS 9
  13978. * 20 MHz, 2 stream, MCS 9
  13979. * 20 MHz, 4 stream, MCS 9
  13980. * 80 MHz, 3 stream, MCS 6
  13981. * 160 MHz, 3 stream, MCS 9 (Unsupported)
  13982. * 160 MHz, 4 stream, MCS 7 (Unsupported)
  13983. *
  13984. * dot11ax This field represends the MCS.
  13985. * 0: HE MCS 0 (BPSK 1/2)
  13986. * 1: HE MCS 1 (QPSK 1/2)
  13987. * 2: HE MCS 2 (QPSK 3/4)
  13988. * 3: HE MCS 3 (16-QAM 1/2)
  13989. * 4: HE MCS 4 (16-QAM 3/4)
  13990. * 5: HE MCS 5 (64-QAM 2/3)
  13991. * 6: HE MCS 6 (64-QAM 3/4)
  13992. * 7: HE MCS 7 (64-QAM 5/6)
  13993. * 8: HE MCS 8 (256-QAM 3/4)
  13994. * 9: HE MCS 9 (256-QAM 5/6)
  13995. * 10: HE MCS 10 (1024-QAM 3/4)
  13996. * 11: HE MCS 11 (1024-QAM 5/6)
  13997. * 12: HE MCS 12 (4096-QAM 3/4)
  13998. * 13: HE MCS 13 (4096-QAM 5/6)
  13999. *
  14000. * dot11ba This field is the rate:
  14001. * 0: LDR
  14002. * 1: HDR
  14003. * 2: Exclusive rate
  14004. */
  14005. transmit_mcs : 4, /* [15:12] */
  14006. /* ofdma_transmission:
  14007. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14008. * Field filled in by PDG.
  14009. * Set when the transmission was an OFDMA transmission (DL or UL).
  14010. * <legal all>
  14011. */
  14012. ofdma_transmission : 1, /* [16] */
  14013. /* tones_in_ru:
  14014. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14015. * Field filled in by PDG.
  14016. * Not valid when in SW transmit mode
  14017. * The number of tones in the RU used.
  14018. * <legal all>
  14019. */
  14020. tones_in_ru : 12, /* [28:17] */
  14021. rsvd2 : 3; /* [31:29] */
  14022. /* word 1 */
  14023. /* ppdu_transmission_tsf:
  14024. * Based on a HWSCH configuration register setting,
  14025. * this field either contains:
  14026. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14027. * of the PPDU containing the frame finished.
  14028. * OR
  14029. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14030. * of the PPDU containing the frame started.
  14031. * <legal all>
  14032. */
  14033. A_UINT32 ppdu_transmission_tsf;
  14034. /* NOTE:
  14035. * To preserve backwards compatibility,
  14036. * no new fields can be added in this struct.
  14037. */
  14038. };
  14039. /* member definitions of htt_t2h_tx_rate_stats_info */
  14040. #define HTT_TX_RATE_STATS_INFO_VALID_M 0x00000001
  14041. #define HTT_TX_RATE_STATS_INFO_VALID_S 0
  14042. #define HTT_TX_RATE_STATS_INFO_VALID_SET(word, value) \
  14043. do { \
  14044. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_VALID, value); \
  14045. (word) |= (value) << HTT_TX_RATE_STATS_INFO_VALID_S; \
  14046. } while (0)
  14047. #define HTT_TX_RATE_STATS_INFO_VALID_GET(word) \
  14048. (((word) & HTT_TX_RATE_STATS_INFO_VALID_M) >> HTT_TX_RATE_STATS_INFO_VALID_S)
  14049. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M 0x0000000E
  14050. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S 1
  14051. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_SET(word, value) \
  14052. do { \
  14053. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_BW, value); \
  14054. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S; \
  14055. } while (0)
  14056. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_GET(word) \
  14057. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S)
  14058. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M 0x000000F0
  14059. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S 4
  14060. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_SET(word, value) \
  14061. do { \
  14062. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE, value); \
  14063. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S; \
  14064. } while (0)
  14065. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_GET(word) \
  14066. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S)
  14067. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M 0x00000100
  14068. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S 8
  14069. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_SET(word, value) \
  14070. do { \
  14071. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC, value); \
  14072. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S; \
  14073. } while (0)
  14074. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_GET(word) \
  14075. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S)
  14076. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M 0x00000200
  14077. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S 9
  14078. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_SET(word, value) \
  14079. do { \
  14080. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC, value); \
  14081. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S; \
  14082. } while (0)
  14083. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_GET(word) \
  14084. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S)
  14085. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M 0x00000C00
  14086. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S 10
  14087. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_SET(word, value) \
  14088. do { \
  14089. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI, value); \
  14090. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S; \
  14091. } while (0)
  14092. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_GET(word) \
  14093. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S)
  14094. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M 0x0000F000
  14095. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S 12
  14096. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_SET(word, value) \
  14097. do { \
  14098. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS, value); \
  14099. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S; \
  14100. } while (0)
  14101. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_GET(word) \
  14102. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S)
  14103. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M 0x00010000
  14104. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S 16
  14105. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_SET(word, value) \
  14106. do { \
  14107. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION, value); \
  14108. (word) |= (value) << HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S; \
  14109. } while (0)
  14110. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_GET(word) \
  14111. (((word) & HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M) >> HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S)
  14112. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M 0x1FFE0000
  14113. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S 17
  14114. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_SET(word, value) \
  14115. do { \
  14116. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TONES_IN_RU, value); \
  14117. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S; \
  14118. } while (0)
  14119. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_GET(word) \
  14120. (((word) & HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M) >> HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S)
  14121. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M 0xFFFFFFFF
  14122. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S 0
  14123. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_SET(word, value) \
  14124. do { \
  14125. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF, value); \
  14126. (word) |= (value) << HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S; \
  14127. } while (0)
  14128. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_GET(word) \
  14129. (((word) & HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M) >> HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S)
  14130. struct htt_t2h_tx_msdu_info { /* 8 words */
  14131. /* words 0 + 1 */
  14132. struct htt_t2h_tx_buffer_addr_info addr_info;
  14133. /* word 2 */
  14134. A_UINT32
  14135. sw_peer_id : 16,
  14136. tid : 4,
  14137. transmit_cnt : 7,
  14138. valid : 1,
  14139. mcast : 1,
  14140. rsvd0 : 3;
  14141. /* word 3 */
  14142. A_UINT32
  14143. release_reason : 4, /* Refer to htt_t2h_tx_msdu_release_reason_e */
  14144. tqm_status_number : 24,
  14145. frame_type : 4; /* holds htt_tx_wbm_status_frame_type value */
  14146. /* word 4 */
  14147. A_UINT32
  14148. /* ack_frame_rssi:
  14149. * If this frame is removed as the result of the
  14150. * reception of an ACK or BA, this field indicates
  14151. * the RSSI of the received ACK or BA frame.
  14152. * When the frame is removed as result of a direct
  14153. * remove command from the SW, this field is set
  14154. * to 0x0 (which is never a valid value when real
  14155. * RSSI is available).
  14156. * Units: dB w.r.t noise floor
  14157. */
  14158. ack_frame_rssi : 8,
  14159. first_msdu : 1,
  14160. last_msdu : 1,
  14161. msdu_part_of_amsdu : 1,
  14162. buffer_timestamp : 19, /* units = TU = 1024 microseconds */
  14163. rsvd1 : 2;
  14164. /* words 5 + 6 */
  14165. struct htt_t2h_tx_rate_stats_info tx_rate_stats;
  14166. /* word 7 */
  14167. /* rsvd3:
  14168. * backup reserved field to add new parameters if [rsvd0, rsvd1, rsvd2]
  14169. * is not sufficient
  14170. */
  14171. A_UINT32 rsvd3;
  14172. /* NOTE:
  14173. * To preserve backwards compatibility,
  14174. * no new fields can be added in this struct.
  14175. */
  14176. };
  14177. /* member definitions of htt_t2h_tx_msdu_info */
  14178. #define HTT_TX_MSDU_INFO_SW_PEER_ID_M 0x0000FFFF
  14179. #define HTT_TX_MSDU_INFO_SW_PEER_ID_S 0
  14180. #define HTT_TX_MSDU_INFO_SW_PEER_ID_SET(word, value) \
  14181. do { \
  14182. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_SW_PEER_ID, value); \
  14183. (word) |= (value) << HTT_TX_MSDU_INFO_SW_PEER_ID_S; \
  14184. } while (0)
  14185. #define HTT_TX_MSDU_INFO_SW_PEER_ID_GET(word) \
  14186. (((word) & HTT_TX_MSDU_INFO_SW_PEER_ID_M) >> HTT_TX_MSDU_INFO_SW_PEER_ID_S)
  14187. #define HTT_TX_MSDU_INFO_TID_M 0x000F0000
  14188. #define HTT_TX_MSDU_INFO_TID_S 16
  14189. #define HTT_TX_MSDU_INFO_TID_SET(word, value) \
  14190. do { \
  14191. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TID, value); \
  14192. (word) |= (value) << HTT_TX_MSDU_INFO_TID_S; \
  14193. } while (0)
  14194. #define HTT_TX_MSDU_INFO_TID_GET(word) \
  14195. (((word) & HTT_TX_MSDU_INFO_TID_M) >> HTT_TX_MSDU_INFO_TID_S)
  14196. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_M 0x07F00000
  14197. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_S 20
  14198. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_SET(word, value) \
  14199. do { \
  14200. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TRANSMIT_CNT, value); \
  14201. (word) |= (value) << HTT_TX_MSDU_INFO_TRANSMIT_CNT_S; \
  14202. } while (0)
  14203. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_GET(word) \
  14204. (((word) & HTT_TX_MSDU_INFO_TRANSMIT_CNT_M) >> HTT_TX_MSDU_INFO_TRANSMIT_CNT_S)
  14205. #define HTT_TX_MSDU_INFO_VALID_M 0x08000000
  14206. #define HTT_TX_MSDU_INFO_VALID_S 27
  14207. #define HTT_TX_MSDU_INFO_VALID_SET(word, value) \
  14208. do { \
  14209. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_VALID, value); \
  14210. (word) |= (value) << HTT_TX_MSDU_INFO_VALID_S; \
  14211. } while (0)
  14212. #define HTT_TX_MSDU_INFO_VALID_GET(word) \
  14213. (((word) & HTT_TX_MSDU_INFO_VALID_M) >> HTT_TX_MSDU_INFO_VALID_S)
  14214. #define HTT_TX_MSDU_INFO_MCAST_M 0x10000000
  14215. #define HTT_TX_MSDU_INFO_MCAST_S 28
  14216. #define HTT_TX_MSDU_INFO_MCAST_SET(word, value) \
  14217. do { \
  14218. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MCAST, value); \
  14219. (word) |= (value) << HTT_TX_MSDU_INFO_MCAST_S; \
  14220. } while (0)
  14221. #define HTT_TX_MSDU_INFO_MCAST_GET(word) \
  14222. (((word) & HTT_TX_MSDU_INFO_MCAST_M) >> HTT_TX_MSDU_INFO_MCAST_S)
  14223. #define HTT_TX_MSDU_INFO_RELEASE_REASON_M 0x0000000F
  14224. #define HTT_TX_MSDU_INFO_RELEASE_REASON_S 0
  14225. #define HTT_TX_MSDU_INFO_RELEASE_REASON_SET(word, value) \
  14226. do { \
  14227. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_RELEASE_REASON, value); \
  14228. (word) |= (value) << HTT_TX_MSDU_INFO_RELEASE_REASON_S; \
  14229. } while (0)
  14230. #define HTT_TX_MSDU_INFO_RELEASE_REASON_GET(word) \
  14231. (((word) & HTT_TX_MSDU_INFO_RELEASE_REASON_M) >> HTT_TX_MSDU_INFO_RELEASE_REASON_S)
  14232. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M 0x0FFFFFF0
  14233. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S 4
  14234. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_SET(word, value) \
  14235. do { \
  14236. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER, value); \
  14237. (word) |= (value) << HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S; \
  14238. } while (0)
  14239. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_GET(word) \
  14240. (((word) & HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M) >> HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S)
  14241. #define HTT_TX_MSDU_INFO_FRAME_TYPE_M 0xF0000000
  14242. #define HTT_TX_MSDU_INFO_FRAME_TYPE_S 28
  14243. #define HTT_TX_MSDU_INFO_FRAME_TYPE_SET(word, value) \
  14244. do { \
  14245. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FRAME_TYPE, value); \
  14246. (word) |= (value) << HTT_TX_MSDU_INFO_FRAME_TYPE_S; \
  14247. } while (0)
  14248. #define HTT_TX_MSDU_INFO_FRAME_TYPE_GET(word) \
  14249. (((word) & HTT_TX_MSDU_INFO_FRAME_TYPE_M) >> HTT_TX_MSDU_INFO_FRAME_TYPE_S)
  14250. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M 0x000000FF
  14251. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S 0
  14252. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_SET(word, value) \
  14253. do { \
  14254. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_ACK_FRAME_RSSI, value); \
  14255. (word) |= (value) << HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S; \
  14256. } while (0)
  14257. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_GET(word) \
  14258. (((word) & HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M) >> HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S)
  14259. #define HTT_TX_MSDU_INFO_FIRST_MSDU_M 0x00000100
  14260. #define HTT_TX_MSDU_INFO_FIRST_MSDU_S 8
  14261. #define HTT_TX_MSDU_INFO_FIRST_MSDU_SET(word, value) \
  14262. do { \
  14263. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FIRST_MSDU, value); \
  14264. (word) |= (value) << HTT_TX_MSDU_INFO_FIRST_MSDU_S; \
  14265. } while (0)
  14266. #define HTT_TX_MSDU_INFO_FIRST_MSDU_GET(word) \
  14267. (((word) & HTT_TX_MSDU_INFO_FIRST_MSDU_M) >> HTT_TX_MSDU_INFO_FIRST_MSDU_S)
  14268. #define HTT_TX_MSDU_INFO_LAST_MSDU_M 0x00000200
  14269. #define HTT_TX_MSDU_INFO_LAST_MSDU_S 9
  14270. #define HTT_TX_MSDU_INFO_LAST_MSDU_SET(word, value) \
  14271. do { \
  14272. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_LAST_MSDU, value); \
  14273. (word) |= (value) << HTT_TX_MSDU_INFO_LAST_MSDU_S; \
  14274. } while (0)
  14275. #define HTT_TX_MSDU_INFO_LAST_MSDU_GET(word) \
  14276. (((word) & HTT_TX_MSDU_INFO_LAST_MSDU_M) >> HTT_TX_MSDU_INFO_LAST_MSDU_S)
  14277. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M 0x00000400
  14278. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S 10
  14279. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_SET(word, value) \
  14280. do { \
  14281. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU, value); \
  14282. (word) |= (value) << HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S; \
  14283. } while (0)
  14284. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_GET(word) \
  14285. (((word) & HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M) >> HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S)
  14286. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M 0x3FFFF800
  14287. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S 11
  14288. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_SET(word, value) \
  14289. do { \
  14290. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP, value); \
  14291. (word) |= (value) << HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S; \
  14292. } while (0)
  14293. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_GET(word) \
  14294. (((word) & HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M) >> HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S)
  14295. struct htt_t2h_soft_umac_tx_compl_ind {
  14296. A_UINT32 msg_type : 8, /* HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND */
  14297. msdu_cnt : 8, /* min: 0, max: 255 */
  14298. rsvd0 : 16;
  14299. /* NOTE:
  14300. * To preserve backwards compatibility,
  14301. * no new fields can be added in this struct.
  14302. */
  14303. /*
  14304. * append here:
  14305. * struct htt_t2h_tx_msdu_info payload[1(or more)]
  14306. * for all the msdu's that are part of this completion.
  14307. */
  14308. };
  14309. /* member definitions of htt_t2h_soft_umac_tx_compl_ind */
  14310. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M 0x0000FF00
  14311. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S 8
  14312. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_SET(word, value) \
  14313. do { \
  14314. HTT_CHECK_SET_VAL(HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT, value); \
  14315. (word) |= (value) << HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S; \
  14316. } while (0)
  14317. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_GET(word) \
  14318. (((word) & HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M) >> HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S)
  14319. /**
  14320. * @brief target -> host rate-control update indication message
  14321. *
  14322. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  14323. *
  14324. * @details
  14325. * The following diagram shows the format of the RC Update message
  14326. * sent from the target to the host, while processing the tx-completion
  14327. * of a transmitted PPDU.
  14328. *
  14329. * |31 24|23 16|15 8|7 0|
  14330. * |-------------------------------------------------------------|
  14331. * | peer ID | vdev ID | msg_type |
  14332. * |-------------------------------------------------------------|
  14333. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  14334. * |-------------------------------------------------------------|
  14335. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  14336. * |-------------------------------------------------------------|
  14337. * | : |
  14338. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14339. * | : |
  14340. * |-------------------------------------------------------------|
  14341. * | : |
  14342. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14343. * | : |
  14344. * |-------------------------------------------------------------|
  14345. * : :
  14346. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14347. *
  14348. */
  14349. typedef struct {
  14350. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  14351. A_UINT32 rate_code_flags;
  14352. A_UINT32 flags; /* Encodes information such as excessive
  14353. retransmission, aggregate, some info
  14354. from .11 frame control,
  14355. STBC, LDPC, (SGI and Tx Chain Mask
  14356. are encoded in ptx_rc->flags field),
  14357. AMPDU truncation (BT/time based etc.),
  14358. RTS/CTS attempt */
  14359. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  14360. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  14361. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  14362. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  14363. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  14364. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  14365. } HTT_RC_TX_DONE_PARAMS;
  14366. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  14367. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  14368. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  14369. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  14370. #define HTT_RC_UPDATE_VDEVID_S 8
  14371. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  14372. #define HTT_RC_UPDATE_PEERID_S 16
  14373. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  14374. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  14375. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  14376. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  14377. do { \
  14378. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  14379. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  14380. } while (0)
  14381. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  14382. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  14383. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  14384. do { \
  14385. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  14386. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  14387. } while (0)
  14388. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  14389. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  14390. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  14391. do { \
  14392. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  14393. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  14394. } while (0)
  14395. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  14396. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  14397. /**
  14398. * @brief target -> host rx fragment indication message definition
  14399. *
  14400. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  14401. *
  14402. * @details
  14403. * The following field definitions describe the format of the rx fragment
  14404. * indication message sent from the target to the host.
  14405. * The rx fragment indication message shares the format of the
  14406. * rx indication message, but not all fields from the rx indication message
  14407. * are relevant to the rx fragment indication message.
  14408. *
  14409. *
  14410. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  14411. * |-----------+-------------------+---------------------+-------------|
  14412. * | peer ID | |FV| ext TID | msg type |
  14413. * |-------------------------------------------------------------------|
  14414. * | | flush | flush |
  14415. * | | end | start |
  14416. * | | seq num | seq num |
  14417. * |-------------------------------------------------------------------|
  14418. * | reserved | FW rx desc bytes |
  14419. * |-------------------------------------------------------------------|
  14420. * | | FW MSDU Rx |
  14421. * | | desc B0 |
  14422. * |-------------------------------------------------------------------|
  14423. * Header fields:
  14424. * - MSG_TYPE
  14425. * Bits 7:0
  14426. * Purpose: identifies this as an rx fragment indication message
  14427. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  14428. * - EXT_TID
  14429. * Bits 12:8
  14430. * Purpose: identify the traffic ID of the rx data, including
  14431. * special "extended" TID values for multicast, broadcast, and
  14432. * non-QoS data frames
  14433. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  14434. * - FLUSH_VALID (FV)
  14435. * Bit 13
  14436. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  14437. * is valid
  14438. * Value:
  14439. * 1 -> flush IE is valid and needs to be processed
  14440. * 0 -> flush IE is not valid and should be ignored
  14441. * - PEER_ID
  14442. * Bits 31:16
  14443. * Purpose: Identify, by ID, which peer sent the rx data
  14444. * Value: ID of the peer who sent the rx data
  14445. * - FLUSH_SEQ_NUM_START
  14446. * Bits 5:0
  14447. * Purpose: Indicate the start of a series of MPDUs to flush
  14448. * Not all MPDUs within this series are necessarily valid - the host
  14449. * must check each sequence number within this range to see if the
  14450. * corresponding MPDU is actually present.
  14451. * This field is only valid if the FV bit is set.
  14452. * Value:
  14453. * The sequence number for the first MPDUs to check to flush.
  14454. * The sequence number is masked by 0x3f.
  14455. * - FLUSH_SEQ_NUM_END
  14456. * Bits 11:6
  14457. * Purpose: Indicate the end of a series of MPDUs to flush
  14458. * Value:
  14459. * The sequence number one larger than the sequence number of the
  14460. * last MPDU to check to flush.
  14461. * The sequence number is masked by 0x3f.
  14462. * Not all MPDUs within this series are necessarily valid - the host
  14463. * must check each sequence number within this range to see if the
  14464. * corresponding MPDU is actually present.
  14465. * This field is only valid if the FV bit is set.
  14466. * Rx descriptor fields:
  14467. * - FW_RX_DESC_BYTES
  14468. * Bits 15:0
  14469. * Purpose: Indicate how many bytes in the Rx indication are used for
  14470. * FW Rx descriptors
  14471. * Value: 1
  14472. */
  14473. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  14474. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  14475. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  14476. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  14477. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  14478. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  14479. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  14480. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  14481. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  14482. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  14483. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  14484. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  14485. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  14486. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  14487. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  14488. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  14489. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  14490. #define HTT_RX_FRAG_IND_BYTES \
  14491. (4 /* msg hdr */ + \
  14492. 4 /* flush spec */ + \
  14493. 4 /* (unused) FW rx desc bytes spec */ + \
  14494. 4 /* FW rx desc */)
  14495. /**
  14496. * @brief target -> host test message definition
  14497. *
  14498. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  14499. *
  14500. * @details
  14501. * The following field definitions describe the format of the test
  14502. * message sent from the target to the host.
  14503. * The message consists of a 4-octet header, followed by a variable
  14504. * number of 32-bit integer values, followed by a variable number
  14505. * of 8-bit character values.
  14506. *
  14507. * |31 16|15 8|7 0|
  14508. * |-----------------------------------------------------------|
  14509. * | num chars | num ints | msg type |
  14510. * |-----------------------------------------------------------|
  14511. * | int 0 |
  14512. * |-----------------------------------------------------------|
  14513. * | int 1 |
  14514. * |-----------------------------------------------------------|
  14515. * | ... |
  14516. * |-----------------------------------------------------------|
  14517. * | char 3 | char 2 | char 1 | char 0 |
  14518. * |-----------------------------------------------------------|
  14519. * | | | ... | char 4 |
  14520. * |-----------------------------------------------------------|
  14521. * - MSG_TYPE
  14522. * Bits 7:0
  14523. * Purpose: identifies this as a test message
  14524. * Value: HTT_MSG_TYPE_TEST
  14525. * - NUM_INTS
  14526. * Bits 15:8
  14527. * Purpose: indicate how many 32-bit integers follow the message header
  14528. * - NUM_CHARS
  14529. * Bits 31:16
  14530. * Purpose: indicate how many 8-bit characters follow the series of integers
  14531. */
  14532. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  14533. #define HTT_RX_TEST_NUM_INTS_S 8
  14534. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  14535. #define HTT_RX_TEST_NUM_CHARS_S 16
  14536. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  14537. do { \
  14538. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  14539. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  14540. } while (0)
  14541. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  14542. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  14543. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  14544. do { \
  14545. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  14546. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  14547. } while (0)
  14548. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  14549. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  14550. /**
  14551. * @brief target -> host packet log message
  14552. *
  14553. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  14554. *
  14555. * @details
  14556. * The following field definitions describe the format of the packet log
  14557. * message sent from the target to the host.
  14558. * The message consists of a 4-octet header,followed by a variable number
  14559. * of 32-bit character values.
  14560. *
  14561. * |31 16|15 12|11 10|9 8|7 0|
  14562. * |------------------------------------------------------------------|
  14563. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  14564. * |------------------------------------------------------------------|
  14565. * | payload |
  14566. * |------------------------------------------------------------------|
  14567. * - MSG_TYPE
  14568. * Bits 7:0
  14569. * Purpose: identifies this as a pktlog message
  14570. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  14571. * - mac_id
  14572. * Bits 9:8
  14573. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  14574. * Value: 0-3
  14575. * - pdev_id
  14576. * Bits 11:10
  14577. * Purpose: pdev_id
  14578. * Value: 0-3
  14579. * 0 (for rings at SOC level),
  14580. * 1/2/3 PDEV -> 0/1/2
  14581. * - payload_size
  14582. * Bits 31:16
  14583. * Purpose: explicitly specify the payload size
  14584. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  14585. */
  14586. PREPACK struct htt_pktlog_msg {
  14587. A_UINT32 header;
  14588. A_UINT32 payload[1/* or more */];
  14589. } POSTPACK;
  14590. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  14591. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  14592. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  14593. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  14594. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  14595. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  14596. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  14597. do { \
  14598. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  14599. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  14600. } while (0)
  14601. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  14602. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  14603. HTT_T2H_PKTLOG_MAC_ID_S)
  14604. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  14605. do { \
  14606. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  14607. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  14608. } while (0)
  14609. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  14610. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  14611. HTT_T2H_PKTLOG_PDEV_ID_S)
  14612. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  14613. do { \
  14614. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  14615. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  14616. } while (0)
  14617. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  14618. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  14619. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  14620. /*
  14621. * Rx reorder statistics
  14622. * NB: all the fields must be defined in 4 octets size.
  14623. */
  14624. struct rx_reorder_stats {
  14625. /* Non QoS MPDUs received */
  14626. A_UINT32 deliver_non_qos;
  14627. /* MPDUs received in-order */
  14628. A_UINT32 deliver_in_order;
  14629. /* Flush due to reorder timer expired */
  14630. A_UINT32 deliver_flush_timeout;
  14631. /* Flush due to move out of window */
  14632. A_UINT32 deliver_flush_oow;
  14633. /* Flush due to DELBA */
  14634. A_UINT32 deliver_flush_delba;
  14635. /* MPDUs dropped due to FCS error */
  14636. A_UINT32 fcs_error;
  14637. /* MPDUs dropped due to monitor mode non-data packet */
  14638. A_UINT32 mgmt_ctrl;
  14639. /* Unicast-data MPDUs dropped due to invalid peer */
  14640. A_UINT32 invalid_peer;
  14641. /* MPDUs dropped due to duplication (non aggregation) */
  14642. A_UINT32 dup_non_aggr;
  14643. /* MPDUs dropped due to processed before */
  14644. A_UINT32 dup_past;
  14645. /* MPDUs dropped due to duplicate in reorder queue */
  14646. A_UINT32 dup_in_reorder;
  14647. /* Reorder timeout happened */
  14648. A_UINT32 reorder_timeout;
  14649. /* invalid bar ssn */
  14650. A_UINT32 invalid_bar_ssn;
  14651. /* reorder reset due to bar ssn */
  14652. A_UINT32 ssn_reset;
  14653. /* Flush due to delete peer */
  14654. A_UINT32 deliver_flush_delpeer;
  14655. /* Flush due to offload*/
  14656. A_UINT32 deliver_flush_offload;
  14657. /* Flush due to out of buffer*/
  14658. A_UINT32 deliver_flush_oob;
  14659. /* MPDUs dropped due to PN check fail */
  14660. A_UINT32 pn_fail;
  14661. /* MPDUs dropped due to unable to allocate memory */
  14662. A_UINT32 store_fail;
  14663. /* Number of times the tid pool alloc succeeded */
  14664. A_UINT32 tid_pool_alloc_succ;
  14665. /* Number of times the MPDU pool alloc succeeded */
  14666. A_UINT32 mpdu_pool_alloc_succ;
  14667. /* Number of times the MSDU pool alloc succeeded */
  14668. A_UINT32 msdu_pool_alloc_succ;
  14669. /* Number of times the tid pool alloc failed */
  14670. A_UINT32 tid_pool_alloc_fail;
  14671. /* Number of times the MPDU pool alloc failed */
  14672. A_UINT32 mpdu_pool_alloc_fail;
  14673. /* Number of times the MSDU pool alloc failed */
  14674. A_UINT32 msdu_pool_alloc_fail;
  14675. /* Number of times the tid pool freed */
  14676. A_UINT32 tid_pool_free;
  14677. /* Number of times the MPDU pool freed */
  14678. A_UINT32 mpdu_pool_free;
  14679. /* Number of times the MSDU pool freed */
  14680. A_UINT32 msdu_pool_free;
  14681. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  14682. A_UINT32 msdu_queued;
  14683. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  14684. A_UINT32 msdu_recycled;
  14685. /* Number of MPDUs with invalid peer but A2 found in AST */
  14686. A_UINT32 invalid_peer_a2_in_ast;
  14687. /* Number of MPDUs with invalid peer but A3 found in AST */
  14688. A_UINT32 invalid_peer_a3_in_ast;
  14689. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  14690. A_UINT32 invalid_peer_bmc_mpdus;
  14691. /* Number of MSDUs with err attention word */
  14692. A_UINT32 rxdesc_err_att;
  14693. /* Number of MSDUs with flag of peer_idx_invalid */
  14694. A_UINT32 rxdesc_err_peer_idx_inv;
  14695. /* Number of MSDUs with flag of peer_idx_timeout */
  14696. A_UINT32 rxdesc_err_peer_idx_to;
  14697. /* Number of MSDUs with flag of overflow */
  14698. A_UINT32 rxdesc_err_ov;
  14699. /* Number of MSDUs with flag of msdu_length_err */
  14700. A_UINT32 rxdesc_err_msdu_len;
  14701. /* Number of MSDUs with flag of mpdu_length_err */
  14702. A_UINT32 rxdesc_err_mpdu_len;
  14703. /* Number of MSDUs with flag of tkip_mic_err */
  14704. A_UINT32 rxdesc_err_tkip_mic;
  14705. /* Number of MSDUs with flag of decrypt_err */
  14706. A_UINT32 rxdesc_err_decrypt;
  14707. /* Number of MSDUs with flag of fcs_err */
  14708. A_UINT32 rxdesc_err_fcs;
  14709. /* Number of Unicast (bc_mc bit is not set in attention word)
  14710. * frames with invalid peer handler
  14711. */
  14712. A_UINT32 rxdesc_uc_msdus_inv_peer;
  14713. /* Number of unicast frame directly (direct bit is set in attention word)
  14714. * to DUT with invalid peer handler
  14715. */
  14716. A_UINT32 rxdesc_direct_msdus_inv_peer;
  14717. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  14718. * frames with invalid peer handler
  14719. */
  14720. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  14721. /* Number of MSDUs dropped due to no first MSDU flag */
  14722. A_UINT32 rxdesc_no_1st_msdu;
  14723. /* Number of MSDUs dropped due to ring overflow */
  14724. A_UINT32 msdu_drop_ring_ov;
  14725. /* Number of MSDUs dropped due to FC mismatch */
  14726. A_UINT32 msdu_drop_fc_mismatch;
  14727. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  14728. A_UINT32 msdu_drop_mgmt_remote_ring;
  14729. /* Number of MSDUs dropped due to errors not reported in attention word */
  14730. A_UINT32 msdu_drop_misc;
  14731. /* Number of MSDUs go to offload before reorder */
  14732. A_UINT32 offload_msdu_wal;
  14733. /* Number of data frame dropped by offload after reorder */
  14734. A_UINT32 offload_msdu_reorder;
  14735. /* Number of MPDUs with sequence number in the past and within the BA window */
  14736. A_UINT32 dup_past_within_window;
  14737. /* Number of MPDUs with sequence number in the past and outside the BA window */
  14738. A_UINT32 dup_past_outside_window;
  14739. /* Number of MSDUs with decrypt/MIC error */
  14740. A_UINT32 rxdesc_err_decrypt_mic;
  14741. /* Number of data MSDUs received on both local and remote rings */
  14742. A_UINT32 data_msdus_on_both_rings;
  14743. /* MPDUs never filled */
  14744. A_UINT32 holes_not_filled;
  14745. };
  14746. /*
  14747. * Rx Remote buffer statistics
  14748. * NB: all the fields must be defined in 4 octets size.
  14749. */
  14750. struct rx_remote_buffer_mgmt_stats {
  14751. /* Total number of MSDUs reaped for Rx processing */
  14752. A_UINT32 remote_reaped;
  14753. /* MSDUs recycled within firmware */
  14754. A_UINT32 remote_recycled;
  14755. /* MSDUs stored by Data Rx */
  14756. A_UINT32 data_rx_msdus_stored;
  14757. /* Number of HTT indications from WAL Rx MSDU */
  14758. A_UINT32 wal_rx_ind;
  14759. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  14760. A_UINT32 wal_rx_ind_unconsumed;
  14761. /* Number of HTT indications from Data Rx MSDU */
  14762. A_UINT32 data_rx_ind;
  14763. /* Number of unconsumed HTT indications from Data Rx MSDU */
  14764. A_UINT32 data_rx_ind_unconsumed;
  14765. /* Number of HTT indications from ATHBUF */
  14766. A_UINT32 athbuf_rx_ind;
  14767. /* Number of remote buffers requested for refill */
  14768. A_UINT32 refill_buf_req;
  14769. /* Number of remote buffers filled by the host */
  14770. A_UINT32 refill_buf_rsp;
  14771. /* Number of times MAC hw_index = f/w write_index */
  14772. A_INT32 mac_no_bufs;
  14773. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  14774. A_INT32 fw_indices_equal;
  14775. /* Number of times f/w finds no buffers to post */
  14776. A_INT32 host_no_bufs;
  14777. };
  14778. /*
  14779. * TXBF MU/SU packets and NDPA statistics
  14780. * NB: all the fields must be defined in 4 octets size.
  14781. */
  14782. struct rx_txbf_musu_ndpa_pkts_stats {
  14783. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  14784. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  14785. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  14786. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  14787. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  14788. A_UINT32 reserved[3]; /* must be set to 0x0 */
  14789. };
  14790. /*
  14791. * htt_dbg_stats_status -
  14792. * present - The requested stats have been delivered in full.
  14793. * This indicates that either the stats information was contained
  14794. * in its entirety within this message, or else this message
  14795. * completes the delivery of the requested stats info that was
  14796. * partially delivered through earlier STATS_CONF messages.
  14797. * partial - The requested stats have been delivered in part.
  14798. * One or more subsequent STATS_CONF messages with the same
  14799. * cookie value will be sent to deliver the remainder of the
  14800. * information.
  14801. * error - The requested stats could not be delivered, for example due
  14802. * to a shortage of memory to construct a message holding the
  14803. * requested stats.
  14804. * invalid - The requested stat type is either not recognized, or the
  14805. * target is configured to not gather the stats type in question.
  14806. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14807. * series_done - This special value indicates that no further stats info
  14808. * elements are present within a series of stats info elems
  14809. * (within a stats upload confirmation message).
  14810. */
  14811. enum htt_dbg_stats_status {
  14812. HTT_DBG_STATS_STATUS_PRESENT = 0,
  14813. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  14814. HTT_DBG_STATS_STATUS_ERROR = 2,
  14815. HTT_DBG_STATS_STATUS_INVALID = 3,
  14816. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  14817. };
  14818. /**
  14819. * @brief target -> host statistics upload
  14820. *
  14821. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  14822. *
  14823. * @details
  14824. * The following field definitions describe the format of the HTT target
  14825. * to host stats upload confirmation message.
  14826. * The message contains a cookie echoed from the HTT host->target stats
  14827. * upload request, which identifies which request the confirmation is
  14828. * for, and a series of tag-length-value stats information elements.
  14829. * The tag-length header for each stats info element also includes a
  14830. * status field, to indicate whether the request for the stat type in
  14831. * question was fully met, partially met, unable to be met, or invalid
  14832. * (if the stat type in question is disabled in the target).
  14833. * A special value of all 1's in this status field is used to indicate
  14834. * the end of the series of stats info elements.
  14835. *
  14836. *
  14837. * |31 16|15 8|7 5|4 0|
  14838. * |------------------------------------------------------------|
  14839. * | reserved | msg type |
  14840. * |------------------------------------------------------------|
  14841. * | cookie LSBs |
  14842. * |------------------------------------------------------------|
  14843. * | cookie MSBs |
  14844. * |------------------------------------------------------------|
  14845. * | stats entry length | reserved | S |stat type|
  14846. * |------------------------------------------------------------|
  14847. * | |
  14848. * | type-specific stats info |
  14849. * | |
  14850. * |------------------------------------------------------------|
  14851. * | stats entry length | reserved | S |stat type|
  14852. * |------------------------------------------------------------|
  14853. * | |
  14854. * | type-specific stats info |
  14855. * | |
  14856. * |------------------------------------------------------------|
  14857. * | n/a | reserved | 111 | n/a |
  14858. * |------------------------------------------------------------|
  14859. * Header fields:
  14860. * - MSG_TYPE
  14861. * Bits 7:0
  14862. * Purpose: identifies this is a statistics upload confirmation message
  14863. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14864. * - COOKIE_LSBS
  14865. * Bits 31:0
  14866. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14867. * message with its preceding host->target stats request message.
  14868. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14869. * - COOKIE_MSBS
  14870. * Bits 31:0
  14871. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14872. * message with its preceding host->target stats request message.
  14873. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14874. *
  14875. * Stats Information Element tag-length header fields:
  14876. * - STAT_TYPE
  14877. * Bits 4:0
  14878. * Purpose: identifies the type of statistics info held in the
  14879. * following information element
  14880. * Value: htt_dbg_stats_type
  14881. * - STATUS
  14882. * Bits 7:5
  14883. * Purpose: indicate whether the requested stats are present
  14884. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14885. * the completion of the stats entry series
  14886. * - LENGTH
  14887. * Bits 31:16
  14888. * Purpose: indicate the stats information size
  14889. * Value: This field specifies the number of bytes of stats information
  14890. * that follows the element tag-length header.
  14891. * It is expected but not required that this length is a multiple of
  14892. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14893. * subsequent stats entry header will begin on a 4-byte aligned
  14894. * boundary.
  14895. */
  14896. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14897. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14898. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14899. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14900. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14901. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14902. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14903. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14904. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14905. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14906. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14907. do { \
  14908. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14909. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14910. } while (0)
  14911. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14912. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14913. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14914. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14915. do { \
  14916. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14917. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14918. } while (0)
  14919. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14920. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14921. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14922. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14923. do { \
  14924. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14925. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14926. } while (0)
  14927. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14928. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14929. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14930. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14931. #define HTT_MAX_AGGR 64
  14932. #define HTT_HL_MAX_AGGR 18
  14933. /**
  14934. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14935. *
  14936. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14937. *
  14938. * @details
  14939. * The following field definitions describe the format of the HTT host
  14940. * to target frag_desc/msdu_ext bank configuration message.
  14941. * The message contains the based address and the min and max id of the
  14942. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14943. * MSDU_EXT/FRAG_DESC.
  14944. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14945. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14946. * the hardware does the mapping/translation.
  14947. *
  14948. * Total banks that can be configured is configured to 16.
  14949. *
  14950. * This should be called before any TX has be initiated by the HTT
  14951. *
  14952. * |31 16|15 8|7 5|4 0|
  14953. * |------------------------------------------------------------|
  14954. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14955. * |------------------------------------------------------------|
  14956. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14957. #if HTT_PADDR64
  14958. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14959. #endif
  14960. * |------------------------------------------------------------|
  14961. * | ... |
  14962. * |------------------------------------------------------------|
  14963. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14964. #if HTT_PADDR64
  14965. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14966. #endif
  14967. * |------------------------------------------------------------|
  14968. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14969. * |------------------------------------------------------------|
  14970. * | ... |
  14971. * |------------------------------------------------------------|
  14972. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14973. * |------------------------------------------------------------|
  14974. * Header fields:
  14975. * - MSG_TYPE
  14976. * Bits 7:0
  14977. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14978. * for systems with 64-bit format for bus addresses:
  14979. * - BANKx_BASE_ADDRESS_LO
  14980. * Bits 31:0
  14981. * Purpose: Provide a mechanism to specify the base address of the
  14982. * MSDU_EXT bank physical/bus address.
  14983. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14984. * - BANKx_BASE_ADDRESS_HI
  14985. * Bits 31:0
  14986. * Purpose: Provide a mechanism to specify the base address of the
  14987. * MSDU_EXT bank physical/bus address.
  14988. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14989. * for systems with 32-bit format for bus addresses:
  14990. * - BANKx_BASE_ADDRESS
  14991. * Bits 31:0
  14992. * Purpose: Provide a mechanism to specify the base address of the
  14993. * MSDU_EXT bank physical/bus address.
  14994. * Value: MSDU_EXT bank physical / bus address
  14995. * - BANKx_MIN_ID
  14996. * Bits 15:0
  14997. * Purpose: Provide a mechanism to specify the min index that needs to
  14998. * mapped.
  14999. * - BANKx_MAX_ID
  15000. * Bits 31:16
  15001. * Purpose: Provide a mechanism to specify the max index that needs to
  15002. * mapped.
  15003. *
  15004. */
  15005. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  15006. * safe value.
  15007. * @note MAX supported banks is 16.
  15008. */
  15009. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  15010. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  15011. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  15012. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  15013. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  15014. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  15015. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  15016. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  15017. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  15018. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  15019. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  15020. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  15021. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  15022. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  15023. do { \
  15024. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  15025. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  15026. } while (0)
  15027. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  15028. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  15029. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  15030. do { \
  15031. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  15032. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  15033. } while (0)
  15034. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  15035. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  15036. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  15037. do { \
  15038. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  15039. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  15040. } while (0)
  15041. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  15042. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  15043. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  15044. do { \
  15045. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  15046. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  15047. } while (0)
  15048. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  15049. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  15050. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  15051. do { \
  15052. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  15053. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  15054. } while (0)
  15055. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  15056. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  15057. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  15058. do { \
  15059. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  15060. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  15061. } while (0)
  15062. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  15063. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  15064. /*
  15065. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  15066. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  15067. * addresses are stored in a XXX-bit field.
  15068. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  15069. * htt_tx_frag_desc64_bank_cfg_t structs.
  15070. */
  15071. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  15072. _paddr_bits_, \
  15073. _paddr__bank_base_address_) \
  15074. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  15075. /** word 0 \
  15076. * msg_type: 8, \
  15077. * pdev_id: 2, \
  15078. * swap: 1, \
  15079. * reserved0: 5, \
  15080. * num_banks: 8, \
  15081. * desc_size: 8; \
  15082. */ \
  15083. A_UINT32 word0; \
  15084. /* \
  15085. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  15086. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  15087. * the second A_UINT32). \
  15088. */ \
  15089. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15090. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15091. } POSTPACK
  15092. /* define htt_tx_frag_desc32_bank_cfg_t */
  15093. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  15094. /* define htt_tx_frag_desc64_bank_cfg_t */
  15095. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  15096. /*
  15097. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  15098. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  15099. */
  15100. #if HTT_PADDR64
  15101. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  15102. #else
  15103. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  15104. #endif
  15105. /**
  15106. * @brief target -> host HTT TX Credit total count update message definition
  15107. *
  15108. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  15109. *
  15110. *|31 16|15|14 9| 8 |7 0 |
  15111. *|---------------------+--+----------+-------+----------|
  15112. *|cur htt credit delta | Q| reserved | sign | msg type |
  15113. *|------------------------------------------------------|
  15114. *
  15115. * Header fields:
  15116. * - MSG_TYPE
  15117. * Bits 7:0
  15118. * Purpose: identifies this as a htt tx credit delta update message
  15119. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  15120. * - SIGN
  15121. * Bits 8
  15122. * identifies whether credit delta is positive or negative
  15123. * Value:
  15124. * - 0x0: credit delta is positive, rebalance in some buffers
  15125. * - 0x1: credit delta is negative, rebalance out some buffers
  15126. * - reserved
  15127. * Bits 14:9
  15128. * Value: 0x0
  15129. * - TXQ_GRP
  15130. * Bit 15
  15131. * Purpose: indicates whether any tx queue group information elements
  15132. * are appended to the tx credit update message
  15133. * Value: 0 -> no tx queue group information element is present
  15134. * 1 -> a tx queue group information element immediately follows
  15135. * - DELTA_COUNT
  15136. * Bits 31:16
  15137. * Purpose: Specify current htt credit delta absolute count
  15138. */
  15139. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  15140. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  15141. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  15142. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  15143. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  15144. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  15145. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  15146. do { \
  15147. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  15148. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  15149. } while (0)
  15150. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  15151. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  15152. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  15153. do { \
  15154. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  15155. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  15156. } while (0)
  15157. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  15158. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  15159. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  15160. do { \
  15161. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  15162. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  15163. } while (0)
  15164. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  15165. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  15166. #define HTT_TX_CREDIT_MSG_BYTES 4
  15167. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  15168. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  15169. /**
  15170. * @brief HTT WDI_IPA Operation Response Message
  15171. *
  15172. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  15173. *
  15174. * @details
  15175. * HTT WDI_IPA Operation Response message is sent by target
  15176. * to host confirming suspend or resume operation.
  15177. * |31 24|23 16|15 8|7 0|
  15178. * |----------------+----------------+----------------+----------------|
  15179. * | op_code | Rsvd | msg_type |
  15180. * |-------------------------------------------------------------------|
  15181. * | Rsvd | Response len |
  15182. * |-------------------------------------------------------------------|
  15183. * | |
  15184. * | Response-type specific info |
  15185. * | |
  15186. * | |
  15187. * |-------------------------------------------------------------------|
  15188. * Header fields:
  15189. * - MSG_TYPE
  15190. * Bits 7:0
  15191. * Purpose: Identifies this as WDI_IPA Operation Response message
  15192. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  15193. * - OP_CODE
  15194. * Bits 31:16
  15195. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  15196. * value: = enum htt_wdi_ipa_op_code
  15197. * - RSP_LEN
  15198. * Bits 16:0
  15199. * Purpose: length for the response-type specific info
  15200. * value: = length in bytes for response-type specific info
  15201. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  15202. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  15203. */
  15204. PREPACK struct htt_wdi_ipa_op_response_t
  15205. {
  15206. /* DWORD 0: flags and meta-data */
  15207. A_UINT32
  15208. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15209. reserved1: 8,
  15210. op_code: 16;
  15211. A_UINT32
  15212. rsp_len: 16,
  15213. reserved2: 16;
  15214. } POSTPACK;
  15215. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  15216. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  15217. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  15218. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  15219. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  15220. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  15221. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  15222. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  15223. do { \
  15224. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  15225. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  15226. } while (0)
  15227. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  15228. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  15229. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  15230. do { \
  15231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  15232. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  15233. } while (0)
  15234. enum htt_phy_mode {
  15235. htt_phy_mode_11a = 0,
  15236. htt_phy_mode_11g = 1,
  15237. htt_phy_mode_11b = 2,
  15238. htt_phy_mode_11g_only = 3,
  15239. htt_phy_mode_11na_ht20 = 4,
  15240. htt_phy_mode_11ng_ht20 = 5,
  15241. htt_phy_mode_11na_ht40 = 6,
  15242. htt_phy_mode_11ng_ht40 = 7,
  15243. htt_phy_mode_11ac_vht20 = 8,
  15244. htt_phy_mode_11ac_vht40 = 9,
  15245. htt_phy_mode_11ac_vht80 = 10,
  15246. htt_phy_mode_11ac_vht20_2g = 11,
  15247. htt_phy_mode_11ac_vht40_2g = 12,
  15248. htt_phy_mode_11ac_vht80_2g = 13,
  15249. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  15250. htt_phy_mode_11ac_vht160 = 15,
  15251. htt_phy_mode_max,
  15252. };
  15253. /**
  15254. * @brief target -> host HTT channel change indication
  15255. *
  15256. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  15257. *
  15258. * @details
  15259. * Specify when a channel change occurs.
  15260. * This allows the host to precisely determine which rx frames arrived
  15261. * on the old channel and which rx frames arrived on the new channel.
  15262. *
  15263. *|31 |7 0 |
  15264. *|-------------------------------------------+----------|
  15265. *| reserved | msg type |
  15266. *|------------------------------------------------------|
  15267. *| primary_chan_center_freq_mhz |
  15268. *|------------------------------------------------------|
  15269. *| contiguous_chan1_center_freq_mhz |
  15270. *|------------------------------------------------------|
  15271. *| contiguous_chan2_center_freq_mhz |
  15272. *|------------------------------------------------------|
  15273. *| phy_mode |
  15274. *|------------------------------------------------------|
  15275. *
  15276. * Header fields:
  15277. * - MSG_TYPE
  15278. * Bits 7:0
  15279. * Purpose: identifies this as a htt channel change indication message
  15280. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  15281. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  15282. * Bits 31:0
  15283. * Purpose: identify the (center of the) new 20 MHz primary channel
  15284. * Value: center frequency of the 20 MHz primary channel, in MHz units
  15285. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  15286. * Bits 31:0
  15287. * Purpose: identify the (center of the) contiguous frequency range
  15288. * comprising the new channel.
  15289. * For example, if the new channel is a 80 MHz channel extending
  15290. * 60 MHz beyond the primary channel, this field would be 30 larger
  15291. * than the primary channel center frequency field.
  15292. * Value: center frequency of the contiguous frequency range comprising
  15293. * the full channel in MHz units
  15294. * (80+80 channels also use the CONTIG_CHAN2 field)
  15295. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  15296. * Bits 31:0
  15297. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  15298. * within a VHT 80+80 channel.
  15299. * This field is only relevant for VHT 80+80 channels.
  15300. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  15301. * channel (arbitrary value for cases besides VHT 80+80)
  15302. * - PHY_MODE
  15303. * Bits 31:0
  15304. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  15305. * and band
  15306. * Value: htt_phy_mode enum value
  15307. */
  15308. PREPACK struct htt_chan_change_t
  15309. {
  15310. /* DWORD 0: flags and meta-data */
  15311. A_UINT32
  15312. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15313. reserved1: 24;
  15314. A_UINT32 primary_chan_center_freq_mhz;
  15315. A_UINT32 contig_chan1_center_freq_mhz;
  15316. A_UINT32 contig_chan2_center_freq_mhz;
  15317. A_UINT32 phy_mode;
  15318. } POSTPACK;
  15319. /*
  15320. * Due to historical / backwards-compatibility reasons, maintain the
  15321. * below htt_chan_change_msg struct definition, which needs to be
  15322. * consistent with the above htt_chan_change_t struct definition
  15323. * (aside from the htt_chan_change_t definition including the msg_type
  15324. * dword within the message, and the htt_chan_change_msg only containing
  15325. * the payload of the message that follows the msg_type dword).
  15326. */
  15327. PREPACK struct htt_chan_change_msg {
  15328. A_UINT32 chan_mhz; /* frequency in mhz */
  15329. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  15330. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  15331. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  15332. } POSTPACK;
  15333. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  15334. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  15335. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  15336. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  15337. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  15338. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  15339. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  15340. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  15341. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  15342. do { \
  15343. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  15344. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  15345. } while (0)
  15346. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  15347. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  15348. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  15349. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  15350. do { \
  15351. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  15352. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  15353. } while (0)
  15354. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  15355. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  15356. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  15357. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  15358. do { \
  15359. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  15360. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  15361. } while (0)
  15362. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  15363. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  15364. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  15365. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  15366. do { \
  15367. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  15368. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  15369. } while (0)
  15370. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  15371. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  15372. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  15373. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  15374. /**
  15375. * @brief rx offload packet error message
  15376. *
  15377. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  15378. *
  15379. * @details
  15380. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  15381. * of target payload like mic err.
  15382. *
  15383. * |31 24|23 16|15 8|7 0|
  15384. * |----------------+----------------+----------------+----------------|
  15385. * | tid | vdev_id | msg_sub_type | msg_type |
  15386. * |-------------------------------------------------------------------|
  15387. * : (sub-type dependent content) :
  15388. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15389. * Header fields:
  15390. * - msg_type
  15391. * Bits 7:0
  15392. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  15393. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  15394. * - msg_sub_type
  15395. * Bits 15:8
  15396. * Purpose: Identifies which type of rx error is reported by this message
  15397. * value: htt_rx_ofld_pkt_err_type
  15398. * - vdev_id
  15399. * Bits 23:16
  15400. * Purpose: Identifies which vdev received the erroneous rx frame
  15401. * value:
  15402. * - tid
  15403. * Bits 31:24
  15404. * Purpose: Identifies the traffic type of the rx frame
  15405. * value:
  15406. *
  15407. * - The payload fields used if the sub-type == MIC error are shown below.
  15408. * Note - MIC err is per MSDU, while PN is per MPDU.
  15409. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  15410. * with MIC err in A-MSDU case, so FW will send only one HTT message
  15411. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  15412. * instead of sending separate HTT messages for each wrong MSDU within
  15413. * the MPDU.
  15414. *
  15415. * |31 24|23 16|15 8|7 0|
  15416. * |----------------+----------------+----------------+----------------|
  15417. * | Rsvd | key_id | peer_id |
  15418. * |-------------------------------------------------------------------|
  15419. * | receiver MAC addr 31:0 |
  15420. * |-------------------------------------------------------------------|
  15421. * | Rsvd | receiver MAC addr 47:32 |
  15422. * |-------------------------------------------------------------------|
  15423. * | transmitter MAC addr 31:0 |
  15424. * |-------------------------------------------------------------------|
  15425. * | Rsvd | transmitter MAC addr 47:32 |
  15426. * |-------------------------------------------------------------------|
  15427. * | PN 31:0 |
  15428. * |-------------------------------------------------------------------|
  15429. * | Rsvd | PN 47:32 |
  15430. * |-------------------------------------------------------------------|
  15431. * - peer_id
  15432. * Bits 15:0
  15433. * Purpose: identifies which peer is frame is from
  15434. * value:
  15435. * - key_id
  15436. * Bits 23:16
  15437. * Purpose: identifies key_id of rx frame
  15438. * value:
  15439. * - RA_31_0 (receiver MAC addr 31:0)
  15440. * Bits 31:0
  15441. * Purpose: identifies by MAC address which vdev received the frame
  15442. * value: MAC address lower 4 bytes
  15443. * - RA_47_32 (receiver MAC addr 47:32)
  15444. * Bits 15:0
  15445. * Purpose: identifies by MAC address which vdev received the frame
  15446. * value: MAC address upper 2 bytes
  15447. * - TA_31_0 (transmitter MAC addr 31:0)
  15448. * Bits 31:0
  15449. * Purpose: identifies by MAC address which peer transmitted the frame
  15450. * value: MAC address lower 4 bytes
  15451. * - TA_47_32 (transmitter MAC addr 47:32)
  15452. * Bits 15:0
  15453. * Purpose: identifies by MAC address which peer transmitted the frame
  15454. * value: MAC address upper 2 bytes
  15455. * - PN_31_0
  15456. * Bits 31:0
  15457. * Purpose: Identifies pn of rx frame
  15458. * value: PN lower 4 bytes
  15459. * - PN_47_32
  15460. * Bits 15:0
  15461. * Purpose: Identifies pn of rx frame
  15462. * value:
  15463. * TKIP or CCMP: PN upper 2 bytes
  15464. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  15465. */
  15466. enum htt_rx_ofld_pkt_err_type {
  15467. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  15468. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  15469. };
  15470. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  15471. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  15472. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  15473. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  15474. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  15475. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  15476. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  15477. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  15478. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  15479. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  15480. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  15481. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  15482. do { \
  15483. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  15484. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  15485. } while (0)
  15486. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  15487. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  15488. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  15489. do { \
  15490. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  15491. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  15492. } while (0)
  15493. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  15494. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  15495. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  15496. do { \
  15497. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  15498. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  15499. } while (0)
  15500. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  15501. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  15502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  15503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  15504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  15505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  15506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  15507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  15508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  15509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  15510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  15511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  15512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  15513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  15514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  15515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  15516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  15517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  15518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  15519. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  15520. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  15521. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  15522. do { \
  15523. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  15524. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  15525. } while (0)
  15526. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  15527. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  15528. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  15529. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  15530. do { \
  15531. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  15532. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  15533. } while (0)
  15534. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  15535. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  15536. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  15537. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  15538. do { \
  15539. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  15540. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  15541. } while (0)
  15542. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  15543. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  15544. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  15545. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  15546. do { \
  15547. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  15548. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  15549. } while (0)
  15550. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  15551. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  15552. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  15553. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  15554. do { \
  15555. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  15556. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  15557. } while (0)
  15558. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  15559. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  15560. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  15561. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  15562. do { \
  15563. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  15564. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  15565. } while (0)
  15566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  15567. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  15568. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  15569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  15570. do { \
  15571. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  15572. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  15573. } while (0)
  15574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  15575. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  15576. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  15577. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  15578. do { \
  15579. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  15580. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  15581. } while (0)
  15582. /**
  15583. * @brief target -> host peer rate report message
  15584. *
  15585. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  15586. *
  15587. * @details
  15588. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  15589. * justified rate of all the peers.
  15590. *
  15591. * |31 24|23 16|15 8|7 0|
  15592. * |----------------+----------------+----------------+----------------|
  15593. * | peer_count | | msg_type |
  15594. * |-------------------------------------------------------------------|
  15595. * : Payload (variant number of peer rate report) :
  15596. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15597. * Header fields:
  15598. * - msg_type
  15599. * Bits 7:0
  15600. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  15601. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  15602. * - reserved
  15603. * Bits 15:8
  15604. * Purpose:
  15605. * value:
  15606. * - peer_count
  15607. * Bits 31:16
  15608. * Purpose: Specify how many peer rate report elements are present in the payload.
  15609. * value:
  15610. *
  15611. * Payload:
  15612. * There are variant number of peer rate report follow the first 32 bits.
  15613. * The peer rate report is defined as follows.
  15614. *
  15615. * |31 20|19 16|15 0|
  15616. * |-----------------------+---------+---------------------------------|-
  15617. * | reserved | phy | peer_id | \
  15618. * |-------------------------------------------------------------------| -> report #0
  15619. * | rate | /
  15620. * |-----------------------+---------+---------------------------------|-
  15621. * | reserved | phy | peer_id | \
  15622. * |-------------------------------------------------------------------| -> report #1
  15623. * | rate | /
  15624. * |-----------------------+---------+---------------------------------|-
  15625. * | reserved | phy | peer_id | \
  15626. * |-------------------------------------------------------------------| -> report #2
  15627. * | rate | /
  15628. * |-------------------------------------------------------------------|-
  15629. * : :
  15630. * : :
  15631. * : :
  15632. * :-------------------------------------------------------------------:
  15633. *
  15634. * - peer_id
  15635. * Bits 15:0
  15636. * Purpose: identify the peer
  15637. * value:
  15638. * - phy
  15639. * Bits 19:16
  15640. * Purpose: identify which phy is in use
  15641. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  15642. * Please see enum htt_peer_report_phy_type for detail.
  15643. * - reserved
  15644. * Bits 31:20
  15645. * Purpose:
  15646. * value:
  15647. * - rate
  15648. * Bits 31:0
  15649. * Purpose: represent the justified rate of the peer specified by peer_id
  15650. * value:
  15651. */
  15652. enum htt_peer_rate_report_phy_type {
  15653. HTT_PEER_RATE_REPORT_11B = 0,
  15654. HTT_PEER_RATE_REPORT_11A_G,
  15655. HTT_PEER_RATE_REPORT_11N,
  15656. HTT_PEER_RATE_REPORT_11AC,
  15657. };
  15658. #define HTT_PEER_RATE_REPORT_SIZE 8
  15659. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  15660. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  15661. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  15662. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  15663. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  15664. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  15665. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  15666. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  15667. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  15668. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  15669. do { \
  15670. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  15671. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  15672. } while (0)
  15673. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  15674. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  15675. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  15676. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  15677. do { \
  15678. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  15679. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  15680. } while (0)
  15681. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  15682. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  15683. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  15684. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  15685. do { \
  15686. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  15687. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  15688. } while (0)
  15689. /**
  15690. * @brief target -> host flow pool map message
  15691. *
  15692. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  15693. *
  15694. * @details
  15695. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  15696. * a flow of descriptors.
  15697. *
  15698. * This message is in TLV format and indicates the parameters to be setup a
  15699. * flow in the host. Each entry indicates that a particular flow ID is ready to
  15700. * receive descriptors from a specified pool.
  15701. *
  15702. * The message would appear as follows:
  15703. *
  15704. * |31 24|23 16|15 8|7 0|
  15705. * |----------------+----------------+----------------+----------------|
  15706. * header | reserved | num_flows | msg_type |
  15707. * |-------------------------------------------------------------------|
  15708. * | |
  15709. * : payload :
  15710. * | |
  15711. * |-------------------------------------------------------------------|
  15712. *
  15713. * The header field is one DWORD long and is interpreted as follows:
  15714. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  15715. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  15716. * this message
  15717. * b'16-31 - reserved: These bits are reserved for future use
  15718. *
  15719. * Payload:
  15720. * The payload would contain multiple objects of the following structure. Each
  15721. * object represents a flow.
  15722. *
  15723. * |31 24|23 16|15 8|7 0|
  15724. * |----------------+----------------+----------------+----------------|
  15725. * header | reserved | num_flows | msg_type |
  15726. * |-------------------------------------------------------------------|
  15727. * payload0| flow_type |
  15728. * |-------------------------------------------------------------------|
  15729. * | flow_id |
  15730. * |-------------------------------------------------------------------|
  15731. * | reserved0 | flow_pool_id |
  15732. * |-------------------------------------------------------------------|
  15733. * | reserved1 | flow_pool_size |
  15734. * |-------------------------------------------------------------------|
  15735. * | reserved2 |
  15736. * |-------------------------------------------------------------------|
  15737. * payload1| flow_type |
  15738. * |-------------------------------------------------------------------|
  15739. * | flow_id |
  15740. * |-------------------------------------------------------------------|
  15741. * | reserved0 | flow_pool_id |
  15742. * |-------------------------------------------------------------------|
  15743. * | reserved1 | flow_pool_size |
  15744. * |-------------------------------------------------------------------|
  15745. * | reserved2 |
  15746. * |-------------------------------------------------------------------|
  15747. * | . |
  15748. * | . |
  15749. * | . |
  15750. * |-------------------------------------------------------------------|
  15751. *
  15752. * Each payload is 5 DWORDS long and is interpreted as follows:
  15753. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  15754. * this flow is associated. It can be VDEV, peer,
  15755. * or tid (AC). Based on enum htt_flow_type.
  15756. *
  15757. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15758. * object. For flow_type vdev it is set to the
  15759. * vdevid, for peer it is peerid and for tid, it is
  15760. * tid_num.
  15761. *
  15762. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  15763. * in the host for this flow
  15764. * b'16:31 - reserved0: This field in reserved for the future. In case
  15765. * we have a hierarchical implementation (HCM) of
  15766. * pools, it can be used to indicate the ID of the
  15767. * parent-pool.
  15768. *
  15769. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  15770. * Descriptors for this flow will be
  15771. * allocated from this pool in the host.
  15772. * b'16:31 - reserved1: This field in reserved for the future. In case
  15773. * we have a hierarchical implementation of pools,
  15774. * it can be used to indicate the max number of
  15775. * descriptors in the pool. The b'0:15 can be used
  15776. * to indicate min number of descriptors in the
  15777. * HCM scheme.
  15778. *
  15779. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  15780. * we have a hierarchical implementation of pools,
  15781. * b'0:15 can be used to indicate the
  15782. * priority-based borrowing (PBB) threshold of
  15783. * the flow's pool. The b'16:31 are still left
  15784. * reserved.
  15785. */
  15786. enum htt_flow_type {
  15787. FLOW_TYPE_VDEV = 0,
  15788. /* Insert new flow types above this line */
  15789. };
  15790. PREPACK struct htt_flow_pool_map_payload_t {
  15791. A_UINT32 flow_type;
  15792. A_UINT32 flow_id;
  15793. A_UINT32 flow_pool_id:16,
  15794. reserved0:16;
  15795. A_UINT32 flow_pool_size:16,
  15796. reserved1:16;
  15797. A_UINT32 reserved2;
  15798. } POSTPACK;
  15799. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  15800. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  15801. (sizeof(struct htt_flow_pool_map_payload_t))
  15802. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  15803. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  15804. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  15805. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  15806. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  15807. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  15808. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  15809. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  15810. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  15811. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  15812. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  15813. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  15814. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  15815. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  15816. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  15817. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  15818. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  15819. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  15820. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  15821. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  15822. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  15823. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  15824. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  15825. do { \
  15826. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  15827. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  15828. } while (0)
  15829. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  15830. do { \
  15831. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  15832. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  15833. } while (0)
  15834. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  15835. do { \
  15836. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  15837. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  15838. } while (0)
  15839. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  15840. do { \
  15841. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  15842. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  15843. } while (0)
  15844. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  15845. do { \
  15846. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  15847. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  15848. } while (0)
  15849. /**
  15850. * @brief target -> host flow pool unmap message
  15851. *
  15852. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15853. *
  15854. * @details
  15855. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15856. * down a flow of descriptors.
  15857. * This message indicates that for the flow (whose ID is provided) is wanting
  15858. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15859. * pool of descriptors from where descriptors are being allocated for this
  15860. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15861. * be unmapped by the host.
  15862. *
  15863. * The message would appear as follows:
  15864. *
  15865. * |31 24|23 16|15 8|7 0|
  15866. * |----------------+----------------+----------------+----------------|
  15867. * | reserved0 | msg_type |
  15868. * |-------------------------------------------------------------------|
  15869. * | flow_type |
  15870. * |-------------------------------------------------------------------|
  15871. * | flow_id |
  15872. * |-------------------------------------------------------------------|
  15873. * | reserved1 | flow_pool_id |
  15874. * |-------------------------------------------------------------------|
  15875. *
  15876. * The message is interpreted as follows:
  15877. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15878. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15879. * b'8:31 - reserved0: Reserved for future use
  15880. *
  15881. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15882. * this flow is associated. It can be VDEV, peer,
  15883. * or tid (AC). Based on enum htt_flow_type.
  15884. *
  15885. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15886. * object. For flow_type vdev it is set to the
  15887. * vdevid, for peer it is peerid and for tid, it is
  15888. * tid_num.
  15889. *
  15890. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15891. * used in the host for this flow
  15892. * b'16:31 - reserved0: This field in reserved for the future.
  15893. *
  15894. */
  15895. PREPACK struct htt_flow_pool_unmap_t {
  15896. A_UINT32 msg_type:8,
  15897. reserved0:24;
  15898. A_UINT32 flow_type;
  15899. A_UINT32 flow_id;
  15900. A_UINT32 flow_pool_id:16,
  15901. reserved1:16;
  15902. } POSTPACK;
  15903. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15904. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15905. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15906. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15907. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15908. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15909. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15910. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15911. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15912. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15913. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15914. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15915. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15916. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15917. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15918. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15919. do { \
  15920. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15921. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15922. } while (0)
  15923. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15924. do { \
  15925. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15926. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15927. } while (0)
  15928. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15929. do { \
  15930. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15931. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15932. } while (0)
  15933. /**
  15934. * @brief target -> host SRING setup done message
  15935. *
  15936. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15937. *
  15938. * @details
  15939. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15940. * SRNG ring setup is done
  15941. *
  15942. * This message indicates whether the last setup operation is successful.
  15943. * It will be sent to host when host set respose_required bit in
  15944. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15945. * The message would appear as follows:
  15946. *
  15947. * |31 24|23 16|15 8|7 0|
  15948. * |--------------- +----------------+----------------+----------------|
  15949. * | setup_status | ring_id | pdev_id | msg_type |
  15950. * |-------------------------------------------------------------------|
  15951. *
  15952. * The message is interpreted as follows:
  15953. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15954. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15955. * b'8:15 - pdev_id:
  15956. * 0 (for rings at SOC/UMAC level),
  15957. * 1/2/3 mac id (for rings at LMAC level)
  15958. * b'16:23 - ring_id: Identify the ring which is set up
  15959. * More details can be got from enum htt_srng_ring_id
  15960. * b'24:31 - setup_status: Indicate status of setup operation
  15961. * Refer to htt_ring_setup_status
  15962. */
  15963. PREPACK struct htt_sring_setup_done_t {
  15964. A_UINT32 msg_type: 8,
  15965. pdev_id: 8,
  15966. ring_id: 8,
  15967. setup_status: 8;
  15968. } POSTPACK;
  15969. enum htt_ring_setup_status {
  15970. htt_ring_setup_status_ok = 0,
  15971. htt_ring_setup_status_error,
  15972. };
  15973. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15974. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15975. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15976. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15977. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15978. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15979. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15980. do { \
  15981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15982. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15983. } while (0)
  15984. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15985. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15986. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15987. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15988. HTT_SRING_SETUP_DONE_RING_ID_S)
  15989. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15990. do { \
  15991. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15992. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15993. } while (0)
  15994. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15995. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15996. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15997. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15998. HTT_SRING_SETUP_DONE_STATUS_S)
  15999. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  16000. do { \
  16001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  16002. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  16003. } while (0)
  16004. /**
  16005. * @brief target -> flow map flow info
  16006. *
  16007. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  16008. *
  16009. * @details
  16010. * HTT TX map flow entry with tqm flow pointer
  16011. * Sent from firmware to host to add tqm flow pointer in corresponding
  16012. * flow search entry. Flow metadata is replayed back to host as part of this
  16013. * struct to enable host to find the specific flow search entry
  16014. *
  16015. * The message would appear as follows:
  16016. *
  16017. * |31 28|27 18|17 14|13 8|7 0|
  16018. * |-------+------------------------------------------+----------------|
  16019. * | rsvd0 | fse_hsh_idx | msg_type |
  16020. * |-------------------------------------------------------------------|
  16021. * | rsvd1 | tid | peer_id |
  16022. * |-------------------------------------------------------------------|
  16023. * | tqm_flow_pntr_lo |
  16024. * |-------------------------------------------------------------------|
  16025. * | tqm_flow_pntr_hi |
  16026. * |-------------------------------------------------------------------|
  16027. * | fse_meta_data |
  16028. * |-------------------------------------------------------------------|
  16029. *
  16030. * The message is interpreted as follows:
  16031. *
  16032. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  16033. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  16034. *
  16035. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  16036. * for this flow entry
  16037. *
  16038. * dword0 - b'28:31 - rsvd0: Reserved for future use
  16039. *
  16040. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  16041. *
  16042. * dword1 - b'14:17 - tid
  16043. *
  16044. * dword1 - b'18:31 - rsvd1: Reserved for future use
  16045. *
  16046. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  16047. *
  16048. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  16049. *
  16050. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  16051. * given by host
  16052. */
  16053. PREPACK struct htt_tx_map_flow_info {
  16054. A_UINT32
  16055. msg_type: 8,
  16056. fse_hsh_idx: 20,
  16057. rsvd0: 4;
  16058. A_UINT32
  16059. peer_id: 14,
  16060. tid: 4,
  16061. rsvd1: 14;
  16062. A_UINT32 tqm_flow_pntr_lo;
  16063. A_UINT32 tqm_flow_pntr_hi;
  16064. struct htt_tx_flow_metadata fse_meta_data;
  16065. } POSTPACK;
  16066. /* DWORD 0 */
  16067. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  16068. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  16069. /* DWORD 1 */
  16070. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  16071. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  16072. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  16073. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  16074. /* DWORD 0 */
  16075. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  16076. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  16077. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  16078. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  16079. do { \
  16080. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  16081. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  16082. } while (0)
  16083. /* DWORD 1 */
  16084. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  16085. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  16086. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  16087. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  16088. do { \
  16089. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  16090. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  16091. } while (0)
  16092. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  16093. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  16094. HTT_TX_MAP_FLOW_INFO_TID_S)
  16095. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  16096. do { \
  16097. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  16098. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  16099. } while (0)
  16100. /*
  16101. * htt_dbg_ext_stats_status -
  16102. * present - The requested stats have been delivered in full.
  16103. * This indicates that either the stats information was contained
  16104. * in its entirety within this message, or else this message
  16105. * completes the delivery of the requested stats info that was
  16106. * partially delivered through earlier STATS_CONF messages.
  16107. * partial - The requested stats have been delivered in part.
  16108. * One or more subsequent STATS_CONF messages with the same
  16109. * cookie value will be sent to deliver the remainder of the
  16110. * information.
  16111. * error - The requested stats could not be delivered, for example due
  16112. * to a shortage of memory to construct a message holding the
  16113. * requested stats.
  16114. * invalid - The requested stat type is either not recognized, or the
  16115. * target is configured to not gather the stats type in question.
  16116. */
  16117. enum htt_dbg_ext_stats_status {
  16118. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  16119. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  16120. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  16121. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  16122. };
  16123. /**
  16124. * @brief target -> host ppdu stats upload
  16125. *
  16126. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  16127. *
  16128. * @details
  16129. * The following field definitions describe the format of the HTT target
  16130. * to host ppdu stats indication message.
  16131. *
  16132. *
  16133. * |31 16|15 12|11 10|9 8|7 0 |
  16134. * |----------------------------------------------------------------------|
  16135. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  16136. * |----------------------------------------------------------------------|
  16137. * | ppdu_id |
  16138. * |----------------------------------------------------------------------|
  16139. * | Timestamp in us |
  16140. * |----------------------------------------------------------------------|
  16141. * | reserved |
  16142. * |----------------------------------------------------------------------|
  16143. * | type-specific stats info |
  16144. * | (see htt_ppdu_stats.h) |
  16145. * |----------------------------------------------------------------------|
  16146. * Header fields:
  16147. * - MSG_TYPE
  16148. * Bits 7:0
  16149. * Purpose: Identifies this is a PPDU STATS indication
  16150. * message.
  16151. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  16152. * - mac_id
  16153. * Bits 9:8
  16154. * Purpose: mac_id of this ppdu_id
  16155. * Value: 0-3
  16156. * - pdev_id
  16157. * Bits 11:10
  16158. * Purpose: pdev_id of this ppdu_id
  16159. * Value: 0-3
  16160. * 0 (for rings at SOC level),
  16161. * 1/2/3 PDEV -> 0/1/2
  16162. * - payload_size
  16163. * Bits 31:16
  16164. * Purpose: total tlv size
  16165. * Value: payload_size in bytes
  16166. */
  16167. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  16168. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  16169. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  16170. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  16171. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  16172. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  16173. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  16174. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  16175. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  16176. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  16177. do { \
  16178. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  16179. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  16180. } while (0)
  16181. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  16182. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  16183. HTT_T2H_PPDU_STATS_MAC_ID_S)
  16184. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  16185. do { \
  16186. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  16187. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  16188. } while (0)
  16189. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  16190. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  16191. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  16192. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  16193. do { \
  16194. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  16195. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  16196. } while (0)
  16197. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  16198. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  16199. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  16200. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  16201. do { \
  16202. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  16203. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  16204. } while (0)
  16205. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  16206. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  16207. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  16208. /* htt_t2h_ppdu_stats_ind_hdr_t
  16209. * This struct contains the fields within the header of the
  16210. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  16211. * stats info.
  16212. * This struct assumes little-endian layout, and thus is only
  16213. * suitable for use within processors known to be little-endian
  16214. * (such as the target).
  16215. * In contrast, the above macros provide endian-portable methods
  16216. * to get and set the bitfields within this PPDU_STATS_IND header.
  16217. */
  16218. typedef struct {
  16219. A_UINT32 msg_type: 8, /* bits 7:0 */
  16220. mac_id: 2, /* bits 9:8 */
  16221. pdev_id: 2, /* bits 11:10 */
  16222. reserved1: 4, /* bits 15:12 */
  16223. payload_size: 16; /* bits 31:16 */
  16224. A_UINT32 ppdu_id;
  16225. A_UINT32 timestamp_us;
  16226. A_UINT32 reserved2;
  16227. } htt_t2h_ppdu_stats_ind_hdr_t;
  16228. /**
  16229. * @brief target -> host extended statistics upload
  16230. *
  16231. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  16232. *
  16233. * @details
  16234. * The following field definitions describe the format of the HTT target
  16235. * to host stats upload confirmation message.
  16236. * The message contains a cookie echoed from the HTT host->target stats
  16237. * upload request, which identifies which request the confirmation is
  16238. * for, and a single stats can span over multiple HTT stats indication
  16239. * due to the HTT message size limitation so every HTT ext stats indication
  16240. * will have tag-length-value stats information elements.
  16241. * The tag-length header for each HTT stats IND message also includes a
  16242. * status field, to indicate whether the request for the stat type in
  16243. * question was fully met, partially met, unable to be met, or invalid
  16244. * (if the stat type in question is disabled in the target).
  16245. * A Done bit 1's indicate the end of the of stats info elements.
  16246. *
  16247. *
  16248. * |31 16|15 12|11|10 8|7 5|4 0|
  16249. * |--------------------------------------------------------------|
  16250. * | reserved | msg type |
  16251. * |--------------------------------------------------------------|
  16252. * | cookie LSBs |
  16253. * |--------------------------------------------------------------|
  16254. * | cookie MSBs |
  16255. * |--------------------------------------------------------------|
  16256. * | stats entry length | rsvd | D| S | stat type |
  16257. * |--------------------------------------------------------------|
  16258. * | type-specific stats info |
  16259. * | (see htt_stats.h) |
  16260. * |--------------------------------------------------------------|
  16261. * Header fields:
  16262. * - MSG_TYPE
  16263. * Bits 7:0
  16264. * Purpose: Identifies this is a extended statistics upload confirmation
  16265. * message.
  16266. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  16267. * - COOKIE_LSBS
  16268. * Bits 31:0
  16269. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16270. * message with its preceding host->target stats request message.
  16271. * Value: LSBs of the opaque cookie specified by the host-side requestor
  16272. * - COOKIE_MSBS
  16273. * Bits 31:0
  16274. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16275. * message with its preceding host->target stats request message.
  16276. * Value: MSBs of the opaque cookie specified by the host-side requestor
  16277. *
  16278. * Stats Information Element tag-length header fields:
  16279. * - STAT_TYPE
  16280. * Bits 7:0
  16281. * Purpose: identifies the type of statistics info held in the
  16282. * following information element
  16283. * Value: htt_dbg_ext_stats_type
  16284. * - STATUS
  16285. * Bits 10:8
  16286. * Purpose: indicate whether the requested stats are present
  16287. * Value: htt_dbg_ext_stats_status
  16288. * - DONE
  16289. * Bits 11
  16290. * Purpose:
  16291. * Indicates the completion of the stats entry, this will be the last
  16292. * stats conf HTT segment for the requested stats type.
  16293. * Value:
  16294. * 0 -> the stats retrieval is ongoing
  16295. * 1 -> the stats retrieval is complete
  16296. * - LENGTH
  16297. * Bits 31:16
  16298. * Purpose: indicate the stats information size
  16299. * Value: This field specifies the number of bytes of stats information
  16300. * that follows the element tag-length header.
  16301. * It is expected but not required that this length is a multiple of
  16302. * 4 bytes.
  16303. */
  16304. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  16305. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  16306. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  16307. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  16308. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  16309. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  16310. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  16311. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  16312. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  16313. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  16314. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  16315. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  16316. do { \
  16317. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  16318. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  16319. } while (0)
  16320. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  16321. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  16322. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  16323. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  16324. do { \
  16325. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  16326. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  16327. } while (0)
  16328. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  16329. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  16330. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  16331. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  16332. do { \
  16333. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  16334. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  16335. } while (0)
  16336. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  16337. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  16338. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  16339. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  16340. do { \
  16341. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  16342. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  16343. } while (0)
  16344. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  16345. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  16346. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  16347. /**
  16348. * @brief target -> host streaming statistics upload
  16349. *
  16350. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  16351. *
  16352. * @details
  16353. * The following field definitions describe the format of the HTT target
  16354. * to host streaming stats upload indication message.
  16355. * The host can use a STREAMING_STATS_REQ message to enable the target to
  16356. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  16357. * use the STREAMING_STATS_REQ message to halt the target's production of
  16358. * STREAMING_STATS_IND messages.
  16359. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  16360. * the stats enabled by the host's STREAMING_STATS_REQ message.
  16361. *
  16362. * |31 8|7 0|
  16363. * |--------------------------------------------------------------|
  16364. * | reserved | msg type |
  16365. * |--------------------------------------------------------------|
  16366. * | type-specific stats info |
  16367. * | (see htt_stats.h) |
  16368. * |--------------------------------------------------------------|
  16369. * Header fields:
  16370. * - MSG_TYPE
  16371. * Bits 7:0
  16372. * Purpose: Identifies this as a streaming statistics upload indication
  16373. * message.
  16374. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  16375. */
  16376. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  16377. typedef enum {
  16378. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  16379. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  16380. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  16381. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  16382. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  16383. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  16384. /* Reserved from 128 - 255 for target internal use.*/
  16385. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  16386. } HTT_PEER_TYPE;
  16387. /** macro to convert MAC address from char array to HTT word format */
  16388. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  16389. (phtt_mac_addr)->mac_addr31to0 = \
  16390. (((c_macaddr)[0] << 0) | \
  16391. ((c_macaddr)[1] << 8) | \
  16392. ((c_macaddr)[2] << 16) | \
  16393. ((c_macaddr)[3] << 24)); \
  16394. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  16395. } while (0)
  16396. /**
  16397. * @brief target -> host monitor mac header indication message
  16398. *
  16399. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  16400. *
  16401. * @details
  16402. * The following diagram shows the format of the monitor mac header message
  16403. * sent from the target to the host.
  16404. * This message is primarily sent when promiscuous rx mode is enabled.
  16405. * One message is sent per rx PPDU.
  16406. *
  16407. * |31 24|23 16|15 8|7 0|
  16408. * |-------------------------------------------------------------|
  16409. * | peer_id | reserved0 | msg_type |
  16410. * |-------------------------------------------------------------|
  16411. * | reserved1 | num_mpdu |
  16412. * |-------------------------------------------------------------|
  16413. * | struct hw_rx_desc |
  16414. * | (see wal_rx_desc.h) |
  16415. * |-------------------------------------------------------------|
  16416. * | struct ieee80211_frame_addr4 |
  16417. * | (see ieee80211_defs.h) |
  16418. * |-------------------------------------------------------------|
  16419. * | struct ieee80211_frame_addr4 |
  16420. * | (see ieee80211_defs.h) |
  16421. * |-------------------------------------------------------------|
  16422. * | ...... |
  16423. * |-------------------------------------------------------------|
  16424. *
  16425. * Header fields:
  16426. * - msg_type
  16427. * Bits 7:0
  16428. * Purpose: Identifies this is a monitor mac header indication message.
  16429. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  16430. * - peer_id
  16431. * Bits 31:16
  16432. * Purpose: Software peer id given by host during association,
  16433. * During promiscuous mode, the peer ID will be invalid (0xFF)
  16434. * for rx PPDUs received from unassociated peers.
  16435. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  16436. * - num_mpdu
  16437. * Bits 15:0
  16438. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  16439. * delivered within the message.
  16440. * Value: 1 to 32
  16441. * num_mpdu is limited to a maximum value of 32, due to buffer
  16442. * size limits. For PPDUs with more than 32 MPDUs, only the
  16443. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  16444. * the PPDU will be provided.
  16445. */
  16446. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  16447. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  16448. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  16449. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  16450. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  16451. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  16452. do { \
  16453. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  16454. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  16455. } while (0)
  16456. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  16457. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  16458. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  16459. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  16460. do { \
  16461. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  16462. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  16463. } while (0)
  16464. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  16465. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  16466. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  16467. /**
  16468. * @brief target -> host flow pool resize Message
  16469. *
  16470. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  16471. *
  16472. * @details
  16473. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  16474. * the flow pool associated with the specified ID is resized
  16475. *
  16476. * The message would appear as follows:
  16477. *
  16478. * |31 16|15 8|7 0|
  16479. * |---------------------------------+----------------+----------------|
  16480. * | reserved0 | Msg type |
  16481. * |-------------------------------------------------------------------|
  16482. * | flow pool new size | flow pool ID |
  16483. * |-------------------------------------------------------------------|
  16484. *
  16485. * The message is interpreted as follows:
  16486. * b'0:7 - msg_type: This will be set to 0x21
  16487. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  16488. *
  16489. * b'0:15 - flow pool ID: Existing flow pool ID
  16490. *
  16491. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  16492. *
  16493. */
  16494. PREPACK struct htt_flow_pool_resize_t {
  16495. A_UINT32 msg_type:8,
  16496. reserved0:24;
  16497. A_UINT32 flow_pool_id:16,
  16498. flow_pool_new_size:16;
  16499. } POSTPACK;
  16500. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  16501. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  16502. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  16503. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  16504. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  16505. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  16506. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  16507. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  16508. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  16509. do { \
  16510. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  16511. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  16512. } while (0)
  16513. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  16514. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  16515. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  16516. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  16517. do { \
  16518. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  16519. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  16520. } while (0)
  16521. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  16522. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  16523. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  16524. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  16525. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  16526. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  16527. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  16528. /*
  16529. * The read and write indices point to the data within the host buffer.
  16530. * Because the first 4 bytes of the host buffer is used for the read index and
  16531. * the next 4 bytes for the write index, the data itself starts at offset 8.
  16532. * The read index and write index are the byte offsets from the base of the
  16533. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  16534. * Refer the ASCII text picture below.
  16535. */
  16536. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  16537. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  16538. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  16539. /*
  16540. ***************************************************************************
  16541. *
  16542. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16543. *
  16544. ***************************************************************************
  16545. *
  16546. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  16547. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  16548. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  16549. * written into the Host memory region mentioned below.
  16550. *
  16551. * Read index is updated by the Host. At any point of time, the read index will
  16552. * indicate the index that will next be read by the Host. The read index is
  16553. * in units of bytes offset from the base of the meta-data buffer.
  16554. *
  16555. * Write index is updated by the FW. At any point of time, the write index will
  16556. * indicate from where the FW can start writing any new data. The write index is
  16557. * in units of bytes offset from the base of the meta-data buffer.
  16558. *
  16559. * If the Host is not fast enough in reading the CFR data, any new capture data
  16560. * would be dropped if there is no space left to write the new captures.
  16561. *
  16562. * The last 4 bytes of the memory region will have the magic pattern
  16563. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  16564. * not overrun the host buffer.
  16565. *
  16566. * ,--------------------. read and write indices store the
  16567. * | | byte offset from the base of the
  16568. * | ,--------+--------. meta-data buffer to the next
  16569. * | | | | location within the data buffer
  16570. * | | v v that will be read / written
  16571. * ************************************************************************
  16572. * * Read * Write * * Magic *
  16573. * * index * index * CFR data1 ...... CFR data N * pattern *
  16574. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  16575. * ************************************************************************
  16576. * |<---------- data buffer ---------->|
  16577. *
  16578. * |<----------------- meta-data buffer allocated in Host ----------------|
  16579. *
  16580. * Note:
  16581. * - Considering the 4 bytes needed to store the Read index (R) and the
  16582. * Write index (W), the initial value is as follows:
  16583. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  16584. * - Buffer empty condition:
  16585. * R = W
  16586. *
  16587. * Regarding CFR data format:
  16588. * --------------------------
  16589. *
  16590. * Each CFR tone is stored in HW as 16-bits with the following format:
  16591. * {bits[15:12], bits[11:6], bits[5:0]} =
  16592. * {unsigned exponent (4 bits),
  16593. * signed mantissa_real (6 bits),
  16594. * signed mantissa_imag (6 bits)}
  16595. *
  16596. * CFR_real = mantissa_real * 2^(exponent-5)
  16597. * CFR_imag = mantissa_imag * 2^(exponent-5)
  16598. *
  16599. *
  16600. * The CFR data is written to the 16-bit unsigned output array (buff) in
  16601. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  16602. *
  16603. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  16604. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  16605. * .
  16606. * .
  16607. * .
  16608. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  16609. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  16610. */
  16611. /* Bandwidth of peer CFR captures */
  16612. typedef enum {
  16613. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  16614. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  16615. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  16616. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  16617. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  16618. HTT_PEER_CFR_CAPTURE_BW_MAX,
  16619. } HTT_PEER_CFR_CAPTURE_BW;
  16620. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  16621. * was captured
  16622. */
  16623. typedef enum {
  16624. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  16625. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  16626. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  16627. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  16628. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  16629. } HTT_PEER_CFR_CAPTURE_MODE;
  16630. typedef enum {
  16631. /* This message type is currently used for the below purpose:
  16632. *
  16633. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  16634. * wmi_peer_cfr_capture_cmd.
  16635. * If payload_present bit is set to 0 then the associated memory region
  16636. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  16637. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  16638. * message; the CFR dump will be present at the end of the message,
  16639. * after the chan_phy_mode.
  16640. */
  16641. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  16642. /* Always keep this last */
  16643. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  16644. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  16645. /**
  16646. * @brief target -> host CFR dump completion indication message definition
  16647. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  16648. *
  16649. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  16650. *
  16651. * @details
  16652. * The following diagram shows the format of the Channel Frequency Response
  16653. * (CFR) dump completion indication. This inidcation is sent to the Host when
  16654. * the channel capture of a peer is copied by Firmware into the Host memory
  16655. *
  16656. * **************************************************************************
  16657. *
  16658. * Message format when the CFR capture message type is
  16659. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16660. *
  16661. * **************************************************************************
  16662. *
  16663. * |31 16|15 |8|7 0|
  16664. * |----------------------------------------------------------------|
  16665. * header: | reserved |P| msg_type |
  16666. * word 0 | | | |
  16667. * |----------------------------------------------------------------|
  16668. * payload: | cfr_capture_msg_type |
  16669. * word 1 | |
  16670. * |----------------------------------------------------------------|
  16671. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  16672. * word 2 | | | | | | | | |
  16673. * |----------------------------------------------------------------|
  16674. * | mac_addr31to0 |
  16675. * word 3 | |
  16676. * |----------------------------------------------------------------|
  16677. * | unused / reserved | mac_addr47to32 |
  16678. * word 4 | | |
  16679. * |----------------------------------------------------------------|
  16680. * | index |
  16681. * word 5 | |
  16682. * |----------------------------------------------------------------|
  16683. * | length |
  16684. * word 6 | |
  16685. * |----------------------------------------------------------------|
  16686. * | timestamp |
  16687. * word 7 | |
  16688. * |----------------------------------------------------------------|
  16689. * | counter |
  16690. * word 8 | |
  16691. * |----------------------------------------------------------------|
  16692. * | chan_mhz |
  16693. * word 9 | |
  16694. * |----------------------------------------------------------------|
  16695. * | band_center_freq1 |
  16696. * word 10 | |
  16697. * |----------------------------------------------------------------|
  16698. * | band_center_freq2 |
  16699. * word 11 | |
  16700. * |----------------------------------------------------------------|
  16701. * | chan_phy_mode |
  16702. * word 12 | |
  16703. * |----------------------------------------------------------------|
  16704. * where,
  16705. * P - payload present bit (payload_present explained below)
  16706. * req_id - memory request id (mem_req_id explained below)
  16707. * S - status field (status explained below)
  16708. * capbw - capture bandwidth (capture_bw explained below)
  16709. * mode - mode of capture (mode explained below)
  16710. * sts - space time streams (sts_count explained below)
  16711. * chbw - channel bandwidth (channel_bw explained below)
  16712. * captype - capture type (cap_type explained below)
  16713. *
  16714. * The following field definitions describe the format of the CFR dump
  16715. * completion indication sent from the target to the host
  16716. *
  16717. * Header fields:
  16718. *
  16719. * Word 0
  16720. * - msg_type
  16721. * Bits 7:0
  16722. * Purpose: Identifies this as CFR TX completion indication
  16723. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  16724. * - payload_present
  16725. * Bit 8
  16726. * Purpose: Identifies how CFR data is sent to host
  16727. * Value: 0 - If CFR Payload is written to host memory
  16728. * 1 - If CFR Payload is sent as part of HTT message
  16729. * (This is the requirement for SDIO/USB where it is
  16730. * not possible to write CFR data to host memory)
  16731. * - reserved
  16732. * Bits 31:9
  16733. * Purpose: Reserved
  16734. * Value: 0
  16735. *
  16736. * Payload fields:
  16737. *
  16738. * Word 1
  16739. * - cfr_capture_msg_type
  16740. * Bits 31:0
  16741. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  16742. * to specify the format used for the remainder of the message
  16743. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16744. * (currently only MSG_TYPE_1 is defined)
  16745. *
  16746. * Word 2
  16747. * - mem_req_id
  16748. * Bits 6:0
  16749. * Purpose: Contain the mem request id of the region where the CFR capture
  16750. * has been stored - of type WMI_HOST_MEM_REQ_ID
  16751. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  16752. this value is invalid)
  16753. * - status
  16754. * Bit 7
  16755. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  16756. * Value: 1 (True) - Successful; 0 (False) - Not successful
  16757. * - capture_bw
  16758. * Bits 10:8
  16759. * Purpose: Carry the bandwidth of the CFR capture
  16760. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  16761. * - mode
  16762. * Bits 13:11
  16763. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  16764. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  16765. * - sts_count
  16766. * Bits 16:14
  16767. * Purpose: Carry the number of space time streams
  16768. * Value: Number of space time streams
  16769. * - channel_bw
  16770. * Bits 19:17
  16771. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  16772. * measurement
  16773. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  16774. * - cap_type
  16775. * Bits 23:20
  16776. * Purpose: Carry the type of the capture
  16777. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  16778. * - vdev_id
  16779. * Bits 31:24
  16780. * Purpose: Carry the virtual device id
  16781. * Value: vdev ID
  16782. *
  16783. * Word 3
  16784. * - mac_addr31to0
  16785. * Bits 31:0
  16786. * Purpose: Contain the bits 31:0 of the peer MAC address
  16787. * Value: Bits 31:0 of the peer MAC address
  16788. *
  16789. * Word 4
  16790. * - mac_addr47to32
  16791. * Bits 15:0
  16792. * Purpose: Contain the bits 47:32 of the peer MAC address
  16793. * Value: Bits 47:32 of the peer MAC address
  16794. *
  16795. * Word 5
  16796. * - index
  16797. * Bits 31:0
  16798. * Purpose: Contain the index at which this CFR dump was written in the Host
  16799. * allocated memory. This index is the number of bytes from the base address.
  16800. * Value: Index position
  16801. *
  16802. * Word 6
  16803. * - length
  16804. * Bits 31:0
  16805. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  16806. * Value: Length of the CFR capture of the peer
  16807. *
  16808. * Word 7
  16809. * - timestamp
  16810. * Bits 31:0
  16811. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  16812. * clock used for this timestamp is private to the target and not visible to
  16813. * the host i.e., Host can interpret only the relative timestamp deltas from
  16814. * one message to the next, but can't interpret the absolute timestamp from a
  16815. * single message.
  16816. * Value: Timestamp in microseconds
  16817. *
  16818. * Word 8
  16819. * - counter
  16820. * Bits 31:0
  16821. * Purpose: Carry the count of the current CFR capture from FW. This is
  16822. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  16823. * in host memory)
  16824. * Value: Count of the current CFR capture
  16825. *
  16826. * Word 9
  16827. * - chan_mhz
  16828. * Bits 31:0
  16829. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  16830. * Value: Primary 20 channel frequency
  16831. *
  16832. * Word 10
  16833. * - band_center_freq1
  16834. * Bits 31:0
  16835. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  16836. * Value: Center frequency 1 in MHz
  16837. *
  16838. * Word 11
  16839. * - band_center_freq2
  16840. * Bits 31:0
  16841. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  16842. * the VDEV
  16843. * 80plus80 mode
  16844. * Value: Center frequency 2 in MHz
  16845. *
  16846. * Word 12
  16847. * - chan_phy_mode
  16848. * Bits 31:0
  16849. * Purpose: Carry the phy mode of the channel, of the VDEV
  16850. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16851. */
  16852. PREPACK struct htt_cfr_dump_ind_type_1 {
  16853. A_UINT32 mem_req_id:7,
  16854. status:1,
  16855. capture_bw:3,
  16856. mode:3,
  16857. sts_count:3,
  16858. channel_bw:3,
  16859. cap_type:4,
  16860. vdev_id:8;
  16861. htt_mac_addr addr;
  16862. A_UINT32 index;
  16863. A_UINT32 length;
  16864. A_UINT32 timestamp;
  16865. A_UINT32 counter;
  16866. struct htt_chan_change_msg chan;
  16867. } POSTPACK;
  16868. PREPACK struct htt_cfr_dump_compl_ind {
  16869. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16870. union {
  16871. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16872. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16873. /* If there is a need to change the memory layout and its associated
  16874. * HTT indication format, a new CFR capture message type can be
  16875. * introduced and added into this union.
  16876. */
  16877. };
  16878. } POSTPACK;
  16879. /*
  16880. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16881. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16882. */
  16883. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16884. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16885. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16886. do { \
  16887. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16888. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16889. } while(0)
  16890. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16891. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16892. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16893. /*
  16894. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16895. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16896. */
  16897. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16898. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16899. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16900. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16901. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16902. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16903. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16904. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16905. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16906. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16907. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16908. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16909. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16910. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16911. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16912. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16913. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16914. do { \
  16915. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16916. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16917. } while (0)
  16918. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16919. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16920. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16921. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16922. do { \
  16923. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16924. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16925. } while (0)
  16926. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16927. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16928. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16929. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16930. do { \
  16931. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16932. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16933. } while (0)
  16934. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16935. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16936. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16937. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16938. do { \
  16939. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16940. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16941. } while (0)
  16942. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16943. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16944. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16945. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16946. do { \
  16947. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16948. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16949. } while (0)
  16950. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16951. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16952. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16953. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16954. do { \
  16955. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16956. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16957. } while (0)
  16958. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16959. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16960. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16961. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16962. do { \
  16963. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16964. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16965. } while (0)
  16966. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16967. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16968. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16969. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16970. do { \
  16971. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16972. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16973. } while (0)
  16974. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16975. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16976. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16977. /**
  16978. * @brief target -> host peer (PPDU) stats message
  16979. *
  16980. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16981. *
  16982. * @details
  16983. * This message is generated by FW when FW is sending stats to host
  16984. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16985. * This message is sent autonomously by the target rather than upon request
  16986. * by the host.
  16987. * The following field definitions describe the format of the HTT target
  16988. * to host peer stats indication message.
  16989. *
  16990. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16991. * or more PPDU stats records.
  16992. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16993. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16994. * then the message would start with the
  16995. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16996. * below.
  16997. *
  16998. * |31 16|15|14|13 11|10 9|8|7 0|
  16999. * |-------------------------------------------------------------|
  17000. * | reserved |MSG_TYPE |
  17001. * |-------------------------------------------------------------|
  17002. * rec 0 | TLV header |
  17003. * rec 0 |-------------------------------------------------------------|
  17004. * rec 0 | ppdu successful bytes |
  17005. * rec 0 |-------------------------------------------------------------|
  17006. * rec 0 | ppdu retry bytes |
  17007. * rec 0 |-------------------------------------------------------------|
  17008. * rec 0 | ppdu failed bytes |
  17009. * rec 0 |-------------------------------------------------------------|
  17010. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  17011. * rec 0 |-------------------------------------------------------------|
  17012. * rec 0 | retried MSDUs | successful MSDUs |
  17013. * rec 0 |-------------------------------------------------------------|
  17014. * rec 0 | TX duration | failed MSDUs |
  17015. * rec 0 |-------------------------------------------------------------|
  17016. * ...
  17017. * |-------------------------------------------------------------|
  17018. * rec N | TLV header |
  17019. * rec N |-------------------------------------------------------------|
  17020. * rec N | ppdu successful bytes |
  17021. * rec N |-------------------------------------------------------------|
  17022. * rec N | ppdu retry bytes |
  17023. * rec N |-------------------------------------------------------------|
  17024. * rec N | ppdu failed bytes |
  17025. * rec N |-------------------------------------------------------------|
  17026. * rec N | peer id | S|SG| BW | BA |A|rate code|
  17027. * rec N |-------------------------------------------------------------|
  17028. * rec N | retried MSDUs | successful MSDUs |
  17029. * rec N |-------------------------------------------------------------|
  17030. * rec N | TX duration | failed MSDUs |
  17031. * rec N |-------------------------------------------------------------|
  17032. *
  17033. * where:
  17034. * A = is A-MPDU flag
  17035. * BA = block-ack failure flags
  17036. * BW = bandwidth spec
  17037. * SG = SGI enabled spec
  17038. * S = skipped rate ctrl
  17039. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  17040. *
  17041. * Header
  17042. * ------
  17043. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  17044. * dword0 - b'8:31 - reserved : Reserved for future use
  17045. *
  17046. * payload include below peer_stats information
  17047. * --------------------------------------------
  17048. * @TLV : HTT_PPDU_STATS_INFO_TLV
  17049. * @tx_success_bytes : total successful bytes in the PPDU.
  17050. * @tx_retry_bytes : total retried bytes in the PPDU.
  17051. * @tx_failed_bytes : total failed bytes in the PPDU.
  17052. * @tx_ratecode : rate code used for the PPDU.
  17053. * @is_ampdu : Indicates PPDU is AMPDU or not.
  17054. * @ba_ack_failed : BA/ACK failed for this PPDU
  17055. * b00 -> BA received
  17056. * b01 -> BA failed once
  17057. * b10 -> BA failed twice, when HW retry is enabled.
  17058. * @bw : BW
  17059. * b00 -> 20 MHz
  17060. * b01 -> 40 MHz
  17061. * b10 -> 80 MHz
  17062. * b11 -> 160 MHz (or 80+80)
  17063. * @sg : SGI enabled
  17064. * @s : skipped ratectrl
  17065. * @peer_id : peer id
  17066. * @tx_success_msdus : successful MSDUs
  17067. * @tx_retry_msdus : retried MSDUs
  17068. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  17069. * @tx_duration : Tx duration for the PPDU (microsecond units)
  17070. */
  17071. /**
  17072. * @brief target -> host backpressure event
  17073. *
  17074. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  17075. *
  17076. * @details
  17077. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  17078. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  17079. * This message will only be sent if the backpressure condition has existed
  17080. * continuously for an initial period (100 ms).
  17081. * Repeat messages with updated information will be sent after each
  17082. * subsequent period (100 ms) as long as the backpressure remains unabated.
  17083. * This message indicates the ring id along with current head and tail index
  17084. * locations (i.e. write and read indices).
  17085. * The backpressure time indicates the time in ms for which continuous
  17086. * backpressure has been observed in the ring.
  17087. *
  17088. * The message format is as follows:
  17089. *
  17090. * |31 24|23 16|15 8|7 0|
  17091. * |----------------+----------------+----------------+----------------|
  17092. * | ring_id | ring_type | pdev_id | msg_type |
  17093. * |-------------------------------------------------------------------|
  17094. * | tail_idx | head_idx |
  17095. * |-------------------------------------------------------------------|
  17096. * | backpressure_time_ms |
  17097. * |-------------------------------------------------------------------|
  17098. *
  17099. * The message is interpreted as follows:
  17100. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  17101. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  17102. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  17103. * 1, 2, 3 indicates pdev_id 0,1,2 and
  17104. * the msg is for LMAC ring.
  17105. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  17106. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  17107. * htt_backpressure_lmac_ring_id. This represents
  17108. * the ring id for which continuous backpressure
  17109. * is seen
  17110. *
  17111. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  17112. * the ring indicated by the ring_id
  17113. *
  17114. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  17115. * the ring indicated by the ring id
  17116. *
  17117. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  17118. * backpressure has been seen in the ring
  17119. * indicated by the ring_id.
  17120. * Units = milliseconds
  17121. */
  17122. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  17123. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  17124. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  17125. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  17126. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  17127. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  17128. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  17129. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  17130. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  17131. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  17132. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  17133. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  17134. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  17135. do { \
  17136. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  17137. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  17138. } while (0)
  17139. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  17140. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  17141. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  17142. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  17143. do { \
  17144. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  17145. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  17146. } while (0)
  17147. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  17148. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  17149. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  17150. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  17151. do { \
  17152. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  17153. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  17154. } while (0)
  17155. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  17156. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  17157. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  17158. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  17159. do { \
  17160. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  17161. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  17162. } while (0)
  17163. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  17164. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  17165. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  17166. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  17167. do { \
  17168. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  17169. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  17170. } while (0)
  17171. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  17172. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  17173. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  17174. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  17175. do { \
  17176. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  17177. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  17178. } while (0)
  17179. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  17180. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  17181. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  17182. enum htt_backpressure_ring_type {
  17183. HTT_SW_RING_TYPE_UMAC,
  17184. HTT_SW_RING_TYPE_LMAC,
  17185. HTT_SW_RING_TYPE_MAX,
  17186. };
  17187. /* Ring id for which the message is sent to host */
  17188. enum htt_backpressure_umac_ringid {
  17189. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  17190. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  17191. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  17192. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  17193. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  17194. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  17195. HTT_SW_RING_IDX_REO_REO2FW_RING,
  17196. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  17197. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  17198. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  17199. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  17200. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  17201. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  17202. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  17203. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  17204. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  17205. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  17206. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  17207. HTT_SW_UMAC_RING_IDX_MAX,
  17208. };
  17209. enum htt_backpressure_lmac_ringid {
  17210. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  17211. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  17212. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  17213. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  17214. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  17215. HTT_SW_RING_IDX_RXDMA2FW_RING,
  17216. HTT_SW_RING_IDX_RXDMA2SW_RING,
  17217. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  17218. HTT_SW_RING_IDX_RXDMA2REO_RING,
  17219. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  17220. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  17221. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  17222. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  17223. HTT_SW_LMAC_RING_IDX_MAX,
  17224. };
  17225. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  17226. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  17227. pdev_id: 8,
  17228. ring_type: 8, /* htt_backpressure_ring_type */
  17229. /*
  17230. * ring_id holds an enum value from either
  17231. * htt_backpressure_umac_ringid or
  17232. * htt_backpressure_lmac_ringid, based on
  17233. * the ring_type setting.
  17234. */
  17235. ring_id: 8;
  17236. A_UINT16 head_idx;
  17237. A_UINT16 tail_idx;
  17238. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  17239. } POSTPACK;
  17240. /*
  17241. * Defines two 32 bit words that can be used by the target to indicate a per
  17242. * user RU allocation and rate information.
  17243. *
  17244. * This information is currently provided in the "sw_response_reference_ptr"
  17245. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  17246. * "rx_ppdu_end_user_stats" TLV.
  17247. *
  17248. * VALID:
  17249. * The consumer of these words must explicitly check the valid bit,
  17250. * and only attempt interpretation of any of the remaining fields if
  17251. * the valid bit is set to 1.
  17252. *
  17253. * VERSION:
  17254. * The consumer of these words must also explicitly check the version bit,
  17255. * and only use the V0 definition if the VERSION field is set to 0.
  17256. *
  17257. * Version 1 is currently undefined, with the exception of the VALID and
  17258. * VERSION fields.
  17259. *
  17260. * Version 0:
  17261. *
  17262. * The fields below are duplicated per BW.
  17263. *
  17264. * The consumer must determine which BW field to use, based on the UL OFDMA
  17265. * PPDU BW indicated by HW.
  17266. *
  17267. * RU_START: RU26 start index for the user.
  17268. * Note that this is always using the RU26 index, regardless
  17269. * of the actual RU assigned to the user
  17270. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  17271. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  17272. *
  17273. * For example, 20MHz (the value in the top row is RU_START)
  17274. *
  17275. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  17276. * RU Size 1 (52): | | | | | |
  17277. * RU Size 2 (106): | | | |
  17278. * RU Size 3 (242): | |
  17279. *
  17280. * RU_SIZE: Indicates the RU size, as defined by enum
  17281. * htt_ul_ofdma_user_info_ru_size.
  17282. *
  17283. * LDPC: LDPC enabled (if 0, BCC is used)
  17284. *
  17285. * DCM: DCM enabled
  17286. *
  17287. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  17288. * |---------------------------------+--------------------------------|
  17289. * |Ver|Valid| FW internal |
  17290. * |---------------------------------+--------------------------------|
  17291. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  17292. * |---------------------------------+--------------------------------|
  17293. */
  17294. enum htt_ul_ofdma_user_info_ru_size {
  17295. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  17296. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  17297. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  17298. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  17299. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  17300. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  17301. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  17302. };
  17303. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  17304. struct htt_ul_ofdma_user_info_v0 {
  17305. A_UINT32 word0;
  17306. A_UINT32 word1;
  17307. };
  17308. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  17309. A_UINT32 w0_fw_rsvd:29; \
  17310. A_UINT32 w0_manual_ulofdma_trig:1; \
  17311. A_UINT32 w0_valid:1; \
  17312. A_UINT32 w0_version:1;
  17313. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  17314. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17315. };
  17316. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  17317. A_UINT32 w1_nss:3; \
  17318. A_UINT32 w1_mcs:4; \
  17319. A_UINT32 w1_ldpc:1; \
  17320. A_UINT32 w1_dcm:1; \
  17321. A_UINT32 w1_ru_start:7; \
  17322. A_UINT32 w1_ru_size:3; \
  17323. A_UINT32 w1_trig_type:4; \
  17324. A_UINT32 w1_unused:9;
  17325. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  17326. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17327. };
  17328. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  17329. A_UINT32 w0_fw_rsvd:27; \
  17330. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  17331. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  17332. A_UINT32 w0_version:1; /* set to a value of “1” to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  17333. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  17334. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17335. };
  17336. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  17337. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  17338. A_UINT32 w1_trig_type:4; \
  17339. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  17340. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  17341. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17342. };
  17343. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  17344. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  17345. union {
  17346. A_UINT32 word0;
  17347. struct {
  17348. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17349. };
  17350. };
  17351. union {
  17352. A_UINT32 word1;
  17353. struct {
  17354. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17355. };
  17356. };
  17357. } POSTPACK;
  17358. /*
  17359. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  17360. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  17361. * this should be picked.
  17362. */
  17363. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  17364. union {
  17365. A_UINT32 word0;
  17366. struct {
  17367. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17368. };
  17369. };
  17370. union {
  17371. A_UINT32 word1;
  17372. struct {
  17373. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17374. };
  17375. };
  17376. } POSTPACK;
  17377. enum HTT_UL_OFDMA_TRIG_TYPE {
  17378. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  17379. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  17380. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  17381. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  17382. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  17383. };
  17384. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  17385. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  17386. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  17387. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_M 0x20000000
  17388. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_S 29
  17389. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  17390. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  17391. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  17392. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  17393. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  17394. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  17395. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  17396. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  17397. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  17398. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  17399. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  17400. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  17401. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  17402. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  17403. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  17404. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  17405. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  17406. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  17407. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  17408. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  17409. /*--- word 0 ---*/
  17410. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  17411. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  17412. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  17413. do { \
  17414. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  17415. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  17416. } while (0)
  17417. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  17418. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  17419. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  17420. do { \
  17421. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  17422. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  17423. } while (0)
  17424. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  17425. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  17426. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  17427. do { \
  17428. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  17429. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  17430. } while (0)
  17431. /*--- word 1 ---*/
  17432. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  17433. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  17434. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  17435. do { \
  17436. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  17437. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  17438. } while (0)
  17439. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  17440. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  17441. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  17442. do { \
  17443. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  17444. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  17445. } while (0)
  17446. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  17447. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  17448. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  17449. do { \
  17450. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  17451. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  17452. } while (0)
  17453. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  17454. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  17455. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  17456. do { \
  17457. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  17458. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  17459. } while (0)
  17460. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  17461. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  17462. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  17463. do { \
  17464. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  17465. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  17466. } while (0)
  17467. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  17468. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  17469. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  17470. do { \
  17471. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  17472. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  17473. } while (0)
  17474. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  17475. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  17476. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  17477. do { \
  17478. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  17479. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  17480. } while (0)
  17481. /**
  17482. * @brief target -> host channel calibration data message
  17483. *
  17484. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  17485. *
  17486. * @brief host -> target channel calibration data message
  17487. *
  17488. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  17489. *
  17490. * @details
  17491. * The following field definitions describe the format of the channel
  17492. * calibration data message sent from the target to the host when
  17493. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  17494. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  17495. * The message is defined as htt_chan_caldata_msg followed by a variable
  17496. * number of 32-bit character values.
  17497. *
  17498. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  17499. * |------------------------------------------------------------------|
  17500. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  17501. * |------------------------------------------------------------------|
  17502. * | payload size | mhz |
  17503. * |------------------------------------------------------------------|
  17504. * | center frequency 2 | center frequency 1 |
  17505. * |------------------------------------------------------------------|
  17506. * | check sum |
  17507. * |------------------------------------------------------------------|
  17508. * | payload |
  17509. * |------------------------------------------------------------------|
  17510. * message info field:
  17511. * - MSG_TYPE
  17512. * Bits 7:0
  17513. * Purpose: identifies this as a channel calibration data message
  17514. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  17515. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  17516. * - SUB_TYPE
  17517. * Bits 11:8
  17518. * Purpose: T2H: indicates whether target is providing chan cal data
  17519. * to the host to store, or requesting that the host
  17520. * download previously-stored data.
  17521. * H2T: indicates whether the host is providing the requested
  17522. * channel cal data, or if it is rejecting the data
  17523. * request because it does not have the requested data.
  17524. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  17525. * - CHKSUM_VALID
  17526. * Bit 12
  17527. * Purpose: indicates if the checksum field is valid
  17528. * value:
  17529. * - FRAG
  17530. * Bit 19:16
  17531. * Purpose: indicates the fragment index for message
  17532. * value: 0 for first fragment, 1 for second fragment, ...
  17533. * - APPEND
  17534. * Bit 20
  17535. * Purpose: indicates if this is the last fragment
  17536. * value: 0 = final fragment, 1 = more fragments will be appended
  17537. *
  17538. * channel and payload size field
  17539. * - MHZ
  17540. * Bits 15:0
  17541. * Purpose: indicates the channel primary frequency
  17542. * Value:
  17543. * - PAYLOAD_SIZE
  17544. * Bits 31:16
  17545. * Purpose: indicates the bytes of calibration data in payload
  17546. * Value:
  17547. *
  17548. * center frequency field
  17549. * - CENTER FREQUENCY 1
  17550. * Bits 15:0
  17551. * Purpose: indicates the channel center frequency
  17552. * Value: channel center frequency, in MHz units
  17553. * - CENTER FREQUENCY 2
  17554. * Bits 31:16
  17555. * Purpose: indicates the secondary channel center frequency,
  17556. * only for 11acvht 80plus80 mode
  17557. * Value: secondary channel center frequency, in MHz units, if applicable
  17558. *
  17559. * checksum field
  17560. * - CHECK_SUM
  17561. * Bits 31:0
  17562. * Purpose: check the payload data, it is just for this fragment.
  17563. * This is intended for the target to check that the channel
  17564. * calibration data returned by the host is the unmodified data
  17565. * that was previously provided to the host by the target.
  17566. * value: checksum of fragment payload
  17567. */
  17568. PREPACK struct htt_chan_caldata_msg {
  17569. /* DWORD 0: message info */
  17570. A_UINT32
  17571. msg_type: 8,
  17572. sub_type: 4 ,
  17573. chksum_valid: 1, /** 1:valid, 0:invalid */
  17574. reserved1: 3,
  17575. frag_idx: 4, /** fragment index for calibration data */
  17576. appending: 1, /** 0: no fragment appending,
  17577. * 1: extra fragment appending */
  17578. reserved2: 11;
  17579. /* DWORD 1: channel and payload size */
  17580. A_UINT32
  17581. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  17582. payload_size: 16; /** unit: bytes */
  17583. /* DWORD 2: center frequency */
  17584. A_UINT32
  17585. band_center_freq1: 16, /** Center frequency 1 in MHz */
  17586. band_center_freq2: 16; /** Center frequency 2 in MHz,
  17587. * valid only for 11acvht 80plus80 mode */
  17588. /* DWORD 3: check sum */
  17589. A_UINT32 chksum;
  17590. /* variable length for calibration data */
  17591. A_UINT32 payload[1/* or more */];
  17592. } POSTPACK;
  17593. /* T2H SUBTYPE */
  17594. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  17595. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  17596. /* H2T SUBTYPE */
  17597. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  17598. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  17599. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  17600. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  17601. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  17602. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  17603. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  17604. do { \
  17605. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  17606. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  17607. } while (0)
  17608. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  17609. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  17610. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  17611. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  17612. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  17613. do { \
  17614. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  17615. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  17616. } while (0)
  17617. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  17618. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  17619. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  17620. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  17621. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  17622. do { \
  17623. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  17624. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  17625. } while (0)
  17626. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  17627. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  17628. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  17629. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  17630. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  17631. do { \
  17632. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  17633. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  17634. } while (0)
  17635. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  17636. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  17637. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  17638. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  17639. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  17640. do { \
  17641. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  17642. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  17643. } while (0)
  17644. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  17645. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  17646. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  17647. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  17648. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  17649. do { \
  17650. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  17651. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  17652. } while (0)
  17653. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  17654. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  17655. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  17656. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  17657. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  17658. do { \
  17659. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  17660. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  17661. } while (0)
  17662. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  17663. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  17664. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  17665. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  17666. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  17667. do { \
  17668. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  17669. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  17670. } while (0)
  17671. /**
  17672. * @brief target -> host FSE CMEM based send
  17673. *
  17674. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  17675. *
  17676. * @details
  17677. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  17678. * FSE placement in CMEM is enabled.
  17679. *
  17680. * This message sends the non-secure CMEM base address.
  17681. * It will be sent to host in response to message
  17682. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  17683. * The message would appear as follows:
  17684. *
  17685. * |31 24|23 16|15 8|7 0|
  17686. * |----------------+----------------+----------------+----------------|
  17687. * | reserved | num_entries | msg_type |
  17688. * |----------------+----------------+----------------+----------------|
  17689. * | base_address_lo |
  17690. * |----------------+----------------+----------------+----------------|
  17691. * | base_address_hi |
  17692. * |-------------------------------------------------------------------|
  17693. *
  17694. * The message is interpreted as follows:
  17695. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  17696. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  17697. * b'8:15 - number_entries: Indicated the number of entries
  17698. * programmed.
  17699. * b'16:31 - reserved.
  17700. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  17701. * CMEM base address
  17702. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  17703. * CMEM base address
  17704. */
  17705. PREPACK struct htt_cmem_base_send_t {
  17706. A_UINT32 msg_type: 8,
  17707. num_entries: 8,
  17708. reserved: 16;
  17709. A_UINT32 base_address_lo;
  17710. A_UINT32 base_address_hi;
  17711. } POSTPACK;
  17712. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  17713. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  17714. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  17715. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  17716. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  17717. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  17718. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  17719. do { \
  17720. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  17721. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  17722. } while (0)
  17723. /**
  17724. * @brief - HTT PPDU ID format
  17725. *
  17726. * @details
  17727. * The following field definitions describe the format of the PPDU ID.
  17728. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  17729. *
  17730. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  17731. * +--------------------------------------------------------------------------
  17732. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  17733. * +--------------------------------------------------------------------------
  17734. *
  17735. * sch id :Schedule command id
  17736. * Bits [11 : 0] : monotonically increasing counter to track the
  17737. * PPDU posted to a specific transmit queue.
  17738. *
  17739. * hwq_id: Hardware Queue ID.
  17740. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  17741. *
  17742. * mac_id: MAC ID
  17743. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  17744. *
  17745. * seq_idx: Sequence index.
  17746. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  17747. * a particular TXOP.
  17748. *
  17749. * tqm_cmd: HWSCH/TQM flag.
  17750. * Bit [23] : Always set to 0.
  17751. *
  17752. * seq_cmd_type: Sequence command type.
  17753. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  17754. * Refer to enum HTT_STATS_FTYPE for values.
  17755. */
  17756. PREPACK struct htt_ppdu_id {
  17757. A_UINT32
  17758. sch_id: 12,
  17759. hwq_id: 5,
  17760. mac_id: 2,
  17761. seq_idx: 2,
  17762. reserved1: 2,
  17763. tqm_cmd: 1,
  17764. seq_cmd_type: 6,
  17765. reserved2: 2;
  17766. } POSTPACK;
  17767. #define HTT_PPDU_ID_SCH_ID_S 0
  17768. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  17769. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  17770. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  17771. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  17772. do { \
  17773. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  17774. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  17775. } while (0)
  17776. #define HTT_PPDU_ID_HWQ_ID_S 12
  17777. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  17778. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  17779. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  17780. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  17781. do { \
  17782. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  17783. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  17784. } while (0)
  17785. #define HTT_PPDU_ID_MAC_ID_S 17
  17786. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  17787. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  17788. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  17789. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  17790. do { \
  17791. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  17792. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  17793. } while (0)
  17794. #define HTT_PPDU_ID_SEQ_IDX_S 19
  17795. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  17796. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  17797. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  17798. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  17799. do { \
  17800. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  17801. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  17802. } while (0)
  17803. #define HTT_PPDU_ID_TQM_CMD_S 23
  17804. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  17805. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  17806. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  17807. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  17808. do { \
  17809. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  17810. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  17811. } while (0)
  17812. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  17813. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  17814. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  17815. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  17816. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  17817. do { \
  17818. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  17819. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  17820. } while (0)
  17821. /**
  17822. * @brief target -> RX PEER METADATA V0 format
  17823. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17824. * message from target, and will confirm to the target which peer metadata
  17825. * version to use in the wmi_init message.
  17826. *
  17827. * The following diagram shows the format of the RX PEER METADATA.
  17828. *
  17829. * |31 24|23 16|15 8|7 0|
  17830. * |-----------------------------------------------------------------------|
  17831. * | Reserved | VDEV ID | PEER ID |
  17832. * |-----------------------------------------------------------------------|
  17833. */
  17834. PREPACK struct htt_rx_peer_metadata_v0 {
  17835. A_UINT32
  17836. peer_id: 16,
  17837. vdev_id: 8,
  17838. reserved1: 8;
  17839. } POSTPACK;
  17840. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  17841. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  17842. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  17843. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  17844. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  17845. do { \
  17846. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  17847. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  17848. } while (0)
  17849. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  17850. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  17851. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17852. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17853. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17854. do { \
  17855. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17856. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17857. } while (0)
  17858. /**
  17859. * @brief target -> RX PEER METADATA V1 format
  17860. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17861. * message from target, and will confirm to the target which peer metadata
  17862. * version to use in the wmi_init message.
  17863. *
  17864. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17865. *
  17866. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17867. * |---------------------------------------------------------------------------|
  17868. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17869. * |---------------------------------------------------------------------------|
  17870. */
  17871. PREPACK struct htt_rx_peer_metadata_v1 {
  17872. A_UINT32
  17873. peer_id: 13,
  17874. ml_peer_valid: 1,
  17875. logical_link_id: 2,
  17876. vdev_id: 8,
  17877. lmac_id: 2,
  17878. chip_id: 3,
  17879. reserved2: 3;
  17880. } POSTPACK;
  17881. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17882. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17883. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17884. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17885. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17886. do { \
  17887. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17888. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17889. } while (0)
  17890. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17891. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17892. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17893. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17894. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17895. do { \
  17896. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17897. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17898. } while (0)
  17899. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17900. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17901. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17902. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17903. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17904. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17905. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17906. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17907. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17908. do { \
  17909. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17910. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17911. } while (0)
  17912. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17913. do { \
  17914. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17915. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17916. } while (0)
  17917. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17918. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17919. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17920. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17921. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17922. do { \
  17923. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17924. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17925. } while (0)
  17926. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17927. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17928. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17929. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17930. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17931. do { \
  17932. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17933. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17934. } while (0)
  17935. /**
  17936. * @brief target -> RX PEER METADATA V1A format
  17937. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17938. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  17939. * and will confirm to the target which peer metadata version to use in the
  17940. * wmi_init message.
  17941. *
  17942. * The following diagram shows the format of the RX PEER METADATA V1A format.
  17943. *
  17944. * |31 29|28 26|25 22|21 14| 13 |12 0|
  17945. * |-------------------------------------------------------------------|
  17946. * |Rsvd2|CHIP ID|logical_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  17947. * |-------------------------------------------------------------------|
  17948. */
  17949. PREPACK struct htt_rx_peer_metadata_v1a {
  17950. A_UINT32
  17951. peer_id: 13,
  17952. ml_peer_valid: 1,
  17953. vdev_id: 8,
  17954. logical_link_id: 4,
  17955. chip_id: 3,
  17956. reserved2: 3;
  17957. } POSTPACK;
  17958. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_S 0
  17959. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_M 0x00001fff
  17960. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_GET(_var) \
  17961. (((_var) & HTT_RX_PEER_META_DATA_V1A_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)
  17962. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_SET(_var, _val) \
  17963. do { \
  17964. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_PEER_ID, _val); \
  17965. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)); \
  17966. } while (0)
  17967. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S 13
  17968. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M 0x00002000
  17969. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_GET(_var) \
  17970. (((_var) & HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)
  17971. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_SET(_var, _val) \
  17972. do { \
  17973. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID, _val); \
  17974. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)); \
  17975. } while (0)
  17976. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S 14
  17977. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M 0x003fc000
  17978. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_GET(_var) \
  17979. (((_var) & HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)
  17980. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_SET(_var, _val) \
  17981. do { \
  17982. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_VDEV_ID, _val); \
  17983. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)); \
  17984. } while (0)
  17985. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S 22
  17986. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M 0x03C00000
  17987. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_GET(_var) \
  17988. (((_var) & HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)
  17989. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_SET(_var, _val) \
  17990. do { \
  17991. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID, _val); \
  17992. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)); \
  17993. } while (0)
  17994. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S 26
  17995. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M 0x1c000000
  17996. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_GET(_var) \
  17997. (((_var) & HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)
  17998. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_SET(_var, _val) \
  17999. do { \
  18000. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_CHIP_ID, _val); \
  18001. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)); \
  18002. } while (0)
  18003. /**
  18004. * @brief target -> RX PEER METADATA V1B format
  18005. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18006. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  18007. * and will confirm to the target which peer metadata version to use in the
  18008. * wmi_init message.
  18009. *
  18010. * The following diagram shows the format of the RX PEER METADATA V1B format.
  18011. *
  18012. * |31 29|28 26|25 22|21 14| 13 |12 0|
  18013. * |--------------------------------------------------------------|
  18014. * |Rsvd2|CHIP ID|hw_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  18015. * |--------------------------------------------------------------|
  18016. */
  18017. PREPACK struct htt_rx_peer_metadata_v1b {
  18018. A_UINT32
  18019. peer_id: 13,
  18020. ml_peer_valid: 1,
  18021. vdev_id: 8,
  18022. hw_link_id: 4,
  18023. chip_id: 3,
  18024. reserved2: 3;
  18025. } POSTPACK;
  18026. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_S 0
  18027. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_M 0x00001fff
  18028. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_GET(_var) \
  18029. (((_var) & HTT_RX_PEER_META_DATA_V1B_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)
  18030. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_SET(_var, _val) \
  18031. do { \
  18032. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_PEER_ID, _val); \
  18033. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)); \
  18034. } while (0)
  18035. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S 13
  18036. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M 0x00002000
  18037. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_GET(_var) \
  18038. (((_var) & HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)
  18039. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_SET(_var, _val) \
  18040. do { \
  18041. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID, _val); \
  18042. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)); \
  18043. } while (0)
  18044. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S 14
  18045. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M 0x003fc000
  18046. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_GET(_var) \
  18047. (((_var) & HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)
  18048. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_SET(_var, _val) \
  18049. do { \
  18050. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_VDEV_ID, _val); \
  18051. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)); \
  18052. } while (0)
  18053. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S 22
  18054. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M 0x03C00000
  18055. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_GET(_var) \
  18056. (((_var) & HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)
  18057. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_SET(_var, _val) \
  18058. do { \
  18059. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID, _val); \
  18060. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)); \
  18061. } while (0)
  18062. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S 26
  18063. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M 0x1c000000
  18064. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_GET(_var) \
  18065. (((_var) & HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)
  18066. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_SET(_var, _val) \
  18067. do { \
  18068. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_CHIP_ID, _val); \
  18069. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)); \
  18070. } while (0)
  18071. /* generic variables for masks and shifts for various fields */
  18072. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_S;
  18073. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_M;
  18074. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_S;
  18075. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_M;
  18076. /* generic function pointers to get/set values from rx peer metadata v0/v1/v1a/v1b */
  18077. extern A_UINT32 (*HTT_RX_PEER_META_DATA_PEER_ID_GET) (A_UINT32 var);
  18078. extern void (*HTT_RX_PEER_META_DATA_PEER_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18079. extern A_UINT32 (*HTT_RX_PEER_META_DATA_VDEV_ID_GET) (A_UINT32 var);
  18080. extern void (*HTT_RX_PEER_META_DATA_VDEV_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18081. extern A_UINT32 (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_GET) (A_UINT32 var);
  18082. extern void (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_SET) (A_UINT32 *var, A_UINT32 val);
  18083. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_GET) (A_UINT32 var);
  18084. extern void (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18085. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LMAC_ID_GET) (A_UINT32 var);
  18086. extern void (*HTT_RX_PEER_META_DATA_LMAC_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18087. extern A_UINT32 (*HTT_RX_PEER_META_DATA_CHIP_ID_GET) (A_UINT32 var);
  18088. extern void (*HTT_RX_PEER_META_DATA_CHIP_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18089. extern A_UINT32 (*HTT_RX_PEER_META_DATA_HW_LINK_ID_GET) (A_UINT32 var);
  18090. extern void (*HTT_RX_PEER_META_DATA_HW_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18091. /*
  18092. * In some systems, the host SW wants to specify priorities between
  18093. * different MSDU / flow queues within the same peer-TID.
  18094. * The below enums are used for the host to identify to the target
  18095. * which MSDU queue's priority it wants to adjust.
  18096. */
  18097. /*
  18098. * The MSDUQ index describe index of TCL HW, where each index is
  18099. * used for queuing particular types of MSDUs.
  18100. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  18101. */
  18102. enum HTT_MSDUQ_INDEX {
  18103. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  18104. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  18105. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  18106. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  18107. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  18108. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  18109. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  18110. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  18111. HTT_MSDUQ_MAX_INDEX,
  18112. };
  18113. /* MSDU qtype definition */
  18114. enum HTT_MSDU_QTYPE {
  18115. /*
  18116. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  18117. * relative priority. Instead, the relative priority of CRIT_0 versus
  18118. * CRIT_1 is controlled by the FW, through the configuration parameters
  18119. * it applies to the queues.
  18120. */
  18121. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  18122. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  18123. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  18124. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  18125. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  18126. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  18127. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  18128. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  18129. /* New MSDU_QTYPE should be added above this line */
  18130. /*
  18131. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  18132. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  18133. * any host/target message definitions. The QTYPE_MAX value can
  18134. * only be used internally within the host or within the target.
  18135. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  18136. * it must regard the unexpected value as a default qtype value,
  18137. * or ignore it.
  18138. */
  18139. HTT_MSDU_QTYPE_MAX,
  18140. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  18141. };
  18142. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  18143. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  18144. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  18145. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  18146. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  18147. };
  18148. /**
  18149. * @brief target -> host mlo timestamp offset indication
  18150. *
  18151. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18152. *
  18153. * @details
  18154. * The following field definitions describe the format of the HTT target
  18155. * to host mlo timestamp offset indication message.
  18156. *
  18157. *
  18158. * |31 16|15 12|11 10|9 8|7 0 |
  18159. * |----------------------------------------------------------------------|
  18160. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  18161. * |----------------------------------------------------------------------|
  18162. * | Sync time stamp lo in us |
  18163. * |----------------------------------------------------------------------|
  18164. * | Sync time stamp hi in us |
  18165. * |----------------------------------------------------------------------|
  18166. * | mlo time stamp offset lo in us |
  18167. * |----------------------------------------------------------------------|
  18168. * | mlo time stamp offset hi in us |
  18169. * |----------------------------------------------------------------------|
  18170. * | mlo time stamp offset clocks in clock ticks |
  18171. * |----------------------------------------------------------------------|
  18172. * |31 26|25 16|15 0 |
  18173. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  18174. * | | compensation in clks | |
  18175. * |----------------------------------------------------------------------|
  18176. * |31 22|21 0 |
  18177. * | rsvd 3 | mlo time stamp comp timer period |
  18178. * |----------------------------------------------------------------------|
  18179. * The message is interpreted as follows:
  18180. *
  18181. * dword0 - b'0:7 - msg_type: This will be set to
  18182. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18183. * value: 0x28
  18184. *
  18185. * dword0 - b'9:8 - pdev_id
  18186. *
  18187. * dword0 - b'11:10 - chip_id
  18188. *
  18189. * dword0 - b'15:12 - rsvd1: Reserved for future use
  18190. *
  18191. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  18192. *
  18193. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  18194. * which last sync interrupt was received
  18195. *
  18196. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  18197. * which last sync interrupt was received
  18198. *
  18199. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  18200. *
  18201. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  18202. *
  18203. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  18204. *
  18205. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  18206. *
  18207. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  18208. * for sub us resolution
  18209. *
  18210. * dword6 - b'31:26 - rsvd2: Reserved for future use
  18211. *
  18212. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  18213. * is applied, in us
  18214. *
  18215. * dword7 - b'31:22 - rsvd3: Reserved for future use
  18216. */
  18217. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  18218. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  18219. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  18220. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  18221. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  18222. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  18223. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  18224. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  18225. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  18226. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  18227. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  18228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  18229. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  18230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  18231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  18232. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  18233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  18234. do { \
  18235. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  18236. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  18237. } while (0)
  18238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  18239. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  18240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  18241. do { \
  18242. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  18243. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  18244. } while (0)
  18245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  18246. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  18247. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  18248. do { \
  18249. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  18250. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  18251. } while (0)
  18252. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  18253. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  18254. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  18255. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  18256. do { \
  18257. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  18258. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  18259. } while (0)
  18260. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  18261. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  18262. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  18263. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  18264. do { \
  18265. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  18266. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  18267. } while (0)
  18268. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  18269. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  18270. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  18271. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  18272. do { \
  18273. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  18274. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  18275. } while (0)
  18276. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  18277. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  18278. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  18279. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  18280. do { \
  18281. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  18282. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  18283. } while (0)
  18284. typedef struct {
  18285. A_UINT32 msg_type: 8, /* bits 7:0 */
  18286. pdev_id: 2, /* bits 9:8 */
  18287. chip_id: 2, /* bits 11:10 */
  18288. reserved1: 4, /* bits 15:12 */
  18289. mac_clk_freq_mhz: 16; /* bits 31:16 */
  18290. A_UINT32 sync_timestamp_lo_us;
  18291. A_UINT32 sync_timestamp_hi_us;
  18292. A_UINT32 mlo_timestamp_offset_lo_us;
  18293. A_UINT32 mlo_timestamp_offset_hi_us;
  18294. A_UINT32 mlo_timestamp_offset_clks;
  18295. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  18296. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  18297. reserved2: 6; /* bits 31:26 */
  18298. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  18299. reserved3: 10; /* bits 31:22 */
  18300. } htt_t2h_mlo_offset_ind_t;
  18301. /*
  18302. * @brief target -> host VDEV TX RX STATS
  18303. *
  18304. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  18305. *
  18306. * @details
  18307. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  18308. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  18309. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  18310. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  18311. * periodically by target even in the absence of any further HTT request
  18312. * messages from host.
  18313. *
  18314. * The message is formatted as follows:
  18315. *
  18316. * |31 16|15 8|7 0|
  18317. * |---------------------------------+----------------+----------------|
  18318. * | payload_size | pdev_id | msg_type |
  18319. * |---------------------------------+----------------+----------------|
  18320. * | reserved0 |
  18321. * |-------------------------------------------------------------------|
  18322. * | reserved1 |
  18323. * |-------------------------------------------------------------------|
  18324. * | reserved2 |
  18325. * |-------------------------------------------------------------------|
  18326. * | |
  18327. * | VDEV specific Tx Rx stats info |
  18328. * | |
  18329. * |-------------------------------------------------------------------|
  18330. *
  18331. * The message is interpreted as follows:
  18332. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  18333. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  18334. * b'8:15 - pdev_id
  18335. * b'16:31 - size in bytes of the payload that follows the 16-byte
  18336. * message header fields (msg_type through reserved2)
  18337. * dword1 - b'0:31 - reserved0.
  18338. * dword2 - b'0:31 - reserved1.
  18339. * dword3 - b'0:31 - reserved2.
  18340. */
  18341. typedef struct {
  18342. A_UINT32 msg_type: 8,
  18343. pdev_id: 8,
  18344. payload_size: 16;
  18345. A_UINT32 reserved0;
  18346. A_UINT32 reserved1;
  18347. A_UINT32 reserved2;
  18348. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  18349. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  18350. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  18351. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  18352. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  18353. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  18354. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  18355. do { \
  18356. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  18357. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  18358. } while (0)
  18359. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  18360. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  18361. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  18362. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  18363. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  18364. do { \
  18365. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  18366. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  18367. } while (0)
  18368. /* SOC related stats */
  18369. typedef struct {
  18370. htt_tlv_hdr_t tlv_hdr;
  18371. /* When TQM is not able to find the peers during Tx, then it drops the packets
  18372. * This can be due to either the peer is deleted or deletion is ongoing
  18373. * */
  18374. A_UINT32 inv_peers_msdu_drop_count_lo;
  18375. A_UINT32 inv_peers_msdu_drop_count_hi;
  18376. } htt_t2h_soc_txrx_stats_common_tlv;
  18377. /* VDEV HW Tx/Rx stats */
  18378. typedef struct {
  18379. htt_tlv_hdr_t tlv_hdr;
  18380. A_UINT32 vdev_id;
  18381. /* Rx msdu byte cnt */
  18382. A_UINT32 rx_msdu_byte_cnt_lo;
  18383. A_UINT32 rx_msdu_byte_cnt_hi;
  18384. /* Rx msdu cnt */
  18385. A_UINT32 rx_msdu_cnt_lo;
  18386. A_UINT32 rx_msdu_cnt_hi;
  18387. /* tx msdu byte cnt */
  18388. A_UINT32 tx_msdu_byte_cnt_lo;
  18389. A_UINT32 tx_msdu_byte_cnt_hi;
  18390. /* tx msdu cnt */
  18391. A_UINT32 tx_msdu_cnt_lo;
  18392. A_UINT32 tx_msdu_cnt_hi;
  18393. /* tx excessive retry discarded msdu cnt */
  18394. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  18395. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  18396. /* TX congestion ctrl msdu drop cnt */
  18397. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  18398. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  18399. /* discarded tx msdus cnt coz of time to live expiry */
  18400. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  18401. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  18402. /* tx excessive retry discarded msdu byte cnt */
  18403. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  18404. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  18405. /* TX congestion ctrl msdu drop byte cnt */
  18406. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  18407. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  18408. /* discarded tx msdus byte cnt coz of time to live expiry */
  18409. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  18410. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  18411. /* TQM bypass frame cnt */
  18412. A_UINT32 tqm_bypass_frame_cnt_lo;
  18413. A_UINT32 tqm_bypass_frame_cnt_hi;
  18414. /* TQM bypass byte cnt */
  18415. A_UINT32 tqm_bypass_byte_cnt_lo;
  18416. A_UINT32 tqm_bypass_byte_cnt_hi;
  18417. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  18418. /*
  18419. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  18420. *
  18421. * @details
  18422. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  18423. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  18424. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  18425. * the default MSDU queues of each of the specified TIDs for the peer
  18426. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  18427. * If the default MSDU queues of a given TID within the peer are not linked
  18428. * to a service class, the svc_class_id field for that TID will have a
  18429. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  18430. * queues for that TID are not mapped to any service class.
  18431. *
  18432. * |31 16|15 8|7 0|
  18433. * |------------------------------+--------------+--------------|
  18434. * | peer ID | reserved | msg type |
  18435. * |------------------------------+--------------+------+-------|
  18436. * | reserved | svc class ID | TID |
  18437. * |------------------------------------------------------------|
  18438. * ...
  18439. * |------------------------------------------------------------|
  18440. * | reserved | svc class ID | TID |
  18441. * |------------------------------------------------------------|
  18442. * Header fields:
  18443. * dword0 - b'7:0 - msg_type: This will be set to
  18444. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  18445. * b'31:16 - peer ID
  18446. * dword1 - b'7:0 - TID
  18447. * b'15:8 - svc class ID
  18448. * (dword2, etc. same format as dword1)
  18449. */
  18450. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  18451. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  18452. A_UINT32 msg_type :8,
  18453. reserved0 :8,
  18454. peer_id :16;
  18455. struct {
  18456. A_UINT32 tid :8,
  18457. svc_class_id :8,
  18458. reserved1 :16;
  18459. } tid_reports[1/*or more*/];
  18460. } POSTPACK;
  18461. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  18462. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  18463. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  18464. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  18465. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  18466. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  18467. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  18468. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  18469. do { \
  18470. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  18471. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  18472. } while (0)
  18473. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  18474. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  18475. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  18476. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  18477. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  18478. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  18479. do { \
  18480. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  18481. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  18482. } while (0)
  18483. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  18484. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  18485. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  18486. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  18487. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  18488. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  18489. do { \
  18490. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  18491. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  18492. } while (0)
  18493. /*
  18494. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  18495. *
  18496. * @details
  18497. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  18498. * flow if the flow is seen the associated service class is conveyed to the
  18499. * target via TCL Data Command. Target on the other hand internally creates the
  18500. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  18501. * of the newly created MSDUQ and some other identifiers to uniquely identity
  18502. * the newly created MSDUQ
  18503. *
  18504. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  18505. * |------------------------------+------------------------+--------------|
  18506. * | peer ID | HTT qtype | msg type |
  18507. * |---------------------------------+--------------+--+---+-------+------|
  18508. * | reserved |AST list index|FO|WC | HLOS | remap|
  18509. * | | | | | TID | TID |
  18510. * |---------------------+------------------------------------------------|
  18511. * | reserved1 | tgt_opaque_id |
  18512. * |---------------------+------------------------------------------------|
  18513. *
  18514. * Header fields:
  18515. *
  18516. * dword0 - b'7:0 - msg_type: This will be set to
  18517. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  18518. * b'15:8 - HTT qtype
  18519. * b'31:16 - peer ID
  18520. *
  18521. * dword1 - b'3:0 - remap TID, as assigned in firmware
  18522. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  18523. * hlos_tid : Common to Lithium and Beryllium
  18524. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  18525. * TCL Data Command : Beryllium
  18526. * b10 - flow_override (FO), as sent by host in
  18527. * TCL Data Command: Beryllium
  18528. * b11:14 - ast_list_idx
  18529. * Array index into the list of extension AST entries
  18530. * (not the actual AST 16-bit index).
  18531. * The ast_list_idx is one-based, with the following
  18532. * range of values:
  18533. * - legacy targets supporting 16 user-defined
  18534. * MSDU queues: 1-2
  18535. * - legacy targets supporting 48 user-defined
  18536. * MSDU queues: 1-6
  18537. * - new targets: 0 (peer_id is used instead)
  18538. * Note that since ast_list_idx is one-based,
  18539. * the host will need to subtract 1 to use it as an
  18540. * index into a list of extension AST entries.
  18541. * b15:31 - reserved
  18542. *
  18543. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  18544. * unique MSDUQ id in firmware
  18545. * b'24:31 - reserved1
  18546. */
  18547. PREPACK struct htt_t2h_sawf_msduq_event {
  18548. A_UINT32 msg_type : 8,
  18549. htt_qtype : 8,
  18550. peer_id :16;
  18551. A_UINT32 remap_tid : 4,
  18552. hlos_tid : 4,
  18553. who_classify_info_sel : 2,
  18554. flow_override : 1,
  18555. ast_list_idx : 4,
  18556. reserved :17;
  18557. A_UINT32 tgt_opaque_id :24,
  18558. reserved1 : 8;
  18559. } POSTPACK;
  18560. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  18561. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  18562. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  18563. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  18564. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  18565. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  18566. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  18567. do { \
  18568. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  18569. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  18570. } while (0)
  18571. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  18572. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  18573. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  18574. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  18575. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  18576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  18577. do { \
  18578. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  18579. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  18580. } while (0)
  18581. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  18582. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  18583. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  18584. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  18585. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  18586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  18587. do { \
  18588. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  18589. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  18590. } while (0)
  18591. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  18592. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  18593. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  18594. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  18595. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  18596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  18597. do { \
  18598. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  18599. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  18600. } while (0)
  18601. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  18602. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  18603. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  18604. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  18605. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  18606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  18607. do { \
  18608. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  18609. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  18610. } while (0)
  18611. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  18612. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  18613. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  18614. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  18615. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  18616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  18617. do { \
  18618. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  18619. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  18620. } while (0)
  18621. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  18622. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  18623. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  18624. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  18625. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  18626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  18627. do { \
  18628. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  18629. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  18630. } while (0)
  18631. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  18632. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  18633. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  18634. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  18635. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  18636. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  18637. do { \
  18638. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  18639. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  18640. } while (0)
  18641. /**
  18642. * @brief target -> PPDU id format indication
  18643. *
  18644. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  18645. *
  18646. * @details
  18647. * The following field definitions describe the format of the HTT target
  18648. * to host PPDU ID format indication message.
  18649. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  18650. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  18651. * seq_idx :- Sequence control index of this PPDU.
  18652. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  18653. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  18654. * tqm_cmd:-
  18655. *
  18656. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  18657. * |--------------------------------------------------+------------------------|
  18658. * | rsvd0 | msg type |
  18659. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18660. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  18661. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18662. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  18663. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18664. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  18665. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18666. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  18667. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18668. * Where: OF = bit offset, NB = number of bits, V = valid
  18669. * The message is interpreted as follows:
  18670. *
  18671. * dword0 - b'7:0 - msg_type: This will be set to
  18672. * HTT_T2H_PPDU_ID_FMT_IND
  18673. * value: 0x30
  18674. *
  18675. * dword0 - b'31:8 - reserved
  18676. *
  18677. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  18678. *
  18679. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  18680. *
  18681. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  18682. *
  18683. * dword1 - b'15:11 - reserved for future use
  18684. *
  18685. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  18686. *
  18687. * dword1 - b'21:17 - number of bits in ring_id
  18688. *
  18689. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  18690. *
  18691. * dword1 - b'31:27 - reserved for future use
  18692. *
  18693. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  18694. *
  18695. * dword2 - b'5:1 - number of bits in sequence index
  18696. *
  18697. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  18698. *
  18699. * dword2 - b'15:11 - reserved for future use
  18700. *
  18701. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  18702. *
  18703. * dword2 - b'21:17 - number of bits in link_id
  18704. *
  18705. * dword2 - b'26:22 - offset of link_id (in number of bits)
  18706. *
  18707. * dword2 - b'31:27 - reserved for future use
  18708. *
  18709. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  18710. *
  18711. * dword3 - b'5:1 - number of bits in seq_cmd_type
  18712. *
  18713. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  18714. *
  18715. * dword3 - b'15:11 - reserved for future use
  18716. *
  18717. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  18718. *
  18719. * dword3 - b'21:17 - number of bits in tqm_cmd
  18720. *
  18721. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  18722. *
  18723. * dword3 - b'31:27 - reserved for future use
  18724. *
  18725. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  18726. *
  18727. * dword4 - b'5:1 - number of bits in mac_id
  18728. *
  18729. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  18730. *
  18731. * dword4 - b'15:11 - reserved for future use
  18732. *
  18733. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  18734. *
  18735. * dword4 - b'21:17 - number of bits in crc
  18736. *
  18737. * dword4 - b'26:22 - offset of crc (in number of bits)
  18738. *
  18739. * dword4 - b'31:27 - reserved for future use
  18740. *
  18741. */
  18742. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  18743. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  18744. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  18745. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  18746. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  18747. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  18748. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  18749. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  18750. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  18751. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  18752. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  18753. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  18754. /* macros for accessing lower 16 bits in dword */
  18755. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  18756. do { \
  18757. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  18758. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  18759. } while (0)
  18760. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  18761. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  18762. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  18763. do { \
  18764. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  18765. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  18766. } while (0)
  18767. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  18768. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  18769. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  18770. do { \
  18771. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  18772. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  18773. } while (0)
  18774. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  18775. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  18776. /* macros for accessing upper 16 bits in dword */
  18777. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  18778. do { \
  18779. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  18780. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  18781. } while (0)
  18782. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  18783. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  18784. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  18785. do { \
  18786. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  18787. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  18788. } while (0)
  18789. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  18790. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  18791. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  18792. do { \
  18793. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  18794. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  18795. } while (0)
  18796. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  18797. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  18798. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  18799. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18800. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  18801. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18802. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  18803. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18804. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  18805. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18806. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  18807. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18808. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  18809. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18810. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  18811. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18812. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  18813. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18814. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  18815. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18816. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  18817. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18818. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  18819. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18820. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  18821. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18822. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  18823. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18824. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  18825. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18826. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  18827. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18828. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  18829. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18830. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  18831. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18832. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  18833. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18834. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  18835. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18836. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  18837. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18838. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  18839. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18840. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  18841. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18842. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  18843. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18844. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  18845. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18846. /* offsets in number dwords */
  18847. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  18848. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  18849. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  18850. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  18851. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  18852. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  18853. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  18854. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  18855. typedef struct {
  18856. A_UINT32 msg_type: 8, /* bits 7:0 */
  18857. rsvd0: 24;/* bits 31:8 */
  18858. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  18859. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  18860. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  18861. rsvd1: 5, /* bits 15:11 */
  18862. ring_id_valid: 1, /* bits 16:16 */
  18863. ring_id_bits: 5, /* bits 21:17 */
  18864. ring_id_offset: 5, /* bits 26:22 */
  18865. rsvd2: 5; /* bits 31:27 */
  18866. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  18867. seq_idx_bits: 5, /* bits 5:1 */
  18868. seq_idx_offset: 5, /* bits 10:6 */
  18869. rsvd3: 5, /* bits 15:11 */
  18870. link_id_valid: 1, /* bits 16:16 */
  18871. link_id_bits: 5, /* bits 21:17 */
  18872. link_id_offset: 5, /* bits 26:22 */
  18873. rsvd4: 5; /* bits 31:27 */
  18874. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  18875. seq_cmd_type_bits: 5, /* bits 5:1 */
  18876. seq_cmd_type_offset: 5, /* bits 10:6 */
  18877. rsvd5: 5, /* bits 15:11 */
  18878. tqm_cmd_valid: 1, /* bits 16:16 */
  18879. tqm_cmd_bits: 5, /* bits 21:17 */
  18880. tqm_cmd_offset: 5, /* bits 26:12 */
  18881. rsvd6: 5; /* bits 31:27 */
  18882. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  18883. mac_id_bits: 5, /* bits 5:1 */
  18884. mac_id_offset: 5, /* bits 10:6 */
  18885. rsvd8: 5, /* bits 15:11 */
  18886. crc_valid: 1, /* bits 16:16 */
  18887. crc_bits: 5, /* bits 21:17 */
  18888. crc_offset: 5, /* bits 26:12 */
  18889. rsvd9: 5; /* bits 31:27 */
  18890. } htt_t2h_ppdu_id_fmt_ind_t;
  18891. /**
  18892. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  18893. *
  18894. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  18895. *
  18896. * @details
  18897. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  18898. * when RX_CCE_SUPER_RULE setup is done
  18899. *
  18900. * This message shows the configuration results after the setup operation.
  18901. * It will always be sent to host.
  18902. * The message would appear as follows:
  18903. *
  18904. * |31 24|23 16|15 8|7 0|
  18905. * |-----------------+-----------------+----------------+----------------|
  18906. * | result | response_type | pdev_id | msg_type |
  18907. * |---------------------------------------------------------------------|
  18908. *
  18909. * The message is interpreted as follows:
  18910. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  18911. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  18912. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is setup on
  18913. * b'16:23 - response_type: Indicate the response type of this setup
  18914. * done msg
  18915. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  18916. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  18917. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18918. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  18919. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18920. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  18921. * b'24:31 - result: Indicate result of setup operation
  18922. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  18923. * b'24 - is_rule_enough: indicate if there are
  18924. * enough free cce rule slots
  18925. * 0: not enough
  18926. * 1: enough
  18927. * b'25:31 - avail_rule_num: indicate the number of
  18928. * remaining free cce rule slots, only makes sense
  18929. * when is_rule_enough = 0
  18930. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  18931. * b'24 - cfg_result_0: indicate the config result
  18932. * of RX_CCE_SUPER_RULE_0
  18933. * 0: Install/Uninstall fails
  18934. * 1: Install/Uninstall succeeds
  18935. * b'25 - cfg_result_1: indicate the config result
  18936. * of RX_CCE_SUPER_RULE_1
  18937. * 0: Install/Uninstall fails
  18938. * 1: Install/Uninstall succeeds
  18939. * b'26:31 - reserved
  18940. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  18941. * b'24 - cfg_result_0: indicate the config result
  18942. * of RX_CCE_SUPER_RULE_0
  18943. * 0: Release fails
  18944. * 1: Release succeeds
  18945. * b'25 - cfg_result_1: indicate the config result
  18946. * of RX_CCE_SUPER_RULE_1
  18947. * 0: Release fails
  18948. * 1: Release succeeds
  18949. * b'26:31 - reserved
  18950. */
  18951. enum htt_rx_cce_super_rule_setup_done_response_type {
  18952. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  18953. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18954. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18955. /*All reply type should be before this*/
  18956. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  18957. };
  18958. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  18959. A_UINT8 msg_type;
  18960. A_UINT8 pdev_id;
  18961. A_UINT8 response_type;
  18962. union {
  18963. struct {
  18964. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  18965. A_UINT8 is_rule_enough: 1,
  18966. avail_rule_num: 7;
  18967. };
  18968. struct {
  18969. /*
  18970. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  18971. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  18972. */
  18973. A_UINT8 cfg_result_0: 1,
  18974. cfg_result_1: 1,
  18975. rsvd: 6;
  18976. };
  18977. } result;
  18978. } POSTPACK;
  18979. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  18980. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M 0x0000ff00
  18981. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S 8
  18982. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_GET(_var) \
  18983. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M) >> \
  18984. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)
  18985. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  18986. do { \
  18987. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID, _val); \
  18988. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)); \
  18989. } while (0)
  18990. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  18991. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  18992. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  18993. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  18994. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  18995. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  18996. do { \
  18997. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  18998. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  18999. } while (0)
  19000. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  19001. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  19002. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  19003. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  19004. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  19005. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  19006. do { \
  19007. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  19008. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  19009. } while (0)
  19010. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  19011. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  19012. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  19013. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  19014. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  19015. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  19016. do { \
  19017. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  19018. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  19019. } while (0)
  19020. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  19021. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  19022. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  19023. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  19024. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  19025. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  19026. do { \
  19027. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  19028. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  19029. } while (0)
  19030. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  19031. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  19032. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  19033. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  19034. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  19035. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  19036. do { \
  19037. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  19038. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  19039. } while (0)
  19040. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  19041. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  19042. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  19043. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  19044. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  19045. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  19046. do { \
  19047. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  19048. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  19049. } while (0)
  19050. /**
  19051. * @brief target -> host CoDel MSDU queue latencies array configuration
  19052. *
  19053. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  19054. *
  19055. * @details
  19056. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  19057. * by the target to inform the host of the location and size of the DDR array of
  19058. * per MSDU queue latency metrics. This array is updated by the host and
  19059. * read by the target. The target uses these metric values to determine
  19060. * which MSDU queues have latencies exceeding their CoDel latency target.
  19061. *
  19062. * |31 16|15 8|7 0|
  19063. * |-------------------------------------------+----------|
  19064. * | number of array elements | reserved | MSG_TYPE |
  19065. * |-------------------------------------------+----------|
  19066. * | array physical address, low bits |
  19067. * |------------------------------------------------------|
  19068. * | array physical address, high bits |
  19069. * |------------------------------------------------------|
  19070. * Header fields:
  19071. * - MSG_TYPE
  19072. * Bits 7:0
  19073. * Purpose: Identifies this as a CoDel MSDU queue latencies
  19074. * array configuration message.
  19075. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  19076. * - NUM_ELEM
  19077. * Bits 31:16
  19078. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  19079. * Value: Specifies the number of elements in the MSDU queue latency
  19080. * metrics array. This value is the same as the maximum number of
  19081. * MSDU queues supported by the target.
  19082. * Since each array element is 16 bits, the size in bytes of the
  19083. * MSDU queue latency metrics array is twice the number of elements.
  19084. * - PADDR_LOW
  19085. * Bits 31:0
  19086. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19087. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  19088. * metrics array.
  19089. * - PADDR_HIGH
  19090. * Bits 31:0
  19091. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19092. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  19093. * metrics array.
  19094. */
  19095. typedef struct {
  19096. A_UINT32 msg_type: 8, /* bits 7:0 */
  19097. reserved: 8, /* bits 15:8 */
  19098. num_elem: 16; /* bits 31:16 */
  19099. A_UINT32 paddr_low;
  19100. A_UINT32 paddr_high;
  19101. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  19102. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  19103. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  19104. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  19105. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  19106. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  19107. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  19108. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  19109. do { \
  19110. HTT_CHECK_SET_VAL( \
  19111. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  19112. ((_var) |= ((_val) << \
  19113. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  19114. } while (0)
  19115. /*
  19116. * This CoDel MSDU queue latencies array whose location and number of
  19117. * elements are specified by this HTT_T2H message consists of 16-bit elements
  19118. * that each specify a statistical summary (min) of a MSDU queue's latency,
  19119. * using milliseconds units.
  19120. */
  19121. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  19122. /**
  19123. * @brief target -> host rx completion indication message definition
  19124. *
  19125. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DATA_IND
  19126. *
  19127. * @details
  19128. * The following diagram shows the format of the Rx completion indication sent
  19129. * from the target to the host
  19130. *
  19131. * |31|29|28 24|23 12|11 9|8| 7|6|5|4|3|2|1|0|
  19132. * |---------------+----------------------------+----------------|
  19133. * | vdev_id | peer_id | msg_type |
  19134. * hdr: |---------------+--------------------------+-+----------------|
  19135. * | rsvd0 |F| msdu_cnt |
  19136. * pyld: |==========================================+=+================|
  19137. * MSDU 0 | buf addr lo (bits 31:0) |
  19138. * |-----+--------------------------------------+----------------|
  19139. * |rsvd1| SW buffer cookie | buf addr hi |
  19140. * |--+--+-----------------------------+--------+--+-+-+-+-+-+-+-|
  19141. * |R2| W| MSDU length | TID |MC|D|S|C|L|F|R|M|
  19142. * |-------------------------------------------------+---------+-|
  19143. * | rsvd3 | err info|E|
  19144. * |=================================================+=========+=|
  19145. * MSDU 1 | buf addr lo (bits 31:0) |
  19146. * : ... :
  19147. * | rsvd3 | err info|E|
  19148. * |-------------------------------------------------------------|
  19149. * Where:
  19150. * F = fragment
  19151. * M = MPDU retry bit
  19152. * R = raw MPDU frame
  19153. * F = first MSDU in MPDU
  19154. * L = last MSDU in MPDU
  19155. * C = MSDU continuation
  19156. * S = Souce Addr is valid
  19157. * D = Dest Addr is valid
  19158. * MC = Dest Addr is multicast / broadcast
  19159. * W = is first MSDU after WoW wakeup
  19160. * R2 = rsvd2
  19161. * E = error valid
  19162. */
  19163. /* htt_t2h_rx_data_msdu_err:
  19164. * To be filled in "htt_t2h_rx_data_msdu_info.error_info" field
  19165. * when FW forwards MSDU to host.
  19166. */
  19167. typedef enum htt_t2h_rx_data_msdu_err {
  19168. /* ERR_DECRYPT:
  19169. * FW sets this when rxdma_error_code = <enum 3 rxdma_decrypt_err>.
  19170. * host maintains error stats, recycles buffer.
  19171. */
  19172. HTT_RXDATA_ERR_DECRYPT = 0,
  19173. /* ERR_TKIP_MIC:
  19174. * FW sets this when rxdma_error_code = <enum 4 rxdma_tkip_mic_err>.
  19175. * Host maintains error stats, recycles buffer, sends notification to
  19176. * middleware.
  19177. */
  19178. HTT_RXDATA_ERR_TKIP_MIC = 1,
  19179. /* ERR_UNENCRYPTED:
  19180. * FW sets this when rxdma_error_code = <enum 5 rxdma_unecrypted_err>.
  19181. * Host maintains error stats, recycles buffer.
  19182. */
  19183. HTT_RXDATA_ERR_UNENCRYPTED = 2,
  19184. /* ERR_MSDU_LIMIT:
  19185. * FW sets this when rxdma_error_code = <enum 7 rxdma_msdu_limit_err>.
  19186. * Host maintains error stats, recycles buffer.
  19187. */
  19188. HTT_RXDATA_ERR_MSDU_LIMIT = 3,
  19189. /* ERR_FLUSH_REQUEST:
  19190. * FW sets this when rxdma_error_code = <enum 13 rxdma_flush_request>.
  19191. * Host maintains error stats, recycles buffer.
  19192. */
  19193. HTT_RXDATA_ERR_FLUSH_REQUEST = 4,
  19194. /* ERR_OOR:
  19195. * FW full reorder layer maps this error to <enum 7 regular_frame_OOR>.
  19196. * Host maintains error stats, recycles buffer mainly for low
  19197. * TCP KPI debugging.
  19198. */
  19199. HTT_RXDATA_ERR_OOR = 5,
  19200. /* ERR_2K_JUMP:
  19201. * FW full reorder layer maps this error to <enum 5 regular_frame_2k_jump>.
  19202. * Host maintains error stats, recycles buffer mainly for low
  19203. * TCP KPI debugging.
  19204. */
  19205. HTT_RXDATA_ERR_2K_JUMP = 6,
  19206. /* ERR_ZERO_LEN_MSDU:
  19207. * FW sets this error flag for a 0 length MSDU.
  19208. * Host maintains error stats, recycles buffer.
  19209. */
  19210. HTT_RXDATA_ERR_ZERO_LEN_MSDU = 7,
  19211. /* add new error codes here */
  19212. HTT_RXDATA_ERR_MAX = 32
  19213. } htt_t2h_rx_data_msdu_err_e;
  19214. struct htt_t2h_rx_data_ind_t
  19215. {
  19216. A_UINT32 /* word 0 */
  19217. /* msg_type:
  19218. * Set to Rx data indication i.e. HTT_T2H_MSG_TYPE_RX_DATA_IND.
  19219. */
  19220. msg_type: 8,
  19221. peer_id: 16, /* This will provide peer data */
  19222. vdev_id: 8; /* This will provide vdev id info */
  19223. A_UINT32 /* word 1 */
  19224. /* msdu_cnt:
  19225. * Total number of MSDUs (htt_t2h_rx_data_msdu_info items) in message.
  19226. */
  19227. msdu_cnt: 8,
  19228. frag: 1, /* this bit will be set for 802.11 frag MPDU */
  19229. rsvd0: 23;
  19230. /* NOTE:
  19231. * To preserve backwards compatibility,
  19232. * no new fields can be added in this struct.
  19233. */
  19234. };
  19235. struct htt_t2h_rx_data_msdu_info
  19236. {
  19237. A_UINT32 /* word 0 */
  19238. buffer_addr_low : 32;
  19239. A_UINT32 /* word 1 */
  19240. buffer_addr_high : 8,
  19241. sw_buffer_cookie : 21,
  19242. rsvd1 : 3;
  19243. A_UINT32 /* word 2 */
  19244. mpdu_retry_bit : 1, /* used for stats maintenance */
  19245. raw_mpdu_frame : 1, /* used for pkt drop and processing */
  19246. first_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19247. last_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19248. msdu_continuation : 1, /* used for MSDU scatter/gather support */
  19249. sa_is_valid : 1, /* used for HW issue check in
  19250. * is_sa_da_idx_valid() */
  19251. da_is_valid : 1, /* used for HW issue check and
  19252. * intra-BSS forwarding */
  19253. da_is_mcbc : 1,
  19254. tid_info : 8, /* used for stats maintenance */
  19255. msdu_length : 14,
  19256. is_first_pkt_after_wkp : 1, /* indicates this is the first rx MSDU
  19257. * provided by fw after WoW exit */
  19258. rsvd2 : 1;
  19259. A_UINT32 /* word 3 */
  19260. error_valid : 1, /* Set if the MSDU has any error */
  19261. error_info : 5, /* If error_valid is TRUE, then refer to
  19262. * "htt_t2h_rx_data_msdu_err_e" for
  19263. * checking error reason. */
  19264. rsvd3 : 26;
  19265. /* NOTE:
  19266. * To preserve backwards compatibility,
  19267. * no new fields can be added in this struct.
  19268. */
  19269. };
  19270. /* HTT_RX_DATA_IND_HDR_SIZE: 2 4-byte words
  19271. * This is the size of htt_t2h_rx_data_ind_t alone which is fixed overhead
  19272. * for every Rx DATA IND sent by FW to host.
  19273. */
  19274. #define HTT_RX_DATA_IND_HDR_SIZE (2*4)
  19275. /* HTT_RX_DATA_MSDU_INFO_SIZE: 4 4-bytes words
  19276. * This is the size of each MSDU detail that will be piggybacked with the
  19277. * RX IND header.
  19278. */
  19279. #define HTT_RX_DATA_MSDU_INFO_SIZE (4*4)
  19280. /* member definitions of htt_t2h_rx_data_ind_t */
  19281. #define HTT_RX_DATA_IND_PEER_ID_M 0x00ffff00
  19282. #define HTT_RX_DATA_IND_PEER_ID_S 8
  19283. #define HTT_RX_DATA_IND_PEER_ID_SET(word, value) \
  19284. do { \
  19285. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_PEER_ID, value); \
  19286. (word) |= (value) << HTT_RX_DATA_IND_PEER_ID_S; \
  19287. } while (0)
  19288. #define HTT_RX_DATA_IND_PEER_ID_GET(word) \
  19289. (((word) & HTT_RX_DATA_IND_PEER_ID_M) >> HTT_RX_DATA_IND_PEER_ID_S)
  19290. #define HTT_RX_DATA_IND_VDEV_ID_M 0xff000000
  19291. #define HTT_RX_DATA_IND_VDEV_ID_S 24
  19292. #define HTT_RX_DATA_IND_VDEV_ID_SET(word, value) \
  19293. do { \
  19294. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_VDEV_ID, value); \
  19295. (word) |= (value) << HTT_RX_DATA_IND_VDEV_ID_S; \
  19296. } while (0)
  19297. #define HTT_RX_DATA_IND_VDEV_ID_GET(word) \
  19298. (((word) & HTT_RX_DATA_IND_VDEV_ID_M) >> HTT_RX_DATA_IND_VDEV_ID_S)
  19299. #define HTT_RX_DATA_IND_MSDU_CNT_M 0x000000ff
  19300. #define HTT_RX_DATA_IND_MSDU_CNT_S 0
  19301. #define HTT_RX_DATA_IND_MSDU_CNT_SET(word, value) \
  19302. do { \
  19303. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_MSDU_CNT, value); \
  19304. (word) |= (value) << HTT_RX_DATA_IND_MSDU_CNT_S; \
  19305. } while (0)
  19306. #define HTT_RX_DATA_IND_MSDU_CNT_GET(word) \
  19307. (((word) & HTT_RX_DATA_IND_MSDU_CNT_M) >> HTT_RX_DATA_IND_MSDU_CNT_S)
  19308. #define HTT_RX_DATA_IND_FRAG_M 0x00000100
  19309. #define HTT_RX_DATA_IND_FRAG_S 8
  19310. #define HTT_RX_DATA_IND_FRAG_SET(word, value) \
  19311. do { \
  19312. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_FRAG, value); \
  19313. (word) |= (value) << HTT_RX_DATA_IND_FRAG_S; \
  19314. } while (0)
  19315. #define HTT_RX_DATA_IND_FRAG_GET(word) \
  19316. (((word) & HTT_RX_DATA_IND_FRAG_M) >> HTT_RX_DATA_IND_FRAG_S)
  19317. /* member definitions of htt_t2h_rx_data_msdu_info */
  19318. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M 0xFFFFFFFF
  19319. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S 0
  19320. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M 0x000000FF
  19321. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S 0
  19322. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_SET(word, value) \
  19323. do { \
  19324. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW, value); \
  19325. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S; \
  19326. } while (0)
  19327. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_GET(word) \
  19328. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S)
  19329. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_SET(word, value) \
  19330. do { \
  19331. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH, value); \
  19332. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S; \
  19333. } while (0)
  19334. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_GET(word) \
  19335. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S)
  19336. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M 0x1FFFFF00
  19337. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S 8
  19338. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  19339. do { \
  19340. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE, value); \
  19341. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S; \
  19342. } while (0)
  19343. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_GET(word) \
  19344. (((word) & HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M) >> HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S)
  19345. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M 0x00000001
  19346. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S 0
  19347. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_SET(word, value) \
  19348. do { \
  19349. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT, value); \
  19350. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S; \
  19351. } while (0)
  19352. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_GET(word) \
  19353. (((word) & HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M) >> HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S)
  19354. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M 0x00000002
  19355. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S 1
  19356. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_SET(word, value) \
  19357. do { \
  19358. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME, value); \
  19359. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S; \
  19360. } while (0)
  19361. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_GET(word) \
  19362. (((word) & HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M) >> HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S)
  19363. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M 0x00000004
  19364. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S 2
  19365. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_SET(word, value) \
  19366. do { \
  19367. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU, value); \
  19368. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S; \
  19369. } while (0)
  19370. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_GET(word) \
  19371. (((word) & HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S)
  19372. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M 0x00000008
  19373. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S 3
  19374. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_SET(word, value) \
  19375. do { \
  19376. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU, value); \
  19377. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S; \
  19378. } while (0)
  19379. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_GET(word) \
  19380. (((word) & HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S)
  19381. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M 0x00000010
  19382. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S 4
  19383. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_SET(word, value) \
  19384. do { \
  19385. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION, value); \
  19386. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S; \
  19387. } while (0)
  19388. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_GET(word) \
  19389. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S)
  19390. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M 0x00000020
  19391. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S 5
  19392. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_SET(word, value) \
  19393. do { \
  19394. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SA_IS_VALID, value); \
  19395. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S; \
  19396. } while (0)
  19397. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_GET(word) \
  19398. (((word) & HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S)
  19399. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M 0x00000040
  19400. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S 6
  19401. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_SET(word, value) \
  19402. do { \
  19403. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_VALID, value); \
  19404. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S; \
  19405. } while (0)
  19406. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_GET(word) \
  19407. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S)
  19408. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M 0x00000080
  19409. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S 7
  19410. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_SET(word, value) \
  19411. do { \
  19412. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC, value); \
  19413. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S; \
  19414. } while (0)
  19415. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_GET(word) \
  19416. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S)
  19417. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_M 0x0000FF00
  19418. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_S 8
  19419. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_SET(word, value) \
  19420. do { \
  19421. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_TID_INFO, value); \
  19422. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_TID_INFO_S; \
  19423. } while (0)
  19424. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_GET(word) \
  19425. (((word) & HTT_RX_DATA_MSDU_INFO_TID_INFO_M) >> HTT_RX_DATA_MSDU_INFO_TID_INFO_S)
  19426. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M 0x3FFF0000
  19427. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S 16
  19428. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_SET(word, value) \
  19429. do { \
  19430. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH, value); \
  19431. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S; \
  19432. } while (0)
  19433. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_GET(word) \
  19434. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S)
  19435. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M 0x40000000
  19436. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S 30
  19437. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_SET(word, value) \
  19438. do { \
  19439. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP, value); \
  19440. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S; \
  19441. } while (0)
  19442. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_GET(word) \
  19443. (((word) & HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M) >> HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S)
  19444. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M 0x00000001
  19445. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S 0
  19446. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_SET(word, value) \
  19447. do { \
  19448. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_VALID, value); \
  19449. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S; \
  19450. } while (0)
  19451. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_GET(word) \
  19452. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S)
  19453. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M 0x0000001E
  19454. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S 1
  19455. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_SET(word, value) \
  19456. do { \
  19457. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_INFO, value); \
  19458. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S; \
  19459. } while (0)
  19460. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_GET(word) \
  19461. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S)
  19462. /**
  19463. * @brief target -> Primary peer migration message to host
  19464. *
  19465. * MSG_TYPE => HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  19466. *
  19467. * @details
  19468. * HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND message is sent by target
  19469. * to host to flush & set-up the RX rings to new primary peer
  19470. *
  19471. * The message would appear as follows:
  19472. *
  19473. * |31 16|15 12|11 8|7 0|
  19474. * |-------------------------------+---------+---------+--------------|
  19475. * | vdev ID | pdev ID | chip ID | msg type |
  19476. * |-------------------------------+---------+---------+--------------|
  19477. * | ML peer ID | SW peer ID |
  19478. * |-------------------------------+----------------------------------|
  19479. *
  19480. * The message is interpreted as follows:
  19481. * dword0 - b'0:7 - msg_type: This will be set to 0x37
  19482. * (HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND)
  19483. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  19484. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  19485. * as primary
  19486. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  19487. * as primary
  19488. *
  19489. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  19490. * chosen as primary
  19491. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  19492. * primary peer belongs.
  19493. */
  19494. typedef struct {
  19495. A_UINT32 msg_type: 8, /* bits 7:0 */
  19496. chip_id: 4, /* bits 11:8 */
  19497. pdev_id: 4, /* bits 15:12 */
  19498. vdev_id: 16; /* bits 31:16 */
  19499. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  19500. ml_peer_id: 16; /* bits 31:16 */
  19501. } htt_t2h_primary_link_peer_migrate_ind_t;
  19502. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  19503. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  19504. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  19505. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  19506. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  19507. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  19508. do { \
  19509. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  19510. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  19511. } while (0)
  19512. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  19513. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  19514. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  19515. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  19516. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  19517. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  19518. do { \
  19519. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  19520. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  19521. } while (0)
  19522. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  19523. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  19524. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  19525. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  19526. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  19527. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  19528. do { \
  19529. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  19530. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  19531. } while (0)
  19532. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  19533. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  19534. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  19535. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  19536. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  19537. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  19538. do { \
  19539. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  19540. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  19541. } while (0)
  19542. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  19543. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  19544. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  19545. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  19546. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  19547. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  19548. do { \
  19549. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  19550. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  19551. } while (0)
  19552. /**
  19553. * @brief target -> host rx peer AST override message defenition
  19554. *
  19555. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND
  19556. *
  19557. * @details
  19558. * Format inherits parts of the HTT_T2H_MSG_TYPE_PEER_MAP_V3 published above
  19559. * where in the dummy ast index is provided to the host.
  19560. * This new message below is sent to the host at run time from the TX_DE
  19561. * exception path when a SAWF flow is detected for a peer.
  19562. * This is sent up once per SAWF peer.
  19563. * This layout assumes the target operates as little-endian.
  19564. *
  19565. * |31 24|23 16|15 8|7 0|
  19566. * |--------------------------------------+-----------------+-----------------|
  19567. * | SW peer ID | vdev ID | msg type |
  19568. * |-----------------+--------------------+-----------------+-----------------|
  19569. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  19570. * |-----------------+--------------------+-----------------+-----------------|
  19571. * | dummy AST Index #1 | MAC addr 5 | MAC addr 4 |
  19572. * |--------------------------------------+-----------------+-----------------|
  19573. * | reserved | dummy AST Index #2 |
  19574. * |--------------------------------------+-----------------------------------|
  19575. *
  19576. * The following field definitions describe the format of the peer ast override
  19577. * index messages sent from the target to the host.
  19578. * - MSG_TYPE
  19579. * Bits 7:0
  19580. * Purpose: identifies this as a peer map v3 message
  19581. * Value: 0x38 (HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND)
  19582. * - VDEV_ID
  19583. * Bits 15:8
  19584. * Purpose: Indicates which virtual device the peer is associated with.
  19585. * - SW_PEER_ID
  19586. * Bits 31:16
  19587. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  19588. * - MAC_ADDR_L32
  19589. * Bits 31:0
  19590. * Purpose: Identifies which peer node the peer ID is for.
  19591. * Value: lower 4 bytes of peer node's MAC address
  19592. * - MAC_ADDR_U16
  19593. * Bits 15:0
  19594. * Purpose: Identifies which peer node the peer ID is for.
  19595. * Value: upper 2 bytes of peer node's MAC address
  19596. * - AST_INDEX1
  19597. * Bits 31:16
  19598. * Purpose: The 1st extra AST index used to identify user defined MSDUQ
  19599. * - AST_INDEX2
  19600. * Bits 15:0
  19601. * Purpose: The 2nd extra AST index used to identify user defined MSDUQ
  19602. */
  19603. /* dword 0 */
  19604. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M 0xffff0000
  19605. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S 16
  19606. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_M 0x0000ff00
  19607. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_S 8
  19608. /* dword 1 */
  19609. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M 0xffffffff
  19610. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S 0
  19611. /* dword 2 */
  19612. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M 0x0000ffff
  19613. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S 0
  19614. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_M 0xffff0000
  19615. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_S 16
  19616. /* dword 3 */
  19617. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_M 0x0000ffff
  19618. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_S 0
  19619. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_SET(word, value) \
  19620. do { \
  19621. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_VDEV_ID, value); \
  19622. (word) |= (value) << HTT_PEER_AST_OVERRIDE_VDEV_ID_S; \
  19623. } while (0)
  19624. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_GET(word) \
  19625. (((word) & HTT_PEER_AST_OVERRIDE_VDEV_ID_M) >> HTT_PEER_AST_OVERRIDE_VDEV_ID_S)
  19626. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_SET(word, value) \
  19627. do { \
  19628. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_SW_PEER_ID, value); \
  19629. (word) |= (value) << HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S; \
  19630. } while (0)
  19631. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_GET(word) \
  19632. (((word) & HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M) >> HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S)
  19633. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_SET(word, value) \
  19634. do { \
  19635. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32, value); \
  19636. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S; \
  19637. } while (0)
  19638. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_GET(word) \
  19639. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S)
  19640. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_SET(word, value) \
  19641. do { \
  19642. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16, value); \
  19643. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S; \
  19644. } while (0)
  19645. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_GET(word) \
  19646. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S)
  19647. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_SET(word, value) \
  19648. do { \
  19649. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX1, value); \
  19650. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX1_S; \
  19651. } while (0)
  19652. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_GET(word) \
  19653. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX1_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX1_S)
  19654. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_SET(word, value) \
  19655. do { \
  19656. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX2, value); \
  19657. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX2_S; \
  19658. } while (0)
  19659. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_GET(word) \
  19660. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX2_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX2_S)
  19661. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_WORD_BASE_OFFSET 4 /* bytes */
  19662. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST1_WORD_BASE_OFFSET 8 /* bytes */
  19663. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST2_WORD_BASE_OFFSET 12 /* bytes */
  19664. #define HTT_PEER_AST_OVERRIDE_INDEX_IND_BYTES 16
  19665. #endif