htt.h 518 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. */
  174. #define HTT_CURRENT_VERSION_MAJOR 3
  175. #define HTT_CURRENT_VERSION_MINOR 62
  176. #define HTT_NUM_TX_FRAG_DESC 1024
  177. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  178. #define HTT_CHECK_SET_VAL(field, val) \
  179. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  180. /* macros to assist in sign-extending fields from HTT messages */
  181. #define HTT_SIGN_BIT_MASK(field) \
  182. ((field ## _M + (1 << field ## _S)) >> 1)
  183. #define HTT_SIGN_BIT(_val, field) \
  184. (_val & HTT_SIGN_BIT_MASK(field))
  185. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  186. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  187. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  188. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  189. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  190. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  191. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  192. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  193. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  194. /*
  195. * TEMPORARY:
  196. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  197. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  198. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  199. * updated.
  200. */
  201. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  202. /*
  203. * TEMPORARY:
  204. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  205. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  206. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  207. * updated.
  208. */
  209. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  210. /* HTT Access Category values */
  211. enum HTT_AC_WMM {
  212. /* WMM Access Categories */
  213. HTT_AC_WMM_BE = 0x0,
  214. HTT_AC_WMM_BK = 0x1,
  215. HTT_AC_WMM_VI = 0x2,
  216. HTT_AC_WMM_VO = 0x3,
  217. /* extension Access Categories */
  218. HTT_AC_EXT_NON_QOS = 0x4,
  219. HTT_AC_EXT_UCAST_MGMT = 0x5,
  220. HTT_AC_EXT_MCAST_DATA = 0x6,
  221. HTT_AC_EXT_MCAST_MGMT = 0x7,
  222. };
  223. enum HTT_AC_WMM_MASK {
  224. /* WMM Access Categories */
  225. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  226. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  227. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  228. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  229. /* extension Access Categories */
  230. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  231. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  232. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  233. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  234. };
  235. #define HTT_AC_MASK_WMM \
  236. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  237. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  238. #define HTT_AC_MASK_EXT \
  239. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  240. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  241. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  242. /*
  243. * htt_dbg_stats_type -
  244. * bit positions for each stats type within a stats type bitmask
  245. * The bitmask contains 24 bits.
  246. */
  247. enum htt_dbg_stats_type {
  248. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  249. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  250. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  251. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  252. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  253. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  254. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  255. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  256. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  257. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  258. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  259. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  260. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  261. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  262. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  263. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  264. /* bits 16-23 currently reserved */
  265. /* keep this last */
  266. HTT_DBG_NUM_STATS
  267. };
  268. /*=== HTT option selection TLVs ===
  269. * Certain HTT messages have alternatives or options.
  270. * For such cases, the host and target need to agree on which option to use.
  271. * Option specification TLVs can be appended to the VERSION_REQ and
  272. * VERSION_CONF messages to select options other than the default.
  273. * These TLVs are entirely optional - if they are not provided, there is a
  274. * well-defined default for each option. If they are provided, they can be
  275. * provided in any order. Each TLV can be present or absent independent of
  276. * the presence / absence of other TLVs.
  277. *
  278. * The HTT option selection TLVs use the following format:
  279. * |31 16|15 8|7 0|
  280. * |---------------------------------+----------------+----------------|
  281. * | value (payload) | length | tag |
  282. * |-------------------------------------------------------------------|
  283. * The value portion need not be only 2 bytes; it can be extended by any
  284. * integer number of 4-byte units. The total length of the TLV, including
  285. * the tag and length fields, must be a multiple of 4 bytes. The length
  286. * field specifies the total TLV size in 4-byte units. Thus, the typical
  287. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  288. * field, would store 0x1 in its length field, to show that the TLV occupies
  289. * a single 4-byte unit.
  290. */
  291. /*--- TLV header format - applies to all HTT option TLVs ---*/
  292. enum HTT_OPTION_TLV_TAGS {
  293. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  294. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  295. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  296. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  297. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  298. };
  299. PREPACK struct htt_option_tlv_header_t {
  300. A_UINT8 tag;
  301. A_UINT8 length;
  302. } POSTPACK;
  303. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  304. #define HTT_OPTION_TLV_TAG_S 0
  305. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  306. #define HTT_OPTION_TLV_LENGTH_S 8
  307. /*
  308. * value0 - 16 bit value field stored in word0
  309. * The TLV's value field may be longer than 2 bytes, in which case
  310. * the remainder of the value is stored in word1, word2, etc.
  311. */
  312. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  313. #define HTT_OPTION_TLV_VALUE0_S 16
  314. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_TAG_GET(word) \
  320. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  321. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  322. do { \
  323. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  324. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  325. } while (0)
  326. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  327. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  328. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  331. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  332. } while (0)
  333. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  334. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  335. /*--- format of specific HTT option TLVs ---*/
  336. /*
  337. * HTT option TLV for specifying LL bus address size
  338. * Some chips require bus addresses used by the target to access buffers
  339. * within the host's memory to be 32 bits; others require bus addresses
  340. * used by the target to access buffers within the host's memory to be
  341. * 64 bits.
  342. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  343. * a suffix to the VERSION_CONF message to specify which bus address format
  344. * the target requires.
  345. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  346. * default to providing bus addresses to the target in 32-bit format.
  347. */
  348. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  349. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  350. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  351. };
  352. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  353. struct htt_option_tlv_header_t hdr;
  354. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  355. } POSTPACK;
  356. /*
  357. * HTT option TLV for specifying whether HL systems should indicate
  358. * over-the-air tx completion for individual frames, or should instead
  359. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  360. * requests an OTA tx completion for a particular tx frame.
  361. * This option does not apply to LL systems, where the TX_COMPL_IND
  362. * is mandatory.
  363. * This option is primarily intended for HL systems in which the tx frame
  364. * downloads over the host --> target bus are as slow as or slower than
  365. * the transmissions over the WLAN PHY. For cases where the bus is faster
  366. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  367. * and consquently will send one TX_COMPL_IND message that covers several
  368. * tx frames. For cases where the WLAN PHY is faster than the bus,
  369. * the target will end up transmitting very short A-MPDUs, and consequently
  370. * sending many TX_COMPL_IND messages, which each cover a very small number
  371. * of tx frames.
  372. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  373. * a suffix to the VERSION_REQ message to request whether the host desires to
  374. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  375. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  376. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  377. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  378. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  379. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  380. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  381. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  382. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  383. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  384. * TLV.
  385. */
  386. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  387. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  388. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  389. };
  390. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  391. struct htt_option_tlv_header_t hdr;
  392. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  393. } POSTPACK;
  394. /*
  395. * HTT option TLV for specifying how many tx queue groups the target
  396. * may establish.
  397. * This TLV specifies the maximum value the target may send in the
  398. * txq_group_id field of any TXQ_GROUP information elements sent by
  399. * the target to the host. This allows the host to pre-allocate an
  400. * appropriate number of tx queue group structs.
  401. *
  402. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  403. * a suffix to the VERSION_REQ message to specify whether the host supports
  404. * tx queue groups at all, and if so if there is any limit on the number of
  405. * tx queue groups that the host supports.
  406. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  407. * a suffix to the VERSION_CONF message. If the host has specified in the
  408. * VER_REQ message a limit on the number of tx queue groups the host can
  409. * supprt, the target shall limit its specification of the maximum tx groups
  410. * to be no larger than this host-specified limit.
  411. *
  412. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  413. * shall preallocate 4 tx queue group structs, and the target shall not
  414. * specify a txq_group_id larger than 3.
  415. */
  416. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  417. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  418. /*
  419. * values 1 through N specify the max number of tx queue groups
  420. * the sender supports
  421. */
  422. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  423. };
  424. /* TEMPORARY backwards-compatibility alias for a typo fix -
  425. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  426. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  427. * to support the old name (with the typo) until all references to the
  428. * old name are replaced with the new name.
  429. */
  430. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  431. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  432. struct htt_option_tlv_header_t hdr;
  433. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  434. } POSTPACK;
  435. /*
  436. * HTT option TLV for specifying whether the target supports an extended
  437. * version of the HTT tx descriptor. If the target provides this TLV
  438. * and specifies in the TLV that the target supports an extended version
  439. * of the HTT tx descriptor, the target must check the "extension" bit in
  440. * the HTT tx descriptor, and if the extension bit is set, to expect a
  441. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  442. * descriptor. Furthermore, the target must provide room for the HTT
  443. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  444. * This option is intended for systems where the host needs to explicitly
  445. * control the transmission parameters such as tx power for individual
  446. * tx frames.
  447. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  448. * as a suffix to the VERSION_CONF message to explicitly specify whether
  449. * the target supports the HTT tx MSDU extension descriptor.
  450. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  451. * by the host as lack of target support for the HTT tx MSDU extension
  452. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  453. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  454. * the HTT tx MSDU extension descriptor.
  455. * The host is not required to provide the HTT tx MSDU extension descriptor
  456. * just because the target supports it; the target must check the
  457. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  458. * extension descriptor is present.
  459. */
  460. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  461. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  462. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  463. };
  464. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  465. struct htt_option_tlv_header_t hdr;
  466. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  467. } POSTPACK;
  468. /*=== host -> target messages ===============================================*/
  469. enum htt_h2t_msg_type {
  470. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  471. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  472. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  473. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  474. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  475. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  476. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  477. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  478. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  479. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  480. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  481. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  482. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  483. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  484. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  485. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  486. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  487. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  488. /* keep this last */
  489. HTT_H2T_NUM_MSGS
  490. };
  491. /*
  492. * HTT host to target message type -
  493. * stored in bits 7:0 of the first word of the message
  494. */
  495. #define HTT_H2T_MSG_TYPE_M 0xff
  496. #define HTT_H2T_MSG_TYPE_S 0
  497. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  498. do { \
  499. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  500. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  501. } while (0)
  502. #define HTT_H2T_MSG_TYPE_GET(word) \
  503. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  504. /**
  505. * @brief host -> target version number request message definition
  506. *
  507. * |31 24|23 16|15 8|7 0|
  508. * |----------------+----------------+----------------+----------------|
  509. * | reserved | msg type |
  510. * |-------------------------------------------------------------------|
  511. * : option request TLV (optional) |
  512. * :...................................................................:
  513. *
  514. * The VER_REQ message may consist of a single 4-byte word, or may be
  515. * extended with TLVs that specify which HTT options the host is requesting
  516. * from the target.
  517. * The following option TLVs may be appended to the VER_REQ message:
  518. * - HL_SUPPRESS_TX_COMPL_IND
  519. * - HL_MAX_TX_QUEUE_GROUPS
  520. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  521. * may be appended to the VER_REQ message (but only one TLV of each type).
  522. *
  523. * Header fields:
  524. * - MSG_TYPE
  525. * Bits 7:0
  526. * Purpose: identifies this as a version number request message
  527. * Value: 0x0
  528. */
  529. #define HTT_VER_REQ_BYTES 4
  530. /* TBDXXX: figure out a reasonable number */
  531. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  532. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  533. /**
  534. * @brief HTT tx MSDU descriptor
  535. *
  536. * @details
  537. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  538. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  539. * the target firmware needs for the FW's tx processing, particularly
  540. * for creating the HW msdu descriptor.
  541. * The same HTT tx descriptor is used for HL and LL systems, though
  542. * a few fields within the tx descriptor are used only by LL or
  543. * only by HL.
  544. * The HTT tx descriptor is defined in two manners: by a struct with
  545. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  546. * definitions.
  547. * The target should use the struct def, for simplicitly and clarity,
  548. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  549. * neutral. Specifically, the host shall use the get/set macros built
  550. * around the mask + shift defs.
  551. */
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  557. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  560. #define HTT_TX_VDEV_ID_WORD 0
  561. #define HTT_TX_VDEV_ID_MASK 0x3f
  562. #define HTT_TX_VDEV_ID_SHIFT 16
  563. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  564. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  565. #define HTT_TX_MSDU_LEN_DWORD 1
  566. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  567. /*
  568. * HTT_VAR_PADDR macros
  569. * Allow physical / bus addresses to be either a single 32-bit value,
  570. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  571. */
  572. #define HTT_VAR_PADDR32(var_name) \
  573. A_UINT32 var_name
  574. #define HTT_VAR_PADDR64_LE(var_name) \
  575. struct { \
  576. /* little-endian: lo precedes hi */ \
  577. A_UINT32 lo; \
  578. A_UINT32 hi; \
  579. } var_name
  580. /*
  581. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  582. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  583. * addresses are stored in a XXX-bit field.
  584. * This macro is used to define both htt_tx_msdu_desc32_t and
  585. * htt_tx_msdu_desc64_t structs.
  586. */
  587. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  588. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  589. { \
  590. /* DWORD 0: flags and meta-data */ \
  591. A_UINT32 \
  592. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  593. \
  594. /* pkt_subtype - \
  595. * Detailed specification of the tx frame contents, extending the \
  596. * general specification provided by pkt_type. \
  597. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  598. * pkt_type | pkt_subtype \
  599. * ============================================================== \
  600. * 802.3 | bit 0:3 - Reserved \
  601. * | bit 4: 0x0 - Copy-Engine Classification Results \
  602. * | not appended to the HTT message \
  603. * | 0x1 - Copy-Engine Classification Results \
  604. * | appended to the HTT message in the \
  605. * | format: \
  606. * | [HTT tx desc, frame header, \
  607. * | CE classification results] \
  608. * | The CE classification results begin \
  609. * | at the next 4-byte boundary after \
  610. * | the frame header. \
  611. * ------------+------------------------------------------------- \
  612. * Eth2 | bit 0:3 - Reserved \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message. \
  617. * | See the above specification of the \
  618. * | CE classification results location. \
  619. * ------------+------------------------------------------------- \
  620. * native WiFi | bit 0:3 - Reserved \
  621. * | bit 4: 0x0 - Copy-Engine Classification Results \
  622. * | not appended to the HTT message \
  623. * | 0x1 - Copy-Engine Classification Results \
  624. * | appended to the HTT message. \
  625. * | See the above specification of the \
  626. * | CE classification results location. \
  627. * ------------+------------------------------------------------- \
  628. * mgmt | 0x0 - 802.11 MAC header absent \
  629. * | 0x1 - 802.11 MAC header present \
  630. * ------------+------------------------------------------------- \
  631. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  632. * | 0x1 - 802.11 MAC header present \
  633. * | bit 1: 0x0 - allow aggregation \
  634. * | 0x1 - don't allow aggregation \
  635. * | bit 2: 0x0 - perform encryption \
  636. * | 0x1 - don't perform encryption \
  637. * | bit 3: 0x0 - perform tx classification / queuing \
  638. * | 0x1 - don't perform tx classification; \
  639. * | insert the frame into the "misc" \
  640. * | tx queue \
  641. * | bit 4: 0x0 - Copy-Engine Classification Results \
  642. * | not appended to the HTT message \
  643. * | 0x1 - Copy-Engine Classification Results \
  644. * | appended to the HTT message. \
  645. * | See the above specification of the \
  646. * | CE classification results location. \
  647. */ \
  648. pkt_subtype: 5, \
  649. \
  650. /* pkt_type - \
  651. * General specification of the tx frame contents. \
  652. * The htt_pkt_type enum should be used to specify and check the \
  653. * value of this field. \
  654. */ \
  655. pkt_type: 3, \
  656. \
  657. /* vdev_id - \
  658. * ID for the vdev that is sending this tx frame. \
  659. * For certain non-standard packet types, e.g. pkt_type == raw \
  660. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  661. * This field is used primarily for determining where to queue \
  662. * broadcast and multicast frames. \
  663. */ \
  664. vdev_id: 6, \
  665. /* ext_tid - \
  666. * The extended traffic ID. \
  667. * If the TID is unknown, the extended TID is set to \
  668. * HTT_TX_EXT_TID_INVALID. \
  669. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  670. * value of the QoS TID. \
  671. * If the tx frame is non-QoS data, then the extended TID is set to \
  672. * HTT_TX_EXT_TID_NON_QOS. \
  673. * If the tx frame is multicast or broadcast, then the extended TID \
  674. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  675. */ \
  676. ext_tid: 5, \
  677. \
  678. /* postponed - \
  679. * This flag indicates whether the tx frame has been downloaded to \
  680. * the target before but discarded by the target, and now is being \
  681. * downloaded again; or if this is a new frame that is being \
  682. * downloaded for the first time. \
  683. * This flag allows the target to determine the correct order for \
  684. * transmitting new vs. old frames. \
  685. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  686. * This flag only applies to HL systems, since in LL systems, \
  687. * the tx flow control is handled entirely within the target. \
  688. */ \
  689. postponed: 1, \
  690. \
  691. /* extension - \
  692. * This flag indicates whether a HTT tx MSDU extension descriptor \
  693. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  694. * \
  695. * 0x0 - no extension MSDU descriptor is present \
  696. * 0x1 - an extension MSDU descriptor immediately follows the \
  697. * regular MSDU descriptor \
  698. */ \
  699. extension: 1, \
  700. \
  701. /* cksum_offload - \
  702. * This flag indicates whether checksum offload is enabled or not \
  703. * for this frame. Target FW use this flag to turn on HW checksumming \
  704. * 0x0 - No checksum offload \
  705. * 0x1 - L3 header checksum only \
  706. * 0x2 - L4 checksum only \
  707. * 0x3 - L3 header checksum + L4 checksum \
  708. */ \
  709. cksum_offload: 2, \
  710. \
  711. /* tx_comp_req - \
  712. * This flag indicates whether Tx Completion \
  713. * from fw is required or not. \
  714. * This flag is only relevant if tx completion is not \
  715. * universally enabled. \
  716. * For all LL systems, tx completion is mandatory, \
  717. * so this flag will be irrelevant. \
  718. * For HL systems tx completion is optional, but HL systems in which \
  719. * the bus throughput exceeds the WLAN throughput will \
  720. * probably want to always use tx completion, and thus \
  721. * would not check this flag. \
  722. * This flag is required when tx completions are not used universally, \
  723. * but are still required for certain tx frames for which \
  724. * an OTA delivery acknowledgment is needed by the host. \
  725. * In practice, this would be for HL systems in which the \
  726. * bus throughput is less than the WLAN throughput. \
  727. * \
  728. * 0x0 - Tx Completion Indication from Fw not required \
  729. * 0x1 - Tx Completion Indication from Fw is required \
  730. */ \
  731. tx_compl_req: 1; \
  732. \
  733. \
  734. /* DWORD 1: MSDU length and ID */ \
  735. A_UINT32 \
  736. len: 16, /* MSDU length, in bytes */ \
  737. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  738. * and this id is used to calculate fragmentation \
  739. * descriptor pointer inside the target based on \
  740. * the base address, configured inside the target. \
  741. */ \
  742. \
  743. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  744. /* frags_desc_ptr - \
  745. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  746. * where the tx frame's fragments reside in memory. \
  747. * This field only applies to LL systems, since in HL systems the \
  748. * (degenerate single-fragment) fragmentation descriptor is created \
  749. * within the target. \
  750. */ \
  751. _paddr__frags_desc_ptr_; \
  752. \
  753. /* DWORD 3 (or 4): peerid, chanfreq */ \
  754. /* \
  755. * Peer ID : Target can use this value to know which peer-id packet \
  756. * destined to. \
  757. * It's intended to be specified by host in case of NAWDS. \
  758. */ \
  759. A_UINT16 peerid; \
  760. \
  761. /* \
  762. * Channel frequency: This identifies the desired channel \
  763. * frequency (in mhz) for tx frames. This is used by FW to help \
  764. * determine when it is safe to transmit or drop frames for \
  765. * off-channel operation. \
  766. * The default value of zero indicates to FW that the corresponding \
  767. * VDEV's home channel (if there is one) is the desired channel \
  768. * frequency. \
  769. */ \
  770. A_UINT16 chanfreq; \
  771. \
  772. /* Reason reserved is commented is increasing the htt structure size \
  773. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  774. * A_UINT32 reserved_dword3_bits0_31; \
  775. */ \
  776. } POSTPACK
  777. /* define a htt_tx_msdu_desc32_t type */
  778. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  779. /* define a htt_tx_msdu_desc64_t type */
  780. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  781. /*
  782. * Make htt_tx_msdu_desc_t be an alias for either
  783. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  784. */
  785. #if HTT_PADDR64
  786. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  787. #else
  788. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  789. #endif
  790. /* decriptor information for Management frame*/
  791. /*
  792. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  793. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  794. */
  795. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  796. extern A_UINT32 mgmt_hdr_len;
  797. PREPACK struct htt_mgmt_tx_desc_t {
  798. A_UINT32 msg_type;
  799. #if HTT_PADDR64
  800. A_UINT64 frag_paddr; /* DMAble address of the data */
  801. #else
  802. A_UINT32 frag_paddr; /* DMAble address of the data */
  803. #endif
  804. A_UINT32 desc_id; /* returned to host during completion
  805. * to free the meory*/
  806. A_UINT32 len; /* Fragment length */
  807. A_UINT32 vdev_id; /* virtual device ID*/
  808. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  809. } POSTPACK;
  810. PREPACK struct htt_mgmt_tx_compl_ind {
  811. A_UINT32 desc_id;
  812. A_UINT32 status;
  813. } POSTPACK;
  814. /*
  815. * This SDU header size comes from the summation of the following:
  816. * 1. Max of:
  817. * a. Native WiFi header, for native WiFi frames: 24 bytes
  818. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  819. * b. 802.11 header, for raw frames: 36 bytes
  820. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  821. * QoS header, HT header)
  822. * c. 802.3 header, for ethernet frames: 14 bytes
  823. * (destination address, source address, ethertype / length)
  824. * 2. Max of:
  825. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  826. * b. IPv6 header, up through the Traffic Class: 2 bytes
  827. * 3. 802.1Q VLAN header: 4 bytes
  828. * 4. LLC/SNAP header: 8 bytes
  829. */
  830. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  831. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  832. #define HTT_TX_HDR_SIZE_ETHERNET 14
  833. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  834. A_COMPILE_TIME_ASSERT(
  835. htt_encap_hdr_size_max_check_nwifi,
  836. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  837. A_COMPILE_TIME_ASSERT(
  838. htt_encap_hdr_size_max_check_enet,
  839. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  840. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  841. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  842. #define HTT_TX_HDR_SIZE_802_1Q 4
  843. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  844. #define HTT_COMMON_TX_FRM_HDR_LEN \
  845. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  846. HTT_TX_HDR_SIZE_802_1Q + \
  847. HTT_TX_HDR_SIZE_LLC_SNAP)
  848. #define HTT_HL_TX_FRM_HDR_LEN \
  849. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  850. #define HTT_LL_TX_FRM_HDR_LEN \
  851. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  852. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  853. /* dword 0 */
  854. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  857. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  858. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  861. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  862. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  865. #define HTT_TX_DESC_PKT_TYPE_S 13
  866. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  869. #define HTT_TX_DESC_VDEV_ID_S 16
  870. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  873. #define HTT_TX_DESC_EXT_TID_S 22
  874. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  877. #define HTT_TX_DESC_POSTPONED_S 27
  878. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  879. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  881. #define HTT_TX_DESC_EXTENSION_S 28
  882. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  885. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  886. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  889. #define HTT_TX_DESC_TX_COMP_S 31
  890. /* dword 1 */
  891. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  892. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  893. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  894. #define HTT_TX_DESC_FRM_LEN_S 0
  895. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  896. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  897. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  898. #define HTT_TX_DESC_FRM_ID_S 16
  899. /* dword 2 */
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  902. /* for systems using 64-bit format for bus addresses */
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  905. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  907. /* for systems using 32-bit format for bus addresses */
  908. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  910. /* dword 3 */
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  914. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  916. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  917. #if HTT_PADDR64
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  920. #else
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  923. #endif
  924. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  925. #define HTT_TX_DESC_PEER_ID_S 0
  926. /*
  927. * TEMPORARY:
  928. * The original definitions for the PEER_ID fields contained typos
  929. * (with _DESC_PADDR appended to this PEER_ID field name).
  930. * Retain deprecated original names for PEER_ID fields until all code that
  931. * refers to them has been updated.
  932. */
  933. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  934. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  935. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  936. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  937. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  938. HTT_TX_DESC_PEER_ID_M
  939. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  940. HTT_TX_DESC_PEER_ID_S
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  944. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  946. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  947. #if HTT_PADDR64
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  950. #else
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  953. #endif
  954. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  955. #define HTT_TX_DESC_CHAN_FREQ_S 16
  956. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  957. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  958. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  961. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  962. } while (0)
  963. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  964. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  965. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  966. do { \
  967. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  968. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  969. } while (0)
  970. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  971. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  972. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  978. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  979. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  985. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  986. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  992. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  993. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  999. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1000. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1007. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1014. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1021. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1028. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1035. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1039. } while (0)
  1040. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1041. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1042. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1043. do { \
  1044. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1045. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1046. } while (0)
  1047. /* enums used in the HTT tx MSDU extension descriptor */
  1048. enum {
  1049. htt_tx_guard_interval_regular = 0,
  1050. htt_tx_guard_interval_short = 1,
  1051. };
  1052. enum {
  1053. htt_tx_preamble_type_ofdm = 0,
  1054. htt_tx_preamble_type_cck = 1,
  1055. htt_tx_preamble_type_ht = 2,
  1056. htt_tx_preamble_type_vht = 3,
  1057. };
  1058. enum {
  1059. htt_tx_bandwidth_5MHz = 0,
  1060. htt_tx_bandwidth_10MHz = 1,
  1061. htt_tx_bandwidth_20MHz = 2,
  1062. htt_tx_bandwidth_40MHz = 3,
  1063. htt_tx_bandwidth_80MHz = 4,
  1064. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1065. };
  1066. /**
  1067. * @brief HTT tx MSDU extension descriptor
  1068. * @details
  1069. * If the target supports HTT tx MSDU extension descriptors, the host has
  1070. * the option of appending the following struct following the regular
  1071. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1072. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1073. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1074. * tx specs for each frame.
  1075. */
  1076. PREPACK struct htt_tx_msdu_desc_ext_t {
  1077. /* DWORD 0: flags */
  1078. A_UINT32
  1079. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1080. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1081. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1082. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1083. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1084. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1085. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1086. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1087. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1088. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1089. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1090. /* DWORD 1: tx power, tx rate, tx BW */
  1091. A_UINT32
  1092. /* pwr -
  1093. * Specify what power the tx frame needs to be transmitted at.
  1094. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1095. * The value needs to be appropriately sign-extended when extracting
  1096. * the value from the message and storing it in a variable that is
  1097. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1098. * automatically handles this sign-extension.)
  1099. * If the transmission uses multiple tx chains, this power spec is
  1100. * the total transmit power, assuming incoherent combination of
  1101. * per-chain power to produce the total power.
  1102. */
  1103. pwr: 8,
  1104. /* mcs_mask -
  1105. * Specify the allowable values for MCS index (modulation and coding)
  1106. * to use for transmitting the frame.
  1107. *
  1108. * For HT / VHT preamble types, this mask directly corresponds to
  1109. * the HT or VHT MCS indices that are allowed. For each bit N set
  1110. * within the mask, MCS index N is allowed for transmitting the frame.
  1111. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1112. * rates versus OFDM rates, so the host has the option of specifying
  1113. * that the target must transmit the frame with CCK or OFDM rates
  1114. * (not HT or VHT), but leaving the decision to the target whether
  1115. * to use CCK or OFDM.
  1116. *
  1117. * For CCK and OFDM, the bits within this mask are interpreted as
  1118. * follows:
  1119. * bit 0 -> CCK 1 Mbps rate is allowed
  1120. * bit 1 -> CCK 2 Mbps rate is allowed
  1121. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1122. * bit 3 -> CCK 11 Mbps rate is allowed
  1123. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1124. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1125. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1126. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1127. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1128. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1129. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1130. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1131. *
  1132. * The MCS index specification needs to be compatible with the
  1133. * bandwidth mask specification. For example, a MCS index == 9
  1134. * specification is inconsistent with a preamble type == VHT,
  1135. * Nss == 1, and channel bandwidth == 20 MHz.
  1136. *
  1137. * Furthermore, the host has only a limited ability to specify to
  1138. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1139. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1140. */
  1141. mcs_mask: 12,
  1142. /* nss_mask -
  1143. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1144. * Each bit in this mask corresponds to a Nss value:
  1145. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1146. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1147. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1148. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1149. * The values in the Nss mask must be suitable for the recipient, e.g.
  1150. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1151. * recipient which only supports 2x2 MIMO.
  1152. */
  1153. nss_mask: 4,
  1154. /* guard_interval -
  1155. * Specify a htt_tx_guard_interval enum value to indicate whether
  1156. * the transmission should use a regular guard interval or a
  1157. * short guard interval.
  1158. */
  1159. guard_interval: 1,
  1160. /* preamble_type_mask -
  1161. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1162. * may choose from for transmitting this frame.
  1163. * The bits in this mask correspond to the values in the
  1164. * htt_tx_preamble_type enum. For example, to allow the target
  1165. * to transmit the frame as either CCK or OFDM, this field would
  1166. * be set to
  1167. * (1 << htt_tx_preamble_type_ofdm) |
  1168. * (1 << htt_tx_preamble_type_cck)
  1169. */
  1170. preamble_type_mask: 4,
  1171. reserved1_31_29: 3; /* unused, set to 0x0 */
  1172. /* DWORD 2: tx chain mask, tx retries */
  1173. A_UINT32
  1174. /* chain_mask - specify which chains to transmit from */
  1175. chain_mask: 4,
  1176. /* retry_limit -
  1177. * Specify the maximum number of transmissions, including the
  1178. * initial transmission, to attempt before giving up if no ack
  1179. * is received.
  1180. * If the tx rate is specified, then all retries shall use the
  1181. * same rate as the initial transmission.
  1182. * If no tx rate is specified, the target can choose whether to
  1183. * retain the original rate during the retransmissions, or to
  1184. * fall back to a more robust rate.
  1185. */
  1186. retry_limit: 4,
  1187. /* bandwidth_mask -
  1188. * Specify what channel widths may be used for the transmission.
  1189. * A value of zero indicates "don't care" - the target may choose
  1190. * the transmission bandwidth.
  1191. * The bits within this mask correspond to the htt_tx_bandwidth
  1192. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1193. * The bandwidth_mask must be consistent with the preamble_type_mask
  1194. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1195. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1196. */
  1197. bandwidth_mask: 6,
  1198. reserved2_31_14: 18; /* unused, set to 0x0 */
  1199. /* DWORD 3: tx expiry time (TSF) LSBs */
  1200. A_UINT32 expire_tsf_lo;
  1201. /* DWORD 4: tx expiry time (TSF) MSBs */
  1202. A_UINT32 expire_tsf_hi;
  1203. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1204. } POSTPACK;
  1205. /* DWORD 0 */
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1226. /* DWORD 1 */
  1227. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1228. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1229. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1230. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1231. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1232. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1233. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1234. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1235. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1236. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1237. /* DWORD 2 */
  1238. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1239. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1240. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1241. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1242. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1243. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1244. /* DWORD 0 */
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1251. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1252. } while (0)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL( \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1268. ((_var) |= ((_val) \
  1269. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1270. } while (0)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1272. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL( \
  1277. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1278. ((_var) |= ((_val) \
  1279. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1280. } while (0)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1320. } while (0)
  1321. /* DWORD 1 */
  1322. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1326. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1327. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1328. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1329. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1330. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1331. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1354. } while (0)
  1355. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1362. } while (0)
  1363. /* DWORD 2 */
  1364. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1371. } while (0)
  1372. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1373. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1374. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1375. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1376. do { \
  1377. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1378. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1379. } while (0)
  1380. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1381. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1382. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1383. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1384. do { \
  1385. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1386. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1387. } while (0)
  1388. typedef enum {
  1389. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1390. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1391. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1392. } htt_11ax_ltf_subtype_t;
  1393. typedef enum {
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1396. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1397. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1398. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1399. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1400. } htt_tx_ext2_preamble_type_t;
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1413. /**
  1414. * @brief HTT tx MSDU extension descriptor v2
  1415. * @details
  1416. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1417. * is received as tcl_exit_base->host_meta_info in firmware.
  1418. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1419. * are already part of tcl_exit_base.
  1420. */
  1421. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1422. /* DWORD 0: flags */
  1423. A_UINT32
  1424. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1425. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1426. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1427. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1428. valid_retries : 1, /* if set, tx retries spec is valid */
  1429. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1430. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1431. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1432. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1433. valid_key_flags : 1, /* if set, key flags is valid */
  1434. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1435. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1436. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1437. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1438. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1439. 1 = ENCRYPT,
  1440. 2 ~ 3 - Reserved */
  1441. /* retry_limit -
  1442. * Specify the maximum number of transmissions, including the
  1443. * initial transmission, to attempt before giving up if no ack
  1444. * is received.
  1445. * If the tx rate is specified, then all retries shall use the
  1446. * same rate as the initial transmission.
  1447. * If no tx rate is specified, the target can choose whether to
  1448. * retain the original rate during the retransmissions, or to
  1449. * fall back to a more robust rate.
  1450. */
  1451. retry_limit : 4,
  1452. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1453. * Valid only for 11ax preamble types HE_SU
  1454. * and HE_EXT_SU
  1455. */
  1456. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1457. * Valid only for 11ax preamble types HE_SU
  1458. * and HE_EXT_SU
  1459. */
  1460. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1461. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1462. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1463. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1464. */
  1465. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1466. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1467. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1468. * Use cases:
  1469. * Any time firmware uses TQM-BYPASS for Data
  1470. * TID, firmware expect host to set this bit.
  1471. */
  1472. /* DWORD 1: tx power, tx rate */
  1473. A_UINT32
  1474. power : 8, /* unit of the power field is 0.5 dbm
  1475. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1476. * signed value ranging from -64dbm to 63.5 dbm
  1477. */
  1478. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1479. * Setting more than one MCS isn't currently
  1480. * supported by the target (but is supported
  1481. * in the interface in case in the future
  1482. * the target supports specifications of
  1483. * a limited set of MCS values.
  1484. */
  1485. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1486. * Setting more than one Nss isn't currently
  1487. * supported by the target (but is supported
  1488. * in the interface in case in the future
  1489. * the target supports specifications of
  1490. * a limited set of Nss values.
  1491. */
  1492. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1493. update_peer_cache : 1; /* When set these custom values will be
  1494. * used for all packets, until the next
  1495. * update via this ext header.
  1496. * This is to make sure not all packets
  1497. * need to include this header.
  1498. */
  1499. /* DWORD 2: tx chain mask, tx retries */
  1500. A_UINT32
  1501. /* chain_mask - specify which chains to transmit from */
  1502. chain_mask : 8,
  1503. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1504. * TODO: Update Enum values for key_flags
  1505. */
  1506. /*
  1507. * Channel frequency: This identifies the desired channel
  1508. * frequency (in MHz) for tx frames. This is used by FW to help
  1509. * determine when it is safe to transmit or drop frames for
  1510. * off-channel operation.
  1511. * The default value of zero indicates to FW that the corresponding
  1512. * VDEV's home channel (if there is one) is the desired channel
  1513. * frequency.
  1514. */
  1515. chanfreq : 16;
  1516. /* DWORD 3: tx expiry time (TSF) LSBs */
  1517. A_UINT32 expire_tsf_lo;
  1518. /* DWORD 4: tx expiry time (TSF) MSBs */
  1519. A_UINT32 expire_tsf_hi;
  1520. /* DWORD 5: reserved
  1521. * This structure can be expanded further up to 60 bytes
  1522. * by adding further DWORDs as needed.
  1523. */
  1524. A_UINT32
  1525. /* learning_frame
  1526. * When this flag is set, this frame will be dropped by FW
  1527. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1528. */
  1529. learning_frame : 1,
  1530. rsvd0 : 31;
  1531. } POSTPACK;
  1532. /* DWORD 0 */
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1559. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1560. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1561. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1562. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1563. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1564. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1565. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1566. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1567. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1568. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1569. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1570. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1571. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1572. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1573. /* DWORD 1 */
  1574. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1575. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1576. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1577. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1578. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1579. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1580. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1581. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1582. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1583. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1584. /* DWORD 2 */
  1585. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1586. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1587. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1588. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1589. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1590. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1591. /* DWORD 5 */
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1594. /* DWORD 0 */
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1597. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1621. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL( \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1626. ((_var) |= ((_val) \
  1627. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1628. } while (0)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1631. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1639. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL( \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1652. ((_var) |= ((_val) \
  1653. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1657. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1658. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1665. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1750. } while (0)
  1751. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1755. do { \
  1756. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1757. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1758. } while (0)
  1759. /* DWORD 1 */
  1760. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1764. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1765. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1766. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1767. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1768. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1769. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1792. } while (0)
  1793. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1795. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1796. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1800. } while (0)
  1801. /* DWORD 2 */
  1802. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1803. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1804. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1806. do { \
  1807. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1808. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1809. } while (0)
  1810. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1817. } while (0)
  1818. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1825. } while (0)
  1826. /* DWORD 5 */
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1834. } while (0)
  1835. typedef enum {
  1836. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1837. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1838. } htt_tcl_metadata_type;
  1839. /**
  1840. * @brief HTT TCL command number format
  1841. * @details
  1842. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1843. * available to firmware as tcl_exit_base->tcl_status_number.
  1844. * For regular / multicast packets host will send vdev and mac id and for
  1845. * NAWDS packets, host will send peer id.
  1846. * A_UINT32 is used to avoid endianness conversion problems.
  1847. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1848. */
  1849. typedef struct {
  1850. A_UINT32
  1851. type: 1, /* vdev_id based or peer_id based */
  1852. rsvd: 31;
  1853. } htt_tx_tcl_vdev_or_peer_t;
  1854. typedef struct {
  1855. A_UINT32
  1856. type: 1, /* vdev_id based or peer_id based */
  1857. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1858. vdev_id: 8,
  1859. pdev_id: 2,
  1860. host_inspected:1,
  1861. rsvd: 19;
  1862. } htt_tx_tcl_vdev_metadata;
  1863. typedef struct {
  1864. A_UINT32
  1865. type: 1, /* vdev_id based or peer_id based */
  1866. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1867. peer_id: 14,
  1868. rsvd: 16;
  1869. } htt_tx_tcl_peer_metadata;
  1870. PREPACK struct htt_tx_tcl_metadata {
  1871. union {
  1872. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1873. htt_tx_tcl_vdev_metadata vdev_meta;
  1874. htt_tx_tcl_peer_metadata peer_meta;
  1875. };
  1876. } POSTPACK;
  1877. /* DWORD 0 */
  1878. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1879. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1880. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1881. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1882. /* VDEV metadata */
  1883. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1884. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1885. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1886. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1887. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1888. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1889. /* PEER metadata */
  1890. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1891. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1892. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1893. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1894. HTT_TX_TCL_METADATA_TYPE_S)
  1895. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1899. } while (0)
  1900. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1901. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1902. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1903. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1907. } while (0)
  1908. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1909. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1910. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1911. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1912. do { \
  1913. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1914. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1915. } while (0)
  1916. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1917. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1918. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1919. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1923. } while (0)
  1924. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1925. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1926. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1927. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1931. } while (0)
  1932. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1933. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1934. HTT_TX_TCL_METADATA_PEER_ID_S)
  1935. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1939. } while (0)
  1940. typedef enum {
  1941. HTT_TX_FW2WBM_TX_STATUS_OK,
  1942. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1943. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1944. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1945. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1946. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1947. HTT_TX_FW2WBM_TX_STATUS_MAX
  1948. } htt_tx_fw2wbm_tx_status_t;
  1949. typedef enum {
  1950. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1951. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1952. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1953. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1954. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1955. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1956. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1957. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1958. } htt_tx_fw2wbm_reinject_reason_t;
  1959. /**
  1960. * @brief HTT TX WBM Completion from firmware to host
  1961. * @details
  1962. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1963. * DWORD 3 and 4 for software based completions (Exception frames and
  1964. * TQM bypass frames)
  1965. * For software based completions, wbm_release_ring->release_source_module will
  1966. * be set to release_source_fw
  1967. */
  1968. PREPACK struct htt_tx_wbm_completion {
  1969. A_UINT32
  1970. sch_cmd_id: 24,
  1971. exception_frame: 1, /* If set, this packet was queued via exception path */
  1972. rsvd0_31_25: 7;
  1973. A_UINT32
  1974. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1975. * reception of an ACK or BA, this field indicates
  1976. * the RSSI of the received ACK or BA frame.
  1977. * When the frame is removed as result of a direct
  1978. * remove command from the SW, this field is set
  1979. * to 0x0 (which is never a valid value when real
  1980. * RSSI is available).
  1981. * Units: dB w.r.t noise floor
  1982. */
  1983. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1984. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1985. rsvd1_31_16: 16;
  1986. } POSTPACK;
  1987. /* DWORD 0 */
  1988. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1989. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1990. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1991. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1992. /* DWORD 1 */
  1993. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1994. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1995. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1996. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1997. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1998. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1999. /* DWORD 0 */
  2000. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2001. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2002. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2003. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2007. } while (0)
  2008. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2009. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2010. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2011. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2015. } while (0)
  2016. /* DWORD 1 */
  2017. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2018. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2019. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2020. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2024. } while (0)
  2025. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2026. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2027. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2028. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2032. } while (0)
  2033. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2034. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2035. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2036. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2040. } while (0)
  2041. /**
  2042. * @brief HTT TX WBM Completion from firmware to host
  2043. * @details
  2044. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2045. * (WBM) offload HW.
  2046. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2047. * For software based completions, release_source_module will
  2048. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2049. * struct wbm_release_ring and then switch to this after looking at
  2050. * release_source_module.
  2051. */
  2052. PREPACK struct htt_tx_wbm_completion_v2 {
  2053. A_UINT32
  2054. used_by_hw0; /* Refer to struct wbm_release_ring */
  2055. A_UINT32
  2056. used_by_hw1; /* Refer to struct wbm_release_ring */
  2057. A_UINT32
  2058. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2059. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2060. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2061. exception_frame: 1,
  2062. rsvd0: 12, /* For future use */
  2063. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2064. rsvd1: 1; /* For future use */
  2065. A_UINT32
  2066. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2067. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2068. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2069. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2070. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2071. */
  2072. A_UINT32
  2073. data1: 32;
  2074. A_UINT32
  2075. data2: 32;
  2076. A_UINT32
  2077. used_by_hw3; /* Refer to struct wbm_release_ring */
  2078. } POSTPACK;
  2079. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2080. /* DWORD 3 */
  2081. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2082. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2083. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2084. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2085. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2086. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2087. /* DWORD 3 */
  2088. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2090. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2091. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2098. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2099. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2103. } while (0)
  2104. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2105. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2106. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2107. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2111. } while (0)
  2112. /**
  2113. * @brief HTT TX WBM transmit status from firmware to host
  2114. * @details
  2115. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2116. * (WBM) offload HW.
  2117. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2118. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2119. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2120. */
  2121. PREPACK struct htt_tx_wbm_transmit_status {
  2122. A_UINT32
  2123. sch_cmd_id: 24,
  2124. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2125. * reception of an ACK or BA, this field indicates
  2126. * the RSSI of the received ACK or BA frame.
  2127. * When the frame is removed as result of a direct
  2128. * remove command from the SW, this field is set
  2129. * to 0x0 (which is never a valid value when real
  2130. * RSSI is available).
  2131. * Units: dB w.r.t noise floor
  2132. */
  2133. A_UINT32
  2134. sw_peer_id: 16,
  2135. tid_num: 5,
  2136. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2137. * and tid_num fields contain valid data.
  2138. * If this "valid" flag is not set, the
  2139. * sw_peer_id and tid_num fields must be ignored.
  2140. */
  2141. mcast: 1,
  2142. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2143. * contains valid data.
  2144. */
  2145. reserved0: 8;
  2146. A_UINT32
  2147. reserved1: 32;
  2148. } POSTPACK;
  2149. /* DWORD 4 */
  2150. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2151. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2152. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2153. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2154. /* DWORD 5 */
  2155. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2156. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2157. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2158. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2159. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2160. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2161. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2162. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2163. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2164. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2165. /* DWORD 4 */
  2166. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2167. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2168. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2169. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2173. } while (0)
  2174. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2175. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2176. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2177. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2181. } while (0)
  2182. /* DWORD 5 */
  2183. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2184. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2185. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2186. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2190. } while (0)
  2191. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2192. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2193. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2194. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2198. } while (0)
  2199. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2200. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2201. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2202. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2203. do { \
  2204. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2205. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2206. } while (0)
  2207. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2208. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2209. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2210. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2211. do { \
  2212. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2213. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2214. } while (0)
  2215. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2216. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2217. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2219. do { \
  2220. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2221. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2222. } while (0)
  2223. /**
  2224. * @brief HTT TX WBM reinject status from firmware to host
  2225. * @details
  2226. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2227. * (WBM) offload HW.
  2228. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2229. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2230. */
  2231. PREPACK struct htt_tx_wbm_reinject_status {
  2232. A_UINT32
  2233. reserved0: 32;
  2234. A_UINT32
  2235. reserved1: 32;
  2236. A_UINT32
  2237. reserved2: 32;
  2238. } POSTPACK;
  2239. /**
  2240. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2241. * @details
  2242. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2243. * (WBM) offload HW.
  2244. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2245. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2246. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2247. * STA side.
  2248. */
  2249. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2250. A_UINT32
  2251. mec_sa_addr_31_0;
  2252. A_UINT32
  2253. mec_sa_addr_47_32: 16,
  2254. sa_ast_index: 16;
  2255. A_UINT32
  2256. vdev_id: 8,
  2257. reserved0: 24;
  2258. } POSTPACK;
  2259. /* DWORD 4 - mec_sa_addr_31_0 */
  2260. /* DWORD 5 */
  2261. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2262. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2263. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2264. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2265. /* DWORD 6 */
  2266. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2267. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2268. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2275. } while (0)
  2276. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2278. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2279. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2283. } while (0)
  2284. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2285. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2286. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2287. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2291. } while (0)
  2292. typedef enum {
  2293. TX_FLOW_PRIORITY_BE,
  2294. TX_FLOW_PRIORITY_HIGH,
  2295. TX_FLOW_PRIORITY_LOW,
  2296. } htt_tx_flow_priority_t;
  2297. typedef enum {
  2298. TX_FLOW_LATENCY_SENSITIVE,
  2299. TX_FLOW_LATENCY_INSENSITIVE,
  2300. } htt_tx_flow_latency_t;
  2301. typedef enum {
  2302. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2303. TX_FLOW_INTERACTIVE_TRAFFIC,
  2304. TX_FLOW_PERIODIC_TRAFFIC,
  2305. TX_FLOW_BURSTY_TRAFFIC,
  2306. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2307. } htt_tx_flow_traffic_pattern_t;
  2308. /**
  2309. * @brief HTT TX Flow search metadata format
  2310. * @details
  2311. * Host will set this metadata in flow table's flow search entry along with
  2312. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2313. * firmware and TQM ring if the flow search entry wins.
  2314. * This metadata is available to firmware in that first MSDU's
  2315. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2316. * to one of the available flows for specific tid and returns the tqm flow
  2317. * pointer as part of htt_tx_map_flow_info message.
  2318. */
  2319. PREPACK struct htt_tx_flow_metadata {
  2320. A_UINT32
  2321. rsvd0_1_0: 2,
  2322. tid: 4,
  2323. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2324. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2325. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2326. * Else choose final tid based on latency, priority.
  2327. */
  2328. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2329. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2330. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2331. } POSTPACK;
  2332. /* DWORD 0 */
  2333. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2334. #define HTT_TX_FLOW_METADATA_TID_S 2
  2335. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2336. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2337. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2338. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2339. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2340. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2341. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2342. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2343. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2344. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2345. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2346. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2347. /* DWORD 0 */
  2348. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2349. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2350. HTT_TX_FLOW_METADATA_TID_S)
  2351. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2352. do { \
  2353. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2354. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2355. } while (0)
  2356. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2357. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2358. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2359. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2360. do { \
  2361. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2362. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2363. } while (0)
  2364. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2365. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2366. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2367. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2368. do { \
  2369. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2370. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2371. } while (0)
  2372. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2373. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2374. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2375. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2378. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2379. } while (0)
  2380. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2381. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2382. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2383. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2386. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2387. } while (0)
  2388. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2389. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2390. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2391. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2395. } while (0)
  2396. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2397. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2398. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2399. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2403. } while (0)
  2404. /**
  2405. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2406. *
  2407. * @details
  2408. * HTT wds entry from source port learning
  2409. * Host will learn wds entries from rx and send this message to firmware
  2410. * to enable firmware to configure/delete AST entries for wds clients.
  2411. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2412. * and when SA's entry is deleted, firmware removes this AST entry
  2413. *
  2414. * The message would appear as follows:
  2415. *
  2416. * |31 30|29 |17 16|15 8|7 0|
  2417. * |----------------+----------------+----------------+----------------|
  2418. * | rsvd0 |PDVID| vdev_id | msg_type |
  2419. * |-------------------------------------------------------------------|
  2420. * | sa_addr_31_0 |
  2421. * |-------------------------------------------------------------------|
  2422. * | | ta_peer_id | sa_addr_47_32 |
  2423. * |-------------------------------------------------------------------|
  2424. * Where PDVID = pdev_id
  2425. *
  2426. * The message is interpreted as follows:
  2427. *
  2428. * dword0 - b'0:7 - msg_type: This will be set to
  2429. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2430. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2431. *
  2432. * dword0 - b'8:15 - vdev_id
  2433. *
  2434. * dword0 - b'16:17 - pdev_id
  2435. *
  2436. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2437. *
  2438. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2439. *
  2440. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2441. *
  2442. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2443. */
  2444. PREPACK struct htt_wds_entry {
  2445. A_UINT32
  2446. msg_type: 8,
  2447. vdev_id: 8,
  2448. pdev_id: 2,
  2449. rsvd0: 14;
  2450. A_UINT32 sa_addr_31_0;
  2451. A_UINT32
  2452. sa_addr_47_32: 16,
  2453. ta_peer_id: 14,
  2454. rsvd2: 2;
  2455. } POSTPACK;
  2456. /* DWORD 0 */
  2457. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2458. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2459. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2460. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2461. /* DWORD 2 */
  2462. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2463. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2464. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2465. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2466. /* DWORD 0 */
  2467. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2468. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2469. HTT_WDS_ENTRY_VDEV_ID_S)
  2470. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2471. do { \
  2472. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2473. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2474. } while (0)
  2475. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2476. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2477. HTT_WDS_ENTRY_PDEV_ID_S)
  2478. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2479. do { \
  2480. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2481. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2482. } while (0)
  2483. /* DWORD 2 */
  2484. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2485. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2486. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2487. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2490. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2491. } while (0)
  2492. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2493. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2494. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2495. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2498. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2499. } while (0)
  2500. /**
  2501. * @brief MAC DMA rx ring setup specification
  2502. * @details
  2503. * To allow for dynamic rx ring reconfiguration and to avoid race
  2504. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2505. * it uses. Instead, it sends this message to the target, indicating how
  2506. * the rx ring used by the host should be set up and maintained.
  2507. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2508. * specifications.
  2509. *
  2510. * |31 16|15 8|7 0|
  2511. * |---------------------------------------------------------------|
  2512. * header: | reserved | num rings | msg type |
  2513. * |---------------------------------------------------------------|
  2514. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2515. #if HTT_PADDR64
  2516. * | FW_IDX shadow register physical address (bits 63:32) |
  2517. #endif
  2518. * |---------------------------------------------------------------|
  2519. * | rx ring base physical address (bits 31:0) |
  2520. #if HTT_PADDR64
  2521. * | rx ring base physical address (bits 63:32) |
  2522. #endif
  2523. * |---------------------------------------------------------------|
  2524. * | rx ring buffer size | rx ring length |
  2525. * |---------------------------------------------------------------|
  2526. * | FW_IDX initial value | enabled flags |
  2527. * |---------------------------------------------------------------|
  2528. * | MSDU payload offset | 802.11 header offset |
  2529. * |---------------------------------------------------------------|
  2530. * | PPDU end offset | PPDU start offset |
  2531. * |---------------------------------------------------------------|
  2532. * | MPDU end offset | MPDU start offset |
  2533. * |---------------------------------------------------------------|
  2534. * | MSDU end offset | MSDU start offset |
  2535. * |---------------------------------------------------------------|
  2536. * | frag info offset | rx attention offset |
  2537. * |---------------------------------------------------------------|
  2538. * payload 2, if present, has the same format as payload 1
  2539. * Header fields:
  2540. * - MSG_TYPE
  2541. * Bits 7:0
  2542. * Purpose: identifies this as an rx ring configuration message
  2543. * Value: 0x2
  2544. * - NUM_RINGS
  2545. * Bits 15:8
  2546. * Purpose: indicates whether the host is setting up one rx ring or two
  2547. * Value: 1 or 2
  2548. * Payload:
  2549. * for systems using 64-bit format for bus addresses:
  2550. * - IDX_SHADOW_REG_PADDR_LO
  2551. * Bits 31:0
  2552. * Value: lower 4 bytes of physical address of the host's
  2553. * FW_IDX shadow register
  2554. * - IDX_SHADOW_REG_PADDR_HI
  2555. * Bits 31:0
  2556. * Value: upper 4 bytes of physical address of the host's
  2557. * FW_IDX shadow register
  2558. * - RING_BASE_PADDR_LO
  2559. * Bits 31:0
  2560. * Value: lower 4 bytes of physical address of the host's rx ring
  2561. * - RING_BASE_PADDR_HI
  2562. * Bits 31:0
  2563. * Value: uppper 4 bytes of physical address of the host's rx ring
  2564. * for systems using 32-bit format for bus addresses:
  2565. * - IDX_SHADOW_REG_PADDR
  2566. * Bits 31:0
  2567. * Value: physical address of the host's FW_IDX shadow register
  2568. * - RING_BASE_PADDR
  2569. * Bits 31:0
  2570. * Value: physical address of the host's rx ring
  2571. * - RING_LEN
  2572. * Bits 15:0
  2573. * Value: number of elements in the rx ring
  2574. * - RING_BUF_SZ
  2575. * Bits 31:16
  2576. * Value: size of the buffers referenced by the rx ring, in byte units
  2577. * - ENABLED_FLAGS
  2578. * Bits 15:0
  2579. * Value: 1-bit flags to show whether different rx fields are enabled
  2580. * bit 0: 802.11 header enabled (1) or disabled (0)
  2581. * bit 1: MSDU payload enabled (1) or disabled (0)
  2582. * bit 2: PPDU start enabled (1) or disabled (0)
  2583. * bit 3: PPDU end enabled (1) or disabled (0)
  2584. * bit 4: MPDU start enabled (1) or disabled (0)
  2585. * bit 5: MPDU end enabled (1) or disabled (0)
  2586. * bit 6: MSDU start enabled (1) or disabled (0)
  2587. * bit 7: MSDU end enabled (1) or disabled (0)
  2588. * bit 8: rx attention enabled (1) or disabled (0)
  2589. * bit 9: frag info enabled (1) or disabled (0)
  2590. * bit 10: unicast rx enabled (1) or disabled (0)
  2591. * bit 11: multicast rx enabled (1) or disabled (0)
  2592. * bit 12: ctrl rx enabled (1) or disabled (0)
  2593. * bit 13: mgmt rx enabled (1) or disabled (0)
  2594. * bit 14: null rx enabled (1) or disabled (0)
  2595. * bit 15: phy data rx enabled (1) or disabled (0)
  2596. * - IDX_INIT_VAL
  2597. * Bits 31:16
  2598. * Purpose: Specify the initial value for the FW_IDX.
  2599. * Value: the number of buffers initially present in the host's rx ring
  2600. * - OFFSET_802_11_HDR
  2601. * Bits 15:0
  2602. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2603. * - OFFSET_MSDU_PAYLOAD
  2604. * Bits 31:16
  2605. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2606. * - OFFSET_PPDU_START
  2607. * Bits 15:0
  2608. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2609. * - OFFSET_PPDU_END
  2610. * Bits 31:16
  2611. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2612. * - OFFSET_MPDU_START
  2613. * Bits 15:0
  2614. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2615. * - OFFSET_MPDU_END
  2616. * Bits 31:16
  2617. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2618. * - OFFSET_MSDU_START
  2619. * Bits 15:0
  2620. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2621. * - OFFSET_MSDU_END
  2622. * Bits 31:16
  2623. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2624. * - OFFSET_RX_ATTN
  2625. * Bits 15:0
  2626. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2627. * - OFFSET_FRAG_INFO
  2628. * Bits 31:16
  2629. * Value: offset in QUAD-bytes of frag info table
  2630. */
  2631. /* header fields */
  2632. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2633. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2634. /* payload fields */
  2635. /* for systems using a 64-bit format for bus addresses */
  2636. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2644. /* for systems using a 32-bit format for bus addresses */
  2645. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2646. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2647. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2648. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2649. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2650. #define HTT_RX_RING_CFG_LEN_S 0
  2651. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2652. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2653. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2654. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2655. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2656. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2657. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2658. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2659. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2660. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2661. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2662. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2663. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2664. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2665. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2666. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2667. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2668. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2669. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2670. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2671. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2672. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2673. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2674. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2675. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2676. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2677. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2678. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2679. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2680. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2681. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2682. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2683. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2684. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2685. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2686. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2687. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2688. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2689. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2690. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2691. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2692. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2693. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2694. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2695. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2696. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2697. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2698. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2699. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2700. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2701. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2702. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2703. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2704. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2705. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2706. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2707. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2708. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2709. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2710. #if HTT_PADDR64
  2711. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2712. #else
  2713. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2714. #endif
  2715. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2716. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2717. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2718. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2719. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2722. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2723. } while (0)
  2724. /* degenerate case for 32-bit fields */
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2727. ((_var) = (_val))
  2728. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2730. ((_var) = (_val))
  2731. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2732. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2733. ((_var) = (_val))
  2734. /* degenerate case for 32-bit fields */
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2737. ((_var) = (_val))
  2738. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2740. ((_var) = (_val))
  2741. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2742. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2743. ((_var) = (_val))
  2744. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2745. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2746. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2749. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2750. } while (0)
  2751. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2752. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2753. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2754. do { \
  2755. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2756. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2757. } while (0)
  2758. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2759. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2760. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2761. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2762. do { \
  2763. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2764. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2765. } while (0)
  2766. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2767. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2768. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2769. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2770. do { \
  2771. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2772. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2773. } while (0)
  2774. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2775. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2776. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2777. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2780. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2781. } while (0)
  2782. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2783. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2784. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2785. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2788. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2789. } while (0)
  2790. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2791. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2792. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2793. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2796. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2797. } while (0)
  2798. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2799. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2800. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2801. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2804. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2805. } while (0)
  2806. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2807. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2808. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2809. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2816. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2817. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2824. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2825. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2832. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2833. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2888. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2889. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2896. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2897. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2904. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2905. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2912. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2913. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2920. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2921. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2928. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2929. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2936. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2937. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2944. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2945. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2952. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2960. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2961. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2965. } while (0)
  2966. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2967. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2968. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2969. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2972. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2973. } while (0)
  2974. /**
  2975. * @brief host -> target FW statistics retrieve
  2976. *
  2977. * @details
  2978. * The following field definitions describe the format of the HTT host
  2979. * to target FW stats retrieve message. The message specifies the type of
  2980. * stats host wants to retrieve.
  2981. *
  2982. * |31 24|23 16|15 8|7 0|
  2983. * |-----------------------------------------------------------|
  2984. * | stats types request bitmask | msg type |
  2985. * |-----------------------------------------------------------|
  2986. * | stats types reset bitmask | reserved |
  2987. * |-----------------------------------------------------------|
  2988. * | stats type | config value |
  2989. * |-----------------------------------------------------------|
  2990. * | cookie LSBs |
  2991. * |-----------------------------------------------------------|
  2992. * | cookie MSBs |
  2993. * |-----------------------------------------------------------|
  2994. * Header fields:
  2995. * - MSG_TYPE
  2996. * Bits 7:0
  2997. * Purpose: identifies this is a stats upload request message
  2998. * Value: 0x3
  2999. * - UPLOAD_TYPES
  3000. * Bits 31:8
  3001. * Purpose: identifies which types of FW statistics to upload
  3002. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3003. * - RESET_TYPES
  3004. * Bits 31:8
  3005. * Purpose: identifies which types of FW statistics to reset
  3006. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3007. * - CFG_VAL
  3008. * Bits 23:0
  3009. * Purpose: give an opaque configuration value to the specified stats type
  3010. * Value: stats-type specific configuration value
  3011. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3012. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3013. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3014. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3015. * - CFG_STAT_TYPE
  3016. * Bits 31:24
  3017. * Purpose: specify which stats type (if any) the config value applies to
  3018. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3019. * a valid configuration specification
  3020. * - COOKIE_LSBS
  3021. * Bits 31:0
  3022. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3023. * message with its preceding host->target stats request message.
  3024. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3025. * - COOKIE_MSBS
  3026. * Bits 31:0
  3027. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3028. * message with its preceding host->target stats request message.
  3029. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3030. */
  3031. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3032. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3033. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3034. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3035. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3036. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3037. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3038. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3039. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3040. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3041. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3042. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3043. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3044. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3047. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3048. } while (0)
  3049. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3050. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3051. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3052. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3053. do { \
  3054. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3055. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3056. } while (0)
  3057. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3058. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3059. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3060. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3063. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3064. } while (0)
  3065. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3066. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3067. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3068. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3069. do { \
  3070. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3071. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3072. } while (0)
  3073. /**
  3074. * @brief host -> target HTT out-of-band sync request
  3075. *
  3076. * @details
  3077. * The HTT SYNC tells the target to suspend processing of subsequent
  3078. * HTT host-to-target messages until some other target agent locally
  3079. * informs the target HTT FW that the current sync counter is equal to
  3080. * or greater than (in a modulo sense) the sync counter specified in
  3081. * the SYNC message.
  3082. * This allows other host-target components to synchronize their operation
  3083. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3084. * security key has been downloaded to and activated by the target.
  3085. * In the absence of any explicit synchronization counter value
  3086. * specification, the target HTT FW will use zero as the default current
  3087. * sync value.
  3088. *
  3089. * |31 24|23 16|15 8|7 0|
  3090. * |-----------------------------------------------------------|
  3091. * | reserved | sync count | msg type |
  3092. * |-----------------------------------------------------------|
  3093. * Header fields:
  3094. * - MSG_TYPE
  3095. * Bits 7:0
  3096. * Purpose: identifies this as a sync message
  3097. * Value: 0x4
  3098. * - SYNC_COUNT
  3099. * Bits 15:8
  3100. * Purpose: specifies what sync value the HTT FW will wait for from
  3101. * an out-of-band specification to resume its operation
  3102. * Value: in-band sync counter value to compare against the out-of-band
  3103. * counter spec.
  3104. * The HTT target FW will suspend its host->target message processing
  3105. * as long as
  3106. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3107. */
  3108. #define HTT_H2T_SYNC_MSG_SZ 4
  3109. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3110. #define HTT_H2T_SYNC_COUNT_S 8
  3111. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3112. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3113. HTT_H2T_SYNC_COUNT_S)
  3114. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3117. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3118. } while (0)
  3119. /**
  3120. * @brief HTT aggregation configuration
  3121. */
  3122. #define HTT_AGGR_CFG_MSG_SZ 4
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3125. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3126. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3128. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3129. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3130. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3133. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3134. } while (0)
  3135. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3136. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3137. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3138. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3141. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3142. } while (0)
  3143. /**
  3144. * @brief host -> target HTT configure max amsdu info per vdev
  3145. *
  3146. * @details
  3147. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3148. *
  3149. * |31 21|20 16|15 8|7 0|
  3150. * |-----------------------------------------------------------|
  3151. * | reserved | vdev id | max amsdu | msg type |
  3152. * |-----------------------------------------------------------|
  3153. * Header fields:
  3154. * - MSG_TYPE
  3155. * Bits 7:0
  3156. * Purpose: identifies this as a aggr cfg ex message
  3157. * Value: 0xa
  3158. * - MAX_NUM_AMSDU_SUBFRM
  3159. * Bits 15:8
  3160. * Purpose: max MSDUs per A-MSDU
  3161. * - VDEV_ID
  3162. * Bits 20:16
  3163. * Purpose: ID of the vdev to which this limit is applied
  3164. */
  3165. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3166. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3167. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3168. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3169. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3170. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3171. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3172. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3173. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3176. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3177. } while (0)
  3178. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3179. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3180. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3181. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3182. do { \
  3183. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3184. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3185. } while (0)
  3186. /**
  3187. * @brief HTT WDI_IPA Config Message
  3188. *
  3189. * @details
  3190. * The HTT WDI_IPA config message is created/sent by host at driver
  3191. * init time. It contains information about data structures used on
  3192. * WDI_IPA TX and RX path.
  3193. * TX CE ring is used for pushing packet metadata from IPA uC
  3194. * to WLAN FW
  3195. * TX Completion ring is used for generating TX completions from
  3196. * WLAN FW to IPA uC
  3197. * RX Indication ring is used for indicating RX packets from FW
  3198. * to IPA uC
  3199. * RX Ring2 is used as either completion ring or as second
  3200. * indication ring. when Ring2 is used as completion ring, IPA uC
  3201. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3202. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3203. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3204. * indicated in RX Indication ring. Please see WDI_IPA specification
  3205. * for more details.
  3206. * |31 24|23 16|15 8|7 0|
  3207. * |----------------+----------------+----------------+----------------|
  3208. * | tx pkt pool size | Rsvd | msg_type |
  3209. * |-------------------------------------------------------------------|
  3210. * | tx comp ring base (bits 31:0) |
  3211. #if HTT_PADDR64
  3212. * | tx comp ring base (bits 63:32) |
  3213. #endif
  3214. * |-------------------------------------------------------------------|
  3215. * | tx comp ring size |
  3216. * |-------------------------------------------------------------------|
  3217. * | tx comp WR_IDX physical address (bits 31:0) |
  3218. #if HTT_PADDR64
  3219. * | tx comp WR_IDX physical address (bits 63:32) |
  3220. #endif
  3221. * |-------------------------------------------------------------------|
  3222. * | tx CE WR_IDX physical address (bits 31:0) |
  3223. #if HTT_PADDR64
  3224. * | tx CE WR_IDX physical address (bits 63:32) |
  3225. #endif
  3226. * |-------------------------------------------------------------------|
  3227. * | rx indication ring base (bits 31:0) |
  3228. #if HTT_PADDR64
  3229. * | rx indication ring base (bits 63:32) |
  3230. #endif
  3231. * |-------------------------------------------------------------------|
  3232. * | rx indication ring size |
  3233. * |-------------------------------------------------------------------|
  3234. * | rx ind RD_IDX physical address (bits 31:0) |
  3235. #if HTT_PADDR64
  3236. * | rx ind RD_IDX physical address (bits 63:32) |
  3237. #endif
  3238. * |-------------------------------------------------------------------|
  3239. * | rx ind WR_IDX physical address (bits 31:0) |
  3240. #if HTT_PADDR64
  3241. * | rx ind WR_IDX physical address (bits 63:32) |
  3242. #endif
  3243. * |-------------------------------------------------------------------|
  3244. * |-------------------------------------------------------------------|
  3245. * | rx ring2 base (bits 31:0) |
  3246. #if HTT_PADDR64
  3247. * | rx ring2 base (bits 63:32) |
  3248. #endif
  3249. * |-------------------------------------------------------------------|
  3250. * | rx ring2 size |
  3251. * |-------------------------------------------------------------------|
  3252. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3253. #if HTT_PADDR64
  3254. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3255. #endif
  3256. * |-------------------------------------------------------------------|
  3257. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3258. #if HTT_PADDR64
  3259. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3260. #endif
  3261. * |-------------------------------------------------------------------|
  3262. *
  3263. * Header fields:
  3264. * Header fields:
  3265. * - MSG_TYPE
  3266. * Bits 7:0
  3267. * Purpose: Identifies this as WDI_IPA config message
  3268. * value: = 0x8
  3269. * - TX_PKT_POOL_SIZE
  3270. * Bits 15:0
  3271. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3272. * WDI_IPA TX path
  3273. * For systems using 32-bit format for bus addresses:
  3274. * - TX_COMP_RING_BASE_ADDR
  3275. * Bits 31:0
  3276. * Purpose: TX Completion Ring base address in DDR
  3277. * - TX_COMP_RING_SIZE
  3278. * Bits 31:0
  3279. * Purpose: TX Completion Ring size (must be power of 2)
  3280. * - TX_COMP_WR_IDX_ADDR
  3281. * Bits 31:0
  3282. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3283. * updates the Write Index for WDI_IPA TX completion ring
  3284. * - TX_CE_WR_IDX_ADDR
  3285. * Bits 31:0
  3286. * Purpose: DDR address where IPA uC
  3287. * updates the WR Index for TX CE ring
  3288. * (needed for fusion platforms)
  3289. * - RX_IND_RING_BASE_ADDR
  3290. * Bits 31:0
  3291. * Purpose: RX Indication Ring base address in DDR
  3292. * - RX_IND_RING_SIZE
  3293. * Bits 31:0
  3294. * Purpose: RX Indication Ring size
  3295. * - RX_IND_RD_IDX_ADDR
  3296. * Bits 31:0
  3297. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3298. * RX indication ring
  3299. * - RX_IND_WR_IDX_ADDR
  3300. * Bits 31:0
  3301. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3302. * updates the Write Index for WDI_IPA RX indication ring
  3303. * - RX_RING2_BASE_ADDR
  3304. * Bits 31:0
  3305. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3306. * - RX_RING2_SIZE
  3307. * Bits 31:0
  3308. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3309. * - RX_RING2_RD_IDX_ADDR
  3310. * Bits 31:0
  3311. * Purpose: If Second RX ring is Indication ring, DDR address where
  3312. * IPA uC updates the Read Index for Ring2.
  3313. * If Second RX ring is completion ring, this is NOT used
  3314. * - RX_RING2_WR_IDX_ADDR
  3315. * Bits 31:0
  3316. * Purpose: If Second RX ring is Indication ring, DDR address where
  3317. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3318. * If second RX ring is completion ring, DDR address where
  3319. * IPA uC updates the Write Index for Ring 2.
  3320. * For systems using 64-bit format for bus addresses:
  3321. * - TX_COMP_RING_BASE_ADDR_LO
  3322. * Bits 31:0
  3323. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3324. * - TX_COMP_RING_BASE_ADDR_HI
  3325. * Bits 31:0
  3326. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3327. * - TX_COMP_RING_SIZE
  3328. * Bits 31:0
  3329. * Purpose: TX Completion Ring size (must be power of 2)
  3330. * - TX_COMP_WR_IDX_ADDR_LO
  3331. * Bits 31:0
  3332. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3333. * Lower 4 bytes of DDR address where WIFI FW
  3334. * updates the Write Index for WDI_IPA TX completion ring
  3335. * - TX_COMP_WR_IDX_ADDR_HI
  3336. * Bits 31:0
  3337. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3338. * Higher 4 bytes of DDR address where WIFI FW
  3339. * updates the Write Index for WDI_IPA TX completion ring
  3340. * - TX_CE_WR_IDX_ADDR_LO
  3341. * Bits 31:0
  3342. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3343. * updates the WR Index for TX CE ring
  3344. * (needed for fusion platforms)
  3345. * - TX_CE_WR_IDX_ADDR_HI
  3346. * Bits 31:0
  3347. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3348. * updates the WR Index for TX CE ring
  3349. * (needed for fusion platforms)
  3350. * - RX_IND_RING_BASE_ADDR_LO
  3351. * Bits 31:0
  3352. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3353. * - RX_IND_RING_BASE_ADDR_HI
  3354. * Bits 31:0
  3355. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3356. * - RX_IND_RING_SIZE
  3357. * Bits 31:0
  3358. * Purpose: RX Indication Ring size
  3359. * - RX_IND_RD_IDX_ADDR_LO
  3360. * Bits 31:0
  3361. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3362. * for WDI_IPA RX indication ring
  3363. * - RX_IND_RD_IDX_ADDR_HI
  3364. * Bits 31:0
  3365. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3366. * for WDI_IPA RX indication ring
  3367. * - RX_IND_WR_IDX_ADDR_LO
  3368. * Bits 31:0
  3369. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3370. * Lower 4 bytes of DDR address where WIFI FW
  3371. * updates the Write Index for WDI_IPA RX indication ring
  3372. * - RX_IND_WR_IDX_ADDR_HI
  3373. * Bits 31:0
  3374. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3375. * Higher 4 bytes of DDR address where WIFI FW
  3376. * updates the Write Index for WDI_IPA RX indication ring
  3377. * - RX_RING2_BASE_ADDR_LO
  3378. * Bits 31:0
  3379. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3380. * - RX_RING2_BASE_ADDR_HI
  3381. * Bits 31:0
  3382. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3383. * - RX_RING2_SIZE
  3384. * Bits 31:0
  3385. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3386. * - RX_RING2_RD_IDX_ADDR_LO
  3387. * Bits 31:0
  3388. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3389. * DDR address where IPA uC updates the Read Index for Ring2.
  3390. * If Second RX ring is completion ring, this is NOT used
  3391. * - RX_RING2_RD_IDX_ADDR_HI
  3392. * Bits 31:0
  3393. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3394. * DDR address where IPA uC updates the Read Index for Ring2.
  3395. * If Second RX ring is completion ring, this is NOT used
  3396. * - RX_RING2_WR_IDX_ADDR_LO
  3397. * Bits 31:0
  3398. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3399. * DDR address where WIFI FW updates the Write Index
  3400. * for WDI_IPA RX ring2
  3401. * If second RX ring is completion ring, lower 4 bytes of
  3402. * DDR address where IPA uC updates the Write Index for Ring 2.
  3403. * - RX_RING2_WR_IDX_ADDR_HI
  3404. * Bits 31:0
  3405. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3406. * DDR address where WIFI FW updates the Write Index
  3407. * for WDI_IPA RX ring2
  3408. * If second RX ring is completion ring, higher 4 bytes of
  3409. * DDR address where IPA uC updates the Write Index for Ring 2.
  3410. */
  3411. #if HTT_PADDR64
  3412. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3413. #else
  3414. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3415. #endif
  3416. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3417. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3434. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3436. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3476. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3477. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3478. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3479. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3480. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3483. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3484. } while (0)
  3485. /* for systems using 32-bit format for bus addr */
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3487. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3491. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3492. } while (0)
  3493. /* for systems using 64-bit format for bus addr */
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3495. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3499. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3500. } while (0)
  3501. /* for systems using 64-bit format for bus addr */
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3503. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3507. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3508. } while (0)
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3510. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3514. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3515. } while (0)
  3516. /* for systems using 32-bit format for bus addr */
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3518. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3519. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3522. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3523. } while (0)
  3524. /* for systems using 64-bit format for bus addr */
  3525. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3526. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3527. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3530. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3531. } while (0)
  3532. /* for systems using 64-bit format for bus addr */
  3533. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3534. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3535. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3538. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3539. } while (0)
  3540. /* for systems using 32-bit format for bus addr */
  3541. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3543. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3547. } while (0)
  3548. /* for systems using 64-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3551. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3555. } while (0)
  3556. /* for systems using 64-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3559. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3563. } while (0)
  3564. /* for systems using 32-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3567. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3571. } while (0)
  3572. /* for systems using 64-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3575. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3579. } while (0)
  3580. /* for systems using 64-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3583. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3587. } while (0)
  3588. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3590. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3594. } while (0)
  3595. /* for systems using 32-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3598. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3602. } while (0)
  3603. /* for systems using 64-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3606. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3614. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3618. } while (0)
  3619. /* for systems using 32-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3622. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3626. } while (0)
  3627. /* for systems using 64-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3630. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3634. } while (0)
  3635. /* for systems using 64-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3638. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3642. } while (0)
  3643. /* for systems using 32-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3646. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3650. } while (0)
  3651. /* for systems using 64-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3654. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3658. } while (0)
  3659. /* for systems using 64-bit format for bus addr */
  3660. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3662. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3666. } while (0)
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3669. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3673. } while (0)
  3674. /* for systems using 32-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3677. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3681. } while (0)
  3682. /* for systems using 64-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3685. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3689. } while (0)
  3690. /* for systems using 64-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3693. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3697. } while (0)
  3698. /* for systems using 32-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3701. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3705. } while (0)
  3706. /* for systems using 64-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3713. } while (0)
  3714. /* for systems using 64-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3717. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3721. } while (0)
  3722. /*
  3723. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3724. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3725. * addresses are stored in a XXX-bit field.
  3726. * This macro is used to define both htt_wdi_ipa_config32_t and
  3727. * htt_wdi_ipa_config64_t structs.
  3728. */
  3729. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3730. _paddr__tx_comp_ring_base_addr_, \
  3731. _paddr__tx_comp_wr_idx_addr_, \
  3732. _paddr__tx_ce_wr_idx_addr_, \
  3733. _paddr__rx_ind_ring_base_addr_, \
  3734. _paddr__rx_ind_rd_idx_addr_, \
  3735. _paddr__rx_ind_wr_idx_addr_, \
  3736. _paddr__rx_ring2_base_addr_,\
  3737. _paddr__rx_ring2_rd_idx_addr_,\
  3738. _paddr__rx_ring2_wr_idx_addr_) \
  3739. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3740. { \
  3741. /* DWORD 0: flags and meta-data */ \
  3742. A_UINT32 \
  3743. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3744. reserved: 8, \
  3745. tx_pkt_pool_size: 16;\
  3746. /* DWORD 1 */\
  3747. _paddr__tx_comp_ring_base_addr_;\
  3748. /* DWORD 2 (or 3)*/\
  3749. A_UINT32 tx_comp_ring_size;\
  3750. /* DWORD 3 (or 4)*/\
  3751. _paddr__tx_comp_wr_idx_addr_;\
  3752. /* DWORD 4 (or 6)*/\
  3753. _paddr__tx_ce_wr_idx_addr_;\
  3754. /* DWORD 5 (or 8)*/\
  3755. _paddr__rx_ind_ring_base_addr_;\
  3756. /* DWORD 6 (or 10)*/\
  3757. A_UINT32 rx_ind_ring_size;\
  3758. /* DWORD 7 (or 11)*/\
  3759. _paddr__rx_ind_rd_idx_addr_;\
  3760. /* DWORD 8 (or 13)*/\
  3761. _paddr__rx_ind_wr_idx_addr_;\
  3762. /* DWORD 9 (or 15)*/\
  3763. _paddr__rx_ring2_base_addr_;\
  3764. /* DWORD 10 (or 17) */\
  3765. A_UINT32 rx_ring2_size;\
  3766. /* DWORD 11 (or 18) */\
  3767. _paddr__rx_ring2_rd_idx_addr_;\
  3768. /* DWORD 12 (or 20) */\
  3769. _paddr__rx_ring2_wr_idx_addr_;\
  3770. } POSTPACK
  3771. /* define a htt_wdi_ipa_config32_t type */
  3772. 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));
  3773. /* define a htt_wdi_ipa_config64_t type */
  3774. 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));
  3775. #if HTT_PADDR64
  3776. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3777. #else
  3778. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3779. #endif
  3780. enum htt_wdi_ipa_op_code {
  3781. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3782. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3783. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3784. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3785. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3786. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3787. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3788. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3789. /* keep this last */
  3790. HTT_WDI_IPA_OPCODE_MAX
  3791. };
  3792. /**
  3793. * @brief HTT WDI_IPA Operation Request Message
  3794. *
  3795. * @details
  3796. * HTT WDI_IPA Operation Request message is sent by host
  3797. * to either suspend or resume WDI_IPA TX or RX path.
  3798. * |31 24|23 16|15 8|7 0|
  3799. * |----------------+----------------+----------------+----------------|
  3800. * | op_code | Rsvd | msg_type |
  3801. * |-------------------------------------------------------------------|
  3802. *
  3803. * Header fields:
  3804. * - MSG_TYPE
  3805. * Bits 7:0
  3806. * Purpose: Identifies this as WDI_IPA Operation Request message
  3807. * value: = 0x9
  3808. * - OP_CODE
  3809. * Bits 31:16
  3810. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3811. * value: = enum htt_wdi_ipa_op_code
  3812. */
  3813. PREPACK struct htt_wdi_ipa_op_request_t
  3814. {
  3815. /* DWORD 0: flags and meta-data */
  3816. A_UINT32
  3817. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3818. reserved: 8,
  3819. op_code: 16;
  3820. } POSTPACK;
  3821. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3822. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3823. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3824. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3825. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3826. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3829. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3830. } while (0)
  3831. /*
  3832. * @brief host -> target HTT_SRING_SETUP message
  3833. *
  3834. * @details
  3835. * After target is booted up, Host can send SRING setup message for
  3836. * each host facing LMAC SRING. Target setups up HW registers based
  3837. * on setup message and confirms back to Host if response_required is set.
  3838. * Host should wait for confirmation message before sending new SRING
  3839. * setup message
  3840. *
  3841. * The message would appear as follows:
  3842. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3843. * |--------------- +-----------------+----------------+------------------|
  3844. * | ring_type | ring_id | pdev_id | msg_type |
  3845. * |----------------------------------------------------------------------|
  3846. * | ring_base_addr_lo |
  3847. * |----------------------------------------------------------------------|
  3848. * | ring_base_addr_hi |
  3849. * |----------------------------------------------------------------------|
  3850. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_head_offset32_remote_addr_lo |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_head_offset32_remote_addr_hi |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_tail_offset32_remote_addr_lo |
  3857. * |----------------------------------------------------------------------|
  3858. * | ring_tail_offset32_remote_addr_hi |
  3859. * |----------------------------------------------------------------------|
  3860. * | ring_msi_addr_lo |
  3861. * |----------------------------------------------------------------------|
  3862. * | ring_msi_addr_hi |
  3863. * |----------------------------------------------------------------------|
  3864. * | ring_msi_data |
  3865. * |----------------------------------------------------------------------|
  3866. * | intr_timer_th |IM| intr_batch_counter_th |
  3867. * |----------------------------------------------------------------------|
  3868. * | reserved |RR|PTCF| intr_low_threshold |
  3869. * |----------------------------------------------------------------------|
  3870. * Where
  3871. * IM = sw_intr_mode
  3872. * RR = response_required
  3873. * PTCF = prefetch_timer_cfg
  3874. *
  3875. * The message is interpreted as follows:
  3876. * dword0 - b'0:7 - msg_type: This will be set to
  3877. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3878. * b'8:15 - pdev_id:
  3879. * 0 (for rings at SOC/UMAC level),
  3880. * 1/2/3 mac id (for rings at LMAC level)
  3881. * b'16:23 - ring_id: identify which ring is to setup,
  3882. * more details can be got from enum htt_srng_ring_id
  3883. * b'24:31 - ring_type: identify type of host rings,
  3884. * more details can be got from enum htt_srng_ring_type
  3885. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3886. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3887. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3888. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3889. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3890. * SW_TO_HW_RING.
  3891. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3892. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3893. * Lower 32 bits of memory address of the remote variable
  3894. * storing the 4-byte word offset that identifies the head
  3895. * element within the ring.
  3896. * (The head offset variable has type A_UINT32.)
  3897. * Valid for HW_TO_SW and SW_TO_SW rings.
  3898. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3899. * Upper 32 bits of memory address of the remote variable
  3900. * storing the 4-byte word offset that identifies the head
  3901. * element within the ring.
  3902. * (The head offset variable has type A_UINT32.)
  3903. * Valid for HW_TO_SW and SW_TO_SW rings.
  3904. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3905. * Lower 32 bits of memory address of the remote variable
  3906. * storing the 4-byte word offset that identifies the tail
  3907. * element within the ring.
  3908. * (The tail offset variable has type A_UINT32.)
  3909. * Valid for HW_TO_SW and SW_TO_SW rings.
  3910. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3911. * Upper 32 bits of memory address of the remote variable
  3912. * storing the 4-byte word offset that identifies the tail
  3913. * element within the ring.
  3914. * (The tail offset variable has type A_UINT32.)
  3915. * Valid for HW_TO_SW and SW_TO_SW rings.
  3916. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3917. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3918. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3919. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3920. * dword10 - b'0:31 - ring_msi_data: MSI data
  3921. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3922. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3923. * dword11 - b'0:14 - intr_batch_counter_th:
  3924. * batch counter threshold is in units of 4-byte words.
  3925. * HW internally maintains and increments batch count.
  3926. * (see SRING spec for detail description).
  3927. * When batch count reaches threshold value, an interrupt
  3928. * is generated by HW.
  3929. * b'15 - sw_intr_mode:
  3930. * This configuration shall be static.
  3931. * Only programmed at power up.
  3932. * 0: generate pulse style sw interrupts
  3933. * 1: generate level style sw interrupts
  3934. * b'16:31 - intr_timer_th:
  3935. * The timer init value when timer is idle or is
  3936. * initialized to start downcounting.
  3937. * In 8us units (to cover a range of 0 to 524 ms)
  3938. * dword12 - b'0:15 - intr_low_threshold:
  3939. * Used only by Consumer ring to generate ring_sw_int_p.
  3940. * Ring entries low threshold water mark, that is used
  3941. * in combination with the interrupt timer as well as
  3942. * the the clearing of the level interrupt.
  3943. * b'16:18 - prefetch_timer_cfg:
  3944. * Used only by Consumer ring to set timer mode to
  3945. * support Application prefetch handling.
  3946. * The external tail offset/pointer will be updated
  3947. * at following intervals:
  3948. * 3'b000: (Prefetch feature disabled; used only for debug)
  3949. * 3'b001: 1 usec
  3950. * 3'b010: 4 usec
  3951. * 3'b011: 8 usec (default)
  3952. * 3'b100: 16 usec
  3953. * Others: Reserverd
  3954. * b'19 - response_required:
  3955. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3956. * b'20:31 - reserved: reserved for future use
  3957. */
  3958. PREPACK struct htt_sring_setup_t {
  3959. A_UINT32 msg_type: 8,
  3960. pdev_id: 8,
  3961. ring_id: 8,
  3962. ring_type: 8;
  3963. A_UINT32 ring_base_addr_lo;
  3964. A_UINT32 ring_base_addr_hi;
  3965. A_UINT32 ring_size: 16,
  3966. ring_entry_size: 8,
  3967. ring_misc_cfg_flag: 8;
  3968. A_UINT32 ring_head_offset32_remote_addr_lo;
  3969. A_UINT32 ring_head_offset32_remote_addr_hi;
  3970. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3971. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3972. A_UINT32 ring_msi_addr_lo;
  3973. A_UINT32 ring_msi_addr_hi;
  3974. A_UINT32 ring_msi_data;
  3975. A_UINT32 intr_batch_counter_th: 15,
  3976. sw_intr_mode: 1,
  3977. intr_timer_th: 16;
  3978. A_UINT32 intr_low_threshold: 16,
  3979. prefetch_timer_cfg: 3,
  3980. response_required: 1,
  3981. reserved1: 12;
  3982. } POSTPACK;
  3983. enum htt_srng_ring_type {
  3984. HTT_HW_TO_SW_RING = 0,
  3985. HTT_SW_TO_HW_RING,
  3986. HTT_SW_TO_SW_RING,
  3987. /* Insert new ring types above this line */
  3988. };
  3989. enum htt_srng_ring_id {
  3990. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3991. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3992. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3993. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3994. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3995. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3996. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3997. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3998. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  3999. /* Add Other SRING which can't be directly configured by host software above this line */
  4000. };
  4001. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4002. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4003. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4004. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4005. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4006. HTT_SRING_SETUP_PDEV_ID_S)
  4007. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4008. do { \
  4009. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4010. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4011. } while (0)
  4012. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4013. #define HTT_SRING_SETUP_RING_ID_S 16
  4014. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4015. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4016. HTT_SRING_SETUP_RING_ID_S)
  4017. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4018. do { \
  4019. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4020. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4021. } while (0)
  4022. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4023. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4024. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4025. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4026. HTT_SRING_SETUP_RING_TYPE_S)
  4027. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4030. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4031. } while (0)
  4032. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4033. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4035. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4036. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4037. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4038. do { \
  4039. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4040. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4041. } while (0)
  4042. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4043. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4044. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4045. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4046. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4047. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4048. do { \
  4049. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4050. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4051. } while (0)
  4052. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4053. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4054. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4056. HTT_SRING_SETUP_RING_SIZE_S)
  4057. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4060. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4061. } while (0)
  4062. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4063. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4064. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4065. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4066. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4067. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4068. do { \
  4069. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4070. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4071. } while (0)
  4072. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4073. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4074. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4076. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4077. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4081. } while (0)
  4082. /* This control bit is applicable to only Producer, which updates Ring ID field
  4083. * of each descriptor before pushing into the ring.
  4084. * 0: updates ring_id(default)
  4085. * 1: ring_id updating disabled */
  4086. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4087. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4088. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4089. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4090. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4092. do { \
  4093. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4094. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4095. } while (0)
  4096. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4097. * of each descriptor before pushing into the ring.
  4098. * 0: updates Loopcnt(default)
  4099. * 1: Loopcnt updating disabled */
  4100. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4101. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4104. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4109. } while (0)
  4110. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4111. * into security_id port of GXI/AXI. */
  4112. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4113. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4116. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4121. } while (0)
  4122. /* During MSI write operation, SRNG drives value of this register bit into
  4123. * swap bit of GXI/AXI. */
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4125. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4126. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4127. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4128. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4132. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4133. } while (0)
  4134. /* During Pointer write operation, SRNG drives value of this register bit into
  4135. * swap bit of GXI/AXI. */
  4136. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4137. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4138. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4139. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4140. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4144. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4145. } while (0)
  4146. /* During any data or TLV write operation, SRNG drives value of this register
  4147. * bit into swap bit of GXI/AXI. */
  4148. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4149. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4151. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4152. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4156. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4157. } while (0)
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4160. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4161. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4163. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4164. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4165. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4168. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4169. } while (0)
  4170. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4171. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4172. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4173. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4174. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4175. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4178. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4179. } while (0)
  4180. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4181. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4183. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4184. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4185. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4188. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4189. } while (0)
  4190. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4191. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4192. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4193. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4194. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4195. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4198. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4199. } while (0)
  4200. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4201. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4203. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4204. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4205. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4208. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4209. } while (0)
  4210. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4211. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4212. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4213. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4214. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4215. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4218. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4219. } while (0)
  4220. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4221. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4222. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4223. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4224. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4225. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4228. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4229. } while (0)
  4230. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4231. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4232. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4233. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4234. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4235. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4238. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4239. } while (0)
  4240. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4241. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4242. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4243. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4244. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4245. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4248. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4249. } while (0)
  4250. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4251. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4252. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4253. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4254. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4255. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4258. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4259. } while (0)
  4260. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4261. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4262. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4263. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4264. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4265. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4268. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4269. } while (0)
  4270. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4271. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4272. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4273. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4274. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4275. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4278. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4279. } while (0)
  4280. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4281. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4282. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4283. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4284. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4285. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4288. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4289. } while (0)
  4290. /**
  4291. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4292. *
  4293. * @details
  4294. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4295. * configure RXDMA rings.
  4296. * The configuration is per ring based and includes both packet subtypes
  4297. * and PPDU/MPDU TLVs.
  4298. *
  4299. * The message would appear as follows:
  4300. *
  4301. * |31 27|26|25|24|23 16|15 8|7 0|
  4302. * |-----------------+----------------+----------------+---------------|
  4303. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4304. * |-------------------------------------------------------------------|
  4305. * | rsvd2 | ring_buffer_size |
  4306. * |-------------------------------------------------------------------|
  4307. * | packet_type_enable_flags_0 |
  4308. * |-------------------------------------------------------------------|
  4309. * | packet_type_enable_flags_1 |
  4310. * |-------------------------------------------------------------------|
  4311. * | packet_type_enable_flags_2 |
  4312. * |-------------------------------------------------------------------|
  4313. * | packet_type_enable_flags_3 |
  4314. * |-------------------------------------------------------------------|
  4315. * | tlv_filter_in_flags |
  4316. * |-------------------------------------------------------------------|
  4317. * | rx_header_offset | rx_packet_offset |
  4318. * |-------------------------------------------------------------------|
  4319. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4320. * |-------------------------------------------------------------------|
  4321. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4322. * |-------------------------------------------------------------------|
  4323. * | rsvd3 | rx_attention_offset |
  4324. * |-------------------------------------------------------------------|
  4325. * Where:
  4326. * PS = pkt_swap
  4327. * SS = status_swap
  4328. * OV = rx_offsets_valid
  4329. * The message is interpreted as follows:
  4330. * dword0 - b'0:7 - msg_type: This will be set to
  4331. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4332. * b'8:15 - pdev_id:
  4333. * 0 (for rings at SOC/UMAC level),
  4334. * 1/2/3 mac id (for rings at LMAC level)
  4335. * b'16:23 - ring_id : Identify the ring to configure.
  4336. * More details can be got from enum htt_srng_ring_id
  4337. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4338. * BUF_RING_CFG_0 defs within HW .h files,
  4339. * e.g. wmac_top_reg_seq_hwioreg.h
  4340. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4341. * BUF_RING_CFG_0 defs within HW .h files,
  4342. * e.g. wmac_top_reg_seq_hwioreg.h
  4343. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4344. * configuration fields are valid
  4345. * b'27:31 - rsvd1: reserved for future use
  4346. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4347. * in byte units.
  4348. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4349. * - b'16:31 - rsvd2: Reserved for future use
  4350. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4351. * Enable MGMT packet from 0b0000 to 0b1001
  4352. * bits from low to high: FP, MD, MO - 3 bits
  4353. * FP: Filter_Pass
  4354. * MD: Monitor_Direct
  4355. * MO: Monitor_Other
  4356. * 10 mgmt subtypes * 3 bits -> 30 bits
  4357. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4358. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4359. * Enable MGMT packet from 0b1010 to 0b1111
  4360. * bits from low to high: FP, MD, MO - 3 bits
  4361. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4362. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4363. * Enable CTRL packet from 0b0000 to 0b1001
  4364. * bits from low to high: FP, MD, MO - 3 bits
  4365. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4366. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4367. * Enable CTRL packet from 0b1010 to 0b1111,
  4368. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4369. * bits from low to high: FP, MD, MO - 3 bits
  4370. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4371. * dword6 - b'0:31 - tlv_filter_in_flags:
  4372. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4373. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4374. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4375. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4376. * A value of 0 will be considered as ignore this config.
  4377. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4378. * e.g. wmac_top_reg_seq_hwioreg.h
  4379. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4380. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4381. * A value of 0 will be considered as ignore this config.
  4382. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4383. * e.g. wmac_top_reg_seq_hwioreg.h
  4384. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4385. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4386. * A value of 0 will be considered as ignore this config.
  4387. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4388. * e.g. wmac_top_reg_seq_hwioreg.h
  4389. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4390. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4391. * A value of 0 will be considered as ignore this config.
  4392. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4393. * e.g. wmac_top_reg_seq_hwioreg.h
  4394. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4395. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4396. * A value of 0 will be considered as ignore this config.
  4397. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4398. * e.g. wmac_top_reg_seq_hwioreg.h
  4399. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4400. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4401. * A value of 0 will be considered as ignore this config.
  4402. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4403. * e.g. wmac_top_reg_seq_hwioreg.h
  4404. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4405. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4406. * A value of 0 will be considered as ignore this config.
  4407. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4408. * e.g. wmac_top_reg_seq_hwioreg.h
  4409. * - b'16-31 - rsvd3 for future use
  4410. */
  4411. PREPACK struct htt_rx_ring_selection_cfg_t {
  4412. A_UINT32 msg_type: 8,
  4413. pdev_id: 8,
  4414. ring_id: 8,
  4415. status_swap: 1,
  4416. pkt_swap: 1,
  4417. rx_offsets_valid: 1,
  4418. rsvd1: 5;
  4419. A_UINT32 ring_buffer_size: 16,
  4420. rsvd2: 16;
  4421. A_UINT32 packet_type_enable_flags_0;
  4422. A_UINT32 packet_type_enable_flags_1;
  4423. A_UINT32 packet_type_enable_flags_2;
  4424. A_UINT32 packet_type_enable_flags_3;
  4425. A_UINT32 tlv_filter_in_flags;
  4426. A_UINT32 rx_packet_offset: 16,
  4427. rx_header_offset: 16;
  4428. A_UINT32 rx_mpdu_end_offset: 16,
  4429. rx_mpdu_start_offset: 16;
  4430. A_UINT32 rx_msdu_end_offset: 16,
  4431. rx_msdu_start_offset: 16;
  4432. A_UINT32 rx_attn_offset: 16,
  4433. rsvd3: 16;
  4434. } POSTPACK;
  4435. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4436. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4437. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4438. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4439. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4440. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4441. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4442. do { \
  4443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4445. } while (0)
  4446. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4447. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4448. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4449. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4450. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4451. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4452. do { \
  4453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4455. } while (0)
  4456. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4457. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4458. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4459. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4460. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4461. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4465. } while (0)
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4469. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4470. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4472. do { \
  4473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4475. } while (0)
  4476. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4477. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4478. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4479. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4480. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4481. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4482. do { \
  4483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4485. } while (0)
  4486. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4487. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4488. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4489. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4490. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4491. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4495. } while (0)
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4499. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4500. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4505. } while (0)
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4509. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4510. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4515. } while (0)
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4519. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4520. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4525. } while (0)
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4529. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4530. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4535. } while (0)
  4536. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4537. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4538. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4539. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4540. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4541. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4545. } while (0)
  4546. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4547. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4548. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4549. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4550. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4551. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4555. } while (0)
  4556. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4557. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4558. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4559. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4560. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4561. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4565. } while (0)
  4566. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4567. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4569. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4570. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4571. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4575. } while (0)
  4576. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4577. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4578. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4579. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4580. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4581. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4582. do { \
  4583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4585. } while (0)
  4586. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4587. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4588. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4589. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4590. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4591. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4592. do { \
  4593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4595. } while (0)
  4596. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4599. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4600. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4602. do { \
  4603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4605. } while (0)
  4606. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4607. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4608. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4609. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4610. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4611. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4612. do { \
  4613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4615. } while (0)
  4616. /*
  4617. * Subtype based MGMT frames enable bits.
  4618. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4619. */
  4620. /* association request */
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4627. /* association response */
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4634. /* Reassociation request */
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4641. /* Reassociation response */
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4648. /* Probe request */
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4655. /* Probe response */
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4662. /* Timing Advertisement */
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4669. /* Reserved */
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4676. /* Beacon */
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4683. /* ATIM */
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4690. /* Disassociation */
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4697. /* Authentication */
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4704. /* Deauthentication */
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4711. /* Action */
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4718. /* Action No Ack */
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4725. /* Reserved */
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4732. /*
  4733. * Subtype based CTRL frames enable bits.
  4734. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4735. */
  4736. /* Reserved */
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4743. /* Reserved */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4750. /* Reserved */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4757. /* Reserved */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4764. /* Reserved */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4771. /* Reserved */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4778. /* Reserved */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4785. /* Control Wrapper */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4792. /* Block Ack Request */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4799. /* Block Ack*/
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4806. /* PS-POLL */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4813. /* RTS */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4820. /* CTS */
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4827. /* ACK */
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4834. /* CF-END */
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4841. /* CF-END + CF-ACK */
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4848. /* Multicast data */
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4855. /* Unicast data */
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4862. /* NULL data */
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4870. do { \
  4871. HTT_CHECK_SET_VAL(httsym, value); \
  4872. (word) |= (value) << httsym##_S; \
  4873. } while (0)
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4875. (((word) & httsym##_M) >> httsym##_S)
  4876. #define htt_rx_ring_pkt_enable_subtype_set( \
  4877. word, flag, mode, type, subtype, val) \
  4878. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4879. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4880. #define htt_rx_ring_pkt_enable_subtype_get( \
  4881. word, flag, mode, type, subtype) \
  4882. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4883. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4884. /* Definition to filter in TLVs */
  4885. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4886. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4887. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4888. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4889. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4890. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4891. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4892. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4893. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4894. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4895. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4896. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4897. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4898. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4899. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4900. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4901. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4902. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4903. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4904. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4905. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4906. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4907. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4908. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4909. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4910. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4911. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(httsym, enable); \
  4914. (word) |= (enable) << httsym##_S; \
  4915. } while (0)
  4916. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4917. (((word) & httsym##_M) >> httsym##_S)
  4918. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4919. HTT_RX_RING_TLV_ENABLE_SET( \
  4920. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4921. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4922. HTT_RX_RING_TLV_ENABLE_GET( \
  4923. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4924. /**
  4925. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4926. * host --> target Receive Flow Steering configuration message definition.
  4927. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4928. * The reason for this is we want RFS to be configured and ready before MAC
  4929. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4930. *
  4931. * |31 24|23 16|15 9|8|7 0|
  4932. * |----------------+----------------+----------------+----------------|
  4933. * | reserved |E| msg type |
  4934. * |-------------------------------------------------------------------|
  4935. * Where E = RFS enable flag
  4936. *
  4937. * The RFS_CONFIG message consists of a single 4-byte word.
  4938. *
  4939. * Header fields:
  4940. * - MSG_TYPE
  4941. * Bits 7:0
  4942. * Purpose: identifies this as a RFS config msg
  4943. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4944. * - RFS_CONFIG
  4945. * Bit 8
  4946. * Purpose: Tells target whether to enable (1) or disable (0)
  4947. * flow steering feature when sending rx indication messages to host
  4948. */
  4949. #define HTT_H2T_RFS_CONFIG_M 0x100
  4950. #define HTT_H2T_RFS_CONFIG_S 8
  4951. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4952. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4953. HTT_H2T_RFS_CONFIG_S)
  4954. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4957. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4958. } while (0)
  4959. #define HTT_RFS_CFG_REQ_BYTES 4
  4960. /**
  4961. * @brief host -> target FW extended statistics retrieve
  4962. *
  4963. * @details
  4964. * The following field definitions describe the format of the HTT host
  4965. * to target FW extended stats retrieve message.
  4966. * The message specifies the type of stats the host wants to retrieve.
  4967. *
  4968. * |31 24|23 16|15 8|7 0|
  4969. * |-----------------------------------------------------------|
  4970. * | reserved | stats type | pdev_mask | msg type |
  4971. * |-----------------------------------------------------------|
  4972. * | config param [0] |
  4973. * |-----------------------------------------------------------|
  4974. * | config param [1] |
  4975. * |-----------------------------------------------------------|
  4976. * | config param [2] |
  4977. * |-----------------------------------------------------------|
  4978. * | config param [3] |
  4979. * |-----------------------------------------------------------|
  4980. * | reserved |
  4981. * |-----------------------------------------------------------|
  4982. * | cookie LSBs |
  4983. * |-----------------------------------------------------------|
  4984. * | cookie MSBs |
  4985. * |-----------------------------------------------------------|
  4986. * Header fields:
  4987. * - MSG_TYPE
  4988. * Bits 7:0
  4989. * Purpose: identifies this is a extended stats upload request message
  4990. * Value: 0x10
  4991. * - PDEV_MASK
  4992. * Bits 8:15
  4993. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4994. * Value: This is a overloaded field, refer to usage and interpretation of
  4995. * PDEV in interface document.
  4996. * Bit 8 : Reserved for SOC stats
  4997. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4998. * Indicates MACID_MASK in DBS
  4999. * - STATS_TYPE
  5000. * Bits 23:16
  5001. * Purpose: identifies which FW statistics to upload
  5002. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5003. * - Reserved
  5004. * Bits 31:24
  5005. * - CONFIG_PARAM [0]
  5006. * Bits 31:0
  5007. * Purpose: give an opaque configuration value to the specified stats type
  5008. * Value: stats-type specific configuration value
  5009. * Refer to htt_stats.h for interpretation for each stats sub_type
  5010. * - CONFIG_PARAM [1]
  5011. * Bits 31:0
  5012. * Purpose: give an opaque configuration value to the specified stats type
  5013. * Value: stats-type specific configuration value
  5014. * Refer to htt_stats.h for interpretation for each stats sub_type
  5015. * - CONFIG_PARAM [2]
  5016. * Bits 31:0
  5017. * Purpose: give an opaque configuration value to the specified stats type
  5018. * Value: stats-type specific configuration value
  5019. * Refer to htt_stats.h for interpretation for each stats sub_type
  5020. * - CONFIG_PARAM [3]
  5021. * Bits 31:0
  5022. * Purpose: give an opaque configuration value to the specified stats type
  5023. * Value: stats-type specific configuration value
  5024. * Refer to htt_stats.h for interpretation for each stats sub_type
  5025. * - Reserved [31:0] for future use.
  5026. * - COOKIE_LSBS
  5027. * Bits 31:0
  5028. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5029. * message with its preceding host->target stats request message.
  5030. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5031. * - COOKIE_MSBS
  5032. * Bits 31:0
  5033. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5034. * message with its preceding host->target stats request message.
  5035. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5036. */
  5037. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5038. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5039. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5040. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5041. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5042. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5043. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5044. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5045. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5046. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5047. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5048. do { \
  5049. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5050. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5051. } while (0)
  5052. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5053. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5054. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5055. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5056. do { \
  5057. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5058. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5059. } while (0)
  5060. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5061. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5062. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5063. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5064. do { \
  5065. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5066. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5067. } while (0)
  5068. /**
  5069. * @brief host -> target FW PPDU_STATS request message
  5070. *
  5071. * @details
  5072. * The following field definitions describe the format of the HTT host
  5073. * to target FW for PPDU_STATS_CFG msg.
  5074. * The message allows the host to configure the PPDU_STATS_IND messages
  5075. * produced by the target.
  5076. *
  5077. * |31 24|23 16|15 8|7 0|
  5078. * |-----------------------------------------------------------|
  5079. * | REQ bit mask | pdev_mask | msg type |
  5080. * |-----------------------------------------------------------|
  5081. * Header fields:
  5082. * - MSG_TYPE
  5083. * Bits 7:0
  5084. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5085. * Value: 0x11
  5086. * - PDEV_MASK
  5087. * Bits 8:15
  5088. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5089. * Value: This is a overloaded field, refer to usage and interpretation of
  5090. * PDEV in interface document.
  5091. * Bit 8 : Reserved for SOC stats
  5092. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5093. * Indicates MACID_MASK in DBS
  5094. * - REQ_TLV_BIT_MASK
  5095. * Bits 16:31
  5096. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5097. * needs to be included in the target's PPDU_STATS_IND messages.
  5098. * Value: refer htt_ppdu_stats_tlv_tag_t
  5099. *
  5100. */
  5101. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5102. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5103. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5104. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5105. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5106. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5107. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5108. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5109. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5110. do { \
  5111. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5112. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5113. } while (0)
  5114. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5115. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5116. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5117. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5118. do { \
  5119. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5120. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5121. } while (0)
  5122. /*=== target -> host messages ===============================================*/
  5123. enum htt_t2h_msg_type {
  5124. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5125. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5126. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5127. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5128. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5129. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5130. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5131. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5132. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5133. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5134. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5135. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5136. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5137. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5138. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5139. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5140. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5141. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5142. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5143. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5144. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5145. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5146. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5147. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5148. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5149. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5150. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5151. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5152. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5153. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5154. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5155. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5156. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5157. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5158. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5159. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5160. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5161. HTT_T2H_MSG_TYPE_TEST,
  5162. /* keep this last */
  5163. HTT_T2H_NUM_MSGS
  5164. };
  5165. /*
  5166. * HTT target to host message type -
  5167. * stored in bits 7:0 of the first word of the message
  5168. */
  5169. #define HTT_T2H_MSG_TYPE_M 0xff
  5170. #define HTT_T2H_MSG_TYPE_S 0
  5171. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5172. do { \
  5173. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5174. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5175. } while (0)
  5176. #define HTT_T2H_MSG_TYPE_GET(word) \
  5177. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5178. /**
  5179. * @brief target -> host version number confirmation message definition
  5180. *
  5181. * |31 24|23 16|15 8|7 0|
  5182. * |----------------+----------------+----------------+----------------|
  5183. * | reserved | major number | minor number | msg type |
  5184. * |-------------------------------------------------------------------|
  5185. * : option request TLV (optional) |
  5186. * :...................................................................:
  5187. *
  5188. * The VER_CONF message may consist of a single 4-byte word, or may be
  5189. * extended with TLVs that specify HTT options selected by the target.
  5190. * The following option TLVs may be appended to the VER_CONF message:
  5191. * - LL_BUS_ADDR_SIZE
  5192. * - HL_SUPPRESS_TX_COMPL_IND
  5193. * - MAX_TX_QUEUE_GROUPS
  5194. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5195. * may be appended to the VER_CONF message (but only one TLV of each type).
  5196. *
  5197. * Header fields:
  5198. * - MSG_TYPE
  5199. * Bits 7:0
  5200. * Purpose: identifies this as a version number confirmation message
  5201. * Value: 0x0
  5202. * - VER_MINOR
  5203. * Bits 15:8
  5204. * Purpose: Specify the minor number of the HTT message library version
  5205. * in use by the target firmware.
  5206. * The minor number specifies the specific revision within a range
  5207. * of fundamentally compatible HTT message definition revisions.
  5208. * Compatible revisions involve adding new messages or perhaps
  5209. * adding new fields to existing messages, in a backwards-compatible
  5210. * manner.
  5211. * Incompatible revisions involve changing the message type values,
  5212. * or redefining existing messages.
  5213. * Value: minor number
  5214. * - VER_MAJOR
  5215. * Bits 15:8
  5216. * Purpose: Specify the major number of the HTT message library version
  5217. * in use by the target firmware.
  5218. * The major number specifies the family of minor revisions that are
  5219. * fundamentally compatible with each other, but not with prior or
  5220. * later families.
  5221. * Value: major number
  5222. */
  5223. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5224. #define HTT_VER_CONF_MINOR_S 8
  5225. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5226. #define HTT_VER_CONF_MAJOR_S 16
  5227. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5230. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5231. } while (0)
  5232. #define HTT_VER_CONF_MINOR_GET(word) \
  5233. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5234. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5235. do { \
  5236. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5237. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5238. } while (0)
  5239. #define HTT_VER_CONF_MAJOR_GET(word) \
  5240. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5241. #define HTT_VER_CONF_BYTES 4
  5242. /**
  5243. * @brief - target -> host HTT Rx In order indication message
  5244. *
  5245. * @details
  5246. *
  5247. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5248. * |----------------+-------------------+---------------------+---------------|
  5249. * | peer ID | P| F| O| ext TID | msg type |
  5250. * |--------------------------------------------------------------------------|
  5251. * | MSDU count | Reserved | vdev id |
  5252. * |--------------------------------------------------------------------------|
  5253. * | MSDU 0 bus address (bits 31:0) |
  5254. #if HTT_PADDR64
  5255. * | MSDU 0 bus address (bits 63:32) |
  5256. #endif
  5257. * |--------------------------------------------------------------------------|
  5258. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5259. * |--------------------------------------------------------------------------|
  5260. * | MSDU 1 bus address (bits 31:0) |
  5261. #if HTT_PADDR64
  5262. * | MSDU 1 bus address (bits 63:32) |
  5263. #endif
  5264. * |--------------------------------------------------------------------------|
  5265. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5266. * |--------------------------------------------------------------------------|
  5267. */
  5268. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5269. *
  5270. * @details
  5271. * bits
  5272. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5273. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5274. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5275. * | | frag | | | | fail |chksum fail|
  5276. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5277. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5278. */
  5279. struct htt_rx_in_ord_paddr_ind_hdr_t
  5280. {
  5281. A_UINT32 /* word 0 */
  5282. msg_type: 8,
  5283. ext_tid: 5,
  5284. offload: 1,
  5285. frag: 1,
  5286. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5287. peer_id: 16;
  5288. A_UINT32 /* word 1 */
  5289. vap_id: 8,
  5290. reserved_1: 8,
  5291. msdu_cnt: 16;
  5292. };
  5293. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5294. {
  5295. A_UINT32 dma_addr;
  5296. A_UINT32
  5297. length: 16,
  5298. fw_desc: 8,
  5299. msdu_info:8;
  5300. };
  5301. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5302. {
  5303. A_UINT32 dma_addr_lo;
  5304. A_UINT32 dma_addr_hi;
  5305. A_UINT32
  5306. length: 16,
  5307. fw_desc: 8,
  5308. msdu_info:8;
  5309. };
  5310. #if HTT_PADDR64
  5311. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5312. #else
  5313. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5314. #endif
  5315. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5316. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5317. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5318. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5319. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5320. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5321. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5322. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5323. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5324. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5325. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5326. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5327. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5328. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5329. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5330. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5331. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5332. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5333. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5334. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5335. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5336. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5337. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5338. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5339. /* for systems using 64-bit format for bus addresses */
  5340. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5341. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5342. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5343. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5344. /* for systems using 32-bit format for bus addresses */
  5345. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5346. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5347. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5348. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5349. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5350. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5351. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5352. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5353. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5354. do { \
  5355. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5356. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5357. } while (0)
  5358. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5359. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5360. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5361. do { \
  5362. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5363. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5364. } while (0)
  5365. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5366. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5367. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5368. do { \
  5369. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5370. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5371. } while (0)
  5372. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5373. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5374. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5375. do { \
  5376. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5377. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5378. } while (0)
  5379. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5380. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5381. /* for systems using 64-bit format for bus addresses */
  5382. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5383. do { \
  5384. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5385. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5386. } while (0)
  5387. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5388. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5389. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5390. do { \
  5391. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5392. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5393. } while (0)
  5394. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5395. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5396. /* for systems using 32-bit format for bus addresses */
  5397. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5398. do { \
  5399. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5400. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5401. } while (0)
  5402. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5403. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5404. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5405. do { \
  5406. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5407. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5408. } while (0)
  5409. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5410. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5411. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5414. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5415. } while (0)
  5416. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5417. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5418. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5421. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5422. } while (0)
  5423. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5424. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5425. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5426. do { \
  5427. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5428. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5429. } while (0)
  5430. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5431. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5432. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5433. do { \
  5434. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5435. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5436. } while (0)
  5437. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5438. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5439. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5442. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5443. } while (0)
  5444. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5445. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5446. /* definitions used within target -> host rx indication message */
  5447. PREPACK struct htt_rx_ind_hdr_prefix_t
  5448. {
  5449. A_UINT32 /* word 0 */
  5450. msg_type: 8,
  5451. ext_tid: 5,
  5452. release_valid: 1,
  5453. flush_valid: 1,
  5454. reserved0: 1,
  5455. peer_id: 16;
  5456. A_UINT32 /* word 1 */
  5457. flush_start_seq_num: 6,
  5458. flush_end_seq_num: 6,
  5459. release_start_seq_num: 6,
  5460. release_end_seq_num: 6,
  5461. num_mpdu_ranges: 8;
  5462. } POSTPACK;
  5463. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5464. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5465. #define HTT_TGT_RSSI_INVALID 0x80
  5466. PREPACK struct htt_rx_ppdu_desc_t
  5467. {
  5468. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5469. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5470. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5471. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5472. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5473. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5474. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5475. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5476. A_UINT32 /* word 0 */
  5477. rssi_cmb: 8,
  5478. timestamp_submicrosec: 8,
  5479. phy_err_code: 8,
  5480. phy_err: 1,
  5481. legacy_rate: 4,
  5482. legacy_rate_sel: 1,
  5483. end_valid: 1,
  5484. start_valid: 1;
  5485. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5486. union {
  5487. A_UINT32 /* word 1 */
  5488. rssi0_pri20: 8,
  5489. rssi0_ext20: 8,
  5490. rssi0_ext40: 8,
  5491. rssi0_ext80: 8;
  5492. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5493. } u0;
  5494. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5495. union {
  5496. A_UINT32 /* word 2 */
  5497. rssi1_pri20: 8,
  5498. rssi1_ext20: 8,
  5499. rssi1_ext40: 8,
  5500. rssi1_ext80: 8;
  5501. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5502. } u1;
  5503. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5504. union {
  5505. A_UINT32 /* word 3 */
  5506. rssi2_pri20: 8,
  5507. rssi2_ext20: 8,
  5508. rssi2_ext40: 8,
  5509. rssi2_ext80: 8;
  5510. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5511. } u2;
  5512. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5513. union {
  5514. A_UINT32 /* word 4 */
  5515. rssi3_pri20: 8,
  5516. rssi3_ext20: 8,
  5517. rssi3_ext40: 8,
  5518. rssi3_ext80: 8;
  5519. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5520. } u3;
  5521. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5522. A_UINT32 tsf32; /* word 5 */
  5523. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5524. A_UINT32 timestamp_microsec; /* word 6 */
  5525. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5526. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5527. A_UINT32 /* word 7 */
  5528. vht_sig_a1: 24,
  5529. preamble_type: 8;
  5530. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5531. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5532. A_UINT32 /* word 8 */
  5533. vht_sig_a2: 24,
  5534. /* sa_ant_matrix
  5535. * For cases where a single rx chain has options to be connected to
  5536. * different rx antennas, show which rx antennas were in use during
  5537. * receipt of a given PPDU.
  5538. * This sa_ant_matrix provides a bitmask of the antennas used while
  5539. * receiving this frame.
  5540. */
  5541. sa_ant_matrix: 8;
  5542. } POSTPACK;
  5543. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5544. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5545. PREPACK struct htt_rx_ind_hdr_suffix_t
  5546. {
  5547. A_UINT32 /* word 0 */
  5548. fw_rx_desc_bytes: 16,
  5549. reserved0: 16;
  5550. } POSTPACK;
  5551. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5552. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5553. PREPACK struct htt_rx_ind_hdr_t
  5554. {
  5555. struct htt_rx_ind_hdr_prefix_t prefix;
  5556. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5557. struct htt_rx_ind_hdr_suffix_t suffix;
  5558. } POSTPACK;
  5559. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5560. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5561. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5562. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5563. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5564. /*
  5565. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5566. * the offset into the HTT rx indication message at which the
  5567. * FW rx PPDU descriptor resides
  5568. */
  5569. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5570. /*
  5571. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5572. * the offset into the HTT rx indication message at which the
  5573. * header suffix (FW rx MSDU byte count) resides
  5574. */
  5575. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5576. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5577. /*
  5578. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5579. * the offset into the HTT rx indication message at which the per-MSDU
  5580. * information starts
  5581. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5582. * per-MSDU information portion of the message. The per-MSDU info itself
  5583. * starts at byte 12.
  5584. */
  5585. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5586. /**
  5587. * @brief target -> host rx indication message definition
  5588. *
  5589. * @details
  5590. * The following field definitions describe the format of the rx indication
  5591. * message sent from the target to the host.
  5592. * The message consists of three major sections:
  5593. * 1. a fixed-length header
  5594. * 2. a variable-length list of firmware rx MSDU descriptors
  5595. * 3. one or more 4-octet MPDU range information elements
  5596. * The fixed length header itself has two sub-sections
  5597. * 1. the message meta-information, including identification of the
  5598. * sender and type of the received data, and a 4-octet flush/release IE
  5599. * 2. the firmware rx PPDU descriptor
  5600. *
  5601. * The format of the message is depicted below.
  5602. * in this depiction, the following abbreviations are used for information
  5603. * elements within the message:
  5604. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5605. * elements associated with the PPDU start are valid.
  5606. * Specifically, the following fields are valid only if SV is set:
  5607. * RSSI (all variants), L, legacy rate, preamble type, service,
  5608. * VHT-SIG-A
  5609. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5610. * elements associated with the PPDU end are valid.
  5611. * Specifically, the following fields are valid only if EV is set:
  5612. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5613. * - L - Legacy rate selector - if legacy rates are used, this flag
  5614. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5615. * (L == 0) PHY.
  5616. * - P - PHY error flag - boolean indication of whether the rx frame had
  5617. * a PHY error
  5618. *
  5619. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5620. * |----------------+-------------------+---------------------+---------------|
  5621. * | peer ID | |RV|FV| ext TID | msg type |
  5622. * |--------------------------------------------------------------------------|
  5623. * | num | release | release | flush | flush |
  5624. * | MPDU | end | start | end | start |
  5625. * | ranges | seq num | seq num | seq num | seq num |
  5626. * |==========================================================================|
  5627. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5628. * |V|V| | rate | | | timestamp | RSSI |
  5629. * |--------------------------------------------------------------------------|
  5630. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5631. * |--------------------------------------------------------------------------|
  5632. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5633. * |--------------------------------------------------------------------------|
  5634. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5635. * |--------------------------------------------------------------------------|
  5636. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5637. * |--------------------------------------------------------------------------|
  5638. * | TSF LSBs |
  5639. * |--------------------------------------------------------------------------|
  5640. * | microsec timestamp |
  5641. * |--------------------------------------------------------------------------|
  5642. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5643. * |--------------------------------------------------------------------------|
  5644. * | service | HT-SIG / VHT-SIG-A2 |
  5645. * |==========================================================================|
  5646. * | reserved | FW rx desc bytes |
  5647. * |--------------------------------------------------------------------------|
  5648. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5649. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5650. * |--------------------------------------------------------------------------|
  5651. * : : :
  5652. * |--------------------------------------------------------------------------|
  5653. * | alignment | MSDU Rx |
  5654. * | padding | desc Bn |
  5655. * |--------------------------------------------------------------------------|
  5656. * | reserved | MPDU range status | MPDU count |
  5657. * |--------------------------------------------------------------------------|
  5658. * : reserved : MPDU range status : MPDU count :
  5659. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5660. *
  5661. * Header fields:
  5662. * - MSG_TYPE
  5663. * Bits 7:0
  5664. * Purpose: identifies this as an rx indication message
  5665. * Value: 0x1
  5666. * - EXT_TID
  5667. * Bits 12:8
  5668. * Purpose: identify the traffic ID of the rx data, including
  5669. * special "extended" TID values for multicast, broadcast, and
  5670. * non-QoS data frames
  5671. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5672. * - FLUSH_VALID (FV)
  5673. * Bit 13
  5674. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5675. * is valid
  5676. * Value:
  5677. * 1 -> flush IE is valid and needs to be processed
  5678. * 0 -> flush IE is not valid and should be ignored
  5679. * - REL_VALID (RV)
  5680. * Bit 13
  5681. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5682. * is valid
  5683. * Value:
  5684. * 1 -> release IE is valid and needs to be processed
  5685. * 0 -> release IE is not valid and should be ignored
  5686. * - PEER_ID
  5687. * Bits 31:16
  5688. * Purpose: Identify, by ID, which peer sent the rx data
  5689. * Value: ID of the peer who sent the rx data
  5690. * - FLUSH_SEQ_NUM_START
  5691. * Bits 5:0
  5692. * Purpose: Indicate the start of a series of MPDUs to flush
  5693. * Not all MPDUs within this series are necessarily valid - the host
  5694. * must check each sequence number within this range to see if the
  5695. * corresponding MPDU is actually present.
  5696. * This field is only valid if the FV bit is set.
  5697. * Value:
  5698. * The sequence number for the first MPDUs to check to flush.
  5699. * The sequence number is masked by 0x3f.
  5700. * - FLUSH_SEQ_NUM_END
  5701. * Bits 11:6
  5702. * Purpose: Indicate the end of a series of MPDUs to flush
  5703. * Value:
  5704. * The sequence number one larger than the sequence number of the
  5705. * last MPDU to check to flush.
  5706. * The sequence number is masked by 0x3f.
  5707. * Not all MPDUs within this series are necessarily valid - the host
  5708. * must check each sequence number within this range to see if the
  5709. * corresponding MPDU is actually present.
  5710. * This field is only valid if the FV bit is set.
  5711. * - REL_SEQ_NUM_START
  5712. * Bits 17:12
  5713. * Purpose: Indicate the start of a series of MPDUs to release.
  5714. * All MPDUs within this series are present and valid - the host
  5715. * need not check each sequence number within this range to see if
  5716. * the corresponding MPDU is actually present.
  5717. * This field is only valid if the RV bit is set.
  5718. * Value:
  5719. * The sequence number for the first MPDUs to check to release.
  5720. * The sequence number is masked by 0x3f.
  5721. * - REL_SEQ_NUM_END
  5722. * Bits 23:18
  5723. * Purpose: Indicate the end of a series of MPDUs to release.
  5724. * Value:
  5725. * The sequence number one larger than the sequence number of the
  5726. * last MPDU to check to release.
  5727. * The sequence number is masked by 0x3f.
  5728. * All MPDUs within this series are present and valid - the host
  5729. * need not check each sequence number within this range to see if
  5730. * the corresponding MPDU is actually present.
  5731. * This field is only valid if the RV bit is set.
  5732. * - NUM_MPDU_RANGES
  5733. * Bits 31:24
  5734. * Purpose: Indicate how many ranges of MPDUs are present.
  5735. * Each MPDU range consists of a series of contiguous MPDUs within the
  5736. * rx frame sequence which all have the same MPDU status.
  5737. * Value: 1-63 (typically a small number, like 1-3)
  5738. *
  5739. * Rx PPDU descriptor fields:
  5740. * - RSSI_CMB
  5741. * Bits 7:0
  5742. * Purpose: Combined RSSI from all active rx chains, across the active
  5743. * bandwidth.
  5744. * Value: RSSI dB units w.r.t. noise floor
  5745. * - TIMESTAMP_SUBMICROSEC
  5746. * Bits 15:8
  5747. * Purpose: high-resolution timestamp
  5748. * Value:
  5749. * Sub-microsecond time of PPDU reception.
  5750. * This timestamp ranges from [0,MAC clock MHz).
  5751. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5752. * to form a high-resolution, large range rx timestamp.
  5753. * - PHY_ERR_CODE
  5754. * Bits 23:16
  5755. * Purpose:
  5756. * If the rx frame processing resulted in a PHY error, indicate what
  5757. * type of rx PHY error occurred.
  5758. * Value:
  5759. * This field is valid if the "P" (PHY_ERR) flag is set.
  5760. * TBD: document/specify the values for this field
  5761. * - PHY_ERR
  5762. * Bit 24
  5763. * Purpose: indicate whether the rx PPDU had a PHY error
  5764. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5765. * - LEGACY_RATE
  5766. * Bits 28:25
  5767. * Purpose:
  5768. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5769. * specify which rate was used.
  5770. * Value:
  5771. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5772. * flag.
  5773. * If LEGACY_RATE_SEL is 0:
  5774. * 0x8: OFDM 48 Mbps
  5775. * 0x9: OFDM 24 Mbps
  5776. * 0xA: OFDM 12 Mbps
  5777. * 0xB: OFDM 6 Mbps
  5778. * 0xC: OFDM 54 Mbps
  5779. * 0xD: OFDM 36 Mbps
  5780. * 0xE: OFDM 18 Mbps
  5781. * 0xF: OFDM 9 Mbps
  5782. * If LEGACY_RATE_SEL is 1:
  5783. * 0x8: CCK 11 Mbps long preamble
  5784. * 0x9: CCK 5.5 Mbps long preamble
  5785. * 0xA: CCK 2 Mbps long preamble
  5786. * 0xB: CCK 1 Mbps long preamble
  5787. * 0xC: CCK 11 Mbps short preamble
  5788. * 0xD: CCK 5.5 Mbps short preamble
  5789. * 0xE: CCK 2 Mbps short preamble
  5790. * - LEGACY_RATE_SEL
  5791. * Bit 29
  5792. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5793. * Value:
  5794. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5795. * used a legacy rate.
  5796. * 0 -> OFDM, 1 -> CCK
  5797. * - END_VALID
  5798. * Bit 30
  5799. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5800. * the start of the PPDU are valid. Specifically, the following
  5801. * fields are only valid if END_VALID is set:
  5802. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5803. * TIMESTAMP_SUBMICROSEC
  5804. * Value:
  5805. * 0 -> rx PPDU desc end fields are not valid
  5806. * 1 -> rx PPDU desc end fields are valid
  5807. * - START_VALID
  5808. * Bit 31
  5809. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5810. * the end of the PPDU are valid. Specifically, the following
  5811. * fields are only valid if START_VALID is set:
  5812. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5813. * VHT-SIG-A
  5814. * Value:
  5815. * 0 -> rx PPDU desc start fields are not valid
  5816. * 1 -> rx PPDU desc start fields are valid
  5817. * - RSSI0_PRI20
  5818. * Bits 7:0
  5819. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5820. * Value: RSSI dB units w.r.t. noise floor
  5821. *
  5822. * - RSSI0_EXT20
  5823. * Bits 7:0
  5824. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5825. * (if the rx bandwidth was >= 40 MHz)
  5826. * Value: RSSI dB units w.r.t. noise floor
  5827. * - RSSI0_EXT40
  5828. * Bits 7:0
  5829. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5830. * (if the rx bandwidth was >= 80 MHz)
  5831. * Value: RSSI dB units w.r.t. noise floor
  5832. * - RSSI0_EXT80
  5833. * Bits 7:0
  5834. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5835. * (if the rx bandwidth was >= 160 MHz)
  5836. * Value: RSSI dB units w.r.t. noise floor
  5837. *
  5838. * - RSSI1_PRI20
  5839. * Bits 7:0
  5840. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5841. * Value: RSSI dB units w.r.t. noise floor
  5842. * - RSSI1_EXT20
  5843. * Bits 7:0
  5844. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5845. * (if the rx bandwidth was >= 40 MHz)
  5846. * Value: RSSI dB units w.r.t. noise floor
  5847. * - RSSI1_EXT40
  5848. * Bits 7:0
  5849. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5850. * (if the rx bandwidth was >= 80 MHz)
  5851. * Value: RSSI dB units w.r.t. noise floor
  5852. * - RSSI1_EXT80
  5853. * Bits 7:0
  5854. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5855. * (if the rx bandwidth was >= 160 MHz)
  5856. * Value: RSSI dB units w.r.t. noise floor
  5857. *
  5858. * - RSSI2_PRI20
  5859. * Bits 7:0
  5860. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5861. * Value: RSSI dB units w.r.t. noise floor
  5862. * - RSSI2_EXT20
  5863. * Bits 7:0
  5864. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5865. * (if the rx bandwidth was >= 40 MHz)
  5866. * Value: RSSI dB units w.r.t. noise floor
  5867. * - RSSI2_EXT40
  5868. * Bits 7:0
  5869. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5870. * (if the rx bandwidth was >= 80 MHz)
  5871. * Value: RSSI dB units w.r.t. noise floor
  5872. * - RSSI2_EXT80
  5873. * Bits 7:0
  5874. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5875. * (if the rx bandwidth was >= 160 MHz)
  5876. * Value: RSSI dB units w.r.t. noise floor
  5877. *
  5878. * - RSSI3_PRI20
  5879. * Bits 7:0
  5880. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5881. * Value: RSSI dB units w.r.t. noise floor
  5882. * - RSSI3_EXT20
  5883. * Bits 7:0
  5884. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5885. * (if the rx bandwidth was >= 40 MHz)
  5886. * Value: RSSI dB units w.r.t. noise floor
  5887. * - RSSI3_EXT40
  5888. * Bits 7:0
  5889. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5890. * (if the rx bandwidth was >= 80 MHz)
  5891. * Value: RSSI dB units w.r.t. noise floor
  5892. * - RSSI3_EXT80
  5893. * Bits 7:0
  5894. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5895. * (if the rx bandwidth was >= 160 MHz)
  5896. * Value: RSSI dB units w.r.t. noise floor
  5897. *
  5898. * - TSF32
  5899. * Bits 31:0
  5900. * Purpose: specify the time the rx PPDU was received, in TSF units
  5901. * Value: 32 LSBs of the TSF
  5902. * - TIMESTAMP_MICROSEC
  5903. * Bits 31:0
  5904. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5905. * Value: PPDU rx time, in microseconds
  5906. * - VHT_SIG_A1
  5907. * Bits 23:0
  5908. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5909. * from the rx PPDU
  5910. * Value:
  5911. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5912. * VHT-SIG-A1 data.
  5913. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5914. * first 24 bits of the HT-SIG data.
  5915. * Otherwise, this field is invalid.
  5916. * Refer to the the 802.11 protocol for the definition of the
  5917. * HT-SIG and VHT-SIG-A1 fields
  5918. * - VHT_SIG_A2
  5919. * Bits 23:0
  5920. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5921. * from the rx PPDU
  5922. * Value:
  5923. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5924. * VHT-SIG-A2 data.
  5925. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5926. * last 24 bits of the HT-SIG data.
  5927. * Otherwise, this field is invalid.
  5928. * Refer to the the 802.11 protocol for the definition of the
  5929. * HT-SIG and VHT-SIG-A2 fields
  5930. * - PREAMBLE_TYPE
  5931. * Bits 31:24
  5932. * Purpose: indicate the PHY format of the received burst
  5933. * Value:
  5934. * 0x4: Legacy (OFDM/CCK)
  5935. * 0x8: HT
  5936. * 0x9: HT with TxBF
  5937. * 0xC: VHT
  5938. * 0xD: VHT with TxBF
  5939. * - SERVICE
  5940. * Bits 31:24
  5941. * Purpose: TBD
  5942. * Value: TBD
  5943. *
  5944. * Rx MSDU descriptor fields:
  5945. * - FW_RX_DESC_BYTES
  5946. * Bits 15:0
  5947. * Purpose: Indicate how many bytes in the Rx indication are used for
  5948. * FW Rx descriptors
  5949. *
  5950. * Payload fields:
  5951. * - MPDU_COUNT
  5952. * Bits 7:0
  5953. * Purpose: Indicate how many sequential MPDUs share the same status.
  5954. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5955. * - MPDU_STATUS
  5956. * Bits 15:8
  5957. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5958. * received successfully.
  5959. * Value:
  5960. * 0x1: success
  5961. * 0x2: FCS error
  5962. * 0x3: duplicate error
  5963. * 0x4: replay error
  5964. * 0x5: invalid peer
  5965. */
  5966. /* header fields */
  5967. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5968. #define HTT_RX_IND_EXT_TID_S 8
  5969. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5970. #define HTT_RX_IND_FLUSH_VALID_S 13
  5971. #define HTT_RX_IND_REL_VALID_M 0x4000
  5972. #define HTT_RX_IND_REL_VALID_S 14
  5973. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5974. #define HTT_RX_IND_PEER_ID_S 16
  5975. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5976. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5977. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5978. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5979. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5980. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5981. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5982. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5983. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5984. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5985. /* rx PPDU descriptor fields */
  5986. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5987. #define HTT_RX_IND_RSSI_CMB_S 0
  5988. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5989. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5990. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5991. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5992. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5993. #define HTT_RX_IND_PHY_ERR_S 24
  5994. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5995. #define HTT_RX_IND_LEGACY_RATE_S 25
  5996. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5997. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5998. #define HTT_RX_IND_END_VALID_M 0x40000000
  5999. #define HTT_RX_IND_END_VALID_S 30
  6000. #define HTT_RX_IND_START_VALID_M 0x80000000
  6001. #define HTT_RX_IND_START_VALID_S 31
  6002. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6003. #define HTT_RX_IND_RSSI_PRI20_S 0
  6004. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6005. #define HTT_RX_IND_RSSI_EXT20_S 8
  6006. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6007. #define HTT_RX_IND_RSSI_EXT40_S 16
  6008. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6009. #define HTT_RX_IND_RSSI_EXT80_S 24
  6010. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6011. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6012. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6013. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6014. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6015. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6016. #define HTT_RX_IND_SERVICE_M 0xff000000
  6017. #define HTT_RX_IND_SERVICE_S 24
  6018. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6019. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6020. /* rx MSDU descriptor fields */
  6021. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6022. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6023. /* payload fields */
  6024. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6025. #define HTT_RX_IND_MPDU_COUNT_S 0
  6026. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6027. #define HTT_RX_IND_MPDU_STATUS_S 8
  6028. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6029. do { \
  6030. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6031. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6032. } while (0)
  6033. #define HTT_RX_IND_EXT_TID_GET(word) \
  6034. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6035. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6038. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6039. } while (0)
  6040. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6041. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6042. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6045. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6046. } while (0)
  6047. #define HTT_RX_IND_REL_VALID_GET(word) \
  6048. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6049. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6050. do { \
  6051. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6052. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6053. } while (0)
  6054. #define HTT_RX_IND_PEER_ID_GET(word) \
  6055. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6056. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6057. do { \
  6058. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6059. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6060. } while (0)
  6061. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6062. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6063. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6064. do { \
  6065. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6066. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6067. } while (0)
  6068. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6069. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6070. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6071. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6072. do { \
  6073. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6074. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6075. } while (0)
  6076. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6077. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6078. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6079. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6080. do { \
  6081. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6082. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6083. } while (0)
  6084. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6085. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6086. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6087. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6088. do { \
  6089. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6090. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6091. } while (0)
  6092. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6093. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6094. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6095. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6096. do { \
  6097. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6098. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6099. } while (0)
  6100. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6101. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6102. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6103. /* FW rx PPDU descriptor fields */
  6104. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6105. do { \
  6106. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6107. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6108. } while (0)
  6109. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6110. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6111. HTT_RX_IND_RSSI_CMB_S)
  6112. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6113. do { \
  6114. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6115. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6116. } while (0)
  6117. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6118. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6119. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6120. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6121. do { \
  6122. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6123. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6124. } while (0)
  6125. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6126. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6127. HTT_RX_IND_PHY_ERR_CODE_S)
  6128. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6129. do { \
  6130. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6131. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6132. } while (0)
  6133. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6134. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6135. HTT_RX_IND_PHY_ERR_S)
  6136. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6137. do { \
  6138. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6139. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6140. } while (0)
  6141. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6142. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6143. HTT_RX_IND_LEGACY_RATE_S)
  6144. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6145. do { \
  6146. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6147. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6148. } while (0)
  6149. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6150. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6151. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6152. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6153. do { \
  6154. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6155. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6156. } while (0)
  6157. #define HTT_RX_IND_END_VALID_GET(word) \
  6158. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6159. HTT_RX_IND_END_VALID_S)
  6160. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6161. do { \
  6162. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6163. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6164. } while (0)
  6165. #define HTT_RX_IND_START_VALID_GET(word) \
  6166. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6167. HTT_RX_IND_START_VALID_S)
  6168. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6169. do { \
  6170. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6171. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6172. } while (0)
  6173. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6174. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6175. HTT_RX_IND_RSSI_PRI20_S)
  6176. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6177. do { \
  6178. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6179. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6180. } while (0)
  6181. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6182. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6183. HTT_RX_IND_RSSI_EXT20_S)
  6184. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6185. do { \
  6186. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6187. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6188. } while (0)
  6189. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6190. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6191. HTT_RX_IND_RSSI_EXT40_S)
  6192. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6193. do { \
  6194. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6195. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6196. } while (0)
  6197. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6198. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6199. HTT_RX_IND_RSSI_EXT80_S)
  6200. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6201. do { \
  6202. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6203. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6204. } while (0)
  6205. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6206. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6207. HTT_RX_IND_VHT_SIG_A1_S)
  6208. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6209. do { \
  6210. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6211. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6212. } while (0)
  6213. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6214. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6215. HTT_RX_IND_VHT_SIG_A2_S)
  6216. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6217. do { \
  6218. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6219. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6220. } while (0)
  6221. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6222. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6223. HTT_RX_IND_PREAMBLE_TYPE_S)
  6224. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6225. do { \
  6226. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6227. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6228. } while (0)
  6229. #define HTT_RX_IND_SERVICE_GET(word) \
  6230. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6231. HTT_RX_IND_SERVICE_S)
  6232. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6235. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6236. } while (0)
  6237. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6238. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6239. HTT_RX_IND_SA_ANT_MATRIX_S)
  6240. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6243. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6244. } while (0)
  6245. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6246. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6247. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6250. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6251. } while (0)
  6252. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6253. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6254. #define HTT_RX_IND_HL_BYTES \
  6255. (HTT_RX_IND_HDR_BYTES + \
  6256. 4 /* single FW rx MSDU descriptor */ + \
  6257. 4 /* single MPDU range information element */)
  6258. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6259. /* Could we use one macro entry? */
  6260. #define HTT_WORD_SET(word, field, value) \
  6261. do { \
  6262. HTT_CHECK_SET_VAL(field, value); \
  6263. (word) |= ((value) << field ## _S); \
  6264. } while (0)
  6265. #define HTT_WORD_GET(word, field) \
  6266. (((word) & field ## _M) >> field ## _S)
  6267. PREPACK struct hl_htt_rx_ind_base {
  6268. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6269. } POSTPACK;
  6270. /*
  6271. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6272. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6273. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6274. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6275. * htt_rx_ind_hl_rx_desc_t.
  6276. */
  6277. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6278. struct htt_rx_ind_hl_rx_desc_t {
  6279. A_UINT8 ver;
  6280. A_UINT8 len;
  6281. struct {
  6282. A_UINT8
  6283. first_msdu: 1,
  6284. last_msdu: 1,
  6285. c3_failed: 1,
  6286. c4_failed: 1,
  6287. ipv6: 1,
  6288. tcp: 1,
  6289. udp: 1,
  6290. reserved: 1;
  6291. } flags;
  6292. /* NOTE: no reserved space - don't append any new fields here */
  6293. };
  6294. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6295. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6296. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6297. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6298. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6299. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6300. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6301. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6302. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6303. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6304. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6305. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6306. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6307. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6308. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6309. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6310. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6311. /* This structure is used in HL, the basic descriptor information
  6312. * used by host. the structure is translated by FW from HW desc
  6313. * or generated by FW. But in HL monitor mode, the host would use
  6314. * the same structure with LL.
  6315. */
  6316. PREPACK struct hl_htt_rx_desc_base {
  6317. A_UINT32
  6318. seq_num:12,
  6319. encrypted:1,
  6320. chan_info_present:1,
  6321. resv0:2,
  6322. mcast_bcast:1,
  6323. fragment:1,
  6324. key_id_oct:8,
  6325. resv1:6;
  6326. A_UINT32
  6327. pn_31_0;
  6328. union {
  6329. struct {
  6330. A_UINT16 pn_47_32;
  6331. A_UINT16 pn_63_48;
  6332. } pn16;
  6333. A_UINT32 pn_63_32;
  6334. } u0;
  6335. A_UINT32
  6336. pn_95_64;
  6337. A_UINT32
  6338. pn_127_96;
  6339. } POSTPACK;
  6340. /*
  6341. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6342. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6343. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6344. * Please see htt_chan_change_t for description of the fields.
  6345. */
  6346. PREPACK struct htt_chan_info_t
  6347. {
  6348. A_UINT32 primary_chan_center_freq_mhz: 16,
  6349. contig_chan1_center_freq_mhz: 16;
  6350. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6351. phy_mode: 8,
  6352. reserved: 8;
  6353. } POSTPACK;
  6354. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6355. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6356. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6357. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6358. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6359. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6360. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6361. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6362. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6363. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6364. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6365. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6366. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6367. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6368. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6369. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6370. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6371. /* Channel information */
  6372. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6373. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6374. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6375. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6376. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6377. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6378. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6379. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6380. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6383. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6384. } while (0)
  6385. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6386. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6387. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6388. do { \
  6389. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6390. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6391. } while (0)
  6392. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6393. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6394. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6397. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6398. } while (0)
  6399. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6400. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6401. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6402. do { \
  6403. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6404. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6405. } while (0)
  6406. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6407. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6408. /*
  6409. * @brief target -> host rx reorder flush message definition
  6410. *
  6411. * @details
  6412. * The following field definitions describe the format of the rx flush
  6413. * message sent from the target to the host.
  6414. * The message consists of a 4-octet header, followed by one or more
  6415. * 4-octet payload information elements.
  6416. *
  6417. * |31 24|23 8|7 0|
  6418. * |--------------------------------------------------------------|
  6419. * | TID | peer ID | msg type |
  6420. * |--------------------------------------------------------------|
  6421. * | seq num end | seq num start | MPDU status | reserved |
  6422. * |--------------------------------------------------------------|
  6423. * First DWORD:
  6424. * - MSG_TYPE
  6425. * Bits 7:0
  6426. * Purpose: identifies this as an rx flush message
  6427. * Value: 0x2
  6428. * - PEER_ID
  6429. * Bits 23:8 (only bits 18:8 actually used)
  6430. * Purpose: identify which peer's rx data is being flushed
  6431. * Value: (rx) peer ID
  6432. * - TID
  6433. * Bits 31:24 (only bits 27:24 actually used)
  6434. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6435. * Value: traffic identifier
  6436. * Second DWORD:
  6437. * - MPDU_STATUS
  6438. * Bits 15:8
  6439. * Purpose:
  6440. * Indicate whether the flushed MPDUs should be discarded or processed.
  6441. * Value:
  6442. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6443. * stages of rx processing
  6444. * other: discard the MPDUs
  6445. * It is anticipated that flush messages will always have
  6446. * MPDU status == 1, but the status flag is included for
  6447. * flexibility.
  6448. * - SEQ_NUM_START
  6449. * Bits 23:16
  6450. * Purpose:
  6451. * Indicate the start of a series of consecutive MPDUs being flushed.
  6452. * Not all MPDUs within this range are necessarily valid - the host
  6453. * must check each sequence number within this range to see if the
  6454. * corresponding MPDU is actually present.
  6455. * Value:
  6456. * The sequence number for the first MPDU in the sequence.
  6457. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6458. * - SEQ_NUM_END
  6459. * Bits 30:24
  6460. * Purpose:
  6461. * Indicate the end of a series of consecutive MPDUs being flushed.
  6462. * Value:
  6463. * The sequence number one larger than the sequence number of the
  6464. * last MPDU being flushed.
  6465. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6466. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6467. * are to be released for further rx processing.
  6468. * Not all MPDUs within this range are necessarily valid - the host
  6469. * must check each sequence number within this range to see if the
  6470. * corresponding MPDU is actually present.
  6471. */
  6472. /* first DWORD */
  6473. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6474. #define HTT_RX_FLUSH_PEER_ID_S 8
  6475. #define HTT_RX_FLUSH_TID_M 0xff000000
  6476. #define HTT_RX_FLUSH_TID_S 24
  6477. /* second DWORD */
  6478. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6479. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6480. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6481. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6482. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6483. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6484. #define HTT_RX_FLUSH_BYTES 8
  6485. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6488. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6489. } while (0)
  6490. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6491. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6492. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6493. do { \
  6494. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6495. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6496. } while (0)
  6497. #define HTT_RX_FLUSH_TID_GET(word) \
  6498. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6499. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6500. do { \
  6501. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6502. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6503. } while (0)
  6504. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6505. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6506. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6507. do { \
  6508. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6509. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6510. } while (0)
  6511. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6512. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6513. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6514. do { \
  6515. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6516. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6517. } while (0)
  6518. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6519. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6520. /*
  6521. * @brief target -> host rx pn check indication message
  6522. *
  6523. * @details
  6524. * The following field definitions describe the format of the Rx PN check
  6525. * indication message sent from the target to the host.
  6526. * The message consists of a 4-octet header, followed by the start and
  6527. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6528. * IE is one octet containing the sequence number that failed the PN
  6529. * check.
  6530. *
  6531. * |31 24|23 8|7 0|
  6532. * |--------------------------------------------------------------|
  6533. * | TID | peer ID | msg type |
  6534. * |--------------------------------------------------------------|
  6535. * | Reserved | PN IE count | seq num end | seq num start|
  6536. * |--------------------------------------------------------------|
  6537. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6538. * |--------------------------------------------------------------|
  6539. * First DWORD:
  6540. * - MSG_TYPE
  6541. * Bits 7:0
  6542. * Purpose: Identifies this as an rx pn check indication message
  6543. * Value: 0x2
  6544. * - PEER_ID
  6545. * Bits 23:8 (only bits 18:8 actually used)
  6546. * Purpose: identify which peer
  6547. * Value: (rx) peer ID
  6548. * - TID
  6549. * Bits 31:24 (only bits 27:24 actually used)
  6550. * Purpose: identify traffic identifier
  6551. * Value: traffic identifier
  6552. * Second DWORD:
  6553. * - SEQ_NUM_START
  6554. * Bits 7:0
  6555. * Purpose:
  6556. * Indicates the starting sequence number of the MPDU in this
  6557. * series of MPDUs that went though PN check.
  6558. * Value:
  6559. * The sequence number for the first MPDU in the sequence.
  6560. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6561. * - SEQ_NUM_END
  6562. * Bits 15:8
  6563. * Purpose:
  6564. * Indicates the ending sequence number of the MPDU in this
  6565. * series of MPDUs that went though PN check.
  6566. * Value:
  6567. * The sequence number one larger then the sequence number of the last
  6568. * MPDU being flushed.
  6569. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6570. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6571. * for invalid PN numbers and are ready to be released for further processing.
  6572. * Not all MPDUs within this range are necessarily valid - the host
  6573. * must check each sequence number within this range to see if the
  6574. * corresponding MPDU is actually present.
  6575. * - PN_IE_COUNT
  6576. * Bits 23:16
  6577. * Purpose:
  6578. * Used to determine the variable number of PN information elements in this
  6579. * message
  6580. *
  6581. * PN information elements:
  6582. * - PN_IE_x-
  6583. * Purpose:
  6584. * Each PN information element contains the sequence number of the MPDU that
  6585. * has failed the target PN check.
  6586. * Value:
  6587. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6588. * that failed the PN check.
  6589. */
  6590. /* first DWORD */
  6591. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6592. #define HTT_RX_PN_IND_PEER_ID_S 8
  6593. #define HTT_RX_PN_IND_TID_M 0xff000000
  6594. #define HTT_RX_PN_IND_TID_S 24
  6595. /* second DWORD */
  6596. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6597. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6598. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6599. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6600. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6601. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6602. #define HTT_RX_PN_IND_BYTES 8
  6603. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6604. do { \
  6605. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6606. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6607. } while (0)
  6608. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6609. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6610. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6613. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6614. } while (0)
  6615. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6616. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6617. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6618. do { \
  6619. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6620. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6621. } while (0)
  6622. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6623. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6624. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6625. do { \
  6626. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6627. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6628. } while (0)
  6629. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6630. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6631. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6632. do { \
  6633. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6634. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6635. } while (0)
  6636. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6637. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6638. /*
  6639. * @brief target -> host rx offload deliver message for LL system
  6640. *
  6641. * @details
  6642. * In a low latency system this message is sent whenever the offload
  6643. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6644. * The DMA of the actual packets into host memory is done before sending out
  6645. * this message. This message indicates only how many MSDUs to reap. The
  6646. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6647. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6648. * DMA'd by the MAC directly into host memory these packets do not contain
  6649. * the MAC descriptors in the header portion of the packet. Instead they contain
  6650. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6651. * message, the packets are delivered directly to the NW stack without going
  6652. * through the regular reorder buffering and PN checking path since it has
  6653. * already been done in target.
  6654. *
  6655. * |31 24|23 16|15 8|7 0|
  6656. * |-----------------------------------------------------------------------|
  6657. * | Total MSDU count | reserved | msg type |
  6658. * |-----------------------------------------------------------------------|
  6659. *
  6660. * @brief target -> host rx offload deliver message for HL system
  6661. *
  6662. * @details
  6663. * In a high latency system this message is sent whenever the offload manager
  6664. * flushes out the packets it has coalesced in its coalescing buffer. The
  6665. * actual packets are also carried along with this message. When the host
  6666. * receives this message, it is expected to deliver these packets to the NW
  6667. * stack directly instead of routing them through the reorder buffering and
  6668. * PN checking path since it has already been done in target.
  6669. *
  6670. * |31 24|23 16|15 8|7 0|
  6671. * |-----------------------------------------------------------------------|
  6672. * | Total MSDU count | reserved | msg type |
  6673. * |-----------------------------------------------------------------------|
  6674. * | peer ID | MSDU length |
  6675. * |-----------------------------------------------------------------------|
  6676. * | MSDU payload | FW Desc | tid | vdev ID |
  6677. * |-----------------------------------------------------------------------|
  6678. * | MSDU payload contd. |
  6679. * |-----------------------------------------------------------------------|
  6680. * | peer ID | MSDU length |
  6681. * |-----------------------------------------------------------------------|
  6682. * | MSDU payload | FW Desc | tid | vdev ID |
  6683. * |-----------------------------------------------------------------------|
  6684. * | MSDU payload contd. |
  6685. * |-----------------------------------------------------------------------|
  6686. *
  6687. */
  6688. /* first DWORD */
  6689. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6690. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6691. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6692. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6693. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6694. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6695. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6696. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6697. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6698. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6699. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6700. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6701. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6702. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6703. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6704. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6705. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6706. do { \
  6707. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6708. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6709. } while (0)
  6710. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6711. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6712. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6713. do { \
  6714. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6715. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6716. } while (0)
  6717. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6718. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6719. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6720. do { \
  6721. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6722. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6723. } while (0)
  6724. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6725. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6726. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6729. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6730. } while (0)
  6731. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6732. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6733. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6736. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6737. } while (0)
  6738. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6739. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6740. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6743. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6744. } while (0)
  6745. /**
  6746. * @brief target -> host rx peer map/unmap message definition
  6747. *
  6748. * @details
  6749. * The following diagram shows the format of the rx peer map message sent
  6750. * from the target to the host. This layout assumes the target operates
  6751. * as little-endian.
  6752. *
  6753. * This message always contains a SW peer ID. The main purpose of the
  6754. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6755. * with, so that the host can use that peer ID to determine which peer
  6756. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6757. * other purposes, such as identifying during tx completions which peer
  6758. * the tx frames in question were transmitted to.
  6759. *
  6760. * In certain generations of chips, the peer map message also contains
  6761. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6762. * to identify which peer the frame needs to be forwarded to (i.e. the
  6763. * peer assocated with the Destination MAC Address within the packet),
  6764. * and particularly which vdev needs to transmit the frame (for cases
  6765. * of inter-vdev rx --> tx forwarding).
  6766. * This DA-based peer ID that is provided for certain rx frames
  6767. * (the rx frames that need to be re-transmitted as tx frames)
  6768. * is the ID that the HW uses for referring to the peer in question,
  6769. * rather than the peer ID that the SW+FW use to refer to the peer.
  6770. *
  6771. *
  6772. * |31 24|23 16|15 8|7 0|
  6773. * |-----------------------------------------------------------------------|
  6774. * | SW peer ID | VDEV ID | msg type |
  6775. * |-----------------------------------------------------------------------|
  6776. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6777. * |-----------------------------------------------------------------------|
  6778. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6779. * |-----------------------------------------------------------------------|
  6780. *
  6781. *
  6782. * The following diagram shows the format of the rx peer unmap message sent
  6783. * from the target to the host.
  6784. *
  6785. * |31 24|23 16|15 8|7 0|
  6786. * |-----------------------------------------------------------------------|
  6787. * | SW peer ID | VDEV ID | msg type |
  6788. * |-----------------------------------------------------------------------|
  6789. *
  6790. * The following field definitions describe the format of the rx peer map
  6791. * and peer unmap messages sent from the target to the host.
  6792. * - MSG_TYPE
  6793. * Bits 7:0
  6794. * Purpose: identifies this as an rx peer map or peer unmap message
  6795. * Value: peer map -> 0x3, peer unmap -> 0x4
  6796. * - VDEV_ID
  6797. * Bits 15:8
  6798. * Purpose: Indicates which virtual device the peer is associated
  6799. * with.
  6800. * Value: vdev ID (used in the host to look up the vdev object)
  6801. * - PEER_ID (a.k.a. SW_PEER_ID)
  6802. * Bits 31:16
  6803. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6804. * freeing (unmap)
  6805. * Value: (rx) peer ID
  6806. * - MAC_ADDR_L32 (peer map only)
  6807. * Bits 31:0
  6808. * Purpose: Identifies which peer node the peer ID is for.
  6809. * Value: lower 4 bytes of peer node's MAC address
  6810. * - MAC_ADDR_U16 (peer map only)
  6811. * Bits 15:0
  6812. * Purpose: Identifies which peer node the peer ID is for.
  6813. * Value: upper 2 bytes of peer node's MAC address
  6814. * - HW_PEER_ID
  6815. * Bits 31:16
  6816. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6817. * address, so for rx frames marked for rx --> tx forwarding, the
  6818. * host can determine from the HW peer ID provided as meta-data with
  6819. * the rx frame which peer the frame is supposed to be forwarded to.
  6820. * Value: ID used by the MAC HW to identify the peer
  6821. */
  6822. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6823. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6824. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6825. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6826. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6827. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6828. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6829. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6830. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6831. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6832. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6833. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6834. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6835. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6836. do { \
  6837. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6838. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6839. } while (0)
  6840. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6841. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6842. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6843. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6844. do { \
  6845. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6846. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6847. } while (0)
  6848. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6849. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6850. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6851. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6852. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6853. do { \
  6854. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6855. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6856. } while (0)
  6857. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6858. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6859. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6860. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6861. #define HTT_RX_PEER_MAP_BYTES 12
  6862. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6863. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6864. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6865. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6866. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6867. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6868. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6869. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6870. #define HTT_RX_PEER_UNMAP_BYTES 4
  6871. /**
  6872. * @brief target -> host rx peer map V2 message definition
  6873. *
  6874. * @details
  6875. * The following diagram shows the format of the rx peer map v2 message sent
  6876. * from the target to the host. This layout assumes the target operates
  6877. * as little-endian.
  6878. *
  6879. * This message always contains a SW peer ID. The main purpose of the
  6880. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6881. * with, so that the host can use that peer ID to determine which peer
  6882. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6883. * other purposes, such as identifying during tx completions which peer
  6884. * the tx frames in question were transmitted to.
  6885. *
  6886. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6887. * is used during rx --> tx frame forwarding to identify which peer the
  6888. * frame needs to be forwarded to (i.e. the peer assocated with the
  6889. * Destination MAC Address within the packet), and particularly which vdev
  6890. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6891. * This DA-based peer ID that is provided for certain rx frames
  6892. * (the rx frames that need to be re-transmitted as tx frames)
  6893. * is the ID that the HW uses for referring to the peer in question,
  6894. * rather than the peer ID that the SW+FW use to refer to the peer.
  6895. *
  6896. *
  6897. * |31 24|23 16|15 8|7 0|
  6898. * |-----------------------------------------------------------------------|
  6899. * | SW peer ID | VDEV ID | msg type |
  6900. * |-----------------------------------------------------------------------|
  6901. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6902. * |-----------------------------------------------------------------------|
  6903. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6904. * |-----------------------------------------------------------------------|
  6905. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6906. * |-----------------------------------------------------------------------|
  6907. * | Reserved_0 |
  6908. * |-----------------------------------------------------------------------|
  6909. * | Reserved_1 |
  6910. * |-----------------------------------------------------------------------|
  6911. * | Reserved_2 |
  6912. * |-----------------------------------------------------------------------|
  6913. * | Reserved_3 |
  6914. * |-----------------------------------------------------------------------|
  6915. *
  6916. *
  6917. * The following field definitions describe the format of the rx peer map v2
  6918. * messages sent from the target to the host.
  6919. * - MSG_TYPE
  6920. * Bits 7:0
  6921. * Purpose: identifies this as an rx peer map v2 message
  6922. * Value: peer map v2 -> 0x1e
  6923. * - VDEV_ID
  6924. * Bits 15:8
  6925. * Purpose: Indicates which virtual device the peer is associated with.
  6926. * Value: vdev ID (used in the host to look up the vdev object)
  6927. * - SW_PEER_ID
  6928. * Bits 31:16
  6929. * Purpose: The peer ID (index) that WAL is allocating
  6930. * Value: (rx) peer ID
  6931. * - MAC_ADDR_L32
  6932. * Bits 31:0
  6933. * Purpose: Identifies which peer node the peer ID is for.
  6934. * Value: lower 4 bytes of peer node's MAC address
  6935. * - MAC_ADDR_U16
  6936. * Bits 15:0
  6937. * Purpose: Identifies which peer node the peer ID is for.
  6938. * Value: upper 2 bytes of peer node's MAC address
  6939. * - HW_PEER_ID
  6940. * Bits 31:16
  6941. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6942. * address, so for rx frames marked for rx --> tx forwarding, the
  6943. * host can determine from the HW peer ID provided as meta-data with
  6944. * the rx frame which peer the frame is supposed to be forwarded to.
  6945. * Value: ID used by the MAC HW to identify the peer
  6946. * - AST_HASH_VALUE
  6947. * Bits 15:0
  6948. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6949. * override feature.
  6950. * - NEXT_HOP
  6951. * Bit 16
  6952. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6953. * (Wireless Distribution System).
  6954. */
  6955. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6956. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6957. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6958. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6959. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6960. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6961. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6962. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6963. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6964. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6965. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6966. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6967. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6968. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6969. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6970. do { \
  6971. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6972. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6973. } while (0)
  6974. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6975. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6976. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6979. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6980. } while (0)
  6981. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6982. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6983. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6984. do { \
  6985. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6986. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6987. } while (0)
  6988. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6989. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6990. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6993. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6994. } while (0)
  6995. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6996. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6997. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6998. do { \
  6999. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7000. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7001. } while (0)
  7002. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7003. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7004. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7005. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7006. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7007. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7008. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7009. /**
  7010. * @brief target -> host rx peer unmap V2 message definition
  7011. *
  7012. *
  7013. * The following diagram shows the format of the rx peer unmap message sent
  7014. * from the target to the host.
  7015. *
  7016. * |31 24|23 16|15 8|7 0|
  7017. * |-----------------------------------------------------------------------|
  7018. * | SW peer ID | VDEV ID | msg type |
  7019. * |-----------------------------------------------------------------------|
  7020. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7021. * |-----------------------------------------------------------------------|
  7022. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7023. * |-----------------------------------------------------------------------|
  7024. * | Peer Delete Duration |
  7025. * |-----------------------------------------------------------------------|
  7026. * | Reserved_0 |
  7027. * |-----------------------------------------------------------------------|
  7028. * | Reserved_1 |
  7029. * |-----------------------------------------------------------------------|
  7030. * | Reserved_2 |
  7031. * |-----------------------------------------------------------------------|
  7032. *
  7033. *
  7034. * The following field definitions describe the format of the rx peer unmap
  7035. * messages sent from the target to the host.
  7036. * - MSG_TYPE
  7037. * Bits 7:0
  7038. * Purpose: identifies this as an rx peer unmap v2 message
  7039. * Value: peer unmap v2 -> 0x1f
  7040. * - VDEV_ID
  7041. * Bits 15:8
  7042. * Purpose: Indicates which virtual device the peer is associated
  7043. * with.
  7044. * Value: vdev ID (used in the host to look up the vdev object)
  7045. * - SW_PEER_ID
  7046. * Bits 31:16
  7047. * Purpose: The peer ID (index) that WAL is freeing
  7048. * Value: (rx) peer ID
  7049. * - MAC_ADDR_L32
  7050. * Bits 31:0
  7051. * Purpose: Identifies which peer node the peer ID is for.
  7052. * Value: lower 4 bytes of peer node's MAC address
  7053. * - MAC_ADDR_U16
  7054. * Bits 15:0
  7055. * Purpose: Identifies which peer node the peer ID is for.
  7056. * Value: upper 2 bytes of peer node's MAC address
  7057. * - NEXT_HOP
  7058. * Bits 16
  7059. * Purpose: Bit indicates next_hop AST entry used for WDS
  7060. * (Wireless Distribution System).
  7061. * - PEER_DELETE_DURATION
  7062. * Bits 31:0
  7063. * Purpose: Time taken to delete peer, in msec,
  7064. * Used for monitoring / debugging PEER delete response delay
  7065. */
  7066. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7067. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7068. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7069. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7070. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7071. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7072. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7073. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7074. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7075. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7076. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7077. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7078. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7079. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7080. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7081. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7082. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7083. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7084. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7085. do { \
  7086. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7087. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7088. } while (0)
  7089. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7090. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7091. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7092. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7093. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7094. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7095. /**
  7096. * @brief target -> host message specifying security parameters
  7097. *
  7098. * @details
  7099. * The following diagram shows the format of the security specification
  7100. * message sent from the target to the host.
  7101. * This security specification message tells the host whether a PN check is
  7102. * necessary on rx data frames, and if so, how large the PN counter is.
  7103. * This message also tells the host about the security processing to apply
  7104. * to defragmented rx frames - specifically, whether a Message Integrity
  7105. * Check is required, and the Michael key to use.
  7106. *
  7107. * |31 24|23 16|15|14 8|7 0|
  7108. * |-----------------------------------------------------------------------|
  7109. * | peer ID | U| security type | msg type |
  7110. * |-----------------------------------------------------------------------|
  7111. * | Michael Key K0 |
  7112. * |-----------------------------------------------------------------------|
  7113. * | Michael Key K1 |
  7114. * |-----------------------------------------------------------------------|
  7115. * | WAPI RSC Low0 |
  7116. * |-----------------------------------------------------------------------|
  7117. * | WAPI RSC Low1 |
  7118. * |-----------------------------------------------------------------------|
  7119. * | WAPI RSC Hi0 |
  7120. * |-----------------------------------------------------------------------|
  7121. * | WAPI RSC Hi1 |
  7122. * |-----------------------------------------------------------------------|
  7123. *
  7124. * The following field definitions describe the format of the security
  7125. * indication message sent from the target to the host.
  7126. * - MSG_TYPE
  7127. * Bits 7:0
  7128. * Purpose: identifies this as a security specification message
  7129. * Value: 0xb
  7130. * - SEC_TYPE
  7131. * Bits 14:8
  7132. * Purpose: specifies which type of security applies to the peer
  7133. * Value: htt_sec_type enum value
  7134. * - UNICAST
  7135. * Bit 15
  7136. * Purpose: whether this security is applied to unicast or multicast data
  7137. * Value: 1 -> unicast, 0 -> multicast
  7138. * - PEER_ID
  7139. * Bits 31:16
  7140. * Purpose: The ID number for the peer the security specification is for
  7141. * Value: peer ID
  7142. * - MICHAEL_KEY_K0
  7143. * Bits 31:0
  7144. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7145. * Value: Michael Key K0 (if security type is TKIP)
  7146. * - MICHAEL_KEY_K1
  7147. * Bits 31:0
  7148. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7149. * Value: Michael Key K1 (if security type is TKIP)
  7150. * - WAPI_RSC_LOW0
  7151. * Bits 31:0
  7152. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7153. * Value: WAPI RSC Low0 (if security type is WAPI)
  7154. * - WAPI_RSC_LOW1
  7155. * Bits 31:0
  7156. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7157. * Value: WAPI RSC Low1 (if security type is WAPI)
  7158. * - WAPI_RSC_HI0
  7159. * Bits 31:0
  7160. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7161. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7162. * - WAPI_RSC_HI1
  7163. * Bits 31:0
  7164. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7165. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7166. */
  7167. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7168. #define HTT_SEC_IND_SEC_TYPE_S 8
  7169. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7170. #define HTT_SEC_IND_UNICAST_S 15
  7171. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7172. #define HTT_SEC_IND_PEER_ID_S 16
  7173. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7174. do { \
  7175. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7176. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7177. } while (0)
  7178. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7179. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7180. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7181. do { \
  7182. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7183. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7184. } while (0)
  7185. #define HTT_SEC_IND_UNICAST_GET(word) \
  7186. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7187. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7188. do { \
  7189. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7190. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7191. } while (0)
  7192. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7193. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7194. #define HTT_SEC_IND_BYTES 28
  7195. /**
  7196. * @brief target -> host rx ADDBA / DELBA message definitions
  7197. *
  7198. * @details
  7199. * The following diagram shows the format of the rx ADDBA message sent
  7200. * from the target to the host:
  7201. *
  7202. * |31 20|19 16|15 8|7 0|
  7203. * |---------------------------------------------------------------------|
  7204. * | peer ID | TID | window size | msg type |
  7205. * |---------------------------------------------------------------------|
  7206. *
  7207. * The following diagram shows the format of the rx DELBA message sent
  7208. * from the target to the host:
  7209. *
  7210. * |31 20|19 16|15 10|9 8|7 0|
  7211. * |---------------------------------------------------------------------|
  7212. * | peer ID | TID | reserved | IR| msg type |
  7213. * |---------------------------------------------------------------------|
  7214. *
  7215. * The following field definitions describe the format of the rx ADDBA
  7216. * and DELBA messages sent from the target to the host.
  7217. * - MSG_TYPE
  7218. * Bits 7:0
  7219. * Purpose: identifies this as an rx ADDBA or DELBA message
  7220. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7221. * - IR (initiator / recipient)
  7222. * Bits 9:8 (DELBA only)
  7223. * Purpose: specify whether the DELBA handshake was initiated by the
  7224. * local STA/AP, or by the peer STA/AP
  7225. * Value:
  7226. * 0 - unspecified
  7227. * 1 - initiator (a.k.a. originator)
  7228. * 2 - recipient (a.k.a. responder)
  7229. * 3 - unused / reserved
  7230. * - WIN_SIZE
  7231. * Bits 15:8 (ADDBA only)
  7232. * Purpose: Specifies the length of the block ack window (max = 64).
  7233. * Value:
  7234. * block ack window length specified by the received ADDBA
  7235. * management message.
  7236. * - TID
  7237. * Bits 19:16
  7238. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7239. * Value:
  7240. * TID specified by the received ADDBA or DELBA management message.
  7241. * - PEER_ID
  7242. * Bits 31:20
  7243. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7244. * Value:
  7245. * ID (hash value) used by the host for fast, direct lookup of
  7246. * host SW peer info, including rx reorder states.
  7247. */
  7248. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7249. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7250. #define HTT_RX_ADDBA_TID_M 0xf0000
  7251. #define HTT_RX_ADDBA_TID_S 16
  7252. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7253. #define HTT_RX_ADDBA_PEER_ID_S 20
  7254. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7255. do { \
  7256. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7257. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7258. } while (0)
  7259. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7260. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7261. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7262. do { \
  7263. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7264. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7265. } while (0)
  7266. #define HTT_RX_ADDBA_TID_GET(word) \
  7267. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7268. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7269. do { \
  7270. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7271. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7272. } while (0)
  7273. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7274. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7275. #define HTT_RX_ADDBA_BYTES 4
  7276. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7277. #define HTT_RX_DELBA_INITIATOR_S 8
  7278. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7279. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7280. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7281. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7282. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7283. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7284. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7285. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7286. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7287. do { \
  7288. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7289. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7290. } while (0)
  7291. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7292. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7293. #define HTT_RX_DELBA_BYTES 4
  7294. /**
  7295. * @brief tx queue group information element definition
  7296. *
  7297. * @details
  7298. * The following diagram shows the format of the tx queue group
  7299. * information element, which can be included in target --> host
  7300. * messages to specify the number of tx "credits" (tx descriptors
  7301. * for LL, or tx buffers for HL) available to a particular group
  7302. * of host-side tx queues, and which host-side tx queues belong to
  7303. * the group.
  7304. *
  7305. * |31|30 24|23 16|15|14|13 0|
  7306. * |------------------------------------------------------------------------|
  7307. * | X| reserved | tx queue grp ID | A| S| credit count |
  7308. * |------------------------------------------------------------------------|
  7309. * | vdev ID mask | AC mask |
  7310. * |------------------------------------------------------------------------|
  7311. *
  7312. * The following definitions describe the fields within the tx queue group
  7313. * information element:
  7314. * - credit_count
  7315. * Bits 13:1
  7316. * Purpose: specify how many tx credits are available to the tx queue group
  7317. * Value: An absolute or relative, positive or negative credit value
  7318. * The 'A' bit specifies whether the value is absolute or relative.
  7319. * The 'S' bit specifies whether the value is positive or negative.
  7320. * A negative value can only be relative, not absolute.
  7321. * An absolute value replaces any prior credit value the host has for
  7322. * the tx queue group in question.
  7323. * A relative value is added to the prior credit value the host has for
  7324. * the tx queue group in question.
  7325. * - sign
  7326. * Bit 14
  7327. * Purpose: specify whether the credit count is positive or negative
  7328. * Value: 0 -> positive, 1 -> negative
  7329. * - absolute
  7330. * Bit 15
  7331. * Purpose: specify whether the credit count is absolute or relative
  7332. * Value: 0 -> relative, 1 -> absolute
  7333. * - txq_group_id
  7334. * Bits 23:16
  7335. * Purpose: indicate which tx queue group's credit and/or membership are
  7336. * being specified
  7337. * Value: 0 to max_tx_queue_groups-1
  7338. * - reserved
  7339. * Bits 30:16
  7340. * Value: 0x0
  7341. * - eXtension
  7342. * Bit 31
  7343. * Purpose: specify whether another tx queue group info element follows
  7344. * Value: 0 -> no more tx queue group information elements
  7345. * 1 -> another tx queue group information element immediately follows
  7346. * - ac_mask
  7347. * Bits 15:0
  7348. * Purpose: specify which Access Categories belong to the tx queue group
  7349. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7350. * the tx queue group.
  7351. * The AC bit-mask values are obtained by left-shifting by the
  7352. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7353. * - vdev_id_mask
  7354. * Bits 31:16
  7355. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7356. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7357. * belong to the tx queue group.
  7358. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7359. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7360. */
  7361. PREPACK struct htt_txq_group {
  7362. A_UINT32
  7363. credit_count: 14,
  7364. sign: 1,
  7365. absolute: 1,
  7366. tx_queue_group_id: 8,
  7367. reserved0: 7,
  7368. extension: 1;
  7369. A_UINT32
  7370. ac_mask: 16,
  7371. vdev_id_mask: 16;
  7372. } POSTPACK;
  7373. /* first word */
  7374. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7375. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7376. #define HTT_TXQ_GROUP_SIGN_S 14
  7377. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7378. #define HTT_TXQ_GROUP_ABS_S 15
  7379. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7380. #define HTT_TXQ_GROUP_ID_S 16
  7381. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7382. #define HTT_TXQ_GROUP_EXT_S 31
  7383. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7384. /* second word */
  7385. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7386. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7387. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7388. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7389. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7390. do { \
  7391. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7392. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7393. } while (0)
  7394. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7395. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7396. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7397. do { \
  7398. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7399. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7400. } while (0)
  7401. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7402. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7403. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7404. do { \
  7405. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7406. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7407. } while (0)
  7408. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7409. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7410. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7411. do { \
  7412. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7413. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7414. } while (0)
  7415. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7416. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7417. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7418. do { \
  7419. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7420. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7421. } while (0)
  7422. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7423. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7424. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7425. do { \
  7426. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7427. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7428. } while (0)
  7429. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7430. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7431. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7432. do { \
  7433. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7434. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7435. } while (0)
  7436. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7437. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7438. /**
  7439. * @brief target -> host TX completion indication message definition
  7440. *
  7441. * @details
  7442. * The following diagram shows the format of the TX completion indication sent
  7443. * from the target to the host
  7444. *
  7445. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7446. * |-------------------------------------------------------------|
  7447. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7448. * |-------------------------------------------------------------|
  7449. * payload: | MSDU1 ID | MSDU0 ID |
  7450. * |-------------------------------------------------------------|
  7451. * : MSDU3 ID : MSDU2 ID :
  7452. * |-------------------------------------------------------------|
  7453. * | struct htt_tx_compl_ind_append_retries |
  7454. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7455. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7456. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7457. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7458. * |-------------------------------------------------------------|
  7459. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7460. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7461. * Where:
  7462. * A0 = append (a.k.a. append0)
  7463. * A1 = append1
  7464. * TP = MSDU tx power presence
  7465. * A2 = append2
  7466. *
  7467. * The following field definitions describe the format of the TX completion
  7468. * indication sent from the target to the host
  7469. * Header fields:
  7470. * - msg_type
  7471. * Bits 7:0
  7472. * Purpose: identifies this as HTT TX completion indication
  7473. * Value: 0x7
  7474. * - status
  7475. * Bits 10:8
  7476. * Purpose: the TX completion status of payload fragmentations descriptors
  7477. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7478. * - tid
  7479. * Bits 14:11
  7480. * Purpose: the tid associated with those fragmentation descriptors. It is
  7481. * valid or not, depending on the tid_invalid bit.
  7482. * Value: 0 to 15
  7483. * - tid_invalid
  7484. * Bits 15:15
  7485. * Purpose: this bit indicates whether the tid field is valid or not
  7486. * Value: 0 indicates valid; 1 indicates invalid
  7487. * - num
  7488. * Bits 23:16
  7489. * Purpose: the number of payload in this indication
  7490. * Value: 1 to 255
  7491. * - append (a.k.a. append0)
  7492. * Bits 24:24
  7493. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7494. * the number of tx retries for one MSDU at the end of this message
  7495. * Value: 0 indicates no appending; 1 indicates appending
  7496. * - append1
  7497. * Bits 25:25
  7498. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7499. * contains the timestamp info for each TX msdu id in payload.
  7500. * The order of the timestamps matches the order of the MSDU IDs.
  7501. * Note that a big-endian host needs to account for the reordering
  7502. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7503. * conversion) when determining which tx timestamp corresponds to
  7504. * which MSDU ID.
  7505. * Value: 0 indicates no appending; 1 indicates appending
  7506. * - msdu_tx_power_presence
  7507. * Bits 26:26
  7508. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7509. * for each MSDU referenced by the TX_COMPL_IND message.
  7510. * The tx power is reported in 0.5 dBm units.
  7511. * The order of the per-MSDU tx power reports matches the order
  7512. * of the MSDU IDs.
  7513. * Note that a big-endian host needs to account for the reordering
  7514. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7515. * conversion) when determining which Tx Power corresponds to
  7516. * which MSDU ID.
  7517. * Value: 0 indicates MSDU tx power reports are not appended,
  7518. * 1 indicates MSDU tx power reports are appended
  7519. * - append2
  7520. * Bits 27:27
  7521. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7522. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7523. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7524. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7525. * for each MSDU, for convenience.
  7526. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7527. * this append2 bit is set).
  7528. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7529. * dB above the noise floor.
  7530. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7531. * 1 indicates MSDU ACK RSSI values are appended.
  7532. * Payload fields:
  7533. * - hmsdu_id
  7534. * Bits 15:0
  7535. * Purpose: this ID is used to track the Tx buffer in host
  7536. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7537. */
  7538. #define HTT_TX_COMPL_IND_STATUS_S 8
  7539. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7540. #define HTT_TX_COMPL_IND_TID_S 11
  7541. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7542. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7543. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7544. #define HTT_TX_COMPL_IND_NUM_S 16
  7545. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7546. #define HTT_TX_COMPL_IND_APPEND_S 24
  7547. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7548. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7549. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7550. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7551. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7552. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7553. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7554. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7555. do { \
  7556. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7557. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7558. } while (0)
  7559. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7560. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7561. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7562. do { \
  7563. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7564. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7565. } while (0)
  7566. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7567. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7568. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7569. do { \
  7570. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7571. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7572. } while (0)
  7573. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7574. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7575. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7578. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7579. } while (0)
  7580. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7581. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7582. HTT_TX_COMPL_IND_TID_INV_S)
  7583. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7586. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7587. } while (0)
  7588. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7589. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7590. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7591. do { \
  7592. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7593. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7594. } while (0)
  7595. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7596. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7597. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7598. do { \
  7599. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7600. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7601. } while (0)
  7602. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7603. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7604. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7605. do { \
  7606. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7607. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7608. } while (0)
  7609. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7610. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7611. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7612. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7613. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7614. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7615. #define HTT_TX_COMPL_IND_STAT_OK 0
  7616. /* DISCARD:
  7617. * current meaning:
  7618. * MSDUs were queued for transmission but filtered by HW or SW
  7619. * without any over the air attempts
  7620. * legacy meaning (HL Rome):
  7621. * MSDUs were discarded by the target FW without any over the air
  7622. * attempts due to lack of space
  7623. */
  7624. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7625. /* NO_ACK:
  7626. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7627. */
  7628. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7629. /* POSTPONE:
  7630. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7631. * be downloaded again later (in the appropriate order), when they are
  7632. * deliverable.
  7633. */
  7634. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7635. /*
  7636. * The PEER_DEL tx completion status is used for HL cases
  7637. * where the peer the frame is for has been deleted.
  7638. * The host has already discarded its copy of the frame, but
  7639. * it still needs the tx completion to restore its credit.
  7640. */
  7641. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7642. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7643. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7644. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7645. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7646. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7647. PREPACK struct htt_tx_compl_ind_base {
  7648. A_UINT32 hdr;
  7649. A_UINT16 payload[1/*or more*/];
  7650. } POSTPACK;
  7651. PREPACK struct htt_tx_compl_ind_append_retries {
  7652. A_UINT16 msdu_id;
  7653. A_UINT8 tx_retries;
  7654. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7655. 0: this is the last append_retries struct */
  7656. } POSTPACK;
  7657. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7658. A_UINT32 timestamp[1/*or more*/];
  7659. } POSTPACK;
  7660. /**
  7661. * @brief target -> host rate-control update indication message
  7662. *
  7663. * @details
  7664. * The following diagram shows the format of the RC Update message
  7665. * sent from the target to the host, while processing the tx-completion
  7666. * of a transmitted PPDU.
  7667. *
  7668. * |31 24|23 16|15 8|7 0|
  7669. * |-------------------------------------------------------------|
  7670. * | peer ID | vdev ID | msg_type |
  7671. * |-------------------------------------------------------------|
  7672. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7673. * |-------------------------------------------------------------|
  7674. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7675. * |-------------------------------------------------------------|
  7676. * | : |
  7677. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7678. * | : |
  7679. * |-------------------------------------------------------------|
  7680. * | : |
  7681. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7682. * | : |
  7683. * |-------------------------------------------------------------|
  7684. * : :
  7685. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7686. *
  7687. */
  7688. typedef struct {
  7689. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7690. A_UINT32 rate_code_flags;
  7691. A_UINT32 flags; /* Encodes information such as excessive
  7692. retransmission, aggregate, some info
  7693. from .11 frame control,
  7694. STBC, LDPC, (SGI and Tx Chain Mask
  7695. are encoded in ptx_rc->flags field),
  7696. AMPDU truncation (BT/time based etc.),
  7697. RTS/CTS attempt */
  7698. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7699. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7700. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7701. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7702. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7703. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7704. } HTT_RC_TX_DONE_PARAMS;
  7705. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7706. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7707. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7708. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7709. #define HTT_RC_UPDATE_VDEVID_S 8
  7710. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7711. #define HTT_RC_UPDATE_PEERID_S 16
  7712. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7713. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7714. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7715. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7718. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7719. } while (0)
  7720. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7721. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7722. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7725. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7726. } while (0)
  7727. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7728. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7729. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7730. do { \
  7731. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7732. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7733. } while (0)
  7734. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7735. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7736. /**
  7737. * @brief target -> host rx fragment indication message definition
  7738. *
  7739. * @details
  7740. * The following field definitions describe the format of the rx fragment
  7741. * indication message sent from the target to the host.
  7742. * The rx fragment indication message shares the format of the
  7743. * rx indication message, but not all fields from the rx indication message
  7744. * are relevant to the rx fragment indication message.
  7745. *
  7746. *
  7747. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7748. * |-----------+-------------------+---------------------+-------------|
  7749. * | peer ID | |FV| ext TID | msg type |
  7750. * |-------------------------------------------------------------------|
  7751. * | | flush | flush |
  7752. * | | end | start |
  7753. * | | seq num | seq num |
  7754. * |-------------------------------------------------------------------|
  7755. * | reserved | FW rx desc bytes |
  7756. * |-------------------------------------------------------------------|
  7757. * | | FW MSDU Rx |
  7758. * | | desc B0 |
  7759. * |-------------------------------------------------------------------|
  7760. * Header fields:
  7761. * - MSG_TYPE
  7762. * Bits 7:0
  7763. * Purpose: identifies this as an rx fragment indication message
  7764. * Value: 0xa
  7765. * - EXT_TID
  7766. * Bits 12:8
  7767. * Purpose: identify the traffic ID of the rx data, including
  7768. * special "extended" TID values for multicast, broadcast, and
  7769. * non-QoS data frames
  7770. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7771. * - FLUSH_VALID (FV)
  7772. * Bit 13
  7773. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7774. * is valid
  7775. * Value:
  7776. * 1 -> flush IE is valid and needs to be processed
  7777. * 0 -> flush IE is not valid and should be ignored
  7778. * - PEER_ID
  7779. * Bits 31:16
  7780. * Purpose: Identify, by ID, which peer sent the rx data
  7781. * Value: ID of the peer who sent the rx data
  7782. * - FLUSH_SEQ_NUM_START
  7783. * Bits 5:0
  7784. * Purpose: Indicate the start of a series of MPDUs to flush
  7785. * Not all MPDUs within this series are necessarily valid - the host
  7786. * must check each sequence number within this range to see if the
  7787. * corresponding MPDU is actually present.
  7788. * This field is only valid if the FV bit is set.
  7789. * Value:
  7790. * The sequence number for the first MPDUs to check to flush.
  7791. * The sequence number is masked by 0x3f.
  7792. * - FLUSH_SEQ_NUM_END
  7793. * Bits 11:6
  7794. * Purpose: Indicate the end of a series of MPDUs to flush
  7795. * Value:
  7796. * The sequence number one larger than the sequence number of the
  7797. * last MPDU to check to flush.
  7798. * The sequence number is masked by 0x3f.
  7799. * Not all MPDUs within this series are necessarily valid - the host
  7800. * must check each sequence number within this range to see if the
  7801. * corresponding MPDU is actually present.
  7802. * This field is only valid if the FV bit is set.
  7803. * Rx descriptor fields:
  7804. * - FW_RX_DESC_BYTES
  7805. * Bits 15:0
  7806. * Purpose: Indicate how many bytes in the Rx indication are used for
  7807. * FW Rx descriptors
  7808. * Value: 1
  7809. */
  7810. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7811. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7812. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7813. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7814. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7815. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7816. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7817. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7818. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7819. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7820. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7821. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7822. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7823. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7824. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7825. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7826. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7827. #define HTT_RX_FRAG_IND_BYTES \
  7828. (4 /* msg hdr */ + \
  7829. 4 /* flush spec */ + \
  7830. 4 /* (unused) FW rx desc bytes spec */ + \
  7831. 4 /* FW rx desc */)
  7832. /**
  7833. * @brief target -> host test message definition
  7834. *
  7835. * @details
  7836. * The following field definitions describe the format of the test
  7837. * message sent from the target to the host.
  7838. * The message consists of a 4-octet header, followed by a variable
  7839. * number of 32-bit integer values, followed by a variable number
  7840. * of 8-bit character values.
  7841. *
  7842. * |31 16|15 8|7 0|
  7843. * |-----------------------------------------------------------|
  7844. * | num chars | num ints | msg type |
  7845. * |-----------------------------------------------------------|
  7846. * | int 0 |
  7847. * |-----------------------------------------------------------|
  7848. * | int 1 |
  7849. * |-----------------------------------------------------------|
  7850. * | ... |
  7851. * |-----------------------------------------------------------|
  7852. * | char 3 | char 2 | char 1 | char 0 |
  7853. * |-----------------------------------------------------------|
  7854. * | | | ... | char 4 |
  7855. * |-----------------------------------------------------------|
  7856. * - MSG_TYPE
  7857. * Bits 7:0
  7858. * Purpose: identifies this as a test message
  7859. * Value: HTT_MSG_TYPE_TEST
  7860. * - NUM_INTS
  7861. * Bits 15:8
  7862. * Purpose: indicate how many 32-bit integers follow the message header
  7863. * - NUM_CHARS
  7864. * Bits 31:16
  7865. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7866. */
  7867. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7868. #define HTT_RX_TEST_NUM_INTS_S 8
  7869. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7870. #define HTT_RX_TEST_NUM_CHARS_S 16
  7871. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7872. do { \
  7873. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7874. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7875. } while (0)
  7876. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7877. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7878. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7879. do { \
  7880. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7881. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7882. } while (0)
  7883. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7884. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7885. /**
  7886. * @brief target -> host packet log message
  7887. *
  7888. * @details
  7889. * The following field definitions describe the format of the packet log
  7890. * message sent from the target to the host.
  7891. * The message consists of a 4-octet header,followed by a variable number
  7892. * of 32-bit character values.
  7893. *
  7894. * |31 16|15 12|11 10|9 8|7 0|
  7895. * |------------------------------------------------------------------|
  7896. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7897. * |------------------------------------------------------------------|
  7898. * | payload |
  7899. * |------------------------------------------------------------------|
  7900. * - MSG_TYPE
  7901. * Bits 7:0
  7902. * Purpose: identifies this as a pktlog message
  7903. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7904. * - mac_id
  7905. * Bits 9:8
  7906. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7907. * Value: 0-3
  7908. * - pdev_id
  7909. * Bits 11:10
  7910. * Purpose: pdev_id
  7911. * Value: 0-3
  7912. * 0 (for rings at SOC level),
  7913. * 1/2/3 PDEV -> 0/1/2
  7914. * - payload_size
  7915. * Bits 31:16
  7916. * Purpose: explicitly specify the payload size
  7917. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7918. */
  7919. PREPACK struct htt_pktlog_msg {
  7920. A_UINT32 header;
  7921. A_UINT32 payload[1/* or more */];
  7922. } POSTPACK;
  7923. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7924. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7925. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7926. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7927. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7928. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7929. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7930. do { \
  7931. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7932. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7933. } while (0)
  7934. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7935. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7936. HTT_T2H_PKTLOG_MAC_ID_S)
  7937. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7938. do { \
  7939. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7940. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7941. } while (0)
  7942. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7943. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7944. HTT_T2H_PKTLOG_PDEV_ID_S)
  7945. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7946. do { \
  7947. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7948. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7949. } while (0)
  7950. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7951. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7952. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7953. /*
  7954. * Rx reorder statistics
  7955. * NB: all the fields must be defined in 4 octets size.
  7956. */
  7957. struct rx_reorder_stats {
  7958. /* Non QoS MPDUs received */
  7959. A_UINT32 deliver_non_qos;
  7960. /* MPDUs received in-order */
  7961. A_UINT32 deliver_in_order;
  7962. /* Flush due to reorder timer expired */
  7963. A_UINT32 deliver_flush_timeout;
  7964. /* Flush due to move out of window */
  7965. A_UINT32 deliver_flush_oow;
  7966. /* Flush due to DELBA */
  7967. A_UINT32 deliver_flush_delba;
  7968. /* MPDUs dropped due to FCS error */
  7969. A_UINT32 fcs_error;
  7970. /* MPDUs dropped due to monitor mode non-data packet */
  7971. A_UINT32 mgmt_ctrl;
  7972. /* Unicast-data MPDUs dropped due to invalid peer */
  7973. A_UINT32 invalid_peer;
  7974. /* MPDUs dropped due to duplication (non aggregation) */
  7975. A_UINT32 dup_non_aggr;
  7976. /* MPDUs dropped due to processed before */
  7977. A_UINT32 dup_past;
  7978. /* MPDUs dropped due to duplicate in reorder queue */
  7979. A_UINT32 dup_in_reorder;
  7980. /* Reorder timeout happened */
  7981. A_UINT32 reorder_timeout;
  7982. /* invalid bar ssn */
  7983. A_UINT32 invalid_bar_ssn;
  7984. /* reorder reset due to bar ssn */
  7985. A_UINT32 ssn_reset;
  7986. /* Flush due to delete peer */
  7987. A_UINT32 deliver_flush_delpeer;
  7988. /* Flush due to offload*/
  7989. A_UINT32 deliver_flush_offload;
  7990. /* Flush due to out of buffer*/
  7991. A_UINT32 deliver_flush_oob;
  7992. /* MPDUs dropped due to PN check fail */
  7993. A_UINT32 pn_fail;
  7994. /* MPDUs dropped due to unable to allocate memory */
  7995. A_UINT32 store_fail;
  7996. /* Number of times the tid pool alloc succeeded */
  7997. A_UINT32 tid_pool_alloc_succ;
  7998. /* Number of times the MPDU pool alloc succeeded */
  7999. A_UINT32 mpdu_pool_alloc_succ;
  8000. /* Number of times the MSDU pool alloc succeeded */
  8001. A_UINT32 msdu_pool_alloc_succ;
  8002. /* Number of times the tid pool alloc failed */
  8003. A_UINT32 tid_pool_alloc_fail;
  8004. /* Number of times the MPDU pool alloc failed */
  8005. A_UINT32 mpdu_pool_alloc_fail;
  8006. /* Number of times the MSDU pool alloc failed */
  8007. A_UINT32 msdu_pool_alloc_fail;
  8008. /* Number of times the tid pool freed */
  8009. A_UINT32 tid_pool_free;
  8010. /* Number of times the MPDU pool freed */
  8011. A_UINT32 mpdu_pool_free;
  8012. /* Number of times the MSDU pool freed */
  8013. A_UINT32 msdu_pool_free;
  8014. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8015. A_UINT32 msdu_queued;
  8016. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8017. A_UINT32 msdu_recycled;
  8018. /* Number of MPDUs with invalid peer but A2 found in AST */
  8019. A_UINT32 invalid_peer_a2_in_ast;
  8020. /* Number of MPDUs with invalid peer but A3 found in AST */
  8021. A_UINT32 invalid_peer_a3_in_ast;
  8022. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8023. A_UINT32 invalid_peer_bmc_mpdus;
  8024. /* Number of MSDUs with err attention word */
  8025. A_UINT32 rxdesc_err_att;
  8026. /* Number of MSDUs with flag of peer_idx_invalid */
  8027. A_UINT32 rxdesc_err_peer_idx_inv;
  8028. /* Number of MSDUs with flag of peer_idx_timeout */
  8029. A_UINT32 rxdesc_err_peer_idx_to;
  8030. /* Number of MSDUs with flag of overflow */
  8031. A_UINT32 rxdesc_err_ov;
  8032. /* Number of MSDUs with flag of msdu_length_err */
  8033. A_UINT32 rxdesc_err_msdu_len;
  8034. /* Number of MSDUs with flag of mpdu_length_err */
  8035. A_UINT32 rxdesc_err_mpdu_len;
  8036. /* Number of MSDUs with flag of tkip_mic_err */
  8037. A_UINT32 rxdesc_err_tkip_mic;
  8038. /* Number of MSDUs with flag of decrypt_err */
  8039. A_UINT32 rxdesc_err_decrypt;
  8040. /* Number of MSDUs with flag of fcs_err */
  8041. A_UINT32 rxdesc_err_fcs;
  8042. /* Number of Unicast (bc_mc bit is not set in attention word)
  8043. * frames with invalid peer handler
  8044. */
  8045. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8046. /* Number of unicast frame directly (direct bit is set in attention word)
  8047. * to DUT with invalid peer handler
  8048. */
  8049. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8050. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8051. * frames with invalid peer handler
  8052. */
  8053. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8054. /* Number of MSDUs dropped due to no first MSDU flag */
  8055. A_UINT32 rxdesc_no_1st_msdu;
  8056. /* Number of MSDUs droped due to ring overflow */
  8057. A_UINT32 msdu_drop_ring_ov;
  8058. /* Number of MSDUs dropped due to FC mismatch */
  8059. A_UINT32 msdu_drop_fc_mismatch;
  8060. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8061. A_UINT32 msdu_drop_mgmt_remote_ring;
  8062. /* Number of MSDUs dropped due to errors not reported in attention word */
  8063. A_UINT32 msdu_drop_misc;
  8064. /* Number of MSDUs go to offload before reorder */
  8065. A_UINT32 offload_msdu_wal;
  8066. /* Number of data frame dropped by offload after reorder */
  8067. A_UINT32 offload_msdu_reorder;
  8068. /* Number of MPDUs with sequence number in the past and within the BA window */
  8069. A_UINT32 dup_past_within_window;
  8070. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8071. A_UINT32 dup_past_outside_window;
  8072. /* Number of MSDUs with decrypt/MIC error */
  8073. A_UINT32 rxdesc_err_decrypt_mic;
  8074. /* Number of data MSDUs received on both local and remote rings */
  8075. A_UINT32 data_msdus_on_both_rings;
  8076. /* MPDUs never filled */
  8077. A_UINT32 holes_not_filled;
  8078. };
  8079. /*
  8080. * Rx Remote buffer statistics
  8081. * NB: all the fields must be defined in 4 octets size.
  8082. */
  8083. struct rx_remote_buffer_mgmt_stats {
  8084. /* Total number of MSDUs reaped for Rx processing */
  8085. A_UINT32 remote_reaped;
  8086. /* MSDUs recycled within firmware */
  8087. A_UINT32 remote_recycled;
  8088. /* MSDUs stored by Data Rx */
  8089. A_UINT32 data_rx_msdus_stored;
  8090. /* Number of HTT indications from WAL Rx MSDU */
  8091. A_UINT32 wal_rx_ind;
  8092. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8093. A_UINT32 wal_rx_ind_unconsumed;
  8094. /* Number of HTT indications from Data Rx MSDU */
  8095. A_UINT32 data_rx_ind;
  8096. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8097. A_UINT32 data_rx_ind_unconsumed;
  8098. /* Number of HTT indications from ATHBUF */
  8099. A_UINT32 athbuf_rx_ind;
  8100. /* Number of remote buffers requested for refill */
  8101. A_UINT32 refill_buf_req;
  8102. /* Number of remote buffers filled by the host */
  8103. A_UINT32 refill_buf_rsp;
  8104. /* Number of times MAC hw_index = f/w write_index */
  8105. A_INT32 mac_no_bufs;
  8106. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8107. A_INT32 fw_indices_equal;
  8108. /* Number of times f/w finds no buffers to post */
  8109. A_INT32 host_no_bufs;
  8110. };
  8111. /*
  8112. * TXBF MU/SU packets and NDPA statistics
  8113. * NB: all the fields must be defined in 4 octets size.
  8114. */
  8115. struct rx_txbf_musu_ndpa_pkts_stats {
  8116. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8117. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8118. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8119. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8120. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8121. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8122. };
  8123. /*
  8124. * htt_dbg_stats_status -
  8125. * present - The requested stats have been delivered in full.
  8126. * This indicates that either the stats information was contained
  8127. * in its entirety within this message, or else this message
  8128. * completes the delivery of the requested stats info that was
  8129. * partially delivered through earlier STATS_CONF messages.
  8130. * partial - The requested stats have been delivered in part.
  8131. * One or more subsequent STATS_CONF messages with the same
  8132. * cookie value will be sent to deliver the remainder of the
  8133. * information.
  8134. * error - The requested stats could not be delivered, for example due
  8135. * to a shortage of memory to construct a message holding the
  8136. * requested stats.
  8137. * invalid - The requested stat type is either not recognized, or the
  8138. * target is configured to not gather the stats type in question.
  8139. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8140. * series_done - This special value indicates that no further stats info
  8141. * elements are present within a series of stats info elems
  8142. * (within a stats upload confirmation message).
  8143. */
  8144. enum htt_dbg_stats_status {
  8145. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8146. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8147. HTT_DBG_STATS_STATUS_ERROR = 2,
  8148. HTT_DBG_STATS_STATUS_INVALID = 3,
  8149. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8150. };
  8151. /**
  8152. * @brief target -> host statistics upload
  8153. *
  8154. * @details
  8155. * The following field definitions describe the format of the HTT target
  8156. * to host stats upload confirmation message.
  8157. * The message contains a cookie echoed from the HTT host->target stats
  8158. * upload request, which identifies which request the confirmation is
  8159. * for, and a series of tag-length-value stats information elements.
  8160. * The tag-length header for each stats info element also includes a
  8161. * status field, to indicate whether the request for the stat type in
  8162. * question was fully met, partially met, unable to be met, or invalid
  8163. * (if the stat type in question is disabled in the target).
  8164. * A special value of all 1's in this status field is used to indicate
  8165. * the end of the series of stats info elements.
  8166. *
  8167. *
  8168. * |31 16|15 8|7 5|4 0|
  8169. * |------------------------------------------------------------|
  8170. * | reserved | msg type |
  8171. * |------------------------------------------------------------|
  8172. * | cookie LSBs |
  8173. * |------------------------------------------------------------|
  8174. * | cookie MSBs |
  8175. * |------------------------------------------------------------|
  8176. * | stats entry length | reserved | S |stat type|
  8177. * |------------------------------------------------------------|
  8178. * | |
  8179. * | type-specific stats info |
  8180. * | |
  8181. * |------------------------------------------------------------|
  8182. * | stats entry length | reserved | S |stat type|
  8183. * |------------------------------------------------------------|
  8184. * | |
  8185. * | type-specific stats info |
  8186. * | |
  8187. * |------------------------------------------------------------|
  8188. * | n/a | reserved | 111 | n/a |
  8189. * |------------------------------------------------------------|
  8190. * Header fields:
  8191. * - MSG_TYPE
  8192. * Bits 7:0
  8193. * Purpose: identifies this is a statistics upload confirmation message
  8194. * Value: 0x9
  8195. * - COOKIE_LSBS
  8196. * Bits 31:0
  8197. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8198. * message with its preceding host->target stats request message.
  8199. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8200. * - COOKIE_MSBS
  8201. * Bits 31:0
  8202. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8203. * message with its preceding host->target stats request message.
  8204. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8205. *
  8206. * Stats Information Element tag-length header fields:
  8207. * - STAT_TYPE
  8208. * Bits 4:0
  8209. * Purpose: identifies the type of statistics info held in the
  8210. * following information element
  8211. * Value: htt_dbg_stats_type
  8212. * - STATUS
  8213. * Bits 7:5
  8214. * Purpose: indicate whether the requested stats are present
  8215. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8216. * the completion of the stats entry series
  8217. * - LENGTH
  8218. * Bits 31:16
  8219. * Purpose: indicate the stats information size
  8220. * Value: This field specifies the number of bytes of stats information
  8221. * that follows the element tag-length header.
  8222. * It is expected but not required that this length is a multiple of
  8223. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8224. * subsequent stats entry header will begin on a 4-byte aligned
  8225. * boundary.
  8226. */
  8227. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8228. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8229. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8230. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8231. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8232. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8233. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8234. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8235. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8236. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8237. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8240. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8241. } while (0)
  8242. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8243. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8244. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8245. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8246. do { \
  8247. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8248. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8249. } while (0)
  8250. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8251. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8252. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8253. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8254. do { \
  8255. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8256. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8257. } while (0)
  8258. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8259. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8260. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8261. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8262. #define HTT_MAX_AGGR 64
  8263. #define HTT_HL_MAX_AGGR 18
  8264. /**
  8265. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8266. *
  8267. * @details
  8268. * The following field definitions describe the format of the HTT host
  8269. * to target frag_desc/msdu_ext bank configuration message.
  8270. * The message contains the based address and the min and max id of the
  8271. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8272. * MSDU_EXT/FRAG_DESC.
  8273. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8274. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8275. * the hardware does the mapping/translation.
  8276. *
  8277. * Total banks that can be configured is configured to 16.
  8278. *
  8279. * This should be called before any TX has be initiated by the HTT
  8280. *
  8281. * |31 16|15 8|7 5|4 0|
  8282. * |------------------------------------------------------------|
  8283. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8284. * |------------------------------------------------------------|
  8285. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8286. #if HTT_PADDR64
  8287. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8288. #endif
  8289. * |------------------------------------------------------------|
  8290. * | ... |
  8291. * |------------------------------------------------------------|
  8292. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8293. #if HTT_PADDR64
  8294. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8295. #endif
  8296. * |------------------------------------------------------------|
  8297. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8298. * |------------------------------------------------------------|
  8299. * | ... |
  8300. * |------------------------------------------------------------|
  8301. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8302. * |------------------------------------------------------------|
  8303. * Header fields:
  8304. * - MSG_TYPE
  8305. * Bits 7:0
  8306. * Value: 0x6
  8307. * for systems with 64-bit format for bus addresses:
  8308. * - BANKx_BASE_ADDRESS_LO
  8309. * Bits 31:0
  8310. * Purpose: Provide a mechanism to specify the base address of the
  8311. * MSDU_EXT bank physical/bus address.
  8312. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8313. * - BANKx_BASE_ADDRESS_HI
  8314. * Bits 31:0
  8315. * Purpose: Provide a mechanism to specify the base address of the
  8316. * MSDU_EXT bank physical/bus address.
  8317. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8318. * for systems with 32-bit format for bus addresses:
  8319. * - BANKx_BASE_ADDRESS
  8320. * Bits 31:0
  8321. * Purpose: Provide a mechanism to specify the base address of the
  8322. * MSDU_EXT bank physical/bus address.
  8323. * Value: MSDU_EXT bank physical / bus address
  8324. * - BANKx_MIN_ID
  8325. * Bits 15:0
  8326. * Purpose: Provide a mechanism to specify the min index that needs to
  8327. * mapped.
  8328. * - BANKx_MAX_ID
  8329. * Bits 31:16
  8330. * Purpose: Provide a mechanism to specify the max index that needs to
  8331. * mapped.
  8332. *
  8333. */
  8334. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8335. * safe value.
  8336. * @note MAX supported banks is 16.
  8337. */
  8338. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8339. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8340. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8341. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8342. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8343. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8344. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8345. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8346. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8347. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8348. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8349. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8350. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8351. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8352. do { \
  8353. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8354. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8355. } while (0)
  8356. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8357. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8358. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8359. do { \
  8360. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8361. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8362. } while (0)
  8363. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8364. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8365. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8366. do { \
  8367. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8368. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8369. } while (0)
  8370. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8371. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8372. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8375. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8376. } while (0)
  8377. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8378. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8379. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8380. do { \
  8381. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8382. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8383. } while (0)
  8384. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8385. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8386. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8387. do { \
  8388. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8389. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8390. } while (0)
  8391. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8392. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8393. /*
  8394. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8395. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8396. * addresses are stored in a XXX-bit field.
  8397. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8398. * htt_tx_frag_desc64_bank_cfg_t structs.
  8399. */
  8400. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8401. _paddr_bits_, \
  8402. _paddr__bank_base_address_) \
  8403. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8404. /** word 0 \
  8405. * msg_type: 8, \
  8406. * pdev_id: 2, \
  8407. * swap: 1, \
  8408. * reserved0: 5, \
  8409. * num_banks: 8, \
  8410. * desc_size: 8; \
  8411. */ \
  8412. A_UINT32 word0; \
  8413. /* \
  8414. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8415. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8416. * the second A_UINT32). \
  8417. */ \
  8418. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8419. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8420. } POSTPACK
  8421. /* define htt_tx_frag_desc32_bank_cfg_t */
  8422. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8423. /* define htt_tx_frag_desc64_bank_cfg_t */
  8424. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8425. /*
  8426. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8427. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8428. */
  8429. #if HTT_PADDR64
  8430. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8431. #else
  8432. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8433. #endif
  8434. /**
  8435. * @brief target -> host HTT TX Credit total count update message definition
  8436. *
  8437. *|31 16|15|14 9| 8 |7 0 |
  8438. *|---------------------+--+----------+-------+----------|
  8439. *|cur htt credit delta | Q| reserved | sign | msg type |
  8440. *|------------------------------------------------------|
  8441. *
  8442. * Header fields:
  8443. * - MSG_TYPE
  8444. * Bits 7:0
  8445. * Purpose: identifies this as a htt tx credit delta update message
  8446. * Value: 0xe
  8447. * - SIGN
  8448. * Bits 8
  8449. * identifies whether credit delta is positive or negative
  8450. * Value:
  8451. * - 0x0: credit delta is positive, rebalance in some buffers
  8452. * - 0x1: credit delta is negative, rebalance out some buffers
  8453. * - reserved
  8454. * Bits 14:9
  8455. * Value: 0x0
  8456. * - TXQ_GRP
  8457. * Bit 15
  8458. * Purpose: indicates whether any tx queue group information elements
  8459. * are appended to the tx credit update message
  8460. * Value: 0 -> no tx queue group information element is present
  8461. * 1 -> a tx queue group information element immediately follows
  8462. * - DELTA_COUNT
  8463. * Bits 31:16
  8464. * Purpose: Specify current htt credit delta absolute count
  8465. */
  8466. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8467. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8468. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8469. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8470. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8471. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8472. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8473. do { \
  8474. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8475. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8476. } while (0)
  8477. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8478. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8479. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8480. do { \
  8481. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8482. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8483. } while (0)
  8484. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8485. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8486. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8489. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8490. } while (0)
  8491. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8492. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8493. #define HTT_TX_CREDIT_MSG_BYTES 4
  8494. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8495. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8496. /**
  8497. * @brief HTT WDI_IPA Operation Response Message
  8498. *
  8499. * @details
  8500. * HTT WDI_IPA Operation Response message is sent by target
  8501. * to host confirming suspend or resume operation.
  8502. * |31 24|23 16|15 8|7 0|
  8503. * |----------------+----------------+----------------+----------------|
  8504. * | op_code | Rsvd | msg_type |
  8505. * |-------------------------------------------------------------------|
  8506. * | Rsvd | Response len |
  8507. * |-------------------------------------------------------------------|
  8508. * | |
  8509. * | Response-type specific info |
  8510. * | |
  8511. * | |
  8512. * |-------------------------------------------------------------------|
  8513. * Header fields:
  8514. * - MSG_TYPE
  8515. * Bits 7:0
  8516. * Purpose: Identifies this as WDI_IPA Operation Response message
  8517. * value: = 0x13
  8518. * - OP_CODE
  8519. * Bits 31:16
  8520. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8521. * value: = enum htt_wdi_ipa_op_code
  8522. * - RSP_LEN
  8523. * Bits 16:0
  8524. * Purpose: length for the response-type specific info
  8525. * value: = length in bytes for response-type specific info
  8526. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8527. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8528. */
  8529. PREPACK struct htt_wdi_ipa_op_response_t
  8530. {
  8531. /* DWORD 0: flags and meta-data */
  8532. A_UINT32
  8533. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8534. reserved1: 8,
  8535. op_code: 16;
  8536. A_UINT32
  8537. rsp_len: 16,
  8538. reserved2: 16;
  8539. } POSTPACK;
  8540. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8541. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8542. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8543. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8544. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8545. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8546. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8547. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8550. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8551. } while (0)
  8552. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8553. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8554. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8555. do { \
  8556. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8557. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8558. } while (0)
  8559. enum htt_phy_mode {
  8560. htt_phy_mode_11a = 0,
  8561. htt_phy_mode_11g = 1,
  8562. htt_phy_mode_11b = 2,
  8563. htt_phy_mode_11g_only = 3,
  8564. htt_phy_mode_11na_ht20 = 4,
  8565. htt_phy_mode_11ng_ht20 = 5,
  8566. htt_phy_mode_11na_ht40 = 6,
  8567. htt_phy_mode_11ng_ht40 = 7,
  8568. htt_phy_mode_11ac_vht20 = 8,
  8569. htt_phy_mode_11ac_vht40 = 9,
  8570. htt_phy_mode_11ac_vht80 = 10,
  8571. htt_phy_mode_11ac_vht20_2g = 11,
  8572. htt_phy_mode_11ac_vht40_2g = 12,
  8573. htt_phy_mode_11ac_vht80_2g = 13,
  8574. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8575. htt_phy_mode_11ac_vht160 = 15,
  8576. htt_phy_mode_max,
  8577. };
  8578. /**
  8579. * @brief target -> host HTT channel change indication
  8580. * @details
  8581. * Specify when a channel change occurs.
  8582. * This allows the host to precisely determine which rx frames arrived
  8583. * on the old channel and which rx frames arrived on the new channel.
  8584. *
  8585. *|31 |7 0 |
  8586. *|-------------------------------------------+----------|
  8587. *| reserved | msg type |
  8588. *|------------------------------------------------------|
  8589. *| primary_chan_center_freq_mhz |
  8590. *|------------------------------------------------------|
  8591. *| contiguous_chan1_center_freq_mhz |
  8592. *|------------------------------------------------------|
  8593. *| contiguous_chan2_center_freq_mhz |
  8594. *|------------------------------------------------------|
  8595. *| phy_mode |
  8596. *|------------------------------------------------------|
  8597. *
  8598. * Header fields:
  8599. * - MSG_TYPE
  8600. * Bits 7:0
  8601. * Purpose: identifies this as a htt channel change indication message
  8602. * Value: 0x15
  8603. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8604. * Bits 31:0
  8605. * Purpose: identify the (center of the) new 20 MHz primary channel
  8606. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8607. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8608. * Bits 31:0
  8609. * Purpose: identify the (center of the) contiguous frequency range
  8610. * comprising the new channel.
  8611. * For example, if the new channel is a 80 MHz channel extending
  8612. * 60 MHz beyond the primary channel, this field would be 30 larger
  8613. * than the primary channel center frequency field.
  8614. * Value: center frequency of the contiguous frequency range comprising
  8615. * the full channel in MHz units
  8616. * (80+80 channels also use the CONTIG_CHAN2 field)
  8617. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8618. * Bits 31:0
  8619. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8620. * within a VHT 80+80 channel.
  8621. * This field is only relevant for VHT 80+80 channels.
  8622. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8623. * channel (arbitrary value for cases besides VHT 80+80)
  8624. * - PHY_MODE
  8625. * Bits 31:0
  8626. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8627. * and band
  8628. * Value: htt_phy_mode enum value
  8629. */
  8630. PREPACK struct htt_chan_change_t
  8631. {
  8632. /* DWORD 0: flags and meta-data */
  8633. A_UINT32
  8634. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8635. reserved1: 24;
  8636. A_UINT32 primary_chan_center_freq_mhz;
  8637. A_UINT32 contig_chan1_center_freq_mhz;
  8638. A_UINT32 contig_chan2_center_freq_mhz;
  8639. A_UINT32 phy_mode;
  8640. } POSTPACK;
  8641. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8642. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8643. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8644. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8645. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8646. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8647. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8648. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8649. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8650. do { \
  8651. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8652. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8653. } while (0)
  8654. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8655. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8656. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8657. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8658. do { \
  8659. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8660. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8661. } while (0)
  8662. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8663. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8664. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8665. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8666. do { \
  8667. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8668. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8669. } while (0)
  8670. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8671. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8672. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8673. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8674. do { \
  8675. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8676. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8677. } while (0)
  8678. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8679. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8680. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8681. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8682. /**
  8683. * @brief rx offload packet error message
  8684. *
  8685. * @details
  8686. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8687. * of target payload like mic err.
  8688. *
  8689. * |31 24|23 16|15 8|7 0|
  8690. * |----------------+----------------+----------------+----------------|
  8691. * | tid | vdev_id | msg_sub_type | msg_type |
  8692. * |-------------------------------------------------------------------|
  8693. * : (sub-type dependent content) :
  8694. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8695. * Header fields:
  8696. * - msg_type
  8697. * Bits 7:0
  8698. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8699. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8700. * - msg_sub_type
  8701. * Bits 15:8
  8702. * Purpose: Identifies which type of rx error is reported by this message
  8703. * value: htt_rx_ofld_pkt_err_type
  8704. * - vdev_id
  8705. * Bits 23:16
  8706. * Purpose: Identifies which vdev received the erroneous rx frame
  8707. * value:
  8708. * - tid
  8709. * Bits 31:24
  8710. * Purpose: Identifies the traffic type of the rx frame
  8711. * value:
  8712. *
  8713. * - The payload fields used if the sub-type == MIC error are shown below.
  8714. * Note - MIC err is per MSDU, while PN is per MPDU.
  8715. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8716. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8717. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8718. * instead of sending separate HTT messages for each wrong MSDU within
  8719. * the MPDU.
  8720. *
  8721. * |31 24|23 16|15 8|7 0|
  8722. * |----------------+----------------+----------------+----------------|
  8723. * | Rsvd | key_id | peer_id |
  8724. * |-------------------------------------------------------------------|
  8725. * | receiver MAC addr 31:0 |
  8726. * |-------------------------------------------------------------------|
  8727. * | Rsvd | receiver MAC addr 47:32 |
  8728. * |-------------------------------------------------------------------|
  8729. * | transmitter MAC addr 31:0 |
  8730. * |-------------------------------------------------------------------|
  8731. * | Rsvd | transmitter MAC addr 47:32 |
  8732. * |-------------------------------------------------------------------|
  8733. * | PN 31:0 |
  8734. * |-------------------------------------------------------------------|
  8735. * | Rsvd | PN 47:32 |
  8736. * |-------------------------------------------------------------------|
  8737. * - peer_id
  8738. * Bits 15:0
  8739. * Purpose: identifies which peer is frame is from
  8740. * value:
  8741. * - key_id
  8742. * Bits 23:16
  8743. * Purpose: identifies key_id of rx frame
  8744. * value:
  8745. * - RA_31_0 (receiver MAC addr 31:0)
  8746. * Bits 31:0
  8747. * Purpose: identifies by MAC address which vdev received the frame
  8748. * value: MAC address lower 4 bytes
  8749. * - RA_47_32 (receiver MAC addr 47:32)
  8750. * Bits 15:0
  8751. * Purpose: identifies by MAC address which vdev received the frame
  8752. * value: MAC address upper 2 bytes
  8753. * - TA_31_0 (transmitter MAC addr 31:0)
  8754. * Bits 31:0
  8755. * Purpose: identifies by MAC address which peer transmitted the frame
  8756. * value: MAC address lower 4 bytes
  8757. * - TA_47_32 (transmitter MAC addr 47:32)
  8758. * Bits 15:0
  8759. * Purpose: identifies by MAC address which peer transmitted the frame
  8760. * value: MAC address upper 2 bytes
  8761. * - PN_31_0
  8762. * Bits 31:0
  8763. * Purpose: Identifies pn of rx frame
  8764. * value: PN lower 4 bytes
  8765. * - PN_47_32
  8766. * Bits 15:0
  8767. * Purpose: Identifies pn of rx frame
  8768. * value:
  8769. * TKIP or CCMP: PN upper 2 bytes
  8770. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8771. */
  8772. enum htt_rx_ofld_pkt_err_type {
  8773. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8774. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8775. };
  8776. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8777. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8778. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8779. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8780. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8781. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8782. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8783. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8784. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8785. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8786. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8787. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8788. do { \
  8789. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8790. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8791. } while (0)
  8792. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8793. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8794. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8795. do { \
  8796. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8797. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8798. } while (0)
  8799. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8800. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8801. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8802. do { \
  8803. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8804. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8805. } while (0)
  8806. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8807. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8808. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8809. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8810. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8811. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8812. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8813. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8814. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8815. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8816. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8817. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8818. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8819. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8820. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8821. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8822. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8823. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8824. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8825. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8826. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8827. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8828. do { \
  8829. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8830. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8831. } while (0)
  8832. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8833. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8834. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8835. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8836. do { \
  8837. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8838. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8839. } while (0)
  8840. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8841. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8842. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8843. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8844. do { \
  8845. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8846. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8847. } while (0)
  8848. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8849. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8850. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8851. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8852. do { \
  8853. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8854. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8855. } while (0)
  8856. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8857. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8858. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8859. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8860. do { \
  8861. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8862. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8863. } while (0)
  8864. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8865. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8866. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8867. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8868. do { \
  8869. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8870. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8871. } while (0)
  8872. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8873. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8874. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8875. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8876. do { \
  8877. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8878. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8879. } while (0)
  8880. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8881. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8882. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8883. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8886. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8887. } while (0)
  8888. /**
  8889. * @brief peer rate report message
  8890. *
  8891. * @details
  8892. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8893. * justified rate of all the peers.
  8894. *
  8895. * |31 24|23 16|15 8|7 0|
  8896. * |----------------+----------------+----------------+----------------|
  8897. * | peer_count | | msg_type |
  8898. * |-------------------------------------------------------------------|
  8899. * : Payload (variant number of peer rate report) :
  8900. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8901. * Header fields:
  8902. * - msg_type
  8903. * Bits 7:0
  8904. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8905. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8906. * - reserved
  8907. * Bits 15:8
  8908. * Purpose:
  8909. * value:
  8910. * - peer_count
  8911. * Bits 31:16
  8912. * Purpose: Specify how many peer rate report elements are present in the payload.
  8913. * value:
  8914. *
  8915. * Payload:
  8916. * There are variant number of peer rate report follow the first 32 bits.
  8917. * The peer rate report is defined as follows.
  8918. *
  8919. * |31 20|19 16|15 0|
  8920. * |-----------------------+---------+---------------------------------|-
  8921. * | reserved | phy | peer_id | \
  8922. * |-------------------------------------------------------------------| -> report #0
  8923. * | rate | /
  8924. * |-----------------------+---------+---------------------------------|-
  8925. * | reserved | phy | peer_id | \
  8926. * |-------------------------------------------------------------------| -> report #1
  8927. * | rate | /
  8928. * |-----------------------+---------+---------------------------------|-
  8929. * | reserved | phy | peer_id | \
  8930. * |-------------------------------------------------------------------| -> report #2
  8931. * | rate | /
  8932. * |-------------------------------------------------------------------|-
  8933. * : :
  8934. * : :
  8935. * : :
  8936. * :-------------------------------------------------------------------:
  8937. *
  8938. * - peer_id
  8939. * Bits 15:0
  8940. * Purpose: identify the peer
  8941. * value:
  8942. * - phy
  8943. * Bits 19:16
  8944. * Purpose: identify which phy is in use
  8945. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8946. * Please see enum htt_peer_report_phy_type for detail.
  8947. * - reserved
  8948. * Bits 31:20
  8949. * Purpose:
  8950. * value:
  8951. * - rate
  8952. * Bits 31:0
  8953. * Purpose: represent the justified rate of the peer specified by peer_id
  8954. * value:
  8955. */
  8956. enum htt_peer_rate_report_phy_type {
  8957. HTT_PEER_RATE_REPORT_11B = 0,
  8958. HTT_PEER_RATE_REPORT_11A_G,
  8959. HTT_PEER_RATE_REPORT_11N,
  8960. HTT_PEER_RATE_REPORT_11AC,
  8961. };
  8962. #define HTT_PEER_RATE_REPORT_SIZE 8
  8963. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8964. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8965. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8966. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8967. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8968. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8969. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8970. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8971. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8972. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8975. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8976. } while (0)
  8977. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8978. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8979. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8980. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8981. do { \
  8982. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8983. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8984. } while (0)
  8985. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8986. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8987. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8988. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8991. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8992. } while (0)
  8993. /**
  8994. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8995. *
  8996. * @details
  8997. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8998. * a flow of descriptors.
  8999. *
  9000. * This message is in TLV format and indicates the parameters to be setup a
  9001. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9002. * receive descriptors from a specified pool.
  9003. *
  9004. * The message would appear as follows:
  9005. *
  9006. * |31 24|23 16|15 8|7 0|
  9007. * |----------------+----------------+----------------+----------------|
  9008. * header | reserved | num_flows | msg_type |
  9009. * |-------------------------------------------------------------------|
  9010. * | |
  9011. * : payload :
  9012. * | |
  9013. * |-------------------------------------------------------------------|
  9014. *
  9015. * The header field is one DWORD long and is interpreted as follows:
  9016. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9017. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9018. * this message
  9019. * b'16-31 - reserved: These bits are reserved for future use
  9020. *
  9021. * Payload:
  9022. * The payload would contain multiple objects of the following structure. Each
  9023. * object represents a flow.
  9024. *
  9025. * |31 24|23 16|15 8|7 0|
  9026. * |----------------+----------------+----------------+----------------|
  9027. * header | reserved | num_flows | msg_type |
  9028. * |-------------------------------------------------------------------|
  9029. * payload0| flow_type |
  9030. * |-------------------------------------------------------------------|
  9031. * | flow_id |
  9032. * |-------------------------------------------------------------------|
  9033. * | reserved0 | flow_pool_id |
  9034. * |-------------------------------------------------------------------|
  9035. * | reserved1 | flow_pool_size |
  9036. * |-------------------------------------------------------------------|
  9037. * | reserved2 |
  9038. * |-------------------------------------------------------------------|
  9039. * payload1| flow_type |
  9040. * |-------------------------------------------------------------------|
  9041. * | flow_id |
  9042. * |-------------------------------------------------------------------|
  9043. * | reserved0 | flow_pool_id |
  9044. * |-------------------------------------------------------------------|
  9045. * | reserved1 | flow_pool_size |
  9046. * |-------------------------------------------------------------------|
  9047. * | reserved2 |
  9048. * |-------------------------------------------------------------------|
  9049. * | . |
  9050. * | . |
  9051. * | . |
  9052. * |-------------------------------------------------------------------|
  9053. *
  9054. * Each payload is 5 DWORDS long and is interpreted as follows:
  9055. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9056. * this flow is associated. It can be VDEV, peer,
  9057. * or tid (AC). Based on enum htt_flow_type.
  9058. *
  9059. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9060. * object. For flow_type vdev it is set to the
  9061. * vdevid, for peer it is peerid and for tid, it is
  9062. * tid_num.
  9063. *
  9064. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9065. * in the host for this flow
  9066. * b'16:31 - reserved0: This field in reserved for the future. In case
  9067. * we have a hierarchical implementation (HCM) of
  9068. * pools, it can be used to indicate the ID of the
  9069. * parent-pool.
  9070. *
  9071. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9072. * Descriptors for this flow will be
  9073. * allocated from this pool in the host.
  9074. * b'16:31 - reserved1: This field in reserved for the future. In case
  9075. * we have a hierarchical implementation of pools,
  9076. * it can be used to indicate the max number of
  9077. * descriptors in the pool. The b'0:15 can be used
  9078. * to indicate min number of descriptors in the
  9079. * HCM scheme.
  9080. *
  9081. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9082. * we have a hierarchical implementation of pools,
  9083. * b'0:15 can be used to indicate the
  9084. * priority-based borrowing (PBB) threshold of
  9085. * the flow's pool. The b'16:31 are still left
  9086. * reserved.
  9087. */
  9088. enum htt_flow_type {
  9089. FLOW_TYPE_VDEV = 0,
  9090. /* Insert new flow types above this line */
  9091. };
  9092. PREPACK struct htt_flow_pool_map_payload_t {
  9093. A_UINT32 flow_type;
  9094. A_UINT32 flow_id;
  9095. A_UINT32 flow_pool_id:16,
  9096. reserved0:16;
  9097. A_UINT32 flow_pool_size:16,
  9098. reserved1:16;
  9099. A_UINT32 reserved2;
  9100. } POSTPACK;
  9101. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9102. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9103. (sizeof(struct htt_flow_pool_map_payload_t))
  9104. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9105. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9106. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9107. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9108. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9109. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9110. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9111. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9112. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9113. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9114. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9115. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9116. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9117. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9118. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9119. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9120. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9121. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9122. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9123. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9124. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9125. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9126. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9129. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9130. } while (0)
  9131. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9132. do { \
  9133. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9134. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9135. } while (0)
  9136. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9137. do { \
  9138. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9139. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9140. } while (0)
  9141. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9142. do { \
  9143. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9144. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9145. } while (0)
  9146. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9149. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9150. } while (0)
  9151. /**
  9152. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9153. *
  9154. * @details
  9155. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9156. * down a flow of descriptors.
  9157. * This message indicates that for the flow (whose ID is provided) is wanting
  9158. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9159. * pool of descriptors from where descriptors are being allocated for this
  9160. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9161. * be unmapped by the host.
  9162. *
  9163. * The message would appear as follows:
  9164. *
  9165. * |31 24|23 16|15 8|7 0|
  9166. * |----------------+----------------+----------------+----------------|
  9167. * | reserved0 | msg_type |
  9168. * |-------------------------------------------------------------------|
  9169. * | flow_type |
  9170. * |-------------------------------------------------------------------|
  9171. * | flow_id |
  9172. * |-------------------------------------------------------------------|
  9173. * | reserved1 | flow_pool_id |
  9174. * |-------------------------------------------------------------------|
  9175. *
  9176. * The message is interpreted as follows:
  9177. * dword0 - b'0:7 - msg_type: This will be set to
  9178. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9179. * b'8:31 - reserved0: Reserved for future use
  9180. *
  9181. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9182. * this flow is associated. It can be VDEV, peer,
  9183. * or tid (AC). Based on enum htt_flow_type.
  9184. *
  9185. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9186. * object. For flow_type vdev it is set to the
  9187. * vdevid, for peer it is peerid and for tid, it is
  9188. * tid_num.
  9189. *
  9190. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9191. * used in the host for this flow
  9192. * b'16:31 - reserved0: This field in reserved for the future.
  9193. *
  9194. */
  9195. PREPACK struct htt_flow_pool_unmap_t {
  9196. A_UINT32 msg_type:8,
  9197. reserved0:24;
  9198. A_UINT32 flow_type;
  9199. A_UINT32 flow_id;
  9200. A_UINT32 flow_pool_id:16,
  9201. reserved1:16;
  9202. } POSTPACK;
  9203. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9204. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9205. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9206. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9207. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9208. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9209. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9210. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9211. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9212. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9213. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9214. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9215. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9216. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9217. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9218. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9219. do { \
  9220. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9221. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9222. } while (0)
  9223. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9224. do { \
  9225. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9226. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9227. } while (0)
  9228. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9231. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9232. } while (0)
  9233. /**
  9234. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9235. *
  9236. * @details
  9237. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9238. * SRNG ring setup is done
  9239. *
  9240. * This message indicates whether the last setup operation is successful.
  9241. * It will be sent to host when host set respose_required bit in
  9242. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9243. * The message would appear as follows:
  9244. *
  9245. * |31 24|23 16|15 8|7 0|
  9246. * |--------------- +----------------+----------------+----------------|
  9247. * | setup_status | ring_id | pdev_id | msg_type |
  9248. * |-------------------------------------------------------------------|
  9249. *
  9250. * The message is interpreted as follows:
  9251. * dword0 - b'0:7 - msg_type: This will be set to
  9252. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9253. * b'8:15 - pdev_id:
  9254. * 0 (for rings at SOC/UMAC level),
  9255. * 1/2/3 mac id (for rings at LMAC level)
  9256. * b'16:23 - ring_id: Identify the ring which is set up
  9257. * More details can be got from enum htt_srng_ring_id
  9258. * b'24:31 - setup_status: Indicate status of setup operation
  9259. * Refer to htt_ring_setup_status
  9260. */
  9261. PREPACK struct htt_sring_setup_done_t {
  9262. A_UINT32 msg_type: 8,
  9263. pdev_id: 8,
  9264. ring_id: 8,
  9265. setup_status: 8;
  9266. } POSTPACK;
  9267. enum htt_ring_setup_status {
  9268. htt_ring_setup_status_ok = 0,
  9269. htt_ring_setup_status_error,
  9270. };
  9271. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9272. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9273. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9274. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9275. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9276. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9277. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9280. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9281. } while (0)
  9282. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9283. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9284. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9285. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9286. HTT_SRING_SETUP_DONE_RING_ID_S)
  9287. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9288. do { \
  9289. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9290. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9291. } while (0)
  9292. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9293. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9294. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9295. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9296. HTT_SRING_SETUP_DONE_STATUS_S)
  9297. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9298. do { \
  9299. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9300. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9301. } while (0)
  9302. /**
  9303. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9304. *
  9305. * @details
  9306. * HTT TX map flow entry with tqm flow pointer
  9307. * Sent from firmware to host to add tqm flow pointer in corresponding
  9308. * flow search entry. Flow metadata is replayed back to host as part of this
  9309. * struct to enable host to find the specific flow search entry
  9310. *
  9311. * The message would appear as follows:
  9312. *
  9313. * |31 28|27 18|17 14|13 8|7 0|
  9314. * |-------+------------------------------------------+----------------|
  9315. * | rsvd0 | fse_hsh_idx | msg_type |
  9316. * |-------------------------------------------------------------------|
  9317. * | rsvd1 | tid | peer_id |
  9318. * |-------------------------------------------------------------------|
  9319. * | tqm_flow_pntr_lo |
  9320. * |-------------------------------------------------------------------|
  9321. * | tqm_flow_pntr_hi |
  9322. * |-------------------------------------------------------------------|
  9323. * | fse_meta_data |
  9324. * |-------------------------------------------------------------------|
  9325. *
  9326. * The message is interpreted as follows:
  9327. *
  9328. * dword0 - b'0:7 - msg_type: This will be set to
  9329. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9330. *
  9331. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9332. * for this flow entry
  9333. *
  9334. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9335. *
  9336. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9337. *
  9338. * dword1 - b'14:17 - tid
  9339. *
  9340. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9341. *
  9342. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9343. *
  9344. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9345. *
  9346. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9347. * given by host
  9348. */
  9349. PREPACK struct htt_tx_map_flow_info {
  9350. A_UINT32
  9351. msg_type: 8,
  9352. fse_hsh_idx: 20,
  9353. rsvd0: 4;
  9354. A_UINT32
  9355. peer_id: 14,
  9356. tid: 4,
  9357. rsvd1: 14;
  9358. A_UINT32 tqm_flow_pntr_lo;
  9359. A_UINT32 tqm_flow_pntr_hi;
  9360. struct htt_tx_flow_metadata fse_meta_data;
  9361. } POSTPACK;
  9362. /* DWORD 0 */
  9363. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9364. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9365. /* DWORD 1 */
  9366. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9367. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9368. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9369. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9370. /* DWORD 0 */
  9371. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9372. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9373. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9374. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9375. do { \
  9376. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9377. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9378. } while (0)
  9379. /* DWORD 1 */
  9380. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9381. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9382. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9383. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9384. do { \
  9385. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9386. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9387. } while (0)
  9388. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9389. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9390. HTT_TX_MAP_FLOW_INFO_TID_S)
  9391. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9392. do { \
  9393. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9394. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9395. } while (0)
  9396. /*
  9397. * htt_dbg_ext_stats_status -
  9398. * present - The requested stats have been delivered in full.
  9399. * This indicates that either the stats information was contained
  9400. * in its entirety within this message, or else this message
  9401. * completes the delivery of the requested stats info that was
  9402. * partially delivered through earlier STATS_CONF messages.
  9403. * partial - The requested stats have been delivered in part.
  9404. * One or more subsequent STATS_CONF messages with the same
  9405. * cookie value will be sent to deliver the remainder of the
  9406. * information.
  9407. * error - The requested stats could not be delivered, for example due
  9408. * to a shortage of memory to construct a message holding the
  9409. * requested stats.
  9410. * invalid - The requested stat type is either not recognized, or the
  9411. * target is configured to not gather the stats type in question.
  9412. */
  9413. enum htt_dbg_ext_stats_status {
  9414. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9415. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9416. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9417. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9418. };
  9419. /**
  9420. * @brief target -> host ppdu stats upload
  9421. *
  9422. * @details
  9423. * The following field definitions describe the format of the HTT target
  9424. * to host ppdu stats indication message.
  9425. *
  9426. *
  9427. * |31 16|15 12|11 10|9 8|7 0 |
  9428. * |----------------------------------------------------------------------|
  9429. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9430. * |----------------------------------------------------------------------|
  9431. * | ppdu_id |
  9432. * |----------------------------------------------------------------------|
  9433. * | Timestamp in us |
  9434. * |----------------------------------------------------------------------|
  9435. * | reserved |
  9436. * |----------------------------------------------------------------------|
  9437. * | type-specific stats info |
  9438. * | (see htt_ppdu_stats.h) |
  9439. * |----------------------------------------------------------------------|
  9440. * Header fields:
  9441. * - MSG_TYPE
  9442. * Bits 7:0
  9443. * Purpose: Identifies this is a PPDU STATS indication
  9444. * message.
  9445. * Value: 0x1d
  9446. * - mac_id
  9447. * Bits 9:8
  9448. * Purpose: mac_id of this ppdu_id
  9449. * Value: 0-3
  9450. * - pdev_id
  9451. * Bits 11:10
  9452. * Purpose: pdev_id of this ppdu_id
  9453. * Value: 0-3
  9454. * 0 (for rings at SOC level),
  9455. * 1/2/3 PDEV -> 0/1/2
  9456. * - payload_size
  9457. * Bits 31:16
  9458. * Purpose: total tlv size
  9459. * Value: payload_size in bytes
  9460. */
  9461. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9462. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9463. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9464. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9465. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9466. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9467. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9468. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9469. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9470. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9471. do { \
  9472. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9473. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9474. } while (0)
  9475. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9476. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9477. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9478. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9479. do { \
  9480. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9481. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9482. } while (0)
  9483. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9484. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9485. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9486. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9487. do { \
  9488. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9489. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9490. } while (0)
  9491. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9492. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9493. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9494. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9495. do { \
  9496. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9497. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9498. } while (0)
  9499. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9500. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9501. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9502. /* htt_t2h_ppdu_stats_ind_hdr_t
  9503. * This struct contains the fields within the header of the
  9504. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9505. * stats info.
  9506. * This struct assumes little-endian layout, and thus is only
  9507. * suitable for use within processors known to be little-endian
  9508. * (such as the target).
  9509. * In contrast, the above macros provide endian-portable methods
  9510. * to get and set the bitfields within this PPDU_STATS_IND header.
  9511. */
  9512. typedef struct {
  9513. A_UINT32 msg_type: 8, /* bits 7:0 */
  9514. mac_id: 2, /* bits 9:8 */
  9515. pdev_id: 2, /* bits 11:10 */
  9516. reserved1: 4, /* bits 15:12 */
  9517. payload_size: 16; /* bits 31:16 */
  9518. A_UINT32 ppdu_id;
  9519. A_UINT32 timestamp_us;
  9520. A_UINT32 reserved2;
  9521. } htt_t2h_ppdu_stats_ind_hdr_t;
  9522. /**
  9523. * @brief target -> host extended statistics upload
  9524. *
  9525. * @details
  9526. * The following field definitions describe the format of the HTT target
  9527. * to host stats upload confirmation message.
  9528. * The message contains a cookie echoed from the HTT host->target stats
  9529. * upload request, which identifies which request the confirmation is
  9530. * for, and a single stats can span over multiple HTT stats indication
  9531. * due to the HTT message size limitation so every HTT ext stats indication
  9532. * will have tag-length-value stats information elements.
  9533. * The tag-length header for each HTT stats IND message also includes a
  9534. * status field, to indicate whether the request for the stat type in
  9535. * question was fully met, partially met, unable to be met, or invalid
  9536. * (if the stat type in question is disabled in the target).
  9537. * A Done bit 1's indicate the end of the of stats info elements.
  9538. *
  9539. *
  9540. * |31 16|15 12|11|10 8|7 5|4 0|
  9541. * |--------------------------------------------------------------|
  9542. * | reserved | msg type |
  9543. * |--------------------------------------------------------------|
  9544. * | cookie LSBs |
  9545. * |--------------------------------------------------------------|
  9546. * | cookie MSBs |
  9547. * |--------------------------------------------------------------|
  9548. * | stats entry length | rsvd | D| S | stat type |
  9549. * |--------------------------------------------------------------|
  9550. * | type-specific stats info |
  9551. * | (see htt_stats.h) |
  9552. * |--------------------------------------------------------------|
  9553. * Header fields:
  9554. * - MSG_TYPE
  9555. * Bits 7:0
  9556. * Purpose: Identifies this is a extended statistics upload confirmation
  9557. * message.
  9558. * Value: 0x1c
  9559. * - COOKIE_LSBS
  9560. * Bits 31:0
  9561. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9562. * message with its preceding host->target stats request message.
  9563. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9564. * - COOKIE_MSBS
  9565. * Bits 31:0
  9566. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9567. * message with its preceding host->target stats request message.
  9568. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9569. *
  9570. * Stats Information Element tag-length header fields:
  9571. * - STAT_TYPE
  9572. * Bits 7:0
  9573. * Purpose: identifies the type of statistics info held in the
  9574. * following information element
  9575. * Value: htt_dbg_ext_stats_type
  9576. * - STATUS
  9577. * Bits 10:8
  9578. * Purpose: indicate whether the requested stats are present
  9579. * Value: htt_dbg_ext_stats_status
  9580. * - DONE
  9581. * Bits 11
  9582. * Purpose:
  9583. * Indicates the completion of the stats entry, this will be the last
  9584. * stats conf HTT segment for the requested stats type.
  9585. * Value:
  9586. * 0 -> the stats retrieval is ongoing
  9587. * 1 -> the stats retrieval is complete
  9588. * - LENGTH
  9589. * Bits 31:16
  9590. * Purpose: indicate the stats information size
  9591. * Value: This field specifies the number of bytes of stats information
  9592. * that follows the element tag-length header.
  9593. * It is expected but not required that this length is a multiple of
  9594. * 4 bytes.
  9595. */
  9596. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9597. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9598. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9599. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9600. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9601. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9602. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9603. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9604. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9605. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9606. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9607. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9608. do { \
  9609. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9610. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9611. } while (0)
  9612. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9613. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9614. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9615. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9616. do { \
  9617. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9618. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9619. } while (0)
  9620. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9621. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9622. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9623. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9624. do { \
  9625. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9626. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9627. } while (0)
  9628. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9629. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9630. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9631. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9634. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9635. } while (0)
  9636. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9637. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9638. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9639. typedef enum {
  9640. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9641. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9642. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9643. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9644. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9645. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9646. /* Reserved from 128 - 255 for target internal use.*/
  9647. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9648. } HTT_PEER_TYPE;
  9649. /** 2 word representation of MAC addr */
  9650. typedef struct {
  9651. /** upper 4 bytes of MAC address */
  9652. A_UINT32 mac_addr31to0;
  9653. /** lower 2 bytes of MAC address */
  9654. A_UINT32 mac_addr47to32;
  9655. } htt_mac_addr;
  9656. /** macro to convert MAC address from char array to HTT word format */
  9657. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9658. (phtt_mac_addr)->mac_addr31to0 = \
  9659. (((c_macaddr)[0] << 0) | \
  9660. ((c_macaddr)[1] << 8) | \
  9661. ((c_macaddr)[2] << 16) | \
  9662. ((c_macaddr)[3] << 24)); \
  9663. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9664. } while (0)
  9665. /**
  9666. * @brief target -> host monitor mac header indication message
  9667. *
  9668. * @details
  9669. * The following diagram shows the format of the monitor mac header message
  9670. * sent from the target to the host.
  9671. * This message is primarily sent when promiscuous rx mode is enabled.
  9672. * One message is sent per rx PPDU.
  9673. *
  9674. * |31 24|23 16|15 8|7 0|
  9675. * |-------------------------------------------------------------|
  9676. * | peer_id | reserved0 | msg_type |
  9677. * |-------------------------------------------------------------|
  9678. * | reserved1 | num_mpdu |
  9679. * |-------------------------------------------------------------|
  9680. * | struct hw_rx_desc |
  9681. * | (see wal_rx_desc.h) |
  9682. * |-------------------------------------------------------------|
  9683. * | struct ieee80211_frame_addr4 |
  9684. * | (see ieee80211_defs.h) |
  9685. * |-------------------------------------------------------------|
  9686. * | struct ieee80211_frame_addr4 |
  9687. * | (see ieee80211_defs.h) |
  9688. * |-------------------------------------------------------------|
  9689. * | ...... |
  9690. * |-------------------------------------------------------------|
  9691. *
  9692. * Header fields:
  9693. * - msg_type
  9694. * Bits 7:0
  9695. * Purpose: Identifies this is a monitor mac header indication message.
  9696. * Value: 0x20
  9697. * - peer_id
  9698. * Bits 31:16
  9699. * Purpose: Software peer id given by host during association,
  9700. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9701. * for rx PPDUs received from unassociated peers.
  9702. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9703. * - num_mpdu
  9704. * Bits 15:0
  9705. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9706. * delivered within the message.
  9707. * Value: 1 to 32
  9708. * num_mpdu is limited to a maximum value of 32, due to buffer
  9709. * size limits. For PPDUs with more than 32 MPDUs, only the
  9710. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9711. * the PPDU will be provided.
  9712. */
  9713. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9714. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9715. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9716. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9717. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9718. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9719. do { \
  9720. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9721. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9722. } while (0)
  9723. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9724. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9725. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9726. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9727. do { \
  9728. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9729. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9730. } while (0)
  9731. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9732. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9733. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9734. /**
  9735. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9736. *
  9737. * @details
  9738. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9739. * the flow pool associated with the specified ID is resized
  9740. *
  9741. * The message would appear as follows:
  9742. *
  9743. * |31 16|15 8|7 0|
  9744. * |---------------------------------+----------------+----------------|
  9745. * | reserved0 | Msg type |
  9746. * |-------------------------------------------------------------------|
  9747. * | flow pool new size | flow pool ID |
  9748. * |-------------------------------------------------------------------|
  9749. *
  9750. * The message is interpreted as follows:
  9751. * b'0:7 - msg_type: This will be set to
  9752. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9753. *
  9754. * b'0:15 - flow pool ID: Existing flow pool ID
  9755. *
  9756. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9757. *
  9758. */
  9759. PREPACK struct htt_flow_pool_resize_t {
  9760. A_UINT32 msg_type:8,
  9761. reserved0:24;
  9762. A_UINT32 flow_pool_id:16,
  9763. flow_pool_new_size:16;
  9764. } POSTPACK;
  9765. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9766. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9767. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9768. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9769. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9770. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9771. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9772. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9773. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9774. do { \
  9775. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9776. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9777. } while (0)
  9778. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9779. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9780. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9781. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9784. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9785. } while (0)
  9786. /**
  9787. * @brief host -> target channel change message
  9788. *
  9789. * @details
  9790. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9791. * to associate RX frames to correct channel they were received on.
  9792. * The following field definitions describe the format of the HTT target
  9793. * to host channel change message.
  9794. * |31 16|15 8|7 5|4 0|
  9795. * |------------------------------------------------------------|
  9796. * | reserved | MSG_TYPE |
  9797. * |------------------------------------------------------------|
  9798. * | CHAN_MHZ |
  9799. * |------------------------------------------------------------|
  9800. * | BAND_CENTER_FREQ1 |
  9801. * |------------------------------------------------------------|
  9802. * | BAND_CENTER_FREQ2 |
  9803. * |------------------------------------------------------------|
  9804. * | CHAN_PHY_MODE |
  9805. * |------------------------------------------------------------|
  9806. * Header fields:
  9807. * - MSG_TYPE
  9808. * Bits 7:0
  9809. * Value: 0xf
  9810. * - CHAN_MHZ
  9811. * Bits 31:0
  9812. * Purpose: frequency of the primary 20mhz channel.
  9813. * - BAND_CENTER_FREQ1
  9814. * Bits 31:0
  9815. * Purpose: centre frequency of the full channel.
  9816. * - BAND_CENTER_FREQ2
  9817. * Bits 31:0
  9818. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9819. * - CHAN_PHY_MODE
  9820. * Bits 31:0
  9821. * Purpose: phy mode of the channel.
  9822. */
  9823. PREPACK struct htt_chan_change_msg {
  9824. A_UINT32 chan_mhz; /* frequency in mhz */
  9825. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9826. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9827. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9828. } POSTPACK;
  9829. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9830. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9831. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9832. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9833. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9834. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9835. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9836. /*
  9837. * The read and write indices point to the data within the host buffer.
  9838. * Because the first 4 bytes of the host buffer is used for the read index and
  9839. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9840. * The read index and write index are the byte offsets from the base of the
  9841. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9842. * Refer the ASCII text picture below.
  9843. */
  9844. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9845. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9846. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9847. /*
  9848. ***************************************************************************
  9849. *
  9850. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9851. *
  9852. ***************************************************************************
  9853. *
  9854. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9855. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9856. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9857. * written into the Host memory region mentioned below.
  9858. *
  9859. * Read index is updated by the Host. At any point of time, the read index will
  9860. * indicate the index that will next be read by the Host. The read index is
  9861. * in units of bytes offset from the base of the meta-data buffer.
  9862. *
  9863. * Write index is updated by the FW. At any point of time, the write index will
  9864. * indicate from where the FW can start writing any new data. The write index is
  9865. * in units of bytes offset from the base of the meta-data buffer.
  9866. *
  9867. * If the Host is not fast enough in reading the CFR data, any new capture data
  9868. * would be dropped if there is no space left to write the new captures.
  9869. *
  9870. * The last 4 bytes of the memory region will have the magic pattern
  9871. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9872. * not overrun the host buffer.
  9873. *
  9874. * ,--------------------. read and write indices store the
  9875. * | | byte offset from the base of the
  9876. * | ,--------+--------. meta-data buffer to the next
  9877. * | | | | location within the data buffer
  9878. * | | v v that will be read / written
  9879. * ************************************************************************
  9880. * * Read * Write * * Magic *
  9881. * * index * index * CFR data1 ...... CFR data N * pattern *
  9882. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9883. * ************************************************************************
  9884. * |<---------- data buffer ---------->|
  9885. *
  9886. * |<----------------- meta-data buffer allocated in Host ----------------|
  9887. *
  9888. * Note:
  9889. * - Considering the 4 bytes needed to store the Read index (R) and the
  9890. * Write index (W), the initial value is as follows:
  9891. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9892. * - Buffer empty condition:
  9893. * R = W
  9894. *
  9895. * Regarding CFR data format:
  9896. * --------------------------
  9897. *
  9898. * Each CFR tone is stored in HW as 16-bits with the following format:
  9899. * {bits[15:12], bits[11:6], bits[5:0]} =
  9900. * {unsigned exponent (4 bits),
  9901. * signed mantissa_real (6 bits),
  9902. * signed mantissa_imag (6 bits)}
  9903. *
  9904. * CFR_real = mantissa_real * 2^(exponent-5)
  9905. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9906. *
  9907. *
  9908. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9909. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9910. *
  9911. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9912. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9913. * .
  9914. * .
  9915. * .
  9916. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9917. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9918. */
  9919. /* Bandwidth of peer CFR captures */
  9920. typedef enum {
  9921. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9922. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9923. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9924. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9925. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9926. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9927. } HTT_PEER_CFR_CAPTURE_BW;
  9928. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9929. * was captured
  9930. */
  9931. typedef enum {
  9932. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9933. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9934. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9935. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9936. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9937. } HTT_PEER_CFR_CAPTURE_MODE;
  9938. typedef enum {
  9939. /* This message type is currently used for the below purpose:
  9940. *
  9941. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9942. * wmi_peer_cfr_capture_cmd.
  9943. * If payload_present bit is set to 0 then the associated memory region
  9944. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9945. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9946. * message; the CFR dump will be present at the end of the message,
  9947. * after the chan_phy_mode.
  9948. */
  9949. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9950. /* Always keep this last */
  9951. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9952. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9953. /**
  9954. * @brief target -> host CFR dump completion indication message definition
  9955. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9956. *
  9957. * @details
  9958. * The following diagram shows the format of the Channel Frequency Response
  9959. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9960. * the channel capture of a peer is copied by Firmware into the Host memory
  9961. *
  9962. * **************************************************************************
  9963. *
  9964. * Message format when the CFR capture message type is
  9965. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9966. *
  9967. * **************************************************************************
  9968. *
  9969. * |31 16|15 |8|7 0|
  9970. * |----------------------------------------------------------------|
  9971. * header: | reserved |P| msg_type |
  9972. * word 0 | | | |
  9973. * |----------------------------------------------------------------|
  9974. * payload: | cfr_capture_msg_type |
  9975. * word 1 | |
  9976. * |----------------------------------------------------------------|
  9977. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9978. * word 2 | | | | | | | | |
  9979. * |----------------------------------------------------------------|
  9980. * | mac_addr31to0 |
  9981. * word 3 | |
  9982. * |----------------------------------------------------------------|
  9983. * | unused / reserved | mac_addr47to32 |
  9984. * word 4 | | |
  9985. * |----------------------------------------------------------------|
  9986. * | index |
  9987. * word 5 | |
  9988. * |----------------------------------------------------------------|
  9989. * | length |
  9990. * word 6 | |
  9991. * |----------------------------------------------------------------|
  9992. * | timestamp |
  9993. * word 7 | |
  9994. * |----------------------------------------------------------------|
  9995. * | counter |
  9996. * word 8 | |
  9997. * |----------------------------------------------------------------|
  9998. * | chan_mhz |
  9999. * word 9 | |
  10000. * |----------------------------------------------------------------|
  10001. * | band_center_freq1 |
  10002. * word 10 | |
  10003. * |----------------------------------------------------------------|
  10004. * | band_center_freq2 |
  10005. * word 11 | |
  10006. * |----------------------------------------------------------------|
  10007. * | chan_phy_mode |
  10008. * word 12 | |
  10009. * |----------------------------------------------------------------|
  10010. * where,
  10011. * P - payload present bit (payload_present explained below)
  10012. * req_id - memory request id (mem_req_id explained below)
  10013. * S - status field (status explained below)
  10014. * capbw - capture bandwidth (capture_bw explained below)
  10015. * mode - mode of capture (mode explained below)
  10016. * sts - space time streams (sts_count explained below)
  10017. * chbw - channel bandwidth (channel_bw explained below)
  10018. * captype - capture type (cap_type explained below)
  10019. *
  10020. * The following field definitions describe the format of the CFR dump
  10021. * completion indication sent from the target to the host
  10022. *
  10023. * Header fields:
  10024. *
  10025. * Word 0
  10026. * - msg_type
  10027. * Bits 7:0
  10028. * Purpose: Identifies this as CFR TX completion indication
  10029. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10030. * - payload_present
  10031. * Bit 8
  10032. * Purpose: Identifies how CFR data is sent to host
  10033. * Value: 0 - If CFR Payload is written to host memory
  10034. * 1 - If CFR Payload is sent as part of HTT message
  10035. * (This is the requirement for SDIO/USB where it is
  10036. * not possible to write CFR data to host memory)
  10037. * - reserved
  10038. * Bits 31:9
  10039. * Purpose: Reserved
  10040. * Value: 0
  10041. *
  10042. * Payload fields:
  10043. *
  10044. * Word 1
  10045. * - cfr_capture_msg_type
  10046. * Bits 31:0
  10047. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10048. * to specify the format used for the remainder of the message
  10049. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10050. * (currently only MSG_TYPE_1 is defined)
  10051. *
  10052. * Word 2
  10053. * - mem_req_id
  10054. * Bits 6:0
  10055. * Purpose: Contain the mem request id of the region where the CFR capture
  10056. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10057. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10058. this value is invalid)
  10059. * - status
  10060. * Bit 7
  10061. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10062. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10063. * - capture_bw
  10064. * Bits 10:8
  10065. * Purpose: Carry the bandwidth of the CFR capture
  10066. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10067. * - mode
  10068. * Bits 13:11
  10069. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10070. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10071. * - sts_count
  10072. * Bits 16:14
  10073. * Purpose: Carry the number of space time streams
  10074. * Value: Number of space time streams
  10075. * - channel_bw
  10076. * Bits 19:17
  10077. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10078. * measurement
  10079. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10080. * - cap_type
  10081. * Bits 23:20
  10082. * Purpose: Carry the type of the capture
  10083. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10084. * - vdev_id
  10085. * Bits 31:24
  10086. * Purpose: Carry the virtual device id
  10087. * Value: vdev ID
  10088. *
  10089. * Word 3
  10090. * - mac_addr31to0
  10091. * Bits 31:0
  10092. * Purpose: Contain the bits 31:0 of the peer MAC address
  10093. * Value: Bits 31:0 of the peer MAC address
  10094. *
  10095. * Word 4
  10096. * - mac_addr47to32
  10097. * Bits 15:0
  10098. * Purpose: Contain the bits 47:32 of the peer MAC address
  10099. * Value: Bits 47:32 of the peer MAC address
  10100. *
  10101. * Word 5
  10102. * - index
  10103. * Bits 31:0
  10104. * Purpose: Contain the index at which this CFR dump was written in the Host
  10105. * allocated memory. This index is the number of bytes from the base address.
  10106. * Value: Index position
  10107. *
  10108. * Word 6
  10109. * - length
  10110. * Bits 31:0
  10111. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10112. * Value: Length of the CFR capture of the peer
  10113. *
  10114. * Word 7
  10115. * - timestamp
  10116. * Bits 31:0
  10117. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10118. * clock used for this timestamp is private to the target and not visible to
  10119. * the host i.e., Host can interpret only the relative timestamp deltas from
  10120. * one message to the next, but can't interpret the absolute timestamp from a
  10121. * single message.
  10122. * Value: Timestamp in microseconds
  10123. *
  10124. * Word 8
  10125. * - counter
  10126. * Bits 31:0
  10127. * Purpose: Carry the count of the current CFR capture from FW. This is
  10128. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10129. * in host memory)
  10130. * Value: Count of the current CFR capture
  10131. *
  10132. * Word 9
  10133. * - chan_mhz
  10134. * Bits 31:0
  10135. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10136. * Value: Primary 20 channel frequency
  10137. *
  10138. * Word 10
  10139. * - band_center_freq1
  10140. * Bits 31:0
  10141. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10142. * Value: Center frequency 1 in MHz
  10143. *
  10144. * Word 11
  10145. * - band_center_freq2
  10146. * Bits 31:0
  10147. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10148. * the VDEV
  10149. * 80plus80 mode
  10150. * Value: Center frequency 2 in MHz
  10151. *
  10152. * Word 12
  10153. * - chan_phy_mode
  10154. * Bits 31:0
  10155. * Purpose: Carry the phy mode of the channel, of the VDEV
  10156. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10157. */
  10158. PREPACK struct htt_cfr_dump_ind_type_1 {
  10159. A_UINT32 mem_req_id:7,
  10160. status:1,
  10161. capture_bw:3,
  10162. mode:3,
  10163. sts_count:3,
  10164. channel_bw:3,
  10165. cap_type:4,
  10166. vdev_id:8;
  10167. htt_mac_addr addr;
  10168. A_UINT32 index;
  10169. A_UINT32 length;
  10170. A_UINT32 timestamp;
  10171. A_UINT32 counter;
  10172. struct htt_chan_change_msg chan;
  10173. } POSTPACK;
  10174. PREPACK struct htt_cfr_dump_compl_ind {
  10175. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10176. union {
  10177. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10178. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10179. /* If there is a need to change the memory layout and its associated
  10180. * HTT indication format, a new CFR capture message type can be
  10181. * introduced and added into this union.
  10182. */
  10183. };
  10184. } POSTPACK;
  10185. /*
  10186. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10187. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10188. */
  10189. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10190. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10191. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10192. do { \
  10193. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10194. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10195. } while(0)
  10196. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10197. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10198. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10199. /*
  10200. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10201. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10202. */
  10203. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10204. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10205. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10206. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10207. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10208. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10209. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10210. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10211. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10212. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10213. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10214. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10215. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10216. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10217. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10218. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10219. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10220. do { \
  10221. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10222. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10223. } while (0)
  10224. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10225. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10226. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10227. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10228. do { \
  10229. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10230. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10231. } while (0)
  10232. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10233. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10234. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10235. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10236. do { \
  10237. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10238. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10239. } while (0)
  10240. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10241. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10242. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10243. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10244. do { \
  10245. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10246. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10247. } while (0)
  10248. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10249. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10250. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10251. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10252. do { \
  10253. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10254. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10255. } while (0)
  10256. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10257. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10258. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10259. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10260. do { \
  10261. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10262. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10263. } while (0)
  10264. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10265. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10266. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10267. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10268. do { \
  10269. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10270. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10271. } while (0)
  10272. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10273. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10274. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10275. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10276. do { \
  10277. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10278. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10279. } while (0)
  10280. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10281. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10282. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10283. /**
  10284. * @brief target -> host peer (PPDU) stats message
  10285. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10286. * @details
  10287. * This message is generated by FW when FW is sending stats to host
  10288. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10289. * This message is sent autonomously by the target rather than upon request
  10290. * by the host.
  10291. * The following field definitions describe the format of the HTT target
  10292. * to host peer stats indication message.
  10293. *
  10294. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10295. * or more PPDU stats records.
  10296. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10297. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10298. * then the message would start with the
  10299. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10300. * below.
  10301. *
  10302. * |31 16|15|14|13 11|10 9|8|7 0|
  10303. * |-------------------------------------------------------------|
  10304. * | reserved |MSG_TYPE |
  10305. * |-------------------------------------------------------------|
  10306. * rec 0 | TLV header |
  10307. * rec 0 |-------------------------------------------------------------|
  10308. * rec 0 | ppdu successful bytes |
  10309. * rec 0 |-------------------------------------------------------------|
  10310. * rec 0 | ppdu retry bytes |
  10311. * rec 0 |-------------------------------------------------------------|
  10312. * rec 0 | ppdu failed bytes |
  10313. * rec 0 |-------------------------------------------------------------|
  10314. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10315. * rec 0 |-------------------------------------------------------------|
  10316. * rec 0 | retried MSDUs | successful MSDUs |
  10317. * rec 0 |-------------------------------------------------------------|
  10318. * rec 0 | TX duration | failed MSDUs |
  10319. * rec 0 |-------------------------------------------------------------|
  10320. * ...
  10321. * |-------------------------------------------------------------|
  10322. * rec N | TLV header |
  10323. * rec N |-------------------------------------------------------------|
  10324. * rec N | ppdu successful bytes |
  10325. * rec N |-------------------------------------------------------------|
  10326. * rec N | ppdu retry bytes |
  10327. * rec N |-------------------------------------------------------------|
  10328. * rec N | ppdu failed bytes |
  10329. * rec N |-------------------------------------------------------------|
  10330. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10331. * rec N |-------------------------------------------------------------|
  10332. * rec N | retried MSDUs | successful MSDUs |
  10333. * rec N |-------------------------------------------------------------|
  10334. * rec N | TX duration | failed MSDUs |
  10335. * rec N |-------------------------------------------------------------|
  10336. *
  10337. * where:
  10338. * A = is A-MPDU flag
  10339. * BA = block-ack failure flags
  10340. * BW = bandwidth spec
  10341. * SG = SGI enabled spec
  10342. * S = skipped rate ctrl
  10343. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10344. *
  10345. * Header
  10346. * ------
  10347. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10348. * dword0 - b'8:31 - reserved : Reserved for future use
  10349. *
  10350. * payload include below peer_stats information
  10351. * --------------------------------------------
  10352. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10353. * @tx_success_bytes : total successful bytes in the PPDU.
  10354. * @tx_retry_bytes : total retried bytes in the PPDU.
  10355. * @tx_failed_bytes : total failed bytes in the PPDU.
  10356. * @tx_ratecode : rate code used for the PPDU.
  10357. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10358. * @ba_ack_failed : BA/ACK failed for this PPDU
  10359. * b00 -> BA received
  10360. * b01 -> BA failed once
  10361. * b10 -> BA failed twice, when HW retry is enabled.
  10362. * @bw : BW
  10363. * b00 -> 20 MHz
  10364. * b01 -> 40 MHz
  10365. * b10 -> 80 MHz
  10366. * b11 -> 160 MHz (or 80+80)
  10367. * @sg : SGI enabled
  10368. * @s : skipped ratectrl
  10369. * @peer_id : peer id
  10370. * @tx_success_msdus : successful MSDUs
  10371. * @tx_retry_msdus : retried MSDUs
  10372. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10373. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10374. */
  10375. #endif