htt.h 508 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264
  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. */
  172. #define HTT_CURRENT_VERSION_MAJOR 3
  173. #define HTT_CURRENT_VERSION_MINOR 60
  174. #define HTT_NUM_TX_FRAG_DESC 1024
  175. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  176. #define HTT_CHECK_SET_VAL(field, val) \
  177. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  178. /* macros to assist in sign-extending fields from HTT messages */
  179. #define HTT_SIGN_BIT_MASK(field) \
  180. ((field ## _M + (1 << field ## _S)) >> 1)
  181. #define HTT_SIGN_BIT(_val, field) \
  182. (_val & HTT_SIGN_BIT_MASK(field))
  183. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  184. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  185. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  186. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  187. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  188. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  189. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  190. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  191. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  192. /*
  193. * TEMPORARY:
  194. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  195. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  196. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  197. * updated.
  198. */
  199. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  200. /*
  201. * TEMPORARY:
  202. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  203. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  204. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  205. * updated.
  206. */
  207. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  208. /* HTT Access Category values */
  209. enum HTT_AC_WMM {
  210. /* WMM Access Categories */
  211. HTT_AC_WMM_BE = 0x0,
  212. HTT_AC_WMM_BK = 0x1,
  213. HTT_AC_WMM_VI = 0x2,
  214. HTT_AC_WMM_VO = 0x3,
  215. /* extension Access Categories */
  216. HTT_AC_EXT_NON_QOS = 0x4,
  217. HTT_AC_EXT_UCAST_MGMT = 0x5,
  218. HTT_AC_EXT_MCAST_DATA = 0x6,
  219. HTT_AC_EXT_MCAST_MGMT = 0x7,
  220. };
  221. enum HTT_AC_WMM_MASK {
  222. /* WMM Access Categories */
  223. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  224. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  225. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  226. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  227. /* extension Access Categories */
  228. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  229. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  230. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  231. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  232. };
  233. #define HTT_AC_MASK_WMM \
  234. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  235. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  236. #define HTT_AC_MASK_EXT \
  237. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  238. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  239. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  240. /*
  241. * htt_dbg_stats_type -
  242. * bit positions for each stats type within a stats type bitmask
  243. * The bitmask contains 24 bits.
  244. */
  245. enum htt_dbg_stats_type {
  246. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  247. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  248. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  249. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  250. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  251. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  252. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  253. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  254. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  255. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  256. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  257. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  258. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  259. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  260. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  261. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  262. /* bits 16-23 currently reserved */
  263. /* keep this last */
  264. HTT_DBG_NUM_STATS
  265. };
  266. /*=== HTT option selection TLVs ===
  267. * Certain HTT messages have alternatives or options.
  268. * For such cases, the host and target need to agree on which option to use.
  269. * Option specification TLVs can be appended to the VERSION_REQ and
  270. * VERSION_CONF messages to select options other than the default.
  271. * These TLVs are entirely optional - if they are not provided, there is a
  272. * well-defined default for each option. If they are provided, they can be
  273. * provided in any order. Each TLV can be present or absent independent of
  274. * the presence / absence of other TLVs.
  275. *
  276. * The HTT option selection TLVs use the following format:
  277. * |31 16|15 8|7 0|
  278. * |---------------------------------+----------------+----------------|
  279. * | value (payload) | length | tag |
  280. * |-------------------------------------------------------------------|
  281. * The value portion need not be only 2 bytes; it can be extended by any
  282. * integer number of 4-byte units. The total length of the TLV, including
  283. * the tag and length fields, must be a multiple of 4 bytes. The length
  284. * field specifies the total TLV size in 4-byte units. Thus, the typical
  285. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  286. * field, would store 0x1 in its length field, to show that the TLV occupies
  287. * a single 4-byte unit.
  288. */
  289. /*--- TLV header format - applies to all HTT option TLVs ---*/
  290. enum HTT_OPTION_TLV_TAGS {
  291. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  292. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  293. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  294. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  295. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  296. };
  297. PREPACK struct htt_option_tlv_header_t {
  298. A_UINT8 tag;
  299. A_UINT8 length;
  300. } POSTPACK;
  301. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  302. #define HTT_OPTION_TLV_TAG_S 0
  303. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  304. #define HTT_OPTION_TLV_LENGTH_S 8
  305. /*
  306. * value0 - 16 bit value field stored in word0
  307. * The TLV's value field may be longer than 2 bytes, in which case
  308. * the remainder of the value is stored in word1, word2, etc.
  309. */
  310. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  311. #define HTT_OPTION_TLV_VALUE0_S 16
  312. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  313. do { \
  314. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  315. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  316. } while (0)
  317. #define HTT_OPTION_TLV_TAG_GET(word) \
  318. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  319. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  320. do { \
  321. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  322. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  323. } while (0)
  324. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  325. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  326. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  327. do { \
  328. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  329. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  330. } while (0)
  331. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  332. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  333. /*--- format of specific HTT option TLVs ---*/
  334. /*
  335. * HTT option TLV for specifying LL bus address size
  336. * Some chips require bus addresses used by the target to access buffers
  337. * within the host's memory to be 32 bits; others require bus addresses
  338. * used by the target to access buffers within the host's memory to be
  339. * 64 bits.
  340. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  341. * a suffix to the VERSION_CONF message to specify which bus address format
  342. * the target requires.
  343. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  344. * default to providing bus addresses to the target in 32-bit format.
  345. */
  346. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  347. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  348. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  349. };
  350. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  351. struct htt_option_tlv_header_t hdr;
  352. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  353. } POSTPACK;
  354. /*
  355. * HTT option TLV for specifying whether HL systems should indicate
  356. * over-the-air tx completion for individual frames, or should instead
  357. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  358. * requests an OTA tx completion for a particular tx frame.
  359. * This option does not apply to LL systems, where the TX_COMPL_IND
  360. * is mandatory.
  361. * This option is primarily intended for HL systems in which the tx frame
  362. * downloads over the host --> target bus are as slow as or slower than
  363. * the transmissions over the WLAN PHY. For cases where the bus is faster
  364. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  365. * and consquently will send one TX_COMPL_IND message that covers several
  366. * tx frames. For cases where the WLAN PHY is faster than the bus,
  367. * the target will end up transmitting very short A-MPDUs, and consequently
  368. * sending many TX_COMPL_IND messages, which each cover a very small number
  369. * of tx frames.
  370. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  371. * a suffix to the VERSION_REQ message to request whether the host desires to
  372. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  373. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  374. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  375. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  376. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  377. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  378. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  379. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  380. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  381. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  382. * TLV.
  383. */
  384. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  385. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  386. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  387. };
  388. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  389. struct htt_option_tlv_header_t hdr;
  390. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  391. } POSTPACK;
  392. /*
  393. * HTT option TLV for specifying how many tx queue groups the target
  394. * may establish.
  395. * This TLV specifies the maximum value the target may send in the
  396. * txq_group_id field of any TXQ_GROUP information elements sent by
  397. * the target to the host. This allows the host to pre-allocate an
  398. * appropriate number of tx queue group structs.
  399. *
  400. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  401. * a suffix to the VERSION_REQ message to specify whether the host supports
  402. * tx queue groups at all, and if so if there is any limit on the number of
  403. * tx queue groups that the host supports.
  404. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  405. * a suffix to the VERSION_CONF message. If the host has specified in the
  406. * VER_REQ message a limit on the number of tx queue groups the host can
  407. * supprt, the target shall limit its specification of the maximum tx groups
  408. * to be no larger than this host-specified limit.
  409. *
  410. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  411. * shall preallocate 4 tx queue group structs, and the target shall not
  412. * specify a txq_group_id larger than 3.
  413. */
  414. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  415. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  416. /*
  417. * values 1 through N specify the max number of tx queue groups
  418. * the sender supports
  419. */
  420. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  421. };
  422. /* TEMPORARY backwards-compatibility alias for a typo fix -
  423. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  424. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  425. * to support the old name (with the typo) until all references to the
  426. * old name are replaced with the new name.
  427. */
  428. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  429. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  430. struct htt_option_tlv_header_t hdr;
  431. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  432. } POSTPACK;
  433. /*
  434. * HTT option TLV for specifying whether the target supports an extended
  435. * version of the HTT tx descriptor. If the target provides this TLV
  436. * and specifies in the TLV that the target supports an extended version
  437. * of the HTT tx descriptor, the target must check the "extension" bit in
  438. * the HTT tx descriptor, and if the extension bit is set, to expect a
  439. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  440. * descriptor. Furthermore, the target must provide room for the HTT
  441. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  442. * This option is intended for systems where the host needs to explicitly
  443. * control the transmission parameters such as tx power for individual
  444. * tx frames.
  445. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  446. * as a suffix to the VERSION_CONF message to explicitly specify whether
  447. * the target supports the HTT tx MSDU extension descriptor.
  448. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  449. * by the host as lack of target support for the HTT tx MSDU extension
  450. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  451. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  452. * the HTT tx MSDU extension descriptor.
  453. * The host is not required to provide the HTT tx MSDU extension descriptor
  454. * just because the target supports it; the target must check the
  455. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  456. * extension descriptor is present.
  457. */
  458. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  459. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  460. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  461. };
  462. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  463. struct htt_option_tlv_header_t hdr;
  464. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  465. } POSTPACK;
  466. /*=== host -> target messages ===============================================*/
  467. enum htt_h2t_msg_type {
  468. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  469. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  470. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  471. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  472. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  473. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  474. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  475. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  476. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  477. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  478. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  479. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  480. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  481. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  482. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  483. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  484. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  485. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  486. /* keep this last */
  487. HTT_H2T_NUM_MSGS
  488. };
  489. /*
  490. * HTT host to target message type -
  491. * stored in bits 7:0 of the first word of the message
  492. */
  493. #define HTT_H2T_MSG_TYPE_M 0xff
  494. #define HTT_H2T_MSG_TYPE_S 0
  495. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  496. do { \
  497. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  498. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  499. } while (0)
  500. #define HTT_H2T_MSG_TYPE_GET(word) \
  501. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  502. /**
  503. * @brief host -> target version number request message definition
  504. *
  505. * |31 24|23 16|15 8|7 0|
  506. * |----------------+----------------+----------------+----------------|
  507. * | reserved | msg type |
  508. * |-------------------------------------------------------------------|
  509. * : option request TLV (optional) |
  510. * :...................................................................:
  511. *
  512. * The VER_REQ message may consist of a single 4-byte word, or may be
  513. * extended with TLVs that specify which HTT options the host is requesting
  514. * from the target.
  515. * The following option TLVs may be appended to the VER_REQ message:
  516. * - HL_SUPPRESS_TX_COMPL_IND
  517. * - HL_MAX_TX_QUEUE_GROUPS
  518. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  519. * may be appended to the VER_REQ message (but only one TLV of each type).
  520. *
  521. * Header fields:
  522. * - MSG_TYPE
  523. * Bits 7:0
  524. * Purpose: identifies this as a version number request message
  525. * Value: 0x0
  526. */
  527. #define HTT_VER_REQ_BYTES 4
  528. /* TBDXXX: figure out a reasonable number */
  529. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  530. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  531. /**
  532. * @brief HTT tx MSDU descriptor
  533. *
  534. * @details
  535. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  536. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  537. * the target firmware needs for the FW's tx processing, particularly
  538. * for creating the HW msdu descriptor.
  539. * The same HTT tx descriptor is used for HL and LL systems, though
  540. * a few fields within the tx descriptor are used only by LL or
  541. * only by HL.
  542. * The HTT tx descriptor is defined in two manners: by a struct with
  543. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  544. * definitions.
  545. * The target should use the struct def, for simplicitly and clarity,
  546. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  547. * neutral. Specifically, the host shall use the get/set macros built
  548. * around the mask + shift defs.
  549. */
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  557. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  558. #define HTT_TX_VDEV_ID_WORD 0
  559. #define HTT_TX_VDEV_ID_MASK 0x3f
  560. #define HTT_TX_VDEV_ID_SHIFT 16
  561. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  562. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  563. #define HTT_TX_MSDU_LEN_DWORD 1
  564. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  565. /*
  566. * HTT_VAR_PADDR macros
  567. * Allow physical / bus addresses to be either a single 32-bit value,
  568. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  569. */
  570. #define HTT_VAR_PADDR32(var_name) \
  571. A_UINT32 var_name
  572. #define HTT_VAR_PADDR64_LE(var_name) \
  573. struct { \
  574. /* little-endian: lo precedes hi */ \
  575. A_UINT32 lo; \
  576. A_UINT32 hi; \
  577. } var_name
  578. /*
  579. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  580. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  581. * addresses are stored in a XXX-bit field.
  582. * This macro is used to define both htt_tx_msdu_desc32_t and
  583. * htt_tx_msdu_desc64_t structs.
  584. */
  585. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  586. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  587. { \
  588. /* DWORD 0: flags and meta-data */ \
  589. A_UINT32 \
  590. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  591. \
  592. /* pkt_subtype - \
  593. * Detailed specification of the tx frame contents, extending the \
  594. * general specification provided by pkt_type. \
  595. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  596. * pkt_type | pkt_subtype \
  597. * ============================================================== \
  598. * 802.3 | bit 0:3 - Reserved \
  599. * | bit 4: 0x0 - Copy-Engine Classification Results \
  600. * | not appended to the HTT message \
  601. * | 0x1 - Copy-Engine Classification Results \
  602. * | appended to the HTT message in the \
  603. * | format: \
  604. * | [HTT tx desc, frame header, \
  605. * | CE classification results] \
  606. * | The CE classification results begin \
  607. * | at the next 4-byte boundary after \
  608. * | the frame header. \
  609. * ------------+------------------------------------------------- \
  610. * Eth2 | bit 0:3 - Reserved \
  611. * | bit 4: 0x0 - Copy-Engine Classification Results \
  612. * | not appended to the HTT message \
  613. * | 0x1 - Copy-Engine Classification Results \
  614. * | appended to the HTT message. \
  615. * | See the above specification of the \
  616. * | CE classification results location. \
  617. * ------------+------------------------------------------------- \
  618. * native WiFi | bit 0:3 - Reserved \
  619. * | bit 4: 0x0 - Copy-Engine Classification Results \
  620. * | not appended to the HTT message \
  621. * | 0x1 - Copy-Engine Classification Results \
  622. * | appended to the HTT message. \
  623. * | See the above specification of the \
  624. * | CE classification results location. \
  625. * ------------+------------------------------------------------- \
  626. * mgmt | 0x0 - 802.11 MAC header absent \
  627. * | 0x1 - 802.11 MAC header present \
  628. * ------------+------------------------------------------------- \
  629. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  630. * | 0x1 - 802.11 MAC header present \
  631. * | bit 1: 0x0 - allow aggregation \
  632. * | 0x1 - don't allow aggregation \
  633. * | bit 2: 0x0 - perform encryption \
  634. * | 0x1 - don't perform encryption \
  635. * | bit 3: 0x0 - perform tx classification / queuing \
  636. * | 0x1 - don't perform tx classification; \
  637. * | insert the frame into the "misc" \
  638. * | tx queue \
  639. * | bit 4: 0x0 - Copy-Engine Classification Results \
  640. * | not appended to the HTT message \
  641. * | 0x1 - Copy-Engine Classification Results \
  642. * | appended to the HTT message. \
  643. * | See the above specification of the \
  644. * | CE classification results location. \
  645. */ \
  646. pkt_subtype: 5, \
  647. \
  648. /* pkt_type - \
  649. * General specification of the tx frame contents. \
  650. * The htt_pkt_type enum should be used to specify and check the \
  651. * value of this field. \
  652. */ \
  653. pkt_type: 3, \
  654. \
  655. /* vdev_id - \
  656. * ID for the vdev that is sending this tx frame. \
  657. * For certain non-standard packet types, e.g. pkt_type == raw \
  658. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  659. * This field is used primarily for determining where to queue \
  660. * broadcast and multicast frames. \
  661. */ \
  662. vdev_id: 6, \
  663. /* ext_tid - \
  664. * The extended traffic ID. \
  665. * If the TID is unknown, the extended TID is set to \
  666. * HTT_TX_EXT_TID_INVALID. \
  667. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  668. * value of the QoS TID. \
  669. * If the tx frame is non-QoS data, then the extended TID is set to \
  670. * HTT_TX_EXT_TID_NON_QOS. \
  671. * If the tx frame is multicast or broadcast, then the extended TID \
  672. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  673. */ \
  674. ext_tid: 5, \
  675. \
  676. /* postponed - \
  677. * This flag indicates whether the tx frame has been downloaded to \
  678. * the target before but discarded by the target, and now is being \
  679. * downloaded again; or if this is a new frame that is being \
  680. * downloaded for the first time. \
  681. * This flag allows the target to determine the correct order for \
  682. * transmitting new vs. old frames. \
  683. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  684. * This flag only applies to HL systems, since in LL systems, \
  685. * the tx flow control is handled entirely within the target. \
  686. */ \
  687. postponed: 1, \
  688. \
  689. /* extension - \
  690. * This flag indicates whether a HTT tx MSDU extension descriptor \
  691. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  692. * \
  693. * 0x0 - no extension MSDU descriptor is present \
  694. * 0x1 - an extension MSDU descriptor immediately follows the \
  695. * regular MSDU descriptor \
  696. */ \
  697. extension: 1, \
  698. \
  699. /* cksum_offload - \
  700. * This flag indicates whether checksum offload is enabled or not \
  701. * for this frame. Target FW use this flag to turn on HW checksumming \
  702. * 0x0 - No checksum offload \
  703. * 0x1 - L3 header checksum only \
  704. * 0x2 - L4 checksum only \
  705. * 0x3 - L3 header checksum + L4 checksum \
  706. */ \
  707. cksum_offload: 2, \
  708. \
  709. /* tx_comp_req - \
  710. * This flag indicates whether Tx Completion \
  711. * from fw is required or not. \
  712. * This flag is only relevant if tx completion is not \
  713. * universally enabled. \
  714. * For all LL systems, tx completion is mandatory, \
  715. * so this flag will be irrelevant. \
  716. * For HL systems tx completion is optional, but HL systems in which \
  717. * the bus throughput exceeds the WLAN throughput will \
  718. * probably want to always use tx completion, and thus \
  719. * would not check this flag. \
  720. * This flag is required when tx completions are not used universally, \
  721. * but are still required for certain tx frames for which \
  722. * an OTA delivery acknowledgment is needed by the host. \
  723. * In practice, this would be for HL systems in which the \
  724. * bus throughput is less than the WLAN throughput. \
  725. * \
  726. * 0x0 - Tx Completion Indication from Fw not required \
  727. * 0x1 - Tx Completion Indication from Fw is required \
  728. */ \
  729. tx_compl_req: 1; \
  730. \
  731. \
  732. /* DWORD 1: MSDU length and ID */ \
  733. A_UINT32 \
  734. len: 16, /* MSDU length, in bytes */ \
  735. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  736. * and this id is used to calculate fragmentation \
  737. * descriptor pointer inside the target based on \
  738. * the base address, configured inside the target. \
  739. */ \
  740. \
  741. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  742. /* frags_desc_ptr - \
  743. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  744. * where the tx frame's fragments reside in memory. \
  745. * This field only applies to LL systems, since in HL systems the \
  746. * (degenerate single-fragment) fragmentation descriptor is created \
  747. * within the target. \
  748. */ \
  749. _paddr__frags_desc_ptr_; \
  750. \
  751. /* DWORD 3 (or 4): peerid, chanfreq */ \
  752. /* \
  753. * Peer ID : Target can use this value to know which peer-id packet \
  754. * destined to. \
  755. * It's intended to be specified by host in case of NAWDS. \
  756. */ \
  757. A_UINT16 peerid; \
  758. \
  759. /* \
  760. * Channel frequency: This identifies the desired channel \
  761. * frequency (in mhz) for tx frames. This is used by FW to help \
  762. * determine when it is safe to transmit or drop frames for \
  763. * off-channel operation. \
  764. * The default value of zero indicates to FW that the corresponding \
  765. * VDEV's home channel (if there is one) is the desired channel \
  766. * frequency. \
  767. */ \
  768. A_UINT16 chanfreq; \
  769. \
  770. /* Reason reserved is commented is increasing the htt structure size \
  771. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  772. * A_UINT32 reserved_dword3_bits0_31; \
  773. */ \
  774. } POSTPACK
  775. /* define a htt_tx_msdu_desc32_t type */
  776. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  777. /* define a htt_tx_msdu_desc64_t type */
  778. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  779. /*
  780. * Make htt_tx_msdu_desc_t be an alias for either
  781. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  782. */
  783. #if HTT_PADDR64
  784. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  785. #else
  786. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  787. #endif
  788. /* decriptor information for Management frame*/
  789. /*
  790. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  791. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  792. */
  793. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  794. extern A_UINT32 mgmt_hdr_len;
  795. PREPACK struct htt_mgmt_tx_desc_t {
  796. A_UINT32 msg_type;
  797. #if HTT_PADDR64
  798. A_UINT64 frag_paddr; /* DMAble address of the data */
  799. #else
  800. A_UINT32 frag_paddr; /* DMAble address of the data */
  801. #endif
  802. A_UINT32 desc_id; /* returned to host during completion
  803. * to free the meory*/
  804. A_UINT32 len; /* Fragment length */
  805. A_UINT32 vdev_id; /* virtual device ID*/
  806. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  807. } POSTPACK;
  808. PREPACK struct htt_mgmt_tx_compl_ind {
  809. A_UINT32 desc_id;
  810. A_UINT32 status;
  811. } POSTPACK;
  812. /*
  813. * This SDU header size comes from the summation of the following:
  814. * 1. Max of:
  815. * a. Native WiFi header, for native WiFi frames: 24 bytes
  816. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  817. * b. 802.11 header, for raw frames: 36 bytes
  818. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  819. * QoS header, HT header)
  820. * c. 802.3 header, for ethernet frames: 14 bytes
  821. * (destination address, source address, ethertype / length)
  822. * 2. Max of:
  823. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  824. * b. IPv6 header, up through the Traffic Class: 2 bytes
  825. * 3. 802.1Q VLAN header: 4 bytes
  826. * 4. LLC/SNAP header: 8 bytes
  827. */
  828. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  829. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  830. #define HTT_TX_HDR_SIZE_ETHERNET 14
  831. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  832. A_COMPILE_TIME_ASSERT(
  833. htt_encap_hdr_size_max_check_nwifi,
  834. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  835. A_COMPILE_TIME_ASSERT(
  836. htt_encap_hdr_size_max_check_enet,
  837. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  838. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  839. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  840. #define HTT_TX_HDR_SIZE_802_1Q 4
  841. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  842. #define HTT_COMMON_TX_FRM_HDR_LEN \
  843. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  844. HTT_TX_HDR_SIZE_802_1Q + \
  845. HTT_TX_HDR_SIZE_LLC_SNAP)
  846. #define HTT_HL_TX_FRM_HDR_LEN \
  847. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  848. #define HTT_LL_TX_FRM_HDR_LEN \
  849. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  850. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  851. /* dword 0 */
  852. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  853. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  854. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  855. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  856. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  857. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  858. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  859. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  860. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  863. #define HTT_TX_DESC_PKT_TYPE_S 13
  864. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  865. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  867. #define HTT_TX_DESC_VDEV_ID_S 16
  868. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  871. #define HTT_TX_DESC_EXT_TID_S 22
  872. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  875. #define HTT_TX_DESC_POSTPONED_S 27
  876. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  877. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  879. #define HTT_TX_DESC_EXTENSION_S 28
  880. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  883. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  884. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  885. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  887. #define HTT_TX_DESC_TX_COMP_S 31
  888. /* dword 1 */
  889. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  890. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  891. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  892. #define HTT_TX_DESC_FRM_LEN_S 0
  893. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  894. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  895. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  896. #define HTT_TX_DESC_FRM_ID_S 16
  897. /* dword 2 */
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  900. /* for systems using 64-bit format for bus addresses */
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  905. /* for systems using 32-bit format for bus addresses */
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  907. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  908. /* dword 3 */
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  912. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  914. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  915. #if HTT_PADDR64
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  917. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  918. #else
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  921. #endif
  922. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  923. #define HTT_TX_DESC_PEER_ID_S 0
  924. /*
  925. * TEMPORARY:
  926. * The original definitions for the PEER_ID fields contained typos
  927. * (with _DESC_PADDR appended to this PEER_ID field name).
  928. * Retain deprecated original names for PEER_ID fields until all code that
  929. * refers to them has been updated.
  930. */
  931. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  932. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  933. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  934. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  935. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  936. HTT_TX_DESC_PEER_ID_M
  937. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  938. HTT_TX_DESC_PEER_ID_S
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  942. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  944. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  945. #if HTT_PADDR64
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  947. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  948. #else
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  951. #endif
  952. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  953. #define HTT_TX_DESC_CHAN_FREQ_S 16
  954. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  955. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  956. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  957. do { \
  958. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  959. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  960. } while (0)
  961. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  962. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  963. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  964. do { \
  965. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  966. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  967. } while (0)
  968. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  969. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  970. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  971. do { \
  972. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  973. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  974. } while (0)
  975. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  976. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  977. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  983. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  984. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  990. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  991. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  997. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  998. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1005. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1012. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1019. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1026. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1033. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1037. } while (0)
  1038. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1039. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1040. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1041. do { \
  1042. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1043. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1044. } while (0)
  1045. /* enums used in the HTT tx MSDU extension descriptor */
  1046. enum {
  1047. htt_tx_guard_interval_regular = 0,
  1048. htt_tx_guard_interval_short = 1,
  1049. };
  1050. enum {
  1051. htt_tx_preamble_type_ofdm = 0,
  1052. htt_tx_preamble_type_cck = 1,
  1053. htt_tx_preamble_type_ht = 2,
  1054. htt_tx_preamble_type_vht = 3,
  1055. };
  1056. enum {
  1057. htt_tx_bandwidth_5MHz = 0,
  1058. htt_tx_bandwidth_10MHz = 1,
  1059. htt_tx_bandwidth_20MHz = 2,
  1060. htt_tx_bandwidth_40MHz = 3,
  1061. htt_tx_bandwidth_80MHz = 4,
  1062. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1063. };
  1064. /**
  1065. * @brief HTT tx MSDU extension descriptor
  1066. * @details
  1067. * If the target supports HTT tx MSDU extension descriptors, the host has
  1068. * the option of appending the following struct following the regular
  1069. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1070. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1071. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1072. * tx specs for each frame.
  1073. */
  1074. PREPACK struct htt_tx_msdu_desc_ext_t {
  1075. /* DWORD 0: flags */
  1076. A_UINT32
  1077. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1078. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1079. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1080. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1081. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1082. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1083. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1084. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1085. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1086. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1087. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1088. /* DWORD 1: tx power, tx rate, tx BW */
  1089. A_UINT32
  1090. /* pwr -
  1091. * Specify what power the tx frame needs to be transmitted at.
  1092. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1093. * The value needs to be appropriately sign-extended when extracting
  1094. * the value from the message and storing it in a variable that is
  1095. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1096. * automatically handles this sign-extension.)
  1097. * If the transmission uses multiple tx chains, this power spec is
  1098. * the total transmit power, assuming incoherent combination of
  1099. * per-chain power to produce the total power.
  1100. */
  1101. pwr: 8,
  1102. /* mcs_mask -
  1103. * Specify the allowable values for MCS index (modulation and coding)
  1104. * to use for transmitting the frame.
  1105. *
  1106. * For HT / VHT preamble types, this mask directly corresponds to
  1107. * the HT or VHT MCS indices that are allowed. For each bit N set
  1108. * within the mask, MCS index N is allowed for transmitting the frame.
  1109. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1110. * rates versus OFDM rates, so the host has the option of specifying
  1111. * that the target must transmit the frame with CCK or OFDM rates
  1112. * (not HT or VHT), but leaving the decision to the target whether
  1113. * to use CCK or OFDM.
  1114. *
  1115. * For CCK and OFDM, the bits within this mask are interpreted as
  1116. * follows:
  1117. * bit 0 -> CCK 1 Mbps rate is allowed
  1118. * bit 1 -> CCK 2 Mbps rate is allowed
  1119. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1120. * bit 3 -> CCK 11 Mbps rate is allowed
  1121. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1122. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1123. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1124. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1125. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1126. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1127. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1128. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1129. *
  1130. * The MCS index specification needs to be compatible with the
  1131. * bandwidth mask specification. For example, a MCS index == 9
  1132. * specification is inconsistent with a preamble type == VHT,
  1133. * Nss == 1, and channel bandwidth == 20 MHz.
  1134. *
  1135. * Furthermore, the host has only a limited ability to specify to
  1136. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1137. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1138. */
  1139. mcs_mask: 12,
  1140. /* nss_mask -
  1141. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1142. * Each bit in this mask corresponds to a Nss value:
  1143. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1144. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1145. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1146. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1147. * The values in the Nss mask must be suitable for the recipient, e.g.
  1148. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1149. * recipient which only supports 2x2 MIMO.
  1150. */
  1151. nss_mask: 4,
  1152. /* guard_interval -
  1153. * Specify a htt_tx_guard_interval enum value to indicate whether
  1154. * the transmission should use a regular guard interval or a
  1155. * short guard interval.
  1156. */
  1157. guard_interval: 1,
  1158. /* preamble_type_mask -
  1159. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1160. * may choose from for transmitting this frame.
  1161. * The bits in this mask correspond to the values in the
  1162. * htt_tx_preamble_type enum. For example, to allow the target
  1163. * to transmit the frame as either CCK or OFDM, this field would
  1164. * be set to
  1165. * (1 << htt_tx_preamble_type_ofdm) |
  1166. * (1 << htt_tx_preamble_type_cck)
  1167. */
  1168. preamble_type_mask: 4,
  1169. reserved1_31_29: 3; /* unused, set to 0x0 */
  1170. /* DWORD 2: tx chain mask, tx retries */
  1171. A_UINT32
  1172. /* chain_mask - specify which chains to transmit from */
  1173. chain_mask: 4,
  1174. /* retry_limit -
  1175. * Specify the maximum number of transmissions, including the
  1176. * initial transmission, to attempt before giving up if no ack
  1177. * is received.
  1178. * If the tx rate is specified, then all retries shall use the
  1179. * same rate as the initial transmission.
  1180. * If no tx rate is specified, the target can choose whether to
  1181. * retain the original rate during the retransmissions, or to
  1182. * fall back to a more robust rate.
  1183. */
  1184. retry_limit: 4,
  1185. /* bandwidth_mask -
  1186. * Specify what channel widths may be used for the transmission.
  1187. * A value of zero indicates "don't care" - the target may choose
  1188. * the transmission bandwidth.
  1189. * The bits within this mask correspond to the htt_tx_bandwidth
  1190. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1191. * The bandwidth_mask must be consistent with the preamble_type_mask
  1192. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1193. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1194. */
  1195. bandwidth_mask: 6,
  1196. reserved2_31_14: 18; /* unused, set to 0x0 */
  1197. /* DWORD 3: tx expiry time (TSF) LSBs */
  1198. A_UINT32 expire_tsf_lo;
  1199. /* DWORD 4: tx expiry time (TSF) MSBs */
  1200. A_UINT32 expire_tsf_hi;
  1201. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1202. } POSTPACK;
  1203. /* DWORD 0 */
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1224. /* DWORD 1 */
  1225. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1226. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1227. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1228. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1229. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1230. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1231. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1232. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1233. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1234. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1235. /* DWORD 2 */
  1236. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1237. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1238. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1239. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1240. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1241. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1242. /* DWORD 0 */
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1244. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1245. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1249. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1250. } while (0)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1252. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1253. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1255. do { \
  1256. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1257. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1258. } while (0)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1260. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL( \
  1265. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1266. ((_var) |= ((_val) \
  1267. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1268. } while (0)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL( \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1276. ((_var) |= ((_val) \
  1277. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1310. } while (0)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1312. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1313. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1318. } while (0)
  1319. /* DWORD 1 */
  1320. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1321. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1322. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1323. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1324. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1325. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1326. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1327. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1328. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1329. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1330. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1331. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1332. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1336. } while (0)
  1337. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1344. } while (0)
  1345. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1352. } while (0)
  1353. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1354. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1355. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1356. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1360. } while (0)
  1361. /* DWORD 2 */
  1362. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1363. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1364. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1365. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1369. } while (0)
  1370. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1377. } while (0)
  1378. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1379. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1380. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1381. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1384. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1385. } while (0)
  1386. typedef enum {
  1387. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1388. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1389. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1390. } htt_11ax_ltf_subtype_t;
  1391. typedef enum {
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1396. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1397. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1398. } htt_tx_ext2_preamble_type_t;
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1411. /**
  1412. * @brief HTT tx MSDU extension descriptor v2
  1413. * @details
  1414. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1415. * is received as tcl_exit_base->host_meta_info in firmware.
  1416. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1417. * are already part of tcl_exit_base.
  1418. */
  1419. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1420. /* DWORD 0: flags */
  1421. A_UINT32
  1422. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1423. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1424. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1425. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1426. valid_retries : 1, /* if set, tx retries spec is valid */
  1427. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1428. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1429. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1430. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1431. valid_key_flags : 1, /* if set, key flags is valid */
  1432. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1433. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1434. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1435. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1436. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1437. 1 = ENCRYPT,
  1438. 2 ~ 3 - Reserved */
  1439. /* retry_limit -
  1440. * Specify the maximum number of transmissions, including the
  1441. * initial transmission, to attempt before giving up if no ack
  1442. * is received.
  1443. * If the tx rate is specified, then all retries shall use the
  1444. * same rate as the initial transmission.
  1445. * If no tx rate is specified, the target can choose whether to
  1446. * retain the original rate during the retransmissions, or to
  1447. * fall back to a more robust rate.
  1448. */
  1449. retry_limit : 4,
  1450. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1451. * Valid only for 11ax preamble types HE_SU
  1452. * and HE_EXT_SU
  1453. */
  1454. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1455. * Valid only for 11ax preamble types HE_SU
  1456. * and HE_EXT_SU
  1457. */
  1458. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1459. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1460. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1461. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1462. */
  1463. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1464. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1465. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1466. * Use cases:
  1467. * Any time firmware uses TQM-BYPASS for Data
  1468. * TID, firmware expect host to set this bit.
  1469. */
  1470. /* DWORD 1: tx power, tx rate */
  1471. A_UINT32
  1472. power : 8, /* unit of the power field is 0.5 dbm
  1473. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1474. * signed value ranging from -64dbm to 63.5 dbm
  1475. */
  1476. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1477. * Setting more than one MCS isn't currently
  1478. * supported by the target (but is supported
  1479. * in the interface in case in the future
  1480. * the target supports specifications of
  1481. * a limited set of MCS values.
  1482. */
  1483. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1484. * Setting more than one Nss isn't currently
  1485. * supported by the target (but is supported
  1486. * in the interface in case in the future
  1487. * the target supports specifications of
  1488. * a limited set of Nss values.
  1489. */
  1490. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1491. update_peer_cache : 1; /* When set these custom values will be
  1492. * used for all packets, until the next
  1493. * update via this ext header.
  1494. * This is to make sure not all packets
  1495. * need to include this header.
  1496. */
  1497. /* DWORD 2: tx chain mask, tx retries */
  1498. A_UINT32
  1499. /* chain_mask - specify which chains to transmit from */
  1500. chain_mask : 8,
  1501. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1502. * TODO: Update Enum values for key_flags
  1503. */
  1504. /*
  1505. * Channel frequency: This identifies the desired channel
  1506. * frequency (in MHz) for tx frames. This is used by FW to help
  1507. * determine when it is safe to transmit or drop frames for
  1508. * off-channel operation.
  1509. * The default value of zero indicates to FW that the corresponding
  1510. * VDEV's home channel (if there is one) is the desired channel
  1511. * frequency.
  1512. */
  1513. chanfreq : 16;
  1514. /* DWORD 3: tx expiry time (TSF) LSBs */
  1515. A_UINT32 expire_tsf_lo;
  1516. /* DWORD 4: tx expiry time (TSF) MSBs */
  1517. A_UINT32 expire_tsf_hi;
  1518. /* DWORD 5: reserved
  1519. * This structure can be expanded further up to 60 bytes
  1520. * by adding further DWORDs as needed.
  1521. */
  1522. A_UINT32
  1523. /* learning_frame
  1524. * When this flag is set, this frame will be dropped by FW
  1525. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1526. */
  1527. learning_frame : 1,
  1528. rsvd0 : 31;
  1529. } POSTPACK;
  1530. /* DWORD 0 */
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1557. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1558. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1559. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1560. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1561. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1562. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1563. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1564. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1565. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1566. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1567. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1568. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1569. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1570. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1571. /* DWORD 1 */
  1572. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1573. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1574. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1575. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1576. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1577. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1578. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1579. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1580. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1581. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1582. /* DWORD 2 */
  1583. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1584. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1585. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1586. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1587. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1588. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1589. /* DWORD 5 */
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1592. /* DWORD 0 */
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1595. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1599. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1603. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1607. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1608. } while (0)
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1610. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1611. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1613. do { \
  1614. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1615. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1616. } while (0)
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1618. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1619. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL( \
  1623. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1624. ((_var) |= ((_val) \
  1625. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1629. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1634. } while (0)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1645. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL( \
  1649. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1650. ((_var) |= ((_val) \
  1651. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1748. } while (0)
  1749. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1753. do { \
  1754. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1755. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1756. } while (0)
  1757. /* DWORD 1 */
  1758. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1759. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1760. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1761. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1762. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1763. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1764. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1765. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1766. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1767. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1768. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1769. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1770. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1771. do { \
  1772. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1773. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1774. } while (0)
  1775. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1776. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1777. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1778. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1779. do { \
  1780. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1781. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1782. } while (0)
  1783. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1784. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1785. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1786. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1787. do { \
  1788. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1789. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1790. } while (0)
  1791. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1793. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1794. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1797. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1798. } while (0)
  1799. /* DWORD 2 */
  1800. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1804. do { \
  1805. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1806. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1807. } while (0)
  1808. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1814. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1815. } while (0)
  1816. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1820. do { \
  1821. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1822. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1823. } while (0)
  1824. /* DWORD 5 */
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1832. } while (0)
  1833. typedef enum {
  1834. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1835. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1836. } htt_tcl_metadata_type;
  1837. /**
  1838. * @brief HTT TCL command number format
  1839. * @details
  1840. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1841. * available to firmware as tcl_exit_base->tcl_status_number.
  1842. * For regular / multicast packets host will send vdev and mac id and for
  1843. * NAWDS packets, host will send peer id.
  1844. * A_UINT32 is used to avoid endianness conversion problems.
  1845. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1846. */
  1847. typedef struct {
  1848. A_UINT32
  1849. type: 1, /* vdev_id based or peer_id based */
  1850. rsvd: 31;
  1851. } htt_tx_tcl_vdev_or_peer_t;
  1852. typedef struct {
  1853. A_UINT32
  1854. type: 1, /* vdev_id based or peer_id based */
  1855. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1856. vdev_id: 8,
  1857. pdev_id: 2,
  1858. host_inspected:1,
  1859. rsvd: 19;
  1860. } htt_tx_tcl_vdev_metadata;
  1861. typedef struct {
  1862. A_UINT32
  1863. type: 1, /* vdev_id based or peer_id based */
  1864. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1865. peer_id: 14,
  1866. rsvd: 16;
  1867. } htt_tx_tcl_peer_metadata;
  1868. PREPACK struct htt_tx_tcl_metadata {
  1869. union {
  1870. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1871. htt_tx_tcl_vdev_metadata vdev_meta;
  1872. htt_tx_tcl_peer_metadata peer_meta;
  1873. };
  1874. } POSTPACK;
  1875. /* DWORD 0 */
  1876. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1877. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1878. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1879. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1880. /* VDEV metadata */
  1881. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1882. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1883. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1884. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1885. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1886. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1887. /* PEER metadata */
  1888. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1889. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1890. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1891. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1892. HTT_TX_TCL_METADATA_TYPE_S)
  1893. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1897. } while (0)
  1898. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1899. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1900. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1901. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1905. } while (0)
  1906. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1907. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1908. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1909. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1912. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1913. } while (0)
  1914. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1915. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1916. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1917. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1920. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1921. } while (0)
  1922. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1923. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1924. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1925. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1929. } while (0)
  1930. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1931. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1932. HTT_TX_TCL_METADATA_PEER_ID_S)
  1933. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1937. } while (0)
  1938. typedef enum {
  1939. HTT_TX_FW2WBM_TX_STATUS_OK,
  1940. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1941. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1942. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1943. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1944. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1945. HTT_TX_FW2WBM_TX_STATUS_MAX
  1946. } htt_tx_fw2wbm_tx_status_t;
  1947. typedef enum {
  1948. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1949. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1950. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1951. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1952. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1953. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1954. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1955. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1956. } htt_tx_fw2wbm_reinject_reason_t;
  1957. /**
  1958. * @brief HTT TX WBM Completion from firmware to host
  1959. * @details
  1960. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1961. * DWORD 3 and 4 for software based completions (Exception frames and
  1962. * TQM bypass frames)
  1963. * For software based completions, wbm_release_ring->release_source_module will
  1964. * be set to release_source_fw
  1965. */
  1966. PREPACK struct htt_tx_wbm_completion {
  1967. A_UINT32
  1968. sch_cmd_id: 24,
  1969. exception_frame: 1, /* If set, this packet was queued via exception path */
  1970. rsvd0_31_25: 7;
  1971. A_UINT32
  1972. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1973. * reception of an ACK or BA, this field indicates
  1974. * the RSSI of the received ACK or BA frame.
  1975. * When the frame is removed as result of a direct
  1976. * remove command from the SW, this field is set
  1977. * to 0x0 (which is never a valid value when real
  1978. * RSSI is available).
  1979. * Units: dB w.r.t noise floor
  1980. */
  1981. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1982. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1983. rsvd1_31_16: 16;
  1984. } POSTPACK;
  1985. /* DWORD 0 */
  1986. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1987. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1988. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1989. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1990. /* DWORD 1 */
  1991. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1992. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1993. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1994. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1995. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1996. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1997. /* DWORD 0 */
  1998. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1999. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2000. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2001. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2005. } while (0)
  2006. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2007. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2008. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2009. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2013. } while (0)
  2014. /* DWORD 1 */
  2015. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2016. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2017. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2018. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2022. } while (0)
  2023. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2024. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2025. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2026. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2030. } while (0)
  2031. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2032. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2033. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2034. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2038. } while (0)
  2039. /**
  2040. * @brief HTT TX WBM Completion from firmware to host
  2041. * @details
  2042. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2043. * (WBM) offload HW.
  2044. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2045. * For software based completions, release_source_module will
  2046. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2047. * struct wbm_release_ring and then switch to this after looking at
  2048. * release_source_module.
  2049. */
  2050. PREPACK struct htt_tx_wbm_completion_v2 {
  2051. A_UINT32
  2052. used_by_hw0; /* Refer to struct wbm_release_ring */
  2053. A_UINT32
  2054. used_by_hw1; /* Refer to struct wbm_release_ring */
  2055. A_UINT32
  2056. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2057. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2058. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2059. exception_frame: 1,
  2060. rsvd0: 12, /* For future use */
  2061. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2062. rsvd1: 1; /* For future use */
  2063. A_UINT32
  2064. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2065. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2066. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2067. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2068. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2069. */
  2070. A_UINT32
  2071. data1: 32;
  2072. A_UINT32
  2073. data2: 32;
  2074. A_UINT32
  2075. used_by_hw3; /* Refer to struct wbm_release_ring */
  2076. } POSTPACK;
  2077. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2078. /* DWORD 3 */
  2079. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2080. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2081. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2082. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2083. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2084. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2085. /* DWORD 3 */
  2086. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2087. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2088. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2089. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2093. } while (0)
  2094. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2095. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2096. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2097. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2098. do { \
  2099. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2100. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2101. } while (0)
  2102. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2103. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2104. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2105. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2108. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2109. } while (0)
  2110. /**
  2111. * @brief HTT TX WBM transmit status from firmware to host
  2112. * @details
  2113. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2114. * (WBM) offload HW.
  2115. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2116. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2117. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2118. */
  2119. PREPACK struct htt_tx_wbm_transmit_status {
  2120. A_UINT32
  2121. sch_cmd_id: 24,
  2122. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2123. * reception of an ACK or BA, this field indicates
  2124. * the RSSI of the received ACK or BA frame.
  2125. * When the frame is removed as result of a direct
  2126. * remove command from the SW, this field is set
  2127. * to 0x0 (which is never a valid value when real
  2128. * RSSI is available).
  2129. * Units: dB w.r.t noise floor
  2130. */
  2131. A_UINT32
  2132. sw_peer_id: 16,
  2133. tid_num: 5,
  2134. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2135. * and tid_num fields contain valid data.
  2136. * If this "valid" flag is not set, the
  2137. * sw_peer_id and tid_num fields must be ignored.
  2138. */
  2139. mcast: 1,
  2140. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2141. * contains valid data.
  2142. */
  2143. reserved0: 8;
  2144. A_UINT32
  2145. reserved1: 32;
  2146. } POSTPACK;
  2147. /* DWORD 4 */
  2148. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2149. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2150. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2151. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2152. /* DWORD 5 */
  2153. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2154. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2155. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2156. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2157. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2158. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2159. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2160. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2161. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2162. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2163. /* DWORD 4 */
  2164. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2165. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2166. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2167. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2171. } while (0)
  2172. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2173. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2174. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2175. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2179. } while (0)
  2180. /* DWORD 5 */
  2181. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2182. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2183. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2184. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2188. } while (0)
  2189. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2190. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2191. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2192. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2195. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2196. } while (0)
  2197. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2198. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2199. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2200. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2201. do { \
  2202. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2203. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2204. } while (0)
  2205. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2206. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2207. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2208. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2209. do { \
  2210. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2211. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2212. } while (0)
  2213. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2214. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2215. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2216. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2217. do { \
  2218. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2219. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2220. } while (0)
  2221. /**
  2222. * @brief HTT TX WBM reinject status from firmware to host
  2223. * @details
  2224. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2225. * (WBM) offload HW.
  2226. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2227. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2228. */
  2229. PREPACK struct htt_tx_wbm_reinject_status {
  2230. A_UINT32
  2231. reserved0: 32;
  2232. A_UINT32
  2233. reserved1: 32;
  2234. A_UINT32
  2235. reserved2: 32;
  2236. } POSTPACK;
  2237. /**
  2238. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2239. * @details
  2240. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2241. * (WBM) offload HW.
  2242. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2243. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2244. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2245. * STA side.
  2246. */
  2247. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2248. A_UINT32
  2249. mec_sa_addr_31_0;
  2250. A_UINT32
  2251. mec_sa_addr_47_32: 16,
  2252. sa_ast_index: 16;
  2253. A_UINT32
  2254. vdev_id: 8,
  2255. reserved0: 24;
  2256. } POSTPACK;
  2257. /* DWORD 4 - mec_sa_addr_31_0 */
  2258. /* DWORD 5 */
  2259. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2260. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2261. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2262. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2263. /* DWORD 6 */
  2264. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2265. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2266. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2267. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2268. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2269. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2273. } while (0)
  2274. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2276. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2277. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2281. } while (0)
  2282. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2283. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2284. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2285. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2289. } while (0)
  2290. typedef enum {
  2291. TX_FLOW_PRIORITY_BE,
  2292. TX_FLOW_PRIORITY_HIGH,
  2293. TX_FLOW_PRIORITY_LOW,
  2294. } htt_tx_flow_priority_t;
  2295. typedef enum {
  2296. TX_FLOW_LATENCY_SENSITIVE,
  2297. TX_FLOW_LATENCY_INSENSITIVE,
  2298. } htt_tx_flow_latency_t;
  2299. typedef enum {
  2300. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2301. TX_FLOW_INTERACTIVE_TRAFFIC,
  2302. TX_FLOW_PERIODIC_TRAFFIC,
  2303. TX_FLOW_BURSTY_TRAFFIC,
  2304. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2305. } htt_tx_flow_traffic_pattern_t;
  2306. /**
  2307. * @brief HTT TX Flow search metadata format
  2308. * @details
  2309. * Host will set this metadata in flow table's flow search entry along with
  2310. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2311. * firmware and TQM ring if the flow search entry wins.
  2312. * This metadata is available to firmware in that first MSDU's
  2313. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2314. * to one of the available flows for specific tid and returns the tqm flow
  2315. * pointer as part of htt_tx_map_flow_info message.
  2316. */
  2317. PREPACK struct htt_tx_flow_metadata {
  2318. A_UINT32
  2319. rsvd0_1_0: 2,
  2320. tid: 4,
  2321. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2322. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2323. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2324. * Else choose final tid based on latency, priority.
  2325. */
  2326. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2327. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2328. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2329. } POSTPACK;
  2330. /* DWORD 0 */
  2331. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2332. #define HTT_TX_FLOW_METADATA_TID_S 2
  2333. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2334. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2335. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2336. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2337. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2338. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2339. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2340. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2341. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2342. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2343. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2344. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2345. /* DWORD 0 */
  2346. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2347. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2348. HTT_TX_FLOW_METADATA_TID_S)
  2349. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2350. do { \
  2351. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2352. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2353. } while (0)
  2354. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2355. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2356. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2357. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2358. do { \
  2359. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2360. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2361. } while (0)
  2362. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2363. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2364. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2365. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2369. } while (0)
  2370. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2371. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2372. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2373. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2374. do { \
  2375. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2376. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2377. } while (0)
  2378. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2379. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2380. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2381. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2382. do { \
  2383. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2384. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2385. } while (0)
  2386. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2387. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2388. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2389. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2390. do { \
  2391. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2392. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2393. } while (0)
  2394. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2395. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2396. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2397. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2398. do { \
  2399. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2400. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2401. } while (0)
  2402. /**
  2403. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2404. *
  2405. * @details
  2406. * HTT wds entry from source port learning
  2407. * Host will learn wds entries from rx and send this message to firmware
  2408. * to enable firmware to configure/delete AST entries for wds clients.
  2409. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2410. * and when SA's entry is deleted, firmware removes this AST entry
  2411. *
  2412. * The message would appear as follows:
  2413. *
  2414. * |31 30|29 |17 16|15 8|7 0|
  2415. * |----------------+----------------+----------------+----------------|
  2416. * | rsvd0 |PDVID| vdev_id | msg_type |
  2417. * |-------------------------------------------------------------------|
  2418. * | sa_addr_31_0 |
  2419. * |-------------------------------------------------------------------|
  2420. * | | ta_peer_id | sa_addr_47_32 |
  2421. * |-------------------------------------------------------------------|
  2422. * Where PDVID = pdev_id
  2423. *
  2424. * The message is interpreted as follows:
  2425. *
  2426. * dword0 - b'0:7 - msg_type: This will be set to
  2427. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2428. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2429. *
  2430. * dword0 - b'8:15 - vdev_id
  2431. *
  2432. * dword0 - b'16:17 - pdev_id
  2433. *
  2434. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2435. *
  2436. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2437. *
  2438. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2439. *
  2440. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2441. */
  2442. PREPACK struct htt_wds_entry {
  2443. A_UINT32
  2444. msg_type: 8,
  2445. vdev_id: 8,
  2446. pdev_id: 2,
  2447. rsvd0: 14;
  2448. A_UINT32 sa_addr_31_0;
  2449. A_UINT32
  2450. sa_addr_47_32: 16,
  2451. ta_peer_id: 14,
  2452. rsvd2: 2;
  2453. } POSTPACK;
  2454. /* DWORD 0 */
  2455. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2456. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2457. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2458. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2459. /* DWORD 2 */
  2460. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2461. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2462. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2463. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2464. /* DWORD 0 */
  2465. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2466. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2467. HTT_WDS_ENTRY_VDEV_ID_S)
  2468. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2471. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2472. } while (0)
  2473. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2474. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2475. HTT_WDS_ENTRY_PDEV_ID_S)
  2476. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2479. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2480. } while (0)
  2481. /* DWORD 2 */
  2482. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2483. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2484. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2485. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2486. do { \
  2487. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2488. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2489. } while (0)
  2490. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2491. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2492. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2493. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2494. do { \
  2495. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2496. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2497. } while (0)
  2498. /**
  2499. * @brief MAC DMA rx ring setup specification
  2500. * @details
  2501. * To allow for dynamic rx ring reconfiguration and to avoid race
  2502. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2503. * it uses. Instead, it sends this message to the target, indicating how
  2504. * the rx ring used by the host should be set up and maintained.
  2505. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2506. * specifications.
  2507. *
  2508. * |31 16|15 8|7 0|
  2509. * |---------------------------------------------------------------|
  2510. * header: | reserved | num rings | msg type |
  2511. * |---------------------------------------------------------------|
  2512. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2513. #if HTT_PADDR64
  2514. * | FW_IDX shadow register physical address (bits 63:32) |
  2515. #endif
  2516. * |---------------------------------------------------------------|
  2517. * | rx ring base physical address (bits 31:0) |
  2518. #if HTT_PADDR64
  2519. * | rx ring base physical address (bits 63:32) |
  2520. #endif
  2521. * |---------------------------------------------------------------|
  2522. * | rx ring buffer size | rx ring length |
  2523. * |---------------------------------------------------------------|
  2524. * | FW_IDX initial value | enabled flags |
  2525. * |---------------------------------------------------------------|
  2526. * | MSDU payload offset | 802.11 header offset |
  2527. * |---------------------------------------------------------------|
  2528. * | PPDU end offset | PPDU start offset |
  2529. * |---------------------------------------------------------------|
  2530. * | MPDU end offset | MPDU start offset |
  2531. * |---------------------------------------------------------------|
  2532. * | MSDU end offset | MSDU start offset |
  2533. * |---------------------------------------------------------------|
  2534. * | frag info offset | rx attention offset |
  2535. * |---------------------------------------------------------------|
  2536. * payload 2, if present, has the same format as payload 1
  2537. * Header fields:
  2538. * - MSG_TYPE
  2539. * Bits 7:0
  2540. * Purpose: identifies this as an rx ring configuration message
  2541. * Value: 0x2
  2542. * - NUM_RINGS
  2543. * Bits 15:8
  2544. * Purpose: indicates whether the host is setting up one rx ring or two
  2545. * Value: 1 or 2
  2546. * Payload:
  2547. * for systems using 64-bit format for bus addresses:
  2548. * - IDX_SHADOW_REG_PADDR_LO
  2549. * Bits 31:0
  2550. * Value: lower 4 bytes of physical address of the host's
  2551. * FW_IDX shadow register
  2552. * - IDX_SHADOW_REG_PADDR_HI
  2553. * Bits 31:0
  2554. * Value: upper 4 bytes of physical address of the host's
  2555. * FW_IDX shadow register
  2556. * - RING_BASE_PADDR_LO
  2557. * Bits 31:0
  2558. * Value: lower 4 bytes of physical address of the host's rx ring
  2559. * - RING_BASE_PADDR_HI
  2560. * Bits 31:0
  2561. * Value: uppper 4 bytes of physical address of the host's rx ring
  2562. * for systems using 32-bit format for bus addresses:
  2563. * - IDX_SHADOW_REG_PADDR
  2564. * Bits 31:0
  2565. * Value: physical address of the host's FW_IDX shadow register
  2566. * - RING_BASE_PADDR
  2567. * Bits 31:0
  2568. * Value: physical address of the host's rx ring
  2569. * - RING_LEN
  2570. * Bits 15:0
  2571. * Value: number of elements in the rx ring
  2572. * - RING_BUF_SZ
  2573. * Bits 31:16
  2574. * Value: size of the buffers referenced by the rx ring, in byte units
  2575. * - ENABLED_FLAGS
  2576. * Bits 15:0
  2577. * Value: 1-bit flags to show whether different rx fields are enabled
  2578. * bit 0: 802.11 header enabled (1) or disabled (0)
  2579. * bit 1: MSDU payload enabled (1) or disabled (0)
  2580. * bit 2: PPDU start enabled (1) or disabled (0)
  2581. * bit 3: PPDU end enabled (1) or disabled (0)
  2582. * bit 4: MPDU start enabled (1) or disabled (0)
  2583. * bit 5: MPDU end enabled (1) or disabled (0)
  2584. * bit 6: MSDU start enabled (1) or disabled (0)
  2585. * bit 7: MSDU end enabled (1) or disabled (0)
  2586. * bit 8: rx attention enabled (1) or disabled (0)
  2587. * bit 9: frag info enabled (1) or disabled (0)
  2588. * bit 10: unicast rx enabled (1) or disabled (0)
  2589. * bit 11: multicast rx enabled (1) or disabled (0)
  2590. * bit 12: ctrl rx enabled (1) or disabled (0)
  2591. * bit 13: mgmt rx enabled (1) or disabled (0)
  2592. * bit 14: null rx enabled (1) or disabled (0)
  2593. * bit 15: phy data rx enabled (1) or disabled (0)
  2594. * - IDX_INIT_VAL
  2595. * Bits 31:16
  2596. * Purpose: Specify the initial value for the FW_IDX.
  2597. * Value: the number of buffers initially present in the host's rx ring
  2598. * - OFFSET_802_11_HDR
  2599. * Bits 15:0
  2600. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2601. * - OFFSET_MSDU_PAYLOAD
  2602. * Bits 31:16
  2603. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2604. * - OFFSET_PPDU_START
  2605. * Bits 15:0
  2606. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2607. * - OFFSET_PPDU_END
  2608. * Bits 31:16
  2609. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2610. * - OFFSET_MPDU_START
  2611. * Bits 15:0
  2612. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2613. * - OFFSET_MPDU_END
  2614. * Bits 31:16
  2615. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2616. * - OFFSET_MSDU_START
  2617. * Bits 15:0
  2618. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2619. * - OFFSET_MSDU_END
  2620. * Bits 31:16
  2621. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2622. * - OFFSET_RX_ATTN
  2623. * Bits 15:0
  2624. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2625. * - OFFSET_FRAG_INFO
  2626. * Bits 31:16
  2627. * Value: offset in QUAD-bytes of frag info table
  2628. */
  2629. /* header fields */
  2630. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2631. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2632. /* payload fields */
  2633. /* for systems using a 64-bit format for bus addresses */
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2635. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2636. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2638. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2639. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2642. /* for systems using a 32-bit format for bus addresses */
  2643. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2644. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2645. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2646. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2647. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2648. #define HTT_RX_RING_CFG_LEN_S 0
  2649. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2650. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2651. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2652. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2653. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2654. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2655. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2656. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2657. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2658. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2659. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2660. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2661. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2662. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2663. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2664. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2665. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2666. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2667. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2668. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2669. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2670. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2671. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2672. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2673. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2674. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2675. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2676. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2677. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2678. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2679. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2680. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2681. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2682. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2683. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2684. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2685. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2686. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2687. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2688. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2689. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2690. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2691. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2692. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2693. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2694. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2695. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2696. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2697. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2698. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2699. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2700. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2701. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2702. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2703. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2704. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2705. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2706. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2707. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2708. #if HTT_PADDR64
  2709. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2710. #else
  2711. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2712. #endif
  2713. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2714. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2715. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2716. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2717. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2718. do { \
  2719. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2720. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2721. } while (0)
  2722. /* degenerate case for 32-bit fields */
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2725. ((_var) = (_val))
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2727. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2728. ((_var) = (_val))
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2730. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2731. ((_var) = (_val))
  2732. /* degenerate case for 32-bit fields */
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2735. ((_var) = (_val))
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2737. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2738. ((_var) = (_val))
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2740. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2741. ((_var) = (_val))
  2742. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2743. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2744. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2747. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2748. } while (0)
  2749. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2750. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2751. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2754. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2755. } while (0)
  2756. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2757. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2758. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2759. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2762. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2763. } while (0)
  2764. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2765. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2766. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2767. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2770. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2771. } while (0)
  2772. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2773. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2774. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2775. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2778. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2779. } while (0)
  2780. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2781. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2782. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2783. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2784. do { \
  2785. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2786. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2787. } while (0)
  2788. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2789. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2790. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2791. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2792. do { \
  2793. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2794. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2795. } while (0)
  2796. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2797. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2798. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2799. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2800. do { \
  2801. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2802. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2803. } while (0)
  2804. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2805. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2806. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2807. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2808. do { \
  2809. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2810. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2811. } while (0)
  2812. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2813. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2814. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2815. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2816. do { \
  2817. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2818. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2819. } while (0)
  2820. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2821. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2822. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2823. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2824. do { \
  2825. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2826. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2827. } while (0)
  2828. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2829. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2830. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2831. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2832. do { \
  2833. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2834. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2835. } while (0)
  2836. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2837. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2838. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2839. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2840. do { \
  2841. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2842. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2843. } while (0)
  2844. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2845. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2846. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2847. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2848. do { \
  2849. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2850. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2851. } while (0)
  2852. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2853. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2854. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2855. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2858. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2859. } while (0)
  2860. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2861. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2862. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2863. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2866. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2867. } while (0)
  2868. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2869. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2870. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2871. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2874. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2875. } while (0)
  2876. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2877. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2878. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2879. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2882. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2883. } while (0)
  2884. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2885. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2886. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2887. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2890. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2891. } while (0)
  2892. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2893. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2894. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2895. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2898. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2899. } while (0)
  2900. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2901. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2902. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2903. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2906. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2907. } while (0)
  2908. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2909. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2910. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2911. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2914. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2915. } while (0)
  2916. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2917. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2918. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2919. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2920. do { \
  2921. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2922. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2923. } while (0)
  2924. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2925. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2926. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2927. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2928. do { \
  2929. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2930. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2931. } while (0)
  2932. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2933. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2934. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2935. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2936. do { \
  2937. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2938. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2939. } while (0)
  2940. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2941. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2942. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2943. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2944. do { \
  2945. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2946. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2947. } while (0)
  2948. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2949. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2950. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2951. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2952. do { \
  2953. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2954. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2955. } while (0)
  2956. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2957. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2958. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2959. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2960. do { \
  2961. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2962. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2963. } while (0)
  2964. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2965. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2966. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2967. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2970. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2971. } while (0)
  2972. /**
  2973. * @brief host -> target FW statistics retrieve
  2974. *
  2975. * @details
  2976. * The following field definitions describe the format of the HTT host
  2977. * to target FW stats retrieve message. The message specifies the type of
  2978. * stats host wants to retrieve.
  2979. *
  2980. * |31 24|23 16|15 8|7 0|
  2981. * |-----------------------------------------------------------|
  2982. * | stats types request bitmask | msg type |
  2983. * |-----------------------------------------------------------|
  2984. * | stats types reset bitmask | reserved |
  2985. * |-----------------------------------------------------------|
  2986. * | stats type | config value |
  2987. * |-----------------------------------------------------------|
  2988. * | cookie LSBs |
  2989. * |-----------------------------------------------------------|
  2990. * | cookie MSBs |
  2991. * |-----------------------------------------------------------|
  2992. * Header fields:
  2993. * - MSG_TYPE
  2994. * Bits 7:0
  2995. * Purpose: identifies this is a stats upload request message
  2996. * Value: 0x3
  2997. * - UPLOAD_TYPES
  2998. * Bits 31:8
  2999. * Purpose: identifies which types of FW statistics to upload
  3000. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3001. * - RESET_TYPES
  3002. * Bits 31:8
  3003. * Purpose: identifies which types of FW statistics to reset
  3004. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3005. * - CFG_VAL
  3006. * Bits 23:0
  3007. * Purpose: give an opaque configuration value to the specified stats type
  3008. * Value: stats-type specific configuration value
  3009. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3010. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3011. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3012. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3013. * - CFG_STAT_TYPE
  3014. * Bits 31:24
  3015. * Purpose: specify which stats type (if any) the config value applies to
  3016. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3017. * a valid configuration specification
  3018. * - COOKIE_LSBS
  3019. * Bits 31:0
  3020. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3021. * message with its preceding host->target stats request message.
  3022. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3023. * - COOKIE_MSBS
  3024. * Bits 31:0
  3025. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3026. * message with its preceding host->target stats request message.
  3027. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3028. */
  3029. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3030. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3031. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3032. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3033. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3034. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3035. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3036. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3037. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3038. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3039. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3040. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3041. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3042. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3045. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3046. } while (0)
  3047. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3048. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3049. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3050. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3051. do { \
  3052. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3053. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3054. } while (0)
  3055. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3056. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3057. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3058. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3059. do { \
  3060. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3061. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3062. } while (0)
  3063. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3064. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3065. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3066. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3067. do { \
  3068. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3069. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3070. } while (0)
  3071. /**
  3072. * @brief host -> target HTT out-of-band sync request
  3073. *
  3074. * @details
  3075. * The HTT SYNC tells the target to suspend processing of subsequent
  3076. * HTT host-to-target messages until some other target agent locally
  3077. * informs the target HTT FW that the current sync counter is equal to
  3078. * or greater than (in a modulo sense) the sync counter specified in
  3079. * the SYNC message.
  3080. * This allows other host-target components to synchronize their operation
  3081. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3082. * security key has been downloaded to and activated by the target.
  3083. * In the absence of any explicit synchronization counter value
  3084. * specification, the target HTT FW will use zero as the default current
  3085. * sync value.
  3086. *
  3087. * |31 24|23 16|15 8|7 0|
  3088. * |-----------------------------------------------------------|
  3089. * | reserved | sync count | msg type |
  3090. * |-----------------------------------------------------------|
  3091. * Header fields:
  3092. * - MSG_TYPE
  3093. * Bits 7:0
  3094. * Purpose: identifies this as a sync message
  3095. * Value: 0x4
  3096. * - SYNC_COUNT
  3097. * Bits 15:8
  3098. * Purpose: specifies what sync value the HTT FW will wait for from
  3099. * an out-of-band specification to resume its operation
  3100. * Value: in-band sync counter value to compare against the out-of-band
  3101. * counter spec.
  3102. * The HTT target FW will suspend its host->target message processing
  3103. * as long as
  3104. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3105. */
  3106. #define HTT_H2T_SYNC_MSG_SZ 4
  3107. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3108. #define HTT_H2T_SYNC_COUNT_S 8
  3109. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3110. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3111. HTT_H2T_SYNC_COUNT_S)
  3112. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3113. do { \
  3114. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3115. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3116. } while (0)
  3117. /**
  3118. * @brief HTT aggregation configuration
  3119. */
  3120. #define HTT_AGGR_CFG_MSG_SZ 4
  3121. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3122. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3125. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3126. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3127. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3128. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3131. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3132. } while (0)
  3133. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3134. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3135. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3136. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3137. do { \
  3138. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3139. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3140. } while (0)
  3141. /**
  3142. * @brief host -> target HTT configure max amsdu info per vdev
  3143. *
  3144. * @details
  3145. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3146. *
  3147. * |31 21|20 16|15 8|7 0|
  3148. * |-----------------------------------------------------------|
  3149. * | reserved | vdev id | max amsdu | msg type |
  3150. * |-----------------------------------------------------------|
  3151. * Header fields:
  3152. * - MSG_TYPE
  3153. * Bits 7:0
  3154. * Purpose: identifies this as a aggr cfg ex message
  3155. * Value: 0xa
  3156. * - MAX_NUM_AMSDU_SUBFRM
  3157. * Bits 15:8
  3158. * Purpose: max MSDUs per A-MSDU
  3159. * - VDEV_ID
  3160. * Bits 20:16
  3161. * Purpose: ID of the vdev to which this limit is applied
  3162. */
  3163. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3164. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3165. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3166. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3167. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3168. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3169. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3170. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3171. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3172. do { \
  3173. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3174. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3175. } while (0)
  3176. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3177. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3178. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3179. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3180. do { \
  3181. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3182. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3183. } while (0)
  3184. /**
  3185. * @brief HTT WDI_IPA Config Message
  3186. *
  3187. * @details
  3188. * The HTT WDI_IPA config message is created/sent by host at driver
  3189. * init time. It contains information about data structures used on
  3190. * WDI_IPA TX and RX path.
  3191. * TX CE ring is used for pushing packet metadata from IPA uC
  3192. * to WLAN FW
  3193. * TX Completion ring is used for generating TX completions from
  3194. * WLAN FW to IPA uC
  3195. * RX Indication ring is used for indicating RX packets from FW
  3196. * to IPA uC
  3197. * RX Ring2 is used as either completion ring or as second
  3198. * indication ring. when Ring2 is used as completion ring, IPA uC
  3199. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3200. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3201. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3202. * indicated in RX Indication ring. Please see WDI_IPA specification
  3203. * for more details.
  3204. * |31 24|23 16|15 8|7 0|
  3205. * |----------------+----------------+----------------+----------------|
  3206. * | tx pkt pool size | Rsvd | msg_type |
  3207. * |-------------------------------------------------------------------|
  3208. * | tx comp ring base (bits 31:0) |
  3209. #if HTT_PADDR64
  3210. * | tx comp ring base (bits 63:32) |
  3211. #endif
  3212. * |-------------------------------------------------------------------|
  3213. * | tx comp ring size |
  3214. * |-------------------------------------------------------------------|
  3215. * | tx comp WR_IDX physical address (bits 31:0) |
  3216. #if HTT_PADDR64
  3217. * | tx comp WR_IDX physical address (bits 63:32) |
  3218. #endif
  3219. * |-------------------------------------------------------------------|
  3220. * | tx CE WR_IDX physical address (bits 31:0) |
  3221. #if HTT_PADDR64
  3222. * | tx CE WR_IDX physical address (bits 63:32) |
  3223. #endif
  3224. * |-------------------------------------------------------------------|
  3225. * | rx indication ring base (bits 31:0) |
  3226. #if HTT_PADDR64
  3227. * | rx indication ring base (bits 63:32) |
  3228. #endif
  3229. * |-------------------------------------------------------------------|
  3230. * | rx indication ring size |
  3231. * |-------------------------------------------------------------------|
  3232. * | rx ind RD_IDX physical address (bits 31:0) |
  3233. #if HTT_PADDR64
  3234. * | rx ind RD_IDX physical address (bits 63:32) |
  3235. #endif
  3236. * |-------------------------------------------------------------------|
  3237. * | rx ind WR_IDX physical address (bits 31:0) |
  3238. #if HTT_PADDR64
  3239. * | rx ind WR_IDX physical address (bits 63:32) |
  3240. #endif
  3241. * |-------------------------------------------------------------------|
  3242. * |-------------------------------------------------------------------|
  3243. * | rx ring2 base (bits 31:0) |
  3244. #if HTT_PADDR64
  3245. * | rx ring2 base (bits 63:32) |
  3246. #endif
  3247. * |-------------------------------------------------------------------|
  3248. * | rx ring2 size |
  3249. * |-------------------------------------------------------------------|
  3250. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3251. #if HTT_PADDR64
  3252. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3253. #endif
  3254. * |-------------------------------------------------------------------|
  3255. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3256. #if HTT_PADDR64
  3257. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3258. #endif
  3259. * |-------------------------------------------------------------------|
  3260. *
  3261. * Header fields:
  3262. * Header fields:
  3263. * - MSG_TYPE
  3264. * Bits 7:0
  3265. * Purpose: Identifies this as WDI_IPA config message
  3266. * value: = 0x8
  3267. * - TX_PKT_POOL_SIZE
  3268. * Bits 15:0
  3269. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3270. * WDI_IPA TX path
  3271. * For systems using 32-bit format for bus addresses:
  3272. * - TX_COMP_RING_BASE_ADDR
  3273. * Bits 31:0
  3274. * Purpose: TX Completion Ring base address in DDR
  3275. * - TX_COMP_RING_SIZE
  3276. * Bits 31:0
  3277. * Purpose: TX Completion Ring size (must be power of 2)
  3278. * - TX_COMP_WR_IDX_ADDR
  3279. * Bits 31:0
  3280. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3281. * updates the Write Index for WDI_IPA TX completion ring
  3282. * - TX_CE_WR_IDX_ADDR
  3283. * Bits 31:0
  3284. * Purpose: DDR address where IPA uC
  3285. * updates the WR Index for TX CE ring
  3286. * (needed for fusion platforms)
  3287. * - RX_IND_RING_BASE_ADDR
  3288. * Bits 31:0
  3289. * Purpose: RX Indication Ring base address in DDR
  3290. * - RX_IND_RING_SIZE
  3291. * Bits 31:0
  3292. * Purpose: RX Indication Ring size
  3293. * - RX_IND_RD_IDX_ADDR
  3294. * Bits 31:0
  3295. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3296. * RX indication ring
  3297. * - RX_IND_WR_IDX_ADDR
  3298. * Bits 31:0
  3299. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3300. * updates the Write Index for WDI_IPA RX indication ring
  3301. * - RX_RING2_BASE_ADDR
  3302. * Bits 31:0
  3303. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3304. * - RX_RING2_SIZE
  3305. * Bits 31:0
  3306. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3307. * - RX_RING2_RD_IDX_ADDR
  3308. * Bits 31:0
  3309. * Purpose: If Second RX ring is Indication ring, DDR address where
  3310. * IPA uC updates the Read Index for Ring2.
  3311. * If Second RX ring is completion ring, this is NOT used
  3312. * - RX_RING2_WR_IDX_ADDR
  3313. * Bits 31:0
  3314. * Purpose: If Second RX ring is Indication ring, DDR address where
  3315. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3316. * If second RX ring is completion ring, DDR address where
  3317. * IPA uC updates the Write Index for Ring 2.
  3318. * For systems using 64-bit format for bus addresses:
  3319. * - TX_COMP_RING_BASE_ADDR_LO
  3320. * Bits 31:0
  3321. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3322. * - TX_COMP_RING_BASE_ADDR_HI
  3323. * Bits 31:0
  3324. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3325. * - TX_COMP_RING_SIZE
  3326. * Bits 31:0
  3327. * Purpose: TX Completion Ring size (must be power of 2)
  3328. * - TX_COMP_WR_IDX_ADDR_LO
  3329. * Bits 31:0
  3330. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3331. * Lower 4 bytes of DDR address where WIFI FW
  3332. * updates the Write Index for WDI_IPA TX completion ring
  3333. * - TX_COMP_WR_IDX_ADDR_HI
  3334. * Bits 31:0
  3335. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3336. * Higher 4 bytes of DDR address where WIFI FW
  3337. * updates the Write Index for WDI_IPA TX completion ring
  3338. * - TX_CE_WR_IDX_ADDR_LO
  3339. * Bits 31:0
  3340. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3341. * updates the WR Index for TX CE ring
  3342. * (needed for fusion platforms)
  3343. * - TX_CE_WR_IDX_ADDR_HI
  3344. * Bits 31:0
  3345. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3346. * updates the WR Index for TX CE ring
  3347. * (needed for fusion platforms)
  3348. * - RX_IND_RING_BASE_ADDR_LO
  3349. * Bits 31:0
  3350. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3351. * - RX_IND_RING_BASE_ADDR_HI
  3352. * Bits 31:0
  3353. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3354. * - RX_IND_RING_SIZE
  3355. * Bits 31:0
  3356. * Purpose: RX Indication Ring size
  3357. * - RX_IND_RD_IDX_ADDR_LO
  3358. * Bits 31:0
  3359. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3360. * for WDI_IPA RX indication ring
  3361. * - RX_IND_RD_IDX_ADDR_HI
  3362. * Bits 31:0
  3363. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3364. * for WDI_IPA RX indication ring
  3365. * - RX_IND_WR_IDX_ADDR_LO
  3366. * Bits 31:0
  3367. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3368. * Lower 4 bytes of DDR address where WIFI FW
  3369. * updates the Write Index for WDI_IPA RX indication ring
  3370. * - RX_IND_WR_IDX_ADDR_HI
  3371. * Bits 31:0
  3372. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3373. * Higher 4 bytes of DDR address where WIFI FW
  3374. * updates the Write Index for WDI_IPA RX indication ring
  3375. * - RX_RING2_BASE_ADDR_LO
  3376. * Bits 31:0
  3377. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3378. * - RX_RING2_BASE_ADDR_HI
  3379. * Bits 31:0
  3380. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3381. * - RX_RING2_SIZE
  3382. * Bits 31:0
  3383. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3384. * - RX_RING2_RD_IDX_ADDR_LO
  3385. * Bits 31:0
  3386. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3387. * DDR address where IPA uC updates the Read Index for Ring2.
  3388. * If Second RX ring is completion ring, this is NOT used
  3389. * - RX_RING2_RD_IDX_ADDR_HI
  3390. * Bits 31:0
  3391. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3392. * DDR address where IPA uC updates the Read Index for Ring2.
  3393. * If Second RX ring is completion ring, this is NOT used
  3394. * - RX_RING2_WR_IDX_ADDR_LO
  3395. * Bits 31:0
  3396. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3397. * DDR address where WIFI FW updates the Write Index
  3398. * for WDI_IPA RX ring2
  3399. * If second RX ring is completion ring, lower 4 bytes of
  3400. * DDR address where IPA uC updates the Write Index for Ring 2.
  3401. * - RX_RING2_WR_IDX_ADDR_HI
  3402. * Bits 31:0
  3403. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3404. * DDR address where WIFI FW updates the Write Index
  3405. * for WDI_IPA RX ring2
  3406. * If second RX ring is completion ring, higher 4 bytes of
  3407. * DDR address where IPA uC updates the Write Index for Ring 2.
  3408. */
  3409. #if HTT_PADDR64
  3410. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3411. #else
  3412. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3413. #endif
  3414. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3415. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3434. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3449. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3451. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3454. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3455. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3476. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3477. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3478. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3481. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3482. } while (0)
  3483. /* for systems using 32-bit format for bus addr */
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3485. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3489. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3490. } while (0)
  3491. /* for systems using 64-bit format for bus addr */
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3493. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3497. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3498. } while (0)
  3499. /* for systems using 64-bit format for bus addr */
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3501. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3505. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3506. } while (0)
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3508. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3512. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3513. } while (0)
  3514. /* for systems using 32-bit format for bus addr */
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3516. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3520. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3521. } while (0)
  3522. /* for systems using 64-bit format for bus addr */
  3523. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3524. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3525. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3528. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3529. } while (0)
  3530. /* for systems using 64-bit format for bus addr */
  3531. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3532. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3533. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3536. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3537. } while (0)
  3538. /* for systems using 32-bit format for bus addr */
  3539. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3540. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3541. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3544. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3545. } while (0)
  3546. /* for systems using 64-bit format for bus addr */
  3547. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3548. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3549. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3552. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3553. } while (0)
  3554. /* for systems using 64-bit format for bus addr */
  3555. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3556. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3557. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3560. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3561. } while (0)
  3562. /* for systems using 32-bit format for bus addr */
  3563. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3564. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3565. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3568. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3569. } while (0)
  3570. /* for systems using 64-bit format for bus addr */
  3571. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3572. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3573. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3576. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3577. } while (0)
  3578. /* for systems using 64-bit format for bus addr */
  3579. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3580. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3584. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3585. } while (0)
  3586. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3588. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3592. } while (0)
  3593. /* for systems using 32-bit format for bus addr */
  3594. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3595. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3596. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3599. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3600. } while (0)
  3601. /* for systems using 64-bit format for bus addr */
  3602. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3603. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3604. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3605. do { \
  3606. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3607. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3608. } while (0)
  3609. /* for systems using 64-bit format for bus addr */
  3610. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3611. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3612. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3616. } while (0)
  3617. /* for systems using 32-bit format for bus addr */
  3618. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3619. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3620. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3623. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3624. } while (0)
  3625. /* for systems using 64-bit format for bus addr */
  3626. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3627. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3628. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3631. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3632. } while (0)
  3633. /* for systems using 64-bit format for bus addr */
  3634. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3635. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3636. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3637. do { \
  3638. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3639. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3640. } while (0)
  3641. /* for systems using 32-bit format for bus addr */
  3642. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3643. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3645. do { \
  3646. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3647. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3648. } while (0)
  3649. /* for systems using 64-bit format for bus addr */
  3650. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3651. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3652. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3653. do { \
  3654. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3655. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3656. } while (0)
  3657. /* for systems using 64-bit format for bus addr */
  3658. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3659. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3660. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3661. do { \
  3662. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3663. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3664. } while (0)
  3665. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3666. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3670. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3671. } while (0)
  3672. /* for systems using 32-bit format for bus addr */
  3673. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3674. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3675. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3678. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3679. } while (0)
  3680. /* for systems using 64-bit format for bus addr */
  3681. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3682. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3683. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3686. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3687. } while (0)
  3688. /* for systems using 64-bit format for bus addr */
  3689. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3690. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3691. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3694. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3695. } while (0)
  3696. /* for systems using 32-bit format for bus addr */
  3697. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3698. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3700. do { \
  3701. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3702. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3703. } while (0)
  3704. /* for systems using 64-bit format for bus addr */
  3705. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3706. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3708. do { \
  3709. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3710. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3711. } while (0)
  3712. /* for systems using 64-bit format for bus addr */
  3713. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3714. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3716. do { \
  3717. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3718. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3719. } while (0)
  3720. /*
  3721. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3722. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3723. * addresses are stored in a XXX-bit field.
  3724. * This macro is used to define both htt_wdi_ipa_config32_t and
  3725. * htt_wdi_ipa_config64_t structs.
  3726. */
  3727. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3728. _paddr__tx_comp_ring_base_addr_, \
  3729. _paddr__tx_comp_wr_idx_addr_, \
  3730. _paddr__tx_ce_wr_idx_addr_, \
  3731. _paddr__rx_ind_ring_base_addr_, \
  3732. _paddr__rx_ind_rd_idx_addr_, \
  3733. _paddr__rx_ind_wr_idx_addr_, \
  3734. _paddr__rx_ring2_base_addr_,\
  3735. _paddr__rx_ring2_rd_idx_addr_,\
  3736. _paddr__rx_ring2_wr_idx_addr_) \
  3737. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3738. { \
  3739. /* DWORD 0: flags and meta-data */ \
  3740. A_UINT32 \
  3741. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3742. reserved: 8, \
  3743. tx_pkt_pool_size: 16;\
  3744. /* DWORD 1 */\
  3745. _paddr__tx_comp_ring_base_addr_;\
  3746. /* DWORD 2 (or 3)*/\
  3747. A_UINT32 tx_comp_ring_size;\
  3748. /* DWORD 3 (or 4)*/\
  3749. _paddr__tx_comp_wr_idx_addr_;\
  3750. /* DWORD 4 (or 6)*/\
  3751. _paddr__tx_ce_wr_idx_addr_;\
  3752. /* DWORD 5 (or 8)*/\
  3753. _paddr__rx_ind_ring_base_addr_;\
  3754. /* DWORD 6 (or 10)*/\
  3755. A_UINT32 rx_ind_ring_size;\
  3756. /* DWORD 7 (or 11)*/\
  3757. _paddr__rx_ind_rd_idx_addr_;\
  3758. /* DWORD 8 (or 13)*/\
  3759. _paddr__rx_ind_wr_idx_addr_;\
  3760. /* DWORD 9 (or 15)*/\
  3761. _paddr__rx_ring2_base_addr_;\
  3762. /* DWORD 10 (or 17) */\
  3763. A_UINT32 rx_ring2_size;\
  3764. /* DWORD 11 (or 18) */\
  3765. _paddr__rx_ring2_rd_idx_addr_;\
  3766. /* DWORD 12 (or 20) */\
  3767. _paddr__rx_ring2_wr_idx_addr_;\
  3768. } POSTPACK
  3769. /* define a htt_wdi_ipa_config32_t type */
  3770. 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));
  3771. /* define a htt_wdi_ipa_config64_t type */
  3772. 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));
  3773. #if HTT_PADDR64
  3774. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3775. #else
  3776. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3777. #endif
  3778. enum htt_wdi_ipa_op_code {
  3779. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3780. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3781. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3782. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3783. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3784. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3785. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3786. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3787. /* keep this last */
  3788. HTT_WDI_IPA_OPCODE_MAX
  3789. };
  3790. /**
  3791. * @brief HTT WDI_IPA Operation Request Message
  3792. *
  3793. * @details
  3794. * HTT WDI_IPA Operation Request message is sent by host
  3795. * to either suspend or resume WDI_IPA TX or RX path.
  3796. * |31 24|23 16|15 8|7 0|
  3797. * |----------------+----------------+----------------+----------------|
  3798. * | op_code | Rsvd | msg_type |
  3799. * |-------------------------------------------------------------------|
  3800. *
  3801. * Header fields:
  3802. * - MSG_TYPE
  3803. * Bits 7:0
  3804. * Purpose: Identifies this as WDI_IPA Operation Request message
  3805. * value: = 0x9
  3806. * - OP_CODE
  3807. * Bits 31:16
  3808. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3809. * value: = enum htt_wdi_ipa_op_code
  3810. */
  3811. PREPACK struct htt_wdi_ipa_op_request_t
  3812. {
  3813. /* DWORD 0: flags and meta-data */
  3814. A_UINT32
  3815. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3816. reserved: 8,
  3817. op_code: 16;
  3818. } POSTPACK;
  3819. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3820. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3821. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3822. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3823. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3824. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3825. do { \
  3826. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3827. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3828. } while (0)
  3829. /*
  3830. * @brief host -> target HTT_SRING_SETUP message
  3831. *
  3832. * @details
  3833. * After target is booted up, Host can send SRING setup message for
  3834. * each host facing LMAC SRING. Target setups up HW registers based
  3835. * on setup message and confirms back to Host if response_required is set.
  3836. * Host should wait for confirmation message before sending new SRING
  3837. * setup message
  3838. *
  3839. * The message would appear as follows:
  3840. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3841. * |--------------- +-----------------+----------------+------------------|
  3842. * | ring_type | ring_id | pdev_id | msg_type |
  3843. * |----------------------------------------------------------------------|
  3844. * | ring_base_addr_lo |
  3845. * |----------------------------------------------------------------------|
  3846. * | ring_base_addr_hi |
  3847. * |----------------------------------------------------------------------|
  3848. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3849. * |----------------------------------------------------------------------|
  3850. * | ring_head_offset32_remote_addr_lo |
  3851. * |----------------------------------------------------------------------|
  3852. * | ring_head_offset32_remote_addr_hi |
  3853. * |----------------------------------------------------------------------|
  3854. * | ring_tail_offset32_remote_addr_lo |
  3855. * |----------------------------------------------------------------------|
  3856. * | ring_tail_offset32_remote_addr_hi |
  3857. * |----------------------------------------------------------------------|
  3858. * | ring_msi_addr_lo |
  3859. * |----------------------------------------------------------------------|
  3860. * | ring_msi_addr_hi |
  3861. * |----------------------------------------------------------------------|
  3862. * | ring_msi_data |
  3863. * |----------------------------------------------------------------------|
  3864. * | intr_timer_th |IM| intr_batch_counter_th |
  3865. * |----------------------------------------------------------------------|
  3866. * | reserved |RR|PTCF| intr_low_threshold |
  3867. * |----------------------------------------------------------------------|
  3868. * Where
  3869. * IM = sw_intr_mode
  3870. * RR = response_required
  3871. * PTCF = prefetch_timer_cfg
  3872. *
  3873. * The message is interpreted as follows:
  3874. * dword0 - b'0:7 - msg_type: This will be set to
  3875. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3876. * b'8:15 - pdev_id:
  3877. * 0 (for rings at SOC/UMAC level),
  3878. * 1/2/3 mac id (for rings at LMAC level)
  3879. * b'16:23 - ring_id: identify which ring is to setup,
  3880. * more details can be got from enum htt_srng_ring_id
  3881. * b'24:31 - ring_type: identify type of host rings,
  3882. * more details can be got from enum htt_srng_ring_type
  3883. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3884. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3885. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3886. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3887. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3888. * SW_TO_HW_RING.
  3889. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3890. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3891. * Lower 32 bits of memory address of the remote variable
  3892. * storing the 4-byte word offset that identifies the head
  3893. * element within the ring.
  3894. * (The head offset variable has type A_UINT32.)
  3895. * Valid for HW_TO_SW and SW_TO_SW rings.
  3896. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3897. * Upper 32 bits of memory address of the remote variable
  3898. * storing the 4-byte word offset that identifies the head
  3899. * element within the ring.
  3900. * (The head offset variable has type A_UINT32.)
  3901. * Valid for HW_TO_SW and SW_TO_SW rings.
  3902. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3903. * Lower 32 bits of memory address of the remote variable
  3904. * storing the 4-byte word offset that identifies the tail
  3905. * element within the ring.
  3906. * (The tail offset variable has type A_UINT32.)
  3907. * Valid for HW_TO_SW and SW_TO_SW rings.
  3908. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3909. * Upper 32 bits of memory address of the remote variable
  3910. * storing the 4-byte word offset that identifies the tail
  3911. * element within the ring.
  3912. * (The tail offset variable has type A_UINT32.)
  3913. * Valid for HW_TO_SW and SW_TO_SW rings.
  3914. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3915. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3916. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3917. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3918. * dword10 - b'0:31 - ring_msi_data: MSI data
  3919. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3920. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3921. * dword11 - b'0:14 - intr_batch_counter_th:
  3922. * batch counter threshold is in units of 4-byte words.
  3923. * HW internally maintains and increments batch count.
  3924. * (see SRING spec for detail description).
  3925. * When batch count reaches threshold value, an interrupt
  3926. * is generated by HW.
  3927. * b'15 - sw_intr_mode:
  3928. * This configuration shall be static.
  3929. * Only programmed at power up.
  3930. * 0: generate pulse style sw interrupts
  3931. * 1: generate level style sw interrupts
  3932. * b'16:31 - intr_timer_th:
  3933. * The timer init value when timer is idle or is
  3934. * initialized to start downcounting.
  3935. * In 8us units (to cover a range of 0 to 524 ms)
  3936. * dword12 - b'0:15 - intr_low_threshold:
  3937. * Used only by Consumer ring to generate ring_sw_int_p.
  3938. * Ring entries low threshold water mark, that is used
  3939. * in combination with the interrupt timer as well as
  3940. * the the clearing of the level interrupt.
  3941. * b'16:18 - prefetch_timer_cfg:
  3942. * Used only by Consumer ring to set timer mode to
  3943. * support Application prefetch handling.
  3944. * The external tail offset/pointer will be updated
  3945. * at following intervals:
  3946. * 3'b000: (Prefetch feature disabled; used only for debug)
  3947. * 3'b001: 1 usec
  3948. * 3'b010: 4 usec
  3949. * 3'b011: 8 usec (default)
  3950. * 3'b100: 16 usec
  3951. * Others: Reserverd
  3952. * b'19 - response_required:
  3953. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3954. * b'20:31 - reserved: reserved for future use
  3955. */
  3956. PREPACK struct htt_sring_setup_t {
  3957. A_UINT32 msg_type: 8,
  3958. pdev_id: 8,
  3959. ring_id: 8,
  3960. ring_type: 8;
  3961. A_UINT32 ring_base_addr_lo;
  3962. A_UINT32 ring_base_addr_hi;
  3963. A_UINT32 ring_size: 16,
  3964. ring_entry_size: 8,
  3965. ring_misc_cfg_flag: 8;
  3966. A_UINT32 ring_head_offset32_remote_addr_lo;
  3967. A_UINT32 ring_head_offset32_remote_addr_hi;
  3968. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3969. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3970. A_UINT32 ring_msi_addr_lo;
  3971. A_UINT32 ring_msi_addr_hi;
  3972. A_UINT32 ring_msi_data;
  3973. A_UINT32 intr_batch_counter_th: 15,
  3974. sw_intr_mode: 1,
  3975. intr_timer_th: 16;
  3976. A_UINT32 intr_low_threshold: 16,
  3977. prefetch_timer_cfg: 3,
  3978. response_required: 1,
  3979. reserved1: 12;
  3980. } POSTPACK;
  3981. enum htt_srng_ring_type {
  3982. HTT_HW_TO_SW_RING = 0,
  3983. HTT_SW_TO_HW_RING,
  3984. HTT_SW_TO_SW_RING,
  3985. /* Insert new ring types above this line */
  3986. };
  3987. enum htt_srng_ring_id {
  3988. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3989. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3990. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3991. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3992. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3993. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3994. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3995. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3996. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  3997. /* Add Other SRING which can't be directly configured by host software above this line */
  3998. };
  3999. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4000. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4001. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4002. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4003. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4004. HTT_SRING_SETUP_PDEV_ID_S)
  4005. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4006. do { \
  4007. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4008. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4009. } while (0)
  4010. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4011. #define HTT_SRING_SETUP_RING_ID_S 16
  4012. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4013. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4014. HTT_SRING_SETUP_RING_ID_S)
  4015. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4016. do { \
  4017. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4018. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4019. } while (0)
  4020. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4021. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4022. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4023. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4024. HTT_SRING_SETUP_RING_TYPE_S)
  4025. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4026. do { \
  4027. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4028. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4029. } while (0)
  4030. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4031. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4032. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4033. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4034. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4036. do { \
  4037. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4038. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4039. } while (0)
  4040. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4041. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4042. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4043. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4044. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4045. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4046. do { \
  4047. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4048. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4049. } while (0)
  4050. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4051. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4052. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4053. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4054. HTT_SRING_SETUP_RING_SIZE_S)
  4055. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4056. do { \
  4057. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4058. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4059. } while (0)
  4060. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4061. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4062. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4063. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4064. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4065. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4066. do { \
  4067. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4068. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4069. } while (0)
  4070. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4071. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4072. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4073. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4074. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4075. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4078. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4079. } while (0)
  4080. /* This control bit is applicable to only Producer, which updates Ring ID field
  4081. * of each descriptor before pushing into the ring.
  4082. * 0: updates ring_id(default)
  4083. * 1: ring_id updating disabled */
  4084. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4085. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4086. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4087. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4088. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4089. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4090. do { \
  4091. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4092. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4093. } while (0)
  4094. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4095. * of each descriptor before pushing into the ring.
  4096. * 0: updates Loopcnt(default)
  4097. * 1: Loopcnt updating disabled */
  4098. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4099. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4100. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4101. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4102. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4106. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4107. } while (0)
  4108. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4109. * into security_id port of GXI/AXI. */
  4110. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4111. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4112. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4113. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4114. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4118. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4119. } while (0)
  4120. /* During MSI write operation, SRNG drives value of this register bit into
  4121. * swap bit of GXI/AXI. */
  4122. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4123. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4125. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4126. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4127. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4130. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4131. } while (0)
  4132. /* During Pointer write operation, SRNG drives value of this register bit into
  4133. * swap bit of GXI/AXI. */
  4134. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4135. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4136. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4137. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4138. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4139. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4142. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4143. } while (0)
  4144. /* During any data or TLV write operation, SRNG drives value of this register
  4145. * bit into swap bit of GXI/AXI. */
  4146. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4147. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4148. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4149. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4150. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4151. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4154. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4155. } while (0)
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4158. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4159. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4160. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4161. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4162. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4164. do { \
  4165. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4166. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4167. } while (0)
  4168. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4169. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4170. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4171. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4172. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4173. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4176. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4177. } while (0)
  4178. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4179. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4180. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4181. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4182. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4184. do { \
  4185. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4186. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4187. } while (0)
  4188. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4189. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4190. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4191. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4192. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4193. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4196. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4197. } while (0)
  4198. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4199. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4200. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4201. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4202. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4206. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4207. } while (0)
  4208. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4209. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4210. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4211. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4212. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4213. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4216. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4217. } while (0)
  4218. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4219. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4220. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4221. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4222. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4223. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4226. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4227. } while (0)
  4228. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4229. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4230. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4231. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4232. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4233. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4236. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4237. } while (0)
  4238. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4239. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4240. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4241. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4242. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4243. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4246. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4247. } while (0)
  4248. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4249. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4250. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4251. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4252. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4253. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4256. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4257. } while (0)
  4258. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4259. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4260. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4261. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4262. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4263. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4266. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4267. } while (0)
  4268. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4269. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4270. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4271. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4272. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4273. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4276. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4277. } while (0)
  4278. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4279. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4280. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4281. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4282. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4283. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4286. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4287. } while (0)
  4288. /**
  4289. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4290. *
  4291. * @details
  4292. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4293. * configure RXDMA rings.
  4294. * The configuration is per ring based and includes both packet subtypes
  4295. * and PPDU/MPDU TLVs.
  4296. *
  4297. * The message would appear as follows:
  4298. *
  4299. * |31 26|25|24|23 16|15 8|7 0|
  4300. * |-----------------+----------------+----------------+---------------|
  4301. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4302. * |-------------------------------------------------------------------|
  4303. * | rsvd2 | ring_buffer_size |
  4304. * |-------------------------------------------------------------------|
  4305. * | packet_type_enable_flags_0 |
  4306. * |-------------------------------------------------------------------|
  4307. * | packet_type_enable_flags_1 |
  4308. * |-------------------------------------------------------------------|
  4309. * | packet_type_enable_flags_2 |
  4310. * |-------------------------------------------------------------------|
  4311. * | packet_type_enable_flags_3 |
  4312. * |-------------------------------------------------------------------|
  4313. * | tlv_filter_in_flags |
  4314. * |-------------------------------------------------------------------|
  4315. * Where:
  4316. * PS = pkt_swap
  4317. * SS = status_swap
  4318. * The message is interpreted as follows:
  4319. * dword0 - b'0:7 - msg_type: This will be set to
  4320. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4321. * b'8:15 - pdev_id:
  4322. * 0 (for rings at SOC/UMAC level),
  4323. * 1/2/3 mac id (for rings at LMAC level)
  4324. * b'16:23 - ring_id : Identify the ring to configure.
  4325. * More details can be got from enum htt_srng_ring_id
  4326. * b'24 - status_swap: 1 is to swap status TLV
  4327. * b'25 - pkt_swap: 1 is to swap packet TLV
  4328. * b'26:31 - rsvd1: reserved for future use
  4329. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4330. * in byte units.
  4331. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4332. * - b'16:31 - rsvd2: Reserved for future use
  4333. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4334. * Enable MGMT packet from 0b0000 to 0b1001
  4335. * bits from low to high: FP, MD, MO - 3 bits
  4336. * FP: Filter_Pass
  4337. * MD: Monitor_Direct
  4338. * MO: Monitor_Other
  4339. * 10 mgmt subtypes * 3 bits -> 30 bits
  4340. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4341. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4342. * Enable MGMT packet from 0b1010 to 0b1111
  4343. * bits from low to high: FP, MD, MO - 3 bits
  4344. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4345. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4346. * Enable CTRL packet from 0b0000 to 0b1001
  4347. * bits from low to high: FP, MD, MO - 3 bits
  4348. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4349. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4350. * Enable CTRL packet from 0b1010 to 0b1111,
  4351. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4352. * bits from low to high: FP, MD, MO - 3 bits
  4353. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4354. * dword6 - b'0:31 - tlv_filter_in_flags:
  4355. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4356. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4357. */
  4358. PREPACK struct htt_rx_ring_selection_cfg_t {
  4359. A_UINT32 msg_type: 8,
  4360. pdev_id: 8,
  4361. ring_id: 8,
  4362. status_swap: 1,
  4363. pkt_swap: 1,
  4364. rsvd1: 6;
  4365. A_UINT32 ring_buffer_size: 16,
  4366. rsvd2: 16;
  4367. A_UINT32 packet_type_enable_flags_0;
  4368. A_UINT32 packet_type_enable_flags_1;
  4369. A_UINT32 packet_type_enable_flags_2;
  4370. A_UINT32 packet_type_enable_flags_3;
  4371. A_UINT32 tlv_filter_in_flags;
  4372. } POSTPACK;
  4373. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4374. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4375. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4376. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4377. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4378. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4379. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4380. do { \
  4381. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4382. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4383. } while (0)
  4384. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4385. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4386. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4387. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4388. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4389. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4390. do { \
  4391. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4392. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4393. } while (0)
  4394. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4395. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4396. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4397. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4398. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4399. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4400. do { \
  4401. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4402. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4403. } while (0)
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4407. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4408. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4410. do { \
  4411. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4412. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4413. } while (0)
  4414. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4415. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4417. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4418. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4419. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4420. do { \
  4421. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4422. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4423. } while (0)
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4427. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4428. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4430. do { \
  4431. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4432. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4433. } while (0)
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4437. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4438. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4440. do { \
  4441. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4442. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4443. } while (0)
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4447. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4448. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4450. do { \
  4451. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4452. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4453. } while (0)
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4457. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4458. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4460. do { \
  4461. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4462. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4463. } while (0)
  4464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4467. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4468. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4470. do { \
  4471. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4472. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4473. } while (0)
  4474. /*
  4475. * Subtype based MGMT frames enable bits.
  4476. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4477. */
  4478. /* association request */
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4485. /* association response */
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4492. /* Reassociation request */
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4499. /* Reassociation response */
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4506. /* Probe request */
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4513. /* Probe response */
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4520. /* Timing Advertisement */
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4527. /* Reserved */
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4534. /* Beacon */
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4541. /* ATIM */
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4548. /* Disassociation */
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4555. /* Authentication */
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4562. /* Deauthentication */
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4569. /* Action */
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4576. /* Action No Ack */
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4583. /* Reserved */
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4590. /*
  4591. * Subtype based CTRL frames enable bits.
  4592. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4593. */
  4594. /* Reserved */
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4601. /* Reserved */
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4608. /* Reserved */
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4615. /* Reserved */
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4622. /* Reserved */
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4629. /* Reserved */
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4636. /* Reserved */
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4643. /* Control Wrapper */
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4650. /* Block Ack Request */
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4657. /* Block Ack*/
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4664. /* PS-POLL */
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4671. /* RTS */
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4678. /* CTS */
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4685. /* ACK */
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4692. /* CF-END */
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4699. /* CF-END + CF-ACK */
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4706. /* Multicast data */
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4713. /* Unicast data */
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4720. /* NULL data */
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4728. do { \
  4729. HTT_CHECK_SET_VAL(httsym, value); \
  4730. (word) |= (value) << httsym##_S; \
  4731. } while (0)
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4733. (((word) & httsym##_M) >> httsym##_S)
  4734. #define htt_rx_ring_pkt_enable_subtype_set( \
  4735. word, flag, mode, type, subtype, val) \
  4736. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4737. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4738. #define htt_rx_ring_pkt_enable_subtype_get( \
  4739. word, flag, mode, type, subtype) \
  4740. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4741. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4742. /* Definition to filter in TLVs */
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4763. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4764. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4765. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4766. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4767. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4768. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4769. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4770. do { \
  4771. HTT_CHECK_SET_VAL(httsym, enable); \
  4772. (word) |= (enable) << httsym##_S; \
  4773. } while (0)
  4774. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4775. (((word) & httsym##_M) >> httsym##_S)
  4776. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4777. HTT_RX_RING_TLV_ENABLE_SET( \
  4778. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4779. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4780. HTT_RX_RING_TLV_ENABLE_GET( \
  4781. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4782. /**
  4783. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4784. * host --> target Receive Flow Steering configuration message definition.
  4785. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4786. * The reason for this is we want RFS to be configured and ready before MAC
  4787. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4788. *
  4789. * |31 24|23 16|15 9|8|7 0|
  4790. * |----------------+----------------+----------------+----------------|
  4791. * | reserved |E| msg type |
  4792. * |-------------------------------------------------------------------|
  4793. * Where E = RFS enable flag
  4794. *
  4795. * The RFS_CONFIG message consists of a single 4-byte word.
  4796. *
  4797. * Header fields:
  4798. * - MSG_TYPE
  4799. * Bits 7:0
  4800. * Purpose: identifies this as a RFS config msg
  4801. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4802. * - RFS_CONFIG
  4803. * Bit 8
  4804. * Purpose: Tells target whether to enable (1) or disable (0)
  4805. * flow steering feature when sending rx indication messages to host
  4806. */
  4807. #define HTT_H2T_RFS_CONFIG_M 0x100
  4808. #define HTT_H2T_RFS_CONFIG_S 8
  4809. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4810. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4811. HTT_H2T_RFS_CONFIG_S)
  4812. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4815. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4816. } while (0)
  4817. #define HTT_RFS_CFG_REQ_BYTES 4
  4818. /**
  4819. * @brief host -> target FW extended statistics retrieve
  4820. *
  4821. * @details
  4822. * The following field definitions describe the format of the HTT host
  4823. * to target FW extended stats retrieve message.
  4824. * The message specifies the type of stats the host wants to retrieve.
  4825. *
  4826. * |31 24|23 16|15 8|7 0|
  4827. * |-----------------------------------------------------------|
  4828. * | reserved | stats type | pdev_mask | msg type |
  4829. * |-----------------------------------------------------------|
  4830. * | config param [0] |
  4831. * |-----------------------------------------------------------|
  4832. * | config param [1] |
  4833. * |-----------------------------------------------------------|
  4834. * | config param [2] |
  4835. * |-----------------------------------------------------------|
  4836. * | config param [3] |
  4837. * |-----------------------------------------------------------|
  4838. * | reserved |
  4839. * |-----------------------------------------------------------|
  4840. * | cookie LSBs |
  4841. * |-----------------------------------------------------------|
  4842. * | cookie MSBs |
  4843. * |-----------------------------------------------------------|
  4844. * Header fields:
  4845. * - MSG_TYPE
  4846. * Bits 7:0
  4847. * Purpose: identifies this is a extended stats upload request message
  4848. * Value: 0x10
  4849. * - PDEV_MASK
  4850. * Bits 8:15
  4851. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4852. * Value: This is a overloaded field, refer to usage and interpretation of
  4853. * PDEV in interface document.
  4854. * Bit 8 : Reserved for SOC stats
  4855. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4856. * Indicates MACID_MASK in DBS
  4857. * - STATS_TYPE
  4858. * Bits 23:16
  4859. * Purpose: identifies which FW statistics to upload
  4860. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4861. * - Reserved
  4862. * Bits 31:24
  4863. * - CONFIG_PARAM [0]
  4864. * Bits 31:0
  4865. * Purpose: give an opaque configuration value to the specified stats type
  4866. * Value: stats-type specific configuration value
  4867. * Refer to htt_stats.h for interpretation for each stats sub_type
  4868. * - CONFIG_PARAM [1]
  4869. * Bits 31:0
  4870. * Purpose: give an opaque configuration value to the specified stats type
  4871. * Value: stats-type specific configuration value
  4872. * Refer to htt_stats.h for interpretation for each stats sub_type
  4873. * - CONFIG_PARAM [2]
  4874. * Bits 31:0
  4875. * Purpose: give an opaque configuration value to the specified stats type
  4876. * Value: stats-type specific configuration value
  4877. * Refer to htt_stats.h for interpretation for each stats sub_type
  4878. * - CONFIG_PARAM [3]
  4879. * Bits 31:0
  4880. * Purpose: give an opaque configuration value to the specified stats type
  4881. * Value: stats-type specific configuration value
  4882. * Refer to htt_stats.h for interpretation for each stats sub_type
  4883. * - Reserved [31:0] for future use.
  4884. * - COOKIE_LSBS
  4885. * Bits 31:0
  4886. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4887. * message with its preceding host->target stats request message.
  4888. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4889. * - COOKIE_MSBS
  4890. * Bits 31:0
  4891. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4892. * message with its preceding host->target stats request message.
  4893. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4894. */
  4895. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4896. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4897. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4898. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4899. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4900. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4901. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4902. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4903. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4904. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4905. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4906. do { \
  4907. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4908. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4909. } while (0)
  4910. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4911. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4912. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4913. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4914. do { \
  4915. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4916. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4917. } while (0)
  4918. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4919. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4920. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4921. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4922. do { \
  4923. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4924. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4925. } while (0)
  4926. /**
  4927. * @brief host -> target FW PPDU_STATS request message
  4928. *
  4929. * @details
  4930. * The following field definitions describe the format of the HTT host
  4931. * to target FW for PPDU_STATS_CFG msg.
  4932. * The message allows the host to configure the PPDU_STATS_IND messages
  4933. * produced by the target.
  4934. *
  4935. * |31 24|23 16|15 8|7 0|
  4936. * |-----------------------------------------------------------|
  4937. * | REQ bit mask | pdev_mask | msg type |
  4938. * |-----------------------------------------------------------|
  4939. * Header fields:
  4940. * - MSG_TYPE
  4941. * Bits 7:0
  4942. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4943. * Value: 0x11
  4944. * - PDEV_MASK
  4945. * Bits 8:15
  4946. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4947. * Value: This is a overloaded field, refer to usage and interpretation of
  4948. * PDEV in interface document.
  4949. * Bit 8 : Reserved for SOC stats
  4950. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4951. * Indicates MACID_MASK in DBS
  4952. * - REQ_TLV_BIT_MASK
  4953. * Bits 16:31
  4954. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4955. * needs to be included in the target's PPDU_STATS_IND messages.
  4956. * Value: refer htt_ppdu_stats_tlv_tag_t
  4957. *
  4958. */
  4959. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4960. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4961. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4962. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4963. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4964. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4965. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4966. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4967. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4968. do { \
  4969. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4970. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4971. } while (0)
  4972. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4973. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4974. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4975. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4976. do { \
  4977. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4978. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4979. } while (0)
  4980. /*=== target -> host messages ===============================================*/
  4981. enum htt_t2h_msg_type {
  4982. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4983. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4984. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4985. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4986. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4987. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4988. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4989. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4990. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4991. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4992. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4993. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4994. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4995. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4996. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4997. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4998. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4999. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5000. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5001. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5002. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5003. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5004. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5005. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5006. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5007. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5008. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5009. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5010. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5011. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5012. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5013. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5014. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5015. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5016. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5017. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5018. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5019. HTT_T2H_MSG_TYPE_TEST,
  5020. /* keep this last */
  5021. HTT_T2H_NUM_MSGS
  5022. };
  5023. /*
  5024. * HTT target to host message type -
  5025. * stored in bits 7:0 of the first word of the message
  5026. */
  5027. #define HTT_T2H_MSG_TYPE_M 0xff
  5028. #define HTT_T2H_MSG_TYPE_S 0
  5029. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5030. do { \
  5031. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5032. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5033. } while (0)
  5034. #define HTT_T2H_MSG_TYPE_GET(word) \
  5035. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5036. /**
  5037. * @brief target -> host version number confirmation message definition
  5038. *
  5039. * |31 24|23 16|15 8|7 0|
  5040. * |----------------+----------------+----------------+----------------|
  5041. * | reserved | major number | minor number | msg type |
  5042. * |-------------------------------------------------------------------|
  5043. * : option request TLV (optional) |
  5044. * :...................................................................:
  5045. *
  5046. * The VER_CONF message may consist of a single 4-byte word, or may be
  5047. * extended with TLVs that specify HTT options selected by the target.
  5048. * The following option TLVs may be appended to the VER_CONF message:
  5049. * - LL_BUS_ADDR_SIZE
  5050. * - HL_SUPPRESS_TX_COMPL_IND
  5051. * - MAX_TX_QUEUE_GROUPS
  5052. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5053. * may be appended to the VER_CONF message (but only one TLV of each type).
  5054. *
  5055. * Header fields:
  5056. * - MSG_TYPE
  5057. * Bits 7:0
  5058. * Purpose: identifies this as a version number confirmation message
  5059. * Value: 0x0
  5060. * - VER_MINOR
  5061. * Bits 15:8
  5062. * Purpose: Specify the minor number of the HTT message library version
  5063. * in use by the target firmware.
  5064. * The minor number specifies the specific revision within a range
  5065. * of fundamentally compatible HTT message definition revisions.
  5066. * Compatible revisions involve adding new messages or perhaps
  5067. * adding new fields to existing messages, in a backwards-compatible
  5068. * manner.
  5069. * Incompatible revisions involve changing the message type values,
  5070. * or redefining existing messages.
  5071. * Value: minor number
  5072. * - VER_MAJOR
  5073. * Bits 15:8
  5074. * Purpose: Specify the major number of the HTT message library version
  5075. * in use by the target firmware.
  5076. * The major number specifies the family of minor revisions that are
  5077. * fundamentally compatible with each other, but not with prior or
  5078. * later families.
  5079. * Value: major number
  5080. */
  5081. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5082. #define HTT_VER_CONF_MINOR_S 8
  5083. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5084. #define HTT_VER_CONF_MAJOR_S 16
  5085. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5086. do { \
  5087. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5088. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5089. } while (0)
  5090. #define HTT_VER_CONF_MINOR_GET(word) \
  5091. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5092. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5093. do { \
  5094. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5095. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5096. } while (0)
  5097. #define HTT_VER_CONF_MAJOR_GET(word) \
  5098. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5099. #define HTT_VER_CONF_BYTES 4
  5100. /**
  5101. * @brief - target -> host HTT Rx In order indication message
  5102. *
  5103. * @details
  5104. *
  5105. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5106. * |----------------+-------------------+---------------------+---------------|
  5107. * | peer ID | P| F| O| ext TID | msg type |
  5108. * |--------------------------------------------------------------------------|
  5109. * | MSDU count | Reserved | vdev id |
  5110. * |--------------------------------------------------------------------------|
  5111. * | MSDU 0 bus address (bits 31:0) |
  5112. #if HTT_PADDR64
  5113. * | MSDU 0 bus address (bits 63:32) |
  5114. #endif
  5115. * |--------------------------------------------------------------------------|
  5116. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5117. * |--------------------------------------------------------------------------|
  5118. * | MSDU 1 bus address (bits 31:0) |
  5119. #if HTT_PADDR64
  5120. * | MSDU 1 bus address (bits 63:32) |
  5121. #endif
  5122. * |--------------------------------------------------------------------------|
  5123. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5124. * |--------------------------------------------------------------------------|
  5125. */
  5126. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5127. *
  5128. * @details
  5129. * bits
  5130. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5131. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5132. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5133. * | | frag | | | | fail |chksum fail|
  5134. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5135. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5136. */
  5137. struct htt_rx_in_ord_paddr_ind_hdr_t
  5138. {
  5139. A_UINT32 /* word 0 */
  5140. msg_type: 8,
  5141. ext_tid: 5,
  5142. offload: 1,
  5143. frag: 1,
  5144. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5145. peer_id: 16;
  5146. A_UINT32 /* word 1 */
  5147. vap_id: 8,
  5148. reserved_1: 8,
  5149. msdu_cnt: 16;
  5150. };
  5151. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5152. {
  5153. A_UINT32 dma_addr;
  5154. A_UINT32
  5155. length: 16,
  5156. fw_desc: 8,
  5157. msdu_info:8;
  5158. };
  5159. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5160. {
  5161. A_UINT32 dma_addr_lo;
  5162. A_UINT32 dma_addr_hi;
  5163. A_UINT32
  5164. length: 16,
  5165. fw_desc: 8,
  5166. msdu_info:8;
  5167. };
  5168. #if HTT_PADDR64
  5169. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5170. #else
  5171. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5172. #endif
  5173. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5174. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5177. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5178. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5179. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5180. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5182. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5183. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5184. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5185. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5186. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5187. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5188. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5189. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5190. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5191. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5192. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5193. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5194. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5197. /* for systems using 64-bit format for bus addresses */
  5198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5199. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5200. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5201. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5202. /* for systems using 32-bit format for bus addresses */
  5203. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5204. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5205. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5206. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5207. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5208. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5209. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5210. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5211. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5212. do { \
  5213. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5214. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5215. } while (0)
  5216. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5217. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5218. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5219. do { \
  5220. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5221. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5222. } while (0)
  5223. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5224. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5225. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5228. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5229. } while (0)
  5230. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5231. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5232. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5235. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5236. } while (0)
  5237. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5238. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5239. /* for systems using 64-bit format for bus addresses */
  5240. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5241. do { \
  5242. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5243. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5244. } while (0)
  5245. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5246. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5247. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5248. do { \
  5249. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5250. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5251. } while (0)
  5252. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5253. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5254. /* for systems using 32-bit format for bus addresses */
  5255. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5256. do { \
  5257. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5258. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5259. } while (0)
  5260. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5261. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5262. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5263. do { \
  5264. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5265. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5266. } while (0)
  5267. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5268. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5269. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5270. do { \
  5271. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5272. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5273. } while (0)
  5274. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5275. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5276. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5277. do { \
  5278. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5279. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5280. } while (0)
  5281. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5282. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5283. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5284. do { \
  5285. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5286. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5287. } while (0)
  5288. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5289. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5290. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5291. do { \
  5292. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5293. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5294. } while (0)
  5295. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5296. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5297. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5298. do { \
  5299. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5300. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5301. } while (0)
  5302. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5303. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5304. /* definitions used within target -> host rx indication message */
  5305. PREPACK struct htt_rx_ind_hdr_prefix_t
  5306. {
  5307. A_UINT32 /* word 0 */
  5308. msg_type: 8,
  5309. ext_tid: 5,
  5310. release_valid: 1,
  5311. flush_valid: 1,
  5312. reserved0: 1,
  5313. peer_id: 16;
  5314. A_UINT32 /* word 1 */
  5315. flush_start_seq_num: 6,
  5316. flush_end_seq_num: 6,
  5317. release_start_seq_num: 6,
  5318. release_end_seq_num: 6,
  5319. num_mpdu_ranges: 8;
  5320. } POSTPACK;
  5321. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5322. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5323. #define HTT_TGT_RSSI_INVALID 0x80
  5324. PREPACK struct htt_rx_ppdu_desc_t
  5325. {
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5328. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5329. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5330. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5331. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5332. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5333. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5334. A_UINT32 /* word 0 */
  5335. rssi_cmb: 8,
  5336. timestamp_submicrosec: 8,
  5337. phy_err_code: 8,
  5338. phy_err: 1,
  5339. legacy_rate: 4,
  5340. legacy_rate_sel: 1,
  5341. end_valid: 1,
  5342. start_valid: 1;
  5343. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5344. union {
  5345. A_UINT32 /* word 1 */
  5346. rssi0_pri20: 8,
  5347. rssi0_ext20: 8,
  5348. rssi0_ext40: 8,
  5349. rssi0_ext80: 8;
  5350. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5351. } u0;
  5352. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5353. union {
  5354. A_UINT32 /* word 2 */
  5355. rssi1_pri20: 8,
  5356. rssi1_ext20: 8,
  5357. rssi1_ext40: 8,
  5358. rssi1_ext80: 8;
  5359. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5360. } u1;
  5361. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5362. union {
  5363. A_UINT32 /* word 3 */
  5364. rssi2_pri20: 8,
  5365. rssi2_ext20: 8,
  5366. rssi2_ext40: 8,
  5367. rssi2_ext80: 8;
  5368. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5369. } u2;
  5370. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5371. union {
  5372. A_UINT32 /* word 4 */
  5373. rssi3_pri20: 8,
  5374. rssi3_ext20: 8,
  5375. rssi3_ext40: 8,
  5376. rssi3_ext80: 8;
  5377. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5378. } u3;
  5379. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5380. A_UINT32 tsf32; /* word 5 */
  5381. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5382. A_UINT32 timestamp_microsec; /* word 6 */
  5383. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5384. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5385. A_UINT32 /* word 7 */
  5386. vht_sig_a1: 24,
  5387. preamble_type: 8;
  5388. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5389. A_UINT32 /* word 8 */
  5390. vht_sig_a2: 24,
  5391. reserved0: 8;
  5392. } POSTPACK;
  5393. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5394. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5395. PREPACK struct htt_rx_ind_hdr_suffix_t
  5396. {
  5397. A_UINT32 /* word 0 */
  5398. fw_rx_desc_bytes: 16,
  5399. reserved0: 16;
  5400. } POSTPACK;
  5401. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5402. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5403. PREPACK struct htt_rx_ind_hdr_t
  5404. {
  5405. struct htt_rx_ind_hdr_prefix_t prefix;
  5406. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5407. struct htt_rx_ind_hdr_suffix_t suffix;
  5408. } POSTPACK;
  5409. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5410. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5411. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5412. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5413. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5414. /*
  5415. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5416. * the offset into the HTT rx indication message at which the
  5417. * FW rx PPDU descriptor resides
  5418. */
  5419. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5420. /*
  5421. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5422. * the offset into the HTT rx indication message at which the
  5423. * header suffix (FW rx MSDU byte count) resides
  5424. */
  5425. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5426. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5427. /*
  5428. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5429. * the offset into the HTT rx indication message at which the per-MSDU
  5430. * information starts
  5431. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5432. * per-MSDU information portion of the message. The per-MSDU info itself
  5433. * starts at byte 12.
  5434. */
  5435. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5436. /**
  5437. * @brief target -> host rx indication message definition
  5438. *
  5439. * @details
  5440. * The following field definitions describe the format of the rx indication
  5441. * message sent from the target to the host.
  5442. * The message consists of three major sections:
  5443. * 1. a fixed-length header
  5444. * 2. a variable-length list of firmware rx MSDU descriptors
  5445. * 3. one or more 4-octet MPDU range information elements
  5446. * The fixed length header itself has two sub-sections
  5447. * 1. the message meta-information, including identification of the
  5448. * sender and type of the received data, and a 4-octet flush/release IE
  5449. * 2. the firmware rx PPDU descriptor
  5450. *
  5451. * The format of the message is depicted below.
  5452. * in this depiction, the following abbreviations are used for information
  5453. * elements within the message:
  5454. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5455. * elements associated with the PPDU start are valid.
  5456. * Specifically, the following fields are valid only if SV is set:
  5457. * RSSI (all variants), L, legacy rate, preamble type, service,
  5458. * VHT-SIG-A
  5459. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5460. * elements associated with the PPDU end are valid.
  5461. * Specifically, the following fields are valid only if EV is set:
  5462. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5463. * - L - Legacy rate selector - if legacy rates are used, this flag
  5464. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5465. * (L == 0) PHY.
  5466. * - P - PHY error flag - boolean indication of whether the rx frame had
  5467. * a PHY error
  5468. *
  5469. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5470. * |----------------+-------------------+---------------------+---------------|
  5471. * | peer ID | |RV|FV| ext TID | msg type |
  5472. * |--------------------------------------------------------------------------|
  5473. * | num | release | release | flush | flush |
  5474. * | MPDU | end | start | end | start |
  5475. * | ranges | seq num | seq num | seq num | seq num |
  5476. * |==========================================================================|
  5477. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5478. * |V|V| | rate | | | timestamp | RSSI |
  5479. * |--------------------------------------------------------------------------|
  5480. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5481. * |--------------------------------------------------------------------------|
  5482. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5483. * |--------------------------------------------------------------------------|
  5484. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5485. * |--------------------------------------------------------------------------|
  5486. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5487. * |--------------------------------------------------------------------------|
  5488. * | TSF LSBs |
  5489. * |--------------------------------------------------------------------------|
  5490. * | microsec timestamp |
  5491. * |--------------------------------------------------------------------------|
  5492. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5493. * |--------------------------------------------------------------------------|
  5494. * | service | HT-SIG / VHT-SIG-A2 |
  5495. * |==========================================================================|
  5496. * | reserved | FW rx desc bytes |
  5497. * |--------------------------------------------------------------------------|
  5498. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5499. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5500. * |--------------------------------------------------------------------------|
  5501. * : : :
  5502. * |--------------------------------------------------------------------------|
  5503. * | alignment | MSDU Rx |
  5504. * | padding | desc Bn |
  5505. * |--------------------------------------------------------------------------|
  5506. * | reserved | MPDU range status | MPDU count |
  5507. * |--------------------------------------------------------------------------|
  5508. * : reserved : MPDU range status : MPDU count :
  5509. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5510. *
  5511. * Header fields:
  5512. * - MSG_TYPE
  5513. * Bits 7:0
  5514. * Purpose: identifies this as an rx indication message
  5515. * Value: 0x1
  5516. * - EXT_TID
  5517. * Bits 12:8
  5518. * Purpose: identify the traffic ID of the rx data, including
  5519. * special "extended" TID values for multicast, broadcast, and
  5520. * non-QoS data frames
  5521. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5522. * - FLUSH_VALID (FV)
  5523. * Bit 13
  5524. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5525. * is valid
  5526. * Value:
  5527. * 1 -> flush IE is valid and needs to be processed
  5528. * 0 -> flush IE is not valid and should be ignored
  5529. * - REL_VALID (RV)
  5530. * Bit 13
  5531. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5532. * is valid
  5533. * Value:
  5534. * 1 -> release IE is valid and needs to be processed
  5535. * 0 -> release IE is not valid and should be ignored
  5536. * - PEER_ID
  5537. * Bits 31:16
  5538. * Purpose: Identify, by ID, which peer sent the rx data
  5539. * Value: ID of the peer who sent the rx data
  5540. * - FLUSH_SEQ_NUM_START
  5541. * Bits 5:0
  5542. * Purpose: Indicate the start of a series of MPDUs to flush
  5543. * Not all MPDUs within this series are necessarily valid - the host
  5544. * must check each sequence number within this range to see if the
  5545. * corresponding MPDU is actually present.
  5546. * This field is only valid if the FV bit is set.
  5547. * Value:
  5548. * The sequence number for the first MPDUs to check to flush.
  5549. * The sequence number is masked by 0x3f.
  5550. * - FLUSH_SEQ_NUM_END
  5551. * Bits 11:6
  5552. * Purpose: Indicate the end of a series of MPDUs to flush
  5553. * Value:
  5554. * The sequence number one larger than the sequence number of the
  5555. * last MPDU to check to flush.
  5556. * The sequence number is masked by 0x3f.
  5557. * Not all MPDUs within this series are necessarily valid - the host
  5558. * must check each sequence number within this range to see if the
  5559. * corresponding MPDU is actually present.
  5560. * This field is only valid if the FV bit is set.
  5561. * - REL_SEQ_NUM_START
  5562. * Bits 17:12
  5563. * Purpose: Indicate the start of a series of MPDUs to release.
  5564. * All MPDUs within this series are present and valid - the host
  5565. * need not check each sequence number within this range to see if
  5566. * the corresponding MPDU is actually present.
  5567. * This field is only valid if the RV bit is set.
  5568. * Value:
  5569. * The sequence number for the first MPDUs to check to release.
  5570. * The sequence number is masked by 0x3f.
  5571. * - REL_SEQ_NUM_END
  5572. * Bits 23:18
  5573. * Purpose: Indicate the end of a series of MPDUs to release.
  5574. * Value:
  5575. * The sequence number one larger than the sequence number of the
  5576. * last MPDU to check to release.
  5577. * The sequence number is masked by 0x3f.
  5578. * All MPDUs within this series are present and valid - the host
  5579. * need not check each sequence number within this range to see if
  5580. * the corresponding MPDU is actually present.
  5581. * This field is only valid if the RV bit is set.
  5582. * - NUM_MPDU_RANGES
  5583. * Bits 31:24
  5584. * Purpose: Indicate how many ranges of MPDUs are present.
  5585. * Each MPDU range consists of a series of contiguous MPDUs within the
  5586. * rx frame sequence which all have the same MPDU status.
  5587. * Value: 1-63 (typically a small number, like 1-3)
  5588. *
  5589. * Rx PPDU descriptor fields:
  5590. * - RSSI_CMB
  5591. * Bits 7:0
  5592. * Purpose: Combined RSSI from all active rx chains, across the active
  5593. * bandwidth.
  5594. * Value: RSSI dB units w.r.t. noise floor
  5595. * - TIMESTAMP_SUBMICROSEC
  5596. * Bits 15:8
  5597. * Purpose: high-resolution timestamp
  5598. * Value:
  5599. * Sub-microsecond time of PPDU reception.
  5600. * This timestamp ranges from [0,MAC clock MHz).
  5601. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5602. * to form a high-resolution, large range rx timestamp.
  5603. * - PHY_ERR_CODE
  5604. * Bits 23:16
  5605. * Purpose:
  5606. * If the rx frame processing resulted in a PHY error, indicate what
  5607. * type of rx PHY error occurred.
  5608. * Value:
  5609. * This field is valid if the "P" (PHY_ERR) flag is set.
  5610. * TBD: document/specify the values for this field
  5611. * - PHY_ERR
  5612. * Bit 24
  5613. * Purpose: indicate whether the rx PPDU had a PHY error
  5614. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5615. * - LEGACY_RATE
  5616. * Bits 28:25
  5617. * Purpose:
  5618. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5619. * specify which rate was used.
  5620. * Value:
  5621. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5622. * flag.
  5623. * If LEGACY_RATE_SEL is 0:
  5624. * 0x8: OFDM 48 Mbps
  5625. * 0x9: OFDM 24 Mbps
  5626. * 0xA: OFDM 12 Mbps
  5627. * 0xB: OFDM 6 Mbps
  5628. * 0xC: OFDM 54 Mbps
  5629. * 0xD: OFDM 36 Mbps
  5630. * 0xE: OFDM 18 Mbps
  5631. * 0xF: OFDM 9 Mbps
  5632. * If LEGACY_RATE_SEL is 1:
  5633. * 0x8: CCK 11 Mbps long preamble
  5634. * 0x9: CCK 5.5 Mbps long preamble
  5635. * 0xA: CCK 2 Mbps long preamble
  5636. * 0xB: CCK 1 Mbps long preamble
  5637. * 0xC: CCK 11 Mbps short preamble
  5638. * 0xD: CCK 5.5 Mbps short preamble
  5639. * 0xE: CCK 2 Mbps short preamble
  5640. * - LEGACY_RATE_SEL
  5641. * Bit 29
  5642. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5643. * Value:
  5644. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5645. * used a legacy rate.
  5646. * 0 -> OFDM, 1 -> CCK
  5647. * - END_VALID
  5648. * Bit 30
  5649. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5650. * the start of the PPDU are valid. Specifically, the following
  5651. * fields are only valid if END_VALID is set:
  5652. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5653. * TIMESTAMP_SUBMICROSEC
  5654. * Value:
  5655. * 0 -> rx PPDU desc end fields are not valid
  5656. * 1 -> rx PPDU desc end fields are valid
  5657. * - START_VALID
  5658. * Bit 31
  5659. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5660. * the end of the PPDU are valid. Specifically, the following
  5661. * fields are only valid if START_VALID is set:
  5662. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5663. * VHT-SIG-A
  5664. * Value:
  5665. * 0 -> rx PPDU desc start fields are not valid
  5666. * 1 -> rx PPDU desc start fields are valid
  5667. * - RSSI0_PRI20
  5668. * Bits 7:0
  5669. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5670. * Value: RSSI dB units w.r.t. noise floor
  5671. *
  5672. * - RSSI0_EXT20
  5673. * Bits 7:0
  5674. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5675. * (if the rx bandwidth was >= 40 MHz)
  5676. * Value: RSSI dB units w.r.t. noise floor
  5677. * - RSSI0_EXT40
  5678. * Bits 7:0
  5679. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5680. * (if the rx bandwidth was >= 80 MHz)
  5681. * Value: RSSI dB units w.r.t. noise floor
  5682. * - RSSI0_EXT80
  5683. * Bits 7:0
  5684. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5685. * (if the rx bandwidth was >= 160 MHz)
  5686. * Value: RSSI dB units w.r.t. noise floor
  5687. *
  5688. * - RSSI1_PRI20
  5689. * Bits 7:0
  5690. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5691. * Value: RSSI dB units w.r.t. noise floor
  5692. * - RSSI1_EXT20
  5693. * Bits 7:0
  5694. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5695. * (if the rx bandwidth was >= 40 MHz)
  5696. * Value: RSSI dB units w.r.t. noise floor
  5697. * - RSSI1_EXT40
  5698. * Bits 7:0
  5699. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5700. * (if the rx bandwidth was >= 80 MHz)
  5701. * Value: RSSI dB units w.r.t. noise floor
  5702. * - RSSI1_EXT80
  5703. * Bits 7:0
  5704. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5705. * (if the rx bandwidth was >= 160 MHz)
  5706. * Value: RSSI dB units w.r.t. noise floor
  5707. *
  5708. * - RSSI2_PRI20
  5709. * Bits 7:0
  5710. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5711. * Value: RSSI dB units w.r.t. noise floor
  5712. * - RSSI2_EXT20
  5713. * Bits 7:0
  5714. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5715. * (if the rx bandwidth was >= 40 MHz)
  5716. * Value: RSSI dB units w.r.t. noise floor
  5717. * - RSSI2_EXT40
  5718. * Bits 7:0
  5719. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5720. * (if the rx bandwidth was >= 80 MHz)
  5721. * Value: RSSI dB units w.r.t. noise floor
  5722. * - RSSI2_EXT80
  5723. * Bits 7:0
  5724. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5725. * (if the rx bandwidth was >= 160 MHz)
  5726. * Value: RSSI dB units w.r.t. noise floor
  5727. *
  5728. * - RSSI3_PRI20
  5729. * Bits 7:0
  5730. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5731. * Value: RSSI dB units w.r.t. noise floor
  5732. * - RSSI3_EXT20
  5733. * Bits 7:0
  5734. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5735. * (if the rx bandwidth was >= 40 MHz)
  5736. * Value: RSSI dB units w.r.t. noise floor
  5737. * - RSSI3_EXT40
  5738. * Bits 7:0
  5739. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5740. * (if the rx bandwidth was >= 80 MHz)
  5741. * Value: RSSI dB units w.r.t. noise floor
  5742. * - RSSI3_EXT80
  5743. * Bits 7:0
  5744. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5745. * (if the rx bandwidth was >= 160 MHz)
  5746. * Value: RSSI dB units w.r.t. noise floor
  5747. *
  5748. * - TSF32
  5749. * Bits 31:0
  5750. * Purpose: specify the time the rx PPDU was received, in TSF units
  5751. * Value: 32 LSBs of the TSF
  5752. * - TIMESTAMP_MICROSEC
  5753. * Bits 31:0
  5754. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5755. * Value: PPDU rx time, in microseconds
  5756. * - VHT_SIG_A1
  5757. * Bits 23:0
  5758. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5759. * from the rx PPDU
  5760. * Value:
  5761. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5762. * VHT-SIG-A1 data.
  5763. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5764. * first 24 bits of the HT-SIG data.
  5765. * Otherwise, this field is invalid.
  5766. * Refer to the the 802.11 protocol for the definition of the
  5767. * HT-SIG and VHT-SIG-A1 fields
  5768. * - VHT_SIG_A2
  5769. * Bits 23:0
  5770. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5771. * from the rx PPDU
  5772. * Value:
  5773. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5774. * VHT-SIG-A2 data.
  5775. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5776. * last 24 bits of the HT-SIG data.
  5777. * Otherwise, this field is invalid.
  5778. * Refer to the the 802.11 protocol for the definition of the
  5779. * HT-SIG and VHT-SIG-A2 fields
  5780. * - PREAMBLE_TYPE
  5781. * Bits 31:24
  5782. * Purpose: indicate the PHY format of the received burst
  5783. * Value:
  5784. * 0x4: Legacy (OFDM/CCK)
  5785. * 0x8: HT
  5786. * 0x9: HT with TxBF
  5787. * 0xC: VHT
  5788. * 0xD: VHT with TxBF
  5789. * - SERVICE
  5790. * Bits 31:24
  5791. * Purpose: TBD
  5792. * Value: TBD
  5793. *
  5794. * Rx MSDU descriptor fields:
  5795. * - FW_RX_DESC_BYTES
  5796. * Bits 15:0
  5797. * Purpose: Indicate how many bytes in the Rx indication are used for
  5798. * FW Rx descriptors
  5799. *
  5800. * Payload fields:
  5801. * - MPDU_COUNT
  5802. * Bits 7:0
  5803. * Purpose: Indicate how many sequential MPDUs share the same status.
  5804. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5805. * - MPDU_STATUS
  5806. * Bits 15:8
  5807. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5808. * received successfully.
  5809. * Value:
  5810. * 0x1: success
  5811. * 0x2: FCS error
  5812. * 0x3: duplicate error
  5813. * 0x4: replay error
  5814. * 0x5: invalid peer
  5815. */
  5816. /* header fields */
  5817. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5818. #define HTT_RX_IND_EXT_TID_S 8
  5819. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5820. #define HTT_RX_IND_FLUSH_VALID_S 13
  5821. #define HTT_RX_IND_REL_VALID_M 0x4000
  5822. #define HTT_RX_IND_REL_VALID_S 14
  5823. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5824. #define HTT_RX_IND_PEER_ID_S 16
  5825. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5826. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5827. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5828. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5829. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5830. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5831. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5832. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5833. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5834. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5835. /* rx PPDU descriptor fields */
  5836. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5837. #define HTT_RX_IND_RSSI_CMB_S 0
  5838. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5839. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5840. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5841. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5842. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5843. #define HTT_RX_IND_PHY_ERR_S 24
  5844. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5845. #define HTT_RX_IND_LEGACY_RATE_S 25
  5846. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5847. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5848. #define HTT_RX_IND_END_VALID_M 0x40000000
  5849. #define HTT_RX_IND_END_VALID_S 30
  5850. #define HTT_RX_IND_START_VALID_M 0x80000000
  5851. #define HTT_RX_IND_START_VALID_S 31
  5852. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5853. #define HTT_RX_IND_RSSI_PRI20_S 0
  5854. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5855. #define HTT_RX_IND_RSSI_EXT20_S 8
  5856. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5857. #define HTT_RX_IND_RSSI_EXT40_S 16
  5858. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5859. #define HTT_RX_IND_RSSI_EXT80_S 24
  5860. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5861. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5862. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5863. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5864. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5865. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5866. #define HTT_RX_IND_SERVICE_M 0xff000000
  5867. #define HTT_RX_IND_SERVICE_S 24
  5868. /* rx MSDU descriptor fields */
  5869. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5870. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5871. /* payload fields */
  5872. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5873. #define HTT_RX_IND_MPDU_COUNT_S 0
  5874. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5875. #define HTT_RX_IND_MPDU_STATUS_S 8
  5876. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5879. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5880. } while (0)
  5881. #define HTT_RX_IND_EXT_TID_GET(word) \
  5882. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5883. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5884. do { \
  5885. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5886. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5887. } while (0)
  5888. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5889. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5890. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5891. do { \
  5892. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5893. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5894. } while (0)
  5895. #define HTT_RX_IND_REL_VALID_GET(word) \
  5896. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5897. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5898. do { \
  5899. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5900. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5901. } while (0)
  5902. #define HTT_RX_IND_PEER_ID_GET(word) \
  5903. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5904. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5905. do { \
  5906. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5907. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5908. } while (0)
  5909. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5910. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5911. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5912. do { \
  5913. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5914. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5915. } while (0)
  5916. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5917. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5918. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5919. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5920. do { \
  5921. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5922. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5923. } while (0)
  5924. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5925. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5926. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5927. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5928. do { \
  5929. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5930. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5931. } while (0)
  5932. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5933. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5934. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5935. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5936. do { \
  5937. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5938. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5939. } while (0)
  5940. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5941. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5942. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5943. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5944. do { \
  5945. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5946. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5947. } while (0)
  5948. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5949. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5950. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5951. /* FW rx PPDU descriptor fields */
  5952. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5953. do { \
  5954. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5955. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5956. } while (0)
  5957. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5958. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5959. HTT_RX_IND_RSSI_CMB_S)
  5960. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5961. do { \
  5962. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5963. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5964. } while (0)
  5965. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5966. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5967. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5968. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5969. do { \
  5970. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5971. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5972. } while (0)
  5973. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5974. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5975. HTT_RX_IND_PHY_ERR_CODE_S)
  5976. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5979. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5980. } while (0)
  5981. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5982. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5983. HTT_RX_IND_PHY_ERR_S)
  5984. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5987. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5988. } while (0)
  5989. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5990. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5991. HTT_RX_IND_LEGACY_RATE_S)
  5992. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5993. do { \
  5994. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5995. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5996. } while (0)
  5997. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5998. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5999. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6000. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6001. do { \
  6002. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6003. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6004. } while (0)
  6005. #define HTT_RX_IND_END_VALID_GET(word) \
  6006. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6007. HTT_RX_IND_END_VALID_S)
  6008. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6009. do { \
  6010. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6011. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6012. } while (0)
  6013. #define HTT_RX_IND_START_VALID_GET(word) \
  6014. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6015. HTT_RX_IND_START_VALID_S)
  6016. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6017. do { \
  6018. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6019. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6020. } while (0)
  6021. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6022. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6023. HTT_RX_IND_RSSI_PRI20_S)
  6024. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6025. do { \
  6026. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6027. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6028. } while (0)
  6029. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6030. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6031. HTT_RX_IND_RSSI_EXT20_S)
  6032. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6035. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6036. } while (0)
  6037. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6038. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6039. HTT_RX_IND_RSSI_EXT40_S)
  6040. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6041. do { \
  6042. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6043. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6044. } while (0)
  6045. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6046. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6047. HTT_RX_IND_RSSI_EXT80_S)
  6048. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6049. do { \
  6050. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6051. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6052. } while (0)
  6053. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6054. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6055. HTT_RX_IND_VHT_SIG_A1_S)
  6056. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6057. do { \
  6058. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6059. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6060. } while (0)
  6061. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6062. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6063. HTT_RX_IND_VHT_SIG_A2_S)
  6064. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6065. do { \
  6066. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6067. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6068. } while (0)
  6069. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6070. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6071. HTT_RX_IND_PREAMBLE_TYPE_S)
  6072. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6073. do { \
  6074. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6075. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6076. } while (0)
  6077. #define HTT_RX_IND_SERVICE_GET(word) \
  6078. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6079. HTT_RX_IND_SERVICE_S)
  6080. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6081. do { \
  6082. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6083. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6084. } while (0)
  6085. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6086. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6087. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6088. do { \
  6089. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6090. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6091. } while (0)
  6092. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6093. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6094. #define HTT_RX_IND_HL_BYTES \
  6095. (HTT_RX_IND_HDR_BYTES + \
  6096. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6097. 4 /* single MPDU range information element */)
  6098. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6099. /* Could we use one macro entry? */
  6100. #define HTT_WORD_SET(word, field, value) \
  6101. do { \
  6102. HTT_CHECK_SET_VAL(field, value); \
  6103. (word) |= ((value) << field ## _S); \
  6104. } while (0)
  6105. #define HTT_WORD_GET(word, field) \
  6106. (((word) & field ## _M) >> field ## _S)
  6107. PREPACK struct hl_htt_rx_ind_base {
  6108. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6109. } POSTPACK;
  6110. /*
  6111. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6112. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6113. * HL host needed info. The field is just after the msdu fw rx desc.
  6114. */
  6115. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6116. struct htt_rx_ind_hl_rx_desc_t {
  6117. A_UINT8 ver;
  6118. A_UINT8 len;
  6119. struct {
  6120. A_UINT8
  6121. first_msdu: 1,
  6122. last_msdu: 1,
  6123. c3_failed: 1,
  6124. c4_failed: 1,
  6125. ipv6: 1,
  6126. tcp: 1,
  6127. udp: 1,
  6128. reserved: 1;
  6129. } flags;
  6130. };
  6131. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6132. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6133. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6134. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6135. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6136. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6137. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6138. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6139. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6140. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6141. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6142. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6143. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6144. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6145. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6146. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6147. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6148. /* This structure is used in HL, the basic descriptor information
  6149. * used by host. the structure is translated by FW from HW desc
  6150. * or generated by FW. But in HL monitor mode, the host would use
  6151. * the same structure with LL.
  6152. */
  6153. PREPACK struct hl_htt_rx_desc_base {
  6154. A_UINT32
  6155. seq_num:12,
  6156. encrypted:1,
  6157. chan_info_present:1,
  6158. resv0:2,
  6159. mcast_bcast:1,
  6160. fragment:1,
  6161. key_id_oct:8,
  6162. resv1:6;
  6163. A_UINT32
  6164. pn_31_0;
  6165. union {
  6166. struct {
  6167. A_UINT16 pn_47_32;
  6168. A_UINT16 pn_63_48;
  6169. } pn16;
  6170. A_UINT32 pn_63_32;
  6171. } u0;
  6172. A_UINT32
  6173. pn_95_64;
  6174. A_UINT32
  6175. pn_127_96;
  6176. } POSTPACK;
  6177. /*
  6178. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6179. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6180. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6181. * Please see htt_chan_change_t for description of the fields.
  6182. */
  6183. PREPACK struct htt_chan_info_t
  6184. {
  6185. A_UINT32 primary_chan_center_freq_mhz: 16,
  6186. contig_chan1_center_freq_mhz: 16;
  6187. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6188. phy_mode: 8,
  6189. reserved: 8;
  6190. } POSTPACK;
  6191. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6192. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6193. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6194. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6195. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6196. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6197. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6198. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6199. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6200. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6201. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6202. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6203. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6204. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6205. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6206. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6207. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6208. /* Channel information */
  6209. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6210. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6211. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6212. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6213. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6214. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6215. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6216. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6217. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6218. do { \
  6219. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6220. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6221. } while (0)
  6222. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6223. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6224. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6225. do { \
  6226. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6227. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6228. } while (0)
  6229. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6230. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6231. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6232. do { \
  6233. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6234. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6235. } while (0)
  6236. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6237. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6238. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6239. do { \
  6240. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6241. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6242. } while (0)
  6243. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6244. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6245. /*
  6246. * @brief target -> host rx reorder flush message definition
  6247. *
  6248. * @details
  6249. * The following field definitions describe the format of the rx flush
  6250. * message sent from the target to the host.
  6251. * The message consists of a 4-octet header, followed by one or more
  6252. * 4-octet payload information elements.
  6253. *
  6254. * |31 24|23 8|7 0|
  6255. * |--------------------------------------------------------------|
  6256. * | TID | peer ID | msg type |
  6257. * |--------------------------------------------------------------|
  6258. * | seq num end | seq num start | MPDU status | reserved |
  6259. * |--------------------------------------------------------------|
  6260. * First DWORD:
  6261. * - MSG_TYPE
  6262. * Bits 7:0
  6263. * Purpose: identifies this as an rx flush message
  6264. * Value: 0x2
  6265. * - PEER_ID
  6266. * Bits 23:8 (only bits 18:8 actually used)
  6267. * Purpose: identify which peer's rx data is being flushed
  6268. * Value: (rx) peer ID
  6269. * - TID
  6270. * Bits 31:24 (only bits 27:24 actually used)
  6271. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6272. * Value: traffic identifier
  6273. * Second DWORD:
  6274. * - MPDU_STATUS
  6275. * Bits 15:8
  6276. * Purpose:
  6277. * Indicate whether the flushed MPDUs should be discarded or processed.
  6278. * Value:
  6279. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6280. * stages of rx processing
  6281. * other: discard the MPDUs
  6282. * It is anticipated that flush messages will always have
  6283. * MPDU status == 1, but the status flag is included for
  6284. * flexibility.
  6285. * - SEQ_NUM_START
  6286. * Bits 23:16
  6287. * Purpose:
  6288. * Indicate the start of a series of consecutive MPDUs being flushed.
  6289. * Not all MPDUs within this range are necessarily valid - the host
  6290. * must check each sequence number within this range to see if the
  6291. * corresponding MPDU is actually present.
  6292. * Value:
  6293. * The sequence number for the first MPDU in the sequence.
  6294. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6295. * - SEQ_NUM_END
  6296. * Bits 30:24
  6297. * Purpose:
  6298. * Indicate the end of a series of consecutive MPDUs being flushed.
  6299. * Value:
  6300. * The sequence number one larger than the sequence number of the
  6301. * last MPDU being flushed.
  6302. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6303. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6304. * are to be released for further rx processing.
  6305. * Not all MPDUs within this range are necessarily valid - the host
  6306. * must check each sequence number within this range to see if the
  6307. * corresponding MPDU is actually present.
  6308. */
  6309. /* first DWORD */
  6310. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6311. #define HTT_RX_FLUSH_PEER_ID_S 8
  6312. #define HTT_RX_FLUSH_TID_M 0xff000000
  6313. #define HTT_RX_FLUSH_TID_S 24
  6314. /* second DWORD */
  6315. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6316. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6317. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6318. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6319. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6320. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6321. #define HTT_RX_FLUSH_BYTES 8
  6322. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6323. do { \
  6324. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6325. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6326. } while (0)
  6327. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6328. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6329. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6330. do { \
  6331. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6332. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6333. } while (0)
  6334. #define HTT_RX_FLUSH_TID_GET(word) \
  6335. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6336. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6337. do { \
  6338. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6339. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6340. } while (0)
  6341. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6342. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6343. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6344. do { \
  6345. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6346. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6347. } while (0)
  6348. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6349. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6350. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6353. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6354. } while (0)
  6355. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6356. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6357. /*
  6358. * @brief target -> host rx pn check indication message
  6359. *
  6360. * @details
  6361. * The following field definitions describe the format of the Rx PN check
  6362. * indication message sent from the target to the host.
  6363. * The message consists of a 4-octet header, followed by the start and
  6364. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6365. * IE is one octet containing the sequence number that failed the PN
  6366. * check.
  6367. *
  6368. * |31 24|23 8|7 0|
  6369. * |--------------------------------------------------------------|
  6370. * | TID | peer ID | msg type |
  6371. * |--------------------------------------------------------------|
  6372. * | Reserved | PN IE count | seq num end | seq num start|
  6373. * |--------------------------------------------------------------|
  6374. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6375. * |--------------------------------------------------------------|
  6376. * First DWORD:
  6377. * - MSG_TYPE
  6378. * Bits 7:0
  6379. * Purpose: Identifies this as an rx pn check indication message
  6380. * Value: 0x2
  6381. * - PEER_ID
  6382. * Bits 23:8 (only bits 18:8 actually used)
  6383. * Purpose: identify which peer
  6384. * Value: (rx) peer ID
  6385. * - TID
  6386. * Bits 31:24 (only bits 27:24 actually used)
  6387. * Purpose: identify traffic identifier
  6388. * Value: traffic identifier
  6389. * Second DWORD:
  6390. * - SEQ_NUM_START
  6391. * Bits 7:0
  6392. * Purpose:
  6393. * Indicates the starting sequence number of the MPDU in this
  6394. * series of MPDUs that went though PN check.
  6395. * Value:
  6396. * The sequence number for the first MPDU in the sequence.
  6397. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6398. * - SEQ_NUM_END
  6399. * Bits 15:8
  6400. * Purpose:
  6401. * Indicates the ending sequence number of the MPDU in this
  6402. * series of MPDUs that went though PN check.
  6403. * Value:
  6404. * The sequence number one larger then the sequence number of the last
  6405. * MPDU being flushed.
  6406. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6407. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6408. * for invalid PN numbers and are ready to be released for further processing.
  6409. * Not all MPDUs within this range are necessarily valid - the host
  6410. * must check each sequence number within this range to see if the
  6411. * corresponding MPDU is actually present.
  6412. * - PN_IE_COUNT
  6413. * Bits 23:16
  6414. * Purpose:
  6415. * Used to determine the variable number of PN information elements in this
  6416. * message
  6417. *
  6418. * PN information elements:
  6419. * - PN_IE_x-
  6420. * Purpose:
  6421. * Each PN information element contains the sequence number of the MPDU that
  6422. * has failed the target PN check.
  6423. * Value:
  6424. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6425. * that failed the PN check.
  6426. */
  6427. /* first DWORD */
  6428. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6429. #define HTT_RX_PN_IND_PEER_ID_S 8
  6430. #define HTT_RX_PN_IND_TID_M 0xff000000
  6431. #define HTT_RX_PN_IND_TID_S 24
  6432. /* second DWORD */
  6433. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6434. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6435. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6436. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6437. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6438. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6439. #define HTT_RX_PN_IND_BYTES 8
  6440. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6441. do { \
  6442. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6443. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6444. } while (0)
  6445. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6446. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6447. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6448. do { \
  6449. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6450. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6451. } while (0)
  6452. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6453. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6454. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6457. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6458. } while (0)
  6459. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6460. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6461. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6462. do { \
  6463. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6464. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6465. } while (0)
  6466. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6467. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6468. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6469. do { \
  6470. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6471. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6472. } while (0)
  6473. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6474. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6475. /*
  6476. * @brief target -> host rx offload deliver message for LL system
  6477. *
  6478. * @details
  6479. * In a low latency system this message is sent whenever the offload
  6480. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6481. * The DMA of the actual packets into host memory is done before sending out
  6482. * this message. This message indicates only how many MSDUs to reap. The
  6483. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6484. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6485. * DMA'd by the MAC directly into host memory these packets do not contain
  6486. * the MAC descriptors in the header portion of the packet. Instead they contain
  6487. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6488. * message, the packets are delivered directly to the NW stack without going
  6489. * through the regular reorder buffering and PN checking path since it has
  6490. * already been done in target.
  6491. *
  6492. * |31 24|23 16|15 8|7 0|
  6493. * |-----------------------------------------------------------------------|
  6494. * | Total MSDU count | reserved | msg type |
  6495. * |-----------------------------------------------------------------------|
  6496. *
  6497. * @brief target -> host rx offload deliver message for HL system
  6498. *
  6499. * @details
  6500. * In a high latency system this message is sent whenever the offload manager
  6501. * flushes out the packets it has coalesced in its coalescing buffer. The
  6502. * actual packets are also carried along with this message. When the host
  6503. * receives this message, it is expected to deliver these packets to the NW
  6504. * stack directly instead of routing them through the reorder buffering and
  6505. * PN checking path since it has already been done in target.
  6506. *
  6507. * |31 24|23 16|15 8|7 0|
  6508. * |-----------------------------------------------------------------------|
  6509. * | Total MSDU count | reserved | msg type |
  6510. * |-----------------------------------------------------------------------|
  6511. * | peer ID | MSDU length |
  6512. * |-----------------------------------------------------------------------|
  6513. * | MSDU payload | FW Desc | tid | vdev ID |
  6514. * |-----------------------------------------------------------------------|
  6515. * | MSDU payload contd. |
  6516. * |-----------------------------------------------------------------------|
  6517. * | peer ID | MSDU length |
  6518. * |-----------------------------------------------------------------------|
  6519. * | MSDU payload | FW Desc | tid | vdev ID |
  6520. * |-----------------------------------------------------------------------|
  6521. * | MSDU payload contd. |
  6522. * |-----------------------------------------------------------------------|
  6523. *
  6524. */
  6525. /* first DWORD */
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6537. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6539. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6541. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6542. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6545. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6546. } while (0)
  6547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6548. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6549. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6550. do { \
  6551. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6552. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6553. } while (0)
  6554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6555. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6557. do { \
  6558. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6559. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6560. } while (0)
  6561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6562. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6564. do { \
  6565. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6566. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6567. } while (0)
  6568. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6569. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6570. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6573. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6574. } while (0)
  6575. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6576. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6577. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6578. do { \
  6579. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6580. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6581. } while (0)
  6582. /**
  6583. * @brief target -> host rx peer map/unmap message definition
  6584. *
  6585. * @details
  6586. * The following diagram shows the format of the rx peer map message sent
  6587. * from the target to the host. This layout assumes the target operates
  6588. * as little-endian.
  6589. *
  6590. * This message always contains a SW peer ID. The main purpose of the
  6591. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6592. * with, so that the host can use that peer ID to determine which peer
  6593. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6594. * other purposes, such as identifying during tx completions which peer
  6595. * the tx frames in question were transmitted to.
  6596. *
  6597. * In certain generations of chips, the peer map message also contains
  6598. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6599. * to identify which peer the frame needs to be forwarded to (i.e. the
  6600. * peer assocated with the Destination MAC Address within the packet),
  6601. * and particularly which vdev needs to transmit the frame (for cases
  6602. * of inter-vdev rx --> tx forwarding).
  6603. * This DA-based peer ID that is provided for certain rx frames
  6604. * (the rx frames that need to be re-transmitted as tx frames)
  6605. * is the ID that the HW uses for referring to the peer in question,
  6606. * rather than the peer ID that the SW+FW use to refer to the peer.
  6607. *
  6608. *
  6609. * |31 24|23 16|15 8|7 0|
  6610. * |-----------------------------------------------------------------------|
  6611. * | SW peer ID | VDEV ID | msg type |
  6612. * |-----------------------------------------------------------------------|
  6613. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6614. * |-----------------------------------------------------------------------|
  6615. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6616. * |-----------------------------------------------------------------------|
  6617. *
  6618. *
  6619. * The following diagram shows the format of the rx peer unmap message sent
  6620. * from the target to the host.
  6621. *
  6622. * |31 24|23 16|15 8|7 0|
  6623. * |-----------------------------------------------------------------------|
  6624. * | SW peer ID | VDEV ID | msg type |
  6625. * |-----------------------------------------------------------------------|
  6626. *
  6627. * The following field definitions describe the format of the rx peer map
  6628. * and peer unmap messages sent from the target to the host.
  6629. * - MSG_TYPE
  6630. * Bits 7:0
  6631. * Purpose: identifies this as an rx peer map or peer unmap message
  6632. * Value: peer map -> 0x3, peer unmap -> 0x4
  6633. * - VDEV_ID
  6634. * Bits 15:8
  6635. * Purpose: Indicates which virtual device the peer is associated
  6636. * with.
  6637. * Value: vdev ID (used in the host to look up the vdev object)
  6638. * - PEER_ID (a.k.a. SW_PEER_ID)
  6639. * Bits 31:16
  6640. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6641. * freeing (unmap)
  6642. * Value: (rx) peer ID
  6643. * - MAC_ADDR_L32 (peer map only)
  6644. * Bits 31:0
  6645. * Purpose: Identifies which peer node the peer ID is for.
  6646. * Value: lower 4 bytes of peer node's MAC address
  6647. * - MAC_ADDR_U16 (peer map only)
  6648. * Bits 15:0
  6649. * Purpose: Identifies which peer node the peer ID is for.
  6650. * Value: upper 2 bytes of peer node's MAC address
  6651. * - HW_PEER_ID
  6652. * Bits 31:16
  6653. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6654. * address, so for rx frames marked for rx --> tx forwarding, the
  6655. * host can determine from the HW peer ID provided as meta-data with
  6656. * the rx frame which peer the frame is supposed to be forwarded to.
  6657. * Value: ID used by the MAC HW to identify the peer
  6658. */
  6659. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6660. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6661. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6662. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6663. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6664. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6665. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6666. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6667. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6668. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6669. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6670. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6671. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6672. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6675. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6676. } while (0)
  6677. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6678. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6679. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6680. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6683. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6684. } while (0)
  6685. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6686. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6687. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6688. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6689. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6690. do { \
  6691. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6692. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6693. } while (0)
  6694. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6695. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6696. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6697. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6698. #define HTT_RX_PEER_MAP_BYTES 12
  6699. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6700. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6701. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6702. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6703. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6704. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6705. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6706. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6707. #define HTT_RX_PEER_UNMAP_BYTES 4
  6708. /**
  6709. * @brief target -> host rx peer map V2 message definition
  6710. *
  6711. * @details
  6712. * The following diagram shows the format of the rx peer map v2 message sent
  6713. * from the target to the host. This layout assumes the target operates
  6714. * as little-endian.
  6715. *
  6716. * This message always contains a SW peer ID. The main purpose of the
  6717. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6718. * with, so that the host can use that peer ID to determine which peer
  6719. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6720. * other purposes, such as identifying during tx completions which peer
  6721. * the tx frames in question were transmitted to.
  6722. *
  6723. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6724. * is used during rx --> tx frame forwarding to identify which peer the
  6725. * frame needs to be forwarded to (i.e. the peer assocated with the
  6726. * Destination MAC Address within the packet), and particularly which vdev
  6727. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6728. * This DA-based peer ID that is provided for certain rx frames
  6729. * (the rx frames that need to be re-transmitted as tx frames)
  6730. * is the ID that the HW uses for referring to the peer in question,
  6731. * rather than the peer ID that the SW+FW use to refer to the peer.
  6732. *
  6733. *
  6734. * |31 24|23 16|15 8|7 0|
  6735. * |-----------------------------------------------------------------------|
  6736. * | SW peer ID | VDEV ID | msg type |
  6737. * |-----------------------------------------------------------------------|
  6738. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6739. * |-----------------------------------------------------------------------|
  6740. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6741. * |-----------------------------------------------------------------------|
  6742. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6743. * |-----------------------------------------------------------------------|
  6744. * | Reserved_0 |
  6745. * |-----------------------------------------------------------------------|
  6746. * | Reserved_1 |
  6747. * |-----------------------------------------------------------------------|
  6748. * | Reserved_2 |
  6749. * |-----------------------------------------------------------------------|
  6750. * | Reserved_3 |
  6751. * |-----------------------------------------------------------------------|
  6752. *
  6753. *
  6754. * The following field definitions describe the format of the rx peer map v2
  6755. * messages sent from the target to the host.
  6756. * - MSG_TYPE
  6757. * Bits 7:0
  6758. * Purpose: identifies this as an rx peer map v2 message
  6759. * Value: peer map v2 -> 0x1e
  6760. * - VDEV_ID
  6761. * Bits 15:8
  6762. * Purpose: Indicates which virtual device the peer is associated with.
  6763. * Value: vdev ID (used in the host to look up the vdev object)
  6764. * - SW_PEER_ID
  6765. * Bits 31:16
  6766. * Purpose: The peer ID (index) that WAL is allocating
  6767. * Value: (rx) peer ID
  6768. * - MAC_ADDR_L32
  6769. * Bits 31:0
  6770. * Purpose: Identifies which peer node the peer ID is for.
  6771. * Value: lower 4 bytes of peer node's MAC address
  6772. * - MAC_ADDR_U16
  6773. * Bits 15:0
  6774. * Purpose: Identifies which peer node the peer ID is for.
  6775. * Value: upper 2 bytes of peer node's MAC address
  6776. * - HW_PEER_ID
  6777. * Bits 31:16
  6778. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6779. * address, so for rx frames marked for rx --> tx forwarding, the
  6780. * host can determine from the HW peer ID provided as meta-data with
  6781. * the rx frame which peer the frame is supposed to be forwarded to.
  6782. * Value: ID used by the MAC HW to identify the peer
  6783. * - AST_HASH_VALUE
  6784. * Bits 15:0
  6785. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6786. * override feature.
  6787. * - NEXT_HOP
  6788. * Bit 16
  6789. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6790. * (Wireless Distribution System).
  6791. */
  6792. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6793. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6794. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6795. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6796. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6797. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6798. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6799. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6800. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6801. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6802. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6803. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6804. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6805. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6806. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6809. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6810. } while (0)
  6811. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6812. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6813. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6814. do { \
  6815. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6816. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6817. } while (0)
  6818. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6819. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6820. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6821. do { \
  6822. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6823. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6824. } while (0)
  6825. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6826. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6827. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6828. do { \
  6829. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6830. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6831. } while (0)
  6832. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6833. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6834. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6835. do { \
  6836. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6837. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6838. } while (0)
  6839. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6840. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6841. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6842. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6843. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6844. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6845. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6846. /**
  6847. * @brief target -> host rx peer unmap V2 message definition
  6848. *
  6849. *
  6850. * The following diagram shows the format of the rx peer unmap message sent
  6851. * from the target to the host.
  6852. *
  6853. * |31 24|23 16|15 8|7 0|
  6854. * |-----------------------------------------------------------------------|
  6855. * | SW peer ID | VDEV ID | msg type |
  6856. * |-----------------------------------------------------------------------|
  6857. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6858. * |-----------------------------------------------------------------------|
  6859. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6860. * |-----------------------------------------------------------------------|
  6861. * | Peer Delete Duration |
  6862. * |-----------------------------------------------------------------------|
  6863. * | Reserved_0 |
  6864. * |-----------------------------------------------------------------------|
  6865. * | Reserved_1 |
  6866. * |-----------------------------------------------------------------------|
  6867. * | Reserved_2 |
  6868. * |-----------------------------------------------------------------------|
  6869. *
  6870. *
  6871. * The following field definitions describe the format of the rx peer unmap
  6872. * messages sent from the target to the host.
  6873. * - MSG_TYPE
  6874. * Bits 7:0
  6875. * Purpose: identifies this as an rx peer unmap v2 message
  6876. * Value: peer unmap v2 -> 0x1f
  6877. * - VDEV_ID
  6878. * Bits 15:8
  6879. * Purpose: Indicates which virtual device the peer is associated
  6880. * with.
  6881. * Value: vdev ID (used in the host to look up the vdev object)
  6882. * - SW_PEER_ID
  6883. * Bits 31:16
  6884. * Purpose: The peer ID (index) that WAL is freeing
  6885. * Value: (rx) peer ID
  6886. * - MAC_ADDR_L32
  6887. * Bits 31:0
  6888. * Purpose: Identifies which peer node the peer ID is for.
  6889. * Value: lower 4 bytes of peer node's MAC address
  6890. * - MAC_ADDR_U16
  6891. * Bits 15:0
  6892. * Purpose: Identifies which peer node the peer ID is for.
  6893. * Value: upper 2 bytes of peer node's MAC address
  6894. * - NEXT_HOP
  6895. * Bits 16
  6896. * Purpose: Bit indicates next_hop AST entry used for WDS
  6897. * (Wireless Distribution System).
  6898. * - PEER_DELETE_DURATION
  6899. * Bits 31:0
  6900. * Purpose: Time taken to delete peer, in msec,
  6901. * Used for monitoring / debugging PEER delete response delay
  6902. */
  6903. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6904. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6905. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6906. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6907. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6908. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6909. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6910. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6911. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6912. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6913. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6914. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6915. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6916. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6917. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6918. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6919. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6920. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6921. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6922. do { \
  6923. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6924. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6925. } while (0)
  6926. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6927. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6928. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6929. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6930. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6931. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6932. /**
  6933. * @brief target -> host message specifying security parameters
  6934. *
  6935. * @details
  6936. * The following diagram shows the format of the security specification
  6937. * message sent from the target to the host.
  6938. * This security specification message tells the host whether a PN check is
  6939. * necessary on rx data frames, and if so, how large the PN counter is.
  6940. * This message also tells the host about the security processing to apply
  6941. * to defragmented rx frames - specifically, whether a Message Integrity
  6942. * Check is required, and the Michael key to use.
  6943. *
  6944. * |31 24|23 16|15|14 8|7 0|
  6945. * |-----------------------------------------------------------------------|
  6946. * | peer ID | U| security type | msg type |
  6947. * |-----------------------------------------------------------------------|
  6948. * | Michael Key K0 |
  6949. * |-----------------------------------------------------------------------|
  6950. * | Michael Key K1 |
  6951. * |-----------------------------------------------------------------------|
  6952. * | WAPI RSC Low0 |
  6953. * |-----------------------------------------------------------------------|
  6954. * | WAPI RSC Low1 |
  6955. * |-----------------------------------------------------------------------|
  6956. * | WAPI RSC Hi0 |
  6957. * |-----------------------------------------------------------------------|
  6958. * | WAPI RSC Hi1 |
  6959. * |-----------------------------------------------------------------------|
  6960. *
  6961. * The following field definitions describe the format of the security
  6962. * indication message sent from the target to the host.
  6963. * - MSG_TYPE
  6964. * Bits 7:0
  6965. * Purpose: identifies this as a security specification message
  6966. * Value: 0xb
  6967. * - SEC_TYPE
  6968. * Bits 14:8
  6969. * Purpose: specifies which type of security applies to the peer
  6970. * Value: htt_sec_type enum value
  6971. * - UNICAST
  6972. * Bit 15
  6973. * Purpose: whether this security is applied to unicast or multicast data
  6974. * Value: 1 -> unicast, 0 -> multicast
  6975. * - PEER_ID
  6976. * Bits 31:16
  6977. * Purpose: The ID number for the peer the security specification is for
  6978. * Value: peer ID
  6979. * - MICHAEL_KEY_K0
  6980. * Bits 31:0
  6981. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6982. * Value: Michael Key K0 (if security type is TKIP)
  6983. * - MICHAEL_KEY_K1
  6984. * Bits 31:0
  6985. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6986. * Value: Michael Key K1 (if security type is TKIP)
  6987. * - WAPI_RSC_LOW0
  6988. * Bits 31:0
  6989. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6990. * Value: WAPI RSC Low0 (if security type is WAPI)
  6991. * - WAPI_RSC_LOW1
  6992. * Bits 31:0
  6993. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6994. * Value: WAPI RSC Low1 (if security type is WAPI)
  6995. * - WAPI_RSC_HI0
  6996. * Bits 31:0
  6997. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6998. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6999. * - WAPI_RSC_HI1
  7000. * Bits 31:0
  7001. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7002. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7003. */
  7004. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7005. #define HTT_SEC_IND_SEC_TYPE_S 8
  7006. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7007. #define HTT_SEC_IND_UNICAST_S 15
  7008. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7009. #define HTT_SEC_IND_PEER_ID_S 16
  7010. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7011. do { \
  7012. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7013. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7014. } while (0)
  7015. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7016. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7017. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7018. do { \
  7019. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7020. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7021. } while (0)
  7022. #define HTT_SEC_IND_UNICAST_GET(word) \
  7023. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7024. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7025. do { \
  7026. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7027. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7028. } while (0)
  7029. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7030. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7031. #define HTT_SEC_IND_BYTES 28
  7032. /**
  7033. * @brief target -> host rx ADDBA / DELBA message definitions
  7034. *
  7035. * @details
  7036. * The following diagram shows the format of the rx ADDBA message sent
  7037. * from the target to the host:
  7038. *
  7039. * |31 20|19 16|15 8|7 0|
  7040. * |---------------------------------------------------------------------|
  7041. * | peer ID | TID | window size | msg type |
  7042. * |---------------------------------------------------------------------|
  7043. *
  7044. * The following diagram shows the format of the rx DELBA message sent
  7045. * from the target to the host:
  7046. *
  7047. * |31 20|19 16|15 10|9 8|7 0|
  7048. * |---------------------------------------------------------------------|
  7049. * | peer ID | TID | reserved | IR| msg type |
  7050. * |---------------------------------------------------------------------|
  7051. *
  7052. * The following field definitions describe the format of the rx ADDBA
  7053. * and DELBA messages sent from the target to the host.
  7054. * - MSG_TYPE
  7055. * Bits 7:0
  7056. * Purpose: identifies this as an rx ADDBA or DELBA message
  7057. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7058. * - IR (initiator / recipient)
  7059. * Bits 9:8 (DELBA only)
  7060. * Purpose: specify whether the DELBA handshake was initiated by the
  7061. * local STA/AP, or by the peer STA/AP
  7062. * Value:
  7063. * 0 - unspecified
  7064. * 1 - initiator (a.k.a. originator)
  7065. * 2 - recipient (a.k.a. responder)
  7066. * 3 - unused / reserved
  7067. * - WIN_SIZE
  7068. * Bits 15:8 (ADDBA only)
  7069. * Purpose: Specifies the length of the block ack window (max = 64).
  7070. * Value:
  7071. * block ack window length specified by the received ADDBA
  7072. * management message.
  7073. * - TID
  7074. * Bits 19:16
  7075. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7076. * Value:
  7077. * TID specified by the received ADDBA or DELBA management message.
  7078. * - PEER_ID
  7079. * Bits 31:20
  7080. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7081. * Value:
  7082. * ID (hash value) used by the host for fast, direct lookup of
  7083. * host SW peer info, including rx reorder states.
  7084. */
  7085. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7086. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7087. #define HTT_RX_ADDBA_TID_M 0xf0000
  7088. #define HTT_RX_ADDBA_TID_S 16
  7089. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7090. #define HTT_RX_ADDBA_PEER_ID_S 20
  7091. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7092. do { \
  7093. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7094. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7095. } while (0)
  7096. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7097. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7098. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7099. do { \
  7100. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7101. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7102. } while (0)
  7103. #define HTT_RX_ADDBA_TID_GET(word) \
  7104. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7105. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7106. do { \
  7107. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7108. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7109. } while (0)
  7110. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7111. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7112. #define HTT_RX_ADDBA_BYTES 4
  7113. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7114. #define HTT_RX_DELBA_INITIATOR_S 8
  7115. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7116. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7117. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7118. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7119. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7120. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7121. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7122. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7123. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7124. do { \
  7125. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7126. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7127. } while (0)
  7128. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7129. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7130. #define HTT_RX_DELBA_BYTES 4
  7131. /**
  7132. * @brief tx queue group information element definition
  7133. *
  7134. * @details
  7135. * The following diagram shows the format of the tx queue group
  7136. * information element, which can be included in target --> host
  7137. * messages to specify the number of tx "credits" (tx descriptors
  7138. * for LL, or tx buffers for HL) available to a particular group
  7139. * of host-side tx queues, and which host-side tx queues belong to
  7140. * the group.
  7141. *
  7142. * |31|30 24|23 16|15|14|13 0|
  7143. * |------------------------------------------------------------------------|
  7144. * | X| reserved | tx queue grp ID | A| S| credit count |
  7145. * |------------------------------------------------------------------------|
  7146. * | vdev ID mask | AC mask |
  7147. * |------------------------------------------------------------------------|
  7148. *
  7149. * The following definitions describe the fields within the tx queue group
  7150. * information element:
  7151. * - credit_count
  7152. * Bits 13:1
  7153. * Purpose: specify how many tx credits are available to the tx queue group
  7154. * Value: An absolute or relative, positive or negative credit value
  7155. * The 'A' bit specifies whether the value is absolute or relative.
  7156. * The 'S' bit specifies whether the value is positive or negative.
  7157. * A negative value can only be relative, not absolute.
  7158. * An absolute value replaces any prior credit value the host has for
  7159. * the tx queue group in question.
  7160. * A relative value is added to the prior credit value the host has for
  7161. * the tx queue group in question.
  7162. * - sign
  7163. * Bit 14
  7164. * Purpose: specify whether the credit count is positive or negative
  7165. * Value: 0 -> positive, 1 -> negative
  7166. * - absolute
  7167. * Bit 15
  7168. * Purpose: specify whether the credit count is absolute or relative
  7169. * Value: 0 -> relative, 1 -> absolute
  7170. * - txq_group_id
  7171. * Bits 23:16
  7172. * Purpose: indicate which tx queue group's credit and/or membership are
  7173. * being specified
  7174. * Value: 0 to max_tx_queue_groups-1
  7175. * - reserved
  7176. * Bits 30:16
  7177. * Value: 0x0
  7178. * - eXtension
  7179. * Bit 31
  7180. * Purpose: specify whether another tx queue group info element follows
  7181. * Value: 0 -> no more tx queue group information elements
  7182. * 1 -> another tx queue group information element immediately follows
  7183. * - ac_mask
  7184. * Bits 15:0
  7185. * Purpose: specify which Access Categories belong to the tx queue group
  7186. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7187. * the tx queue group.
  7188. * The AC bit-mask values are obtained by left-shifting by the
  7189. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7190. * - vdev_id_mask
  7191. * Bits 31:16
  7192. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7193. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7194. * belong to the tx queue group.
  7195. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7196. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7197. */
  7198. PREPACK struct htt_txq_group {
  7199. A_UINT32
  7200. credit_count: 14,
  7201. sign: 1,
  7202. absolute: 1,
  7203. tx_queue_group_id: 8,
  7204. reserved0: 7,
  7205. extension: 1;
  7206. A_UINT32
  7207. ac_mask: 16,
  7208. vdev_id_mask: 16;
  7209. } POSTPACK;
  7210. /* first word */
  7211. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7212. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7213. #define HTT_TXQ_GROUP_SIGN_S 14
  7214. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7215. #define HTT_TXQ_GROUP_ABS_S 15
  7216. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7217. #define HTT_TXQ_GROUP_ID_S 16
  7218. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7219. #define HTT_TXQ_GROUP_EXT_S 31
  7220. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7221. /* second word */
  7222. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7223. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7224. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7225. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7226. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7227. do { \
  7228. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7229. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7230. } while (0)
  7231. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7232. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7233. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7234. do { \
  7235. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7236. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7237. } while (0)
  7238. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7239. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7240. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7241. do { \
  7242. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7243. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7244. } while (0)
  7245. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7246. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7247. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7248. do { \
  7249. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7250. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7251. } while (0)
  7252. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7253. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7254. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7255. do { \
  7256. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7257. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7258. } while (0)
  7259. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7260. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7261. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7262. do { \
  7263. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7264. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7265. } while (0)
  7266. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7267. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7268. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7269. do { \
  7270. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7271. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7272. } while (0)
  7273. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7274. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7275. /**
  7276. * @brief target -> host TX completion indication message definition
  7277. *
  7278. * @details
  7279. * The following diagram shows the format of the TX completion indication sent
  7280. * from the target to the host
  7281. *
  7282. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7283. * |-------------------------------------------------------------|
  7284. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7285. * |-------------------------------------------------------------|
  7286. * payload: | MSDU1 ID | MSDU0 ID |
  7287. * |-------------------------------------------------------------|
  7288. * : MSDU3 ID : MSDU2 ID :
  7289. * |-------------------------------------------------------------|
  7290. * | struct htt_tx_compl_ind_append_retries |
  7291. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7292. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7293. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7294. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7295. * |-------------------------------------------------------------|
  7296. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7297. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7298. * Where:
  7299. * A0 = append (a.k.a. append0)
  7300. * A1 = append1
  7301. * TP = MSDU tx power presence
  7302. * A2 = append2
  7303. *
  7304. * The following field definitions describe the format of the TX completion
  7305. * indication sent from the target to the host
  7306. * Header fields:
  7307. * - msg_type
  7308. * Bits 7:0
  7309. * Purpose: identifies this as HTT TX completion indication
  7310. * Value: 0x7
  7311. * - status
  7312. * Bits 10:8
  7313. * Purpose: the TX completion status of payload fragmentations descriptors
  7314. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7315. * - tid
  7316. * Bits 14:11
  7317. * Purpose: the tid associated with those fragmentation descriptors. It is
  7318. * valid or not, depending on the tid_invalid bit.
  7319. * Value: 0 to 15
  7320. * - tid_invalid
  7321. * Bits 15:15
  7322. * Purpose: this bit indicates whether the tid field is valid or not
  7323. * Value: 0 indicates valid; 1 indicates invalid
  7324. * - num
  7325. * Bits 23:16
  7326. * Purpose: the number of payload in this indication
  7327. * Value: 1 to 255
  7328. * - append (a.k.a. append0)
  7329. * Bits 24:24
  7330. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7331. * the number of tx retries for one MSDU at the end of this message
  7332. * Value: 0 indicates no appending; 1 indicates appending
  7333. * - append1
  7334. * Bits 25:25
  7335. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7336. * contains the timestamp info for each TX msdu id in payload.
  7337. * The order of the timestamps matches the order of the MSDU IDs.
  7338. * Note that a big-endian host needs to account for the reordering
  7339. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7340. * conversion) when determining which tx timestamp corresponds to
  7341. * which MSDU ID.
  7342. * Value: 0 indicates no appending; 1 indicates appending
  7343. * - msdu_tx_power_presence
  7344. * Bits 26:26
  7345. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7346. * for each MSDU referenced by the TX_COMPL_IND message.
  7347. * The tx power is reported in 0.5 dBm units.
  7348. * The order of the per-MSDU tx power reports matches the order
  7349. * of the MSDU IDs.
  7350. * Note that a big-endian host needs to account for the reordering
  7351. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7352. * conversion) when determining which Tx Power corresponds to
  7353. * which MSDU ID.
  7354. * Value: 0 indicates MSDU tx power reports are not appended,
  7355. * 1 indicates MSDU tx power reports are appended
  7356. * - append2
  7357. * Bits 27:27
  7358. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7359. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7360. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7361. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7362. * for each MSDU, for convenience.
  7363. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7364. * this append2 bit is set).
  7365. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7366. * dB above the noise floor.
  7367. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7368. * 1 indicates MSDU ACK RSSI values are appended.
  7369. * Payload fields:
  7370. * - hmsdu_id
  7371. * Bits 15:0
  7372. * Purpose: this ID is used to track the Tx buffer in host
  7373. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7374. */
  7375. #define HTT_TX_COMPL_IND_STATUS_S 8
  7376. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7377. #define HTT_TX_COMPL_IND_TID_S 11
  7378. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7379. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7380. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7381. #define HTT_TX_COMPL_IND_NUM_S 16
  7382. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7383. #define HTT_TX_COMPL_IND_APPEND_S 24
  7384. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7385. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7386. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7387. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7388. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7389. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7390. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7391. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7392. do { \
  7393. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7394. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7395. } while (0)
  7396. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7397. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7398. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7399. do { \
  7400. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7401. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7402. } while (0)
  7403. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7404. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7405. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7406. do { \
  7407. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7408. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7409. } while (0)
  7410. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7411. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7412. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7413. do { \
  7414. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7415. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7416. } while (0)
  7417. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7418. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7419. HTT_TX_COMPL_IND_TID_INV_S)
  7420. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7421. do { \
  7422. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7423. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7424. } while (0)
  7425. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7426. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7427. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7428. do { \
  7429. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7430. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7431. } while (0)
  7432. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7433. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7434. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7435. do { \
  7436. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7437. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7438. } while (0)
  7439. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7440. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7441. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7442. do { \
  7443. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7444. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7445. } while (0)
  7446. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7447. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7448. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7449. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7450. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7451. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7452. #define HTT_TX_COMPL_IND_STAT_OK 0
  7453. /* DISCARD:
  7454. * current meaning:
  7455. * MSDUs were queued for transmission but filtered by HW or SW
  7456. * without any over the air attempts
  7457. * legacy meaning (HL Rome):
  7458. * MSDUs were discarded by the target FW without any over the air
  7459. * attempts due to lack of space
  7460. */
  7461. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7462. /* NO_ACK:
  7463. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7464. */
  7465. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7466. /* POSTPONE:
  7467. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7468. * be downloaded again later (in the appropriate order), when they are
  7469. * deliverable.
  7470. */
  7471. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7472. /*
  7473. * The PEER_DEL tx completion status is used for HL cases
  7474. * where the peer the frame is for has been deleted.
  7475. * The host has already discarded its copy of the frame, but
  7476. * it still needs the tx completion to restore its credit.
  7477. */
  7478. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7479. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7480. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7481. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7482. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7483. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7484. PREPACK struct htt_tx_compl_ind_base {
  7485. A_UINT32 hdr;
  7486. A_UINT16 payload[1/*or more*/];
  7487. } POSTPACK;
  7488. PREPACK struct htt_tx_compl_ind_append_retries {
  7489. A_UINT16 msdu_id;
  7490. A_UINT8 tx_retries;
  7491. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7492. 0: this is the last append_retries struct */
  7493. } POSTPACK;
  7494. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7495. A_UINT32 timestamp[1/*or more*/];
  7496. } POSTPACK;
  7497. /**
  7498. * @brief target -> host rate-control update indication message
  7499. *
  7500. * @details
  7501. * The following diagram shows the format of the RC Update message
  7502. * sent from the target to the host, while processing the tx-completion
  7503. * of a transmitted PPDU.
  7504. *
  7505. * |31 24|23 16|15 8|7 0|
  7506. * |-------------------------------------------------------------|
  7507. * | peer ID | vdev ID | msg_type |
  7508. * |-------------------------------------------------------------|
  7509. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7510. * |-------------------------------------------------------------|
  7511. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7512. * |-------------------------------------------------------------|
  7513. * | : |
  7514. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7515. * | : |
  7516. * |-------------------------------------------------------------|
  7517. * | : |
  7518. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7519. * | : |
  7520. * |-------------------------------------------------------------|
  7521. * : :
  7522. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7523. *
  7524. */
  7525. typedef struct {
  7526. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7527. A_UINT32 rate_code_flags;
  7528. A_UINT32 flags; /* Encodes information such as excessive
  7529. retransmission, aggregate, some info
  7530. from .11 frame control,
  7531. STBC, LDPC, (SGI and Tx Chain Mask
  7532. are encoded in ptx_rc->flags field),
  7533. AMPDU truncation (BT/time based etc.),
  7534. RTS/CTS attempt */
  7535. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7536. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7537. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7538. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7539. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7540. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7541. } HTT_RC_TX_DONE_PARAMS;
  7542. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7543. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7544. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7545. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7546. #define HTT_RC_UPDATE_VDEVID_S 8
  7547. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7548. #define HTT_RC_UPDATE_PEERID_S 16
  7549. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7550. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7551. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7552. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7553. do { \
  7554. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7555. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7556. } while (0)
  7557. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7558. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7559. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7560. do { \
  7561. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7562. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7563. } while (0)
  7564. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7565. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7566. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7567. do { \
  7568. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7569. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7570. } while (0)
  7571. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7572. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7573. /**
  7574. * @brief target -> host rx fragment indication message definition
  7575. *
  7576. * @details
  7577. * The following field definitions describe the format of the rx fragment
  7578. * indication message sent from the target to the host.
  7579. * The rx fragment indication message shares the format of the
  7580. * rx indication message, but not all fields from the rx indication message
  7581. * are relevant to the rx fragment indication message.
  7582. *
  7583. *
  7584. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7585. * |-----------+-------------------+---------------------+-------------|
  7586. * | peer ID | |FV| ext TID | msg type |
  7587. * |-------------------------------------------------------------------|
  7588. * | | flush | flush |
  7589. * | | end | start |
  7590. * | | seq num | seq num |
  7591. * |-------------------------------------------------------------------|
  7592. * | reserved | FW rx desc bytes |
  7593. * |-------------------------------------------------------------------|
  7594. * | | FW MSDU Rx |
  7595. * | | desc B0 |
  7596. * |-------------------------------------------------------------------|
  7597. * Header fields:
  7598. * - MSG_TYPE
  7599. * Bits 7:0
  7600. * Purpose: identifies this as an rx fragment indication message
  7601. * Value: 0xa
  7602. * - EXT_TID
  7603. * Bits 12:8
  7604. * Purpose: identify the traffic ID of the rx data, including
  7605. * special "extended" TID values for multicast, broadcast, and
  7606. * non-QoS data frames
  7607. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7608. * - FLUSH_VALID (FV)
  7609. * Bit 13
  7610. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7611. * is valid
  7612. * Value:
  7613. * 1 -> flush IE is valid and needs to be processed
  7614. * 0 -> flush IE is not valid and should be ignored
  7615. * - PEER_ID
  7616. * Bits 31:16
  7617. * Purpose: Identify, by ID, which peer sent the rx data
  7618. * Value: ID of the peer who sent the rx data
  7619. * - FLUSH_SEQ_NUM_START
  7620. * Bits 5:0
  7621. * Purpose: Indicate the start of a series of MPDUs to flush
  7622. * Not all MPDUs within this series are necessarily valid - the host
  7623. * must check each sequence number within this range to see if the
  7624. * corresponding MPDU is actually present.
  7625. * This field is only valid if the FV bit is set.
  7626. * Value:
  7627. * The sequence number for the first MPDUs to check to flush.
  7628. * The sequence number is masked by 0x3f.
  7629. * - FLUSH_SEQ_NUM_END
  7630. * Bits 11:6
  7631. * Purpose: Indicate the end of a series of MPDUs to flush
  7632. * Value:
  7633. * The sequence number one larger than the sequence number of the
  7634. * last MPDU to check to flush.
  7635. * The sequence number is masked by 0x3f.
  7636. * Not all MPDUs within this series are necessarily valid - the host
  7637. * must check each sequence number within this range to see if the
  7638. * corresponding MPDU is actually present.
  7639. * This field is only valid if the FV bit is set.
  7640. * Rx descriptor fields:
  7641. * - FW_RX_DESC_BYTES
  7642. * Bits 15:0
  7643. * Purpose: Indicate how many bytes in the Rx indication are used for
  7644. * FW Rx descriptors
  7645. * Value: 1
  7646. */
  7647. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7648. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7649. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7650. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7651. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7652. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7653. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7654. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7655. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7656. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7657. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7658. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7659. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7660. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7661. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7662. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7663. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7664. #define HTT_RX_FRAG_IND_BYTES \
  7665. (4 /* msg hdr */ + \
  7666. 4 /* flush spec */ + \
  7667. 4 /* (unused) FW rx desc bytes spec */ + \
  7668. 4 /* FW rx desc */)
  7669. /**
  7670. * @brief target -> host test message definition
  7671. *
  7672. * @details
  7673. * The following field definitions describe the format of the test
  7674. * message sent from the target to the host.
  7675. * The message consists of a 4-octet header, followed by a variable
  7676. * number of 32-bit integer values, followed by a variable number
  7677. * of 8-bit character values.
  7678. *
  7679. * |31 16|15 8|7 0|
  7680. * |-----------------------------------------------------------|
  7681. * | num chars | num ints | msg type |
  7682. * |-----------------------------------------------------------|
  7683. * | int 0 |
  7684. * |-----------------------------------------------------------|
  7685. * | int 1 |
  7686. * |-----------------------------------------------------------|
  7687. * | ... |
  7688. * |-----------------------------------------------------------|
  7689. * | char 3 | char 2 | char 1 | char 0 |
  7690. * |-----------------------------------------------------------|
  7691. * | | | ... | char 4 |
  7692. * |-----------------------------------------------------------|
  7693. * - MSG_TYPE
  7694. * Bits 7:0
  7695. * Purpose: identifies this as a test message
  7696. * Value: HTT_MSG_TYPE_TEST
  7697. * - NUM_INTS
  7698. * Bits 15:8
  7699. * Purpose: indicate how many 32-bit integers follow the message header
  7700. * - NUM_CHARS
  7701. * Bits 31:16
  7702. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7703. */
  7704. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7705. #define HTT_RX_TEST_NUM_INTS_S 8
  7706. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7707. #define HTT_RX_TEST_NUM_CHARS_S 16
  7708. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7711. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7712. } while (0)
  7713. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7714. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7715. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7718. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7719. } while (0)
  7720. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7721. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7722. /**
  7723. * @brief target -> host packet log message
  7724. *
  7725. * @details
  7726. * The following field definitions describe the format of the packet log
  7727. * message sent from the target to the host.
  7728. * The message consists of a 4-octet header,followed by a variable number
  7729. * of 32-bit character values.
  7730. *
  7731. * |31 16|15 12|11 10|9 8|7 0|
  7732. * |------------------------------------------------------------------|
  7733. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7734. * |------------------------------------------------------------------|
  7735. * | payload |
  7736. * |------------------------------------------------------------------|
  7737. * - MSG_TYPE
  7738. * Bits 7:0
  7739. * Purpose: identifies this as a pktlog message
  7740. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7741. * - mac_id
  7742. * Bits 9:8
  7743. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7744. * Value: 0-3
  7745. * - pdev_id
  7746. * Bits 11:10
  7747. * Purpose: pdev_id
  7748. * Value: 0-3
  7749. * 0 (for rings at SOC level),
  7750. * 1/2/3 PDEV -> 0/1/2
  7751. * - payload_size
  7752. * Bits 31:16
  7753. * Purpose: explicitly specify the payload size
  7754. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7755. */
  7756. PREPACK struct htt_pktlog_msg {
  7757. A_UINT32 header;
  7758. A_UINT32 payload[1/* or more */];
  7759. } POSTPACK;
  7760. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7761. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7762. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7763. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7764. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7765. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7766. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7767. do { \
  7768. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7769. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7770. } while (0)
  7771. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7772. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7773. HTT_T2H_PKTLOG_MAC_ID_S)
  7774. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7775. do { \
  7776. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7777. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7778. } while (0)
  7779. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7780. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7781. HTT_T2H_PKTLOG_PDEV_ID_S)
  7782. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7783. do { \
  7784. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7785. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7786. } while (0)
  7787. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7788. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7789. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7790. /*
  7791. * Rx reorder statistics
  7792. * NB: all the fields must be defined in 4 octets size.
  7793. */
  7794. struct rx_reorder_stats {
  7795. /* Non QoS MPDUs received */
  7796. A_UINT32 deliver_non_qos;
  7797. /* MPDUs received in-order */
  7798. A_UINT32 deliver_in_order;
  7799. /* Flush due to reorder timer expired */
  7800. A_UINT32 deliver_flush_timeout;
  7801. /* Flush due to move out of window */
  7802. A_UINT32 deliver_flush_oow;
  7803. /* Flush due to DELBA */
  7804. A_UINT32 deliver_flush_delba;
  7805. /* MPDUs dropped due to FCS error */
  7806. A_UINT32 fcs_error;
  7807. /* MPDUs dropped due to monitor mode non-data packet */
  7808. A_UINT32 mgmt_ctrl;
  7809. /* Unicast-data MPDUs dropped due to invalid peer */
  7810. A_UINT32 invalid_peer;
  7811. /* MPDUs dropped due to duplication (non aggregation) */
  7812. A_UINT32 dup_non_aggr;
  7813. /* MPDUs dropped due to processed before */
  7814. A_UINT32 dup_past;
  7815. /* MPDUs dropped due to duplicate in reorder queue */
  7816. A_UINT32 dup_in_reorder;
  7817. /* Reorder timeout happened */
  7818. A_UINT32 reorder_timeout;
  7819. /* invalid bar ssn */
  7820. A_UINT32 invalid_bar_ssn;
  7821. /* reorder reset due to bar ssn */
  7822. A_UINT32 ssn_reset;
  7823. /* Flush due to delete peer */
  7824. A_UINT32 deliver_flush_delpeer;
  7825. /* Flush due to offload*/
  7826. A_UINT32 deliver_flush_offload;
  7827. /* Flush due to out of buffer*/
  7828. A_UINT32 deliver_flush_oob;
  7829. /* MPDUs dropped due to PN check fail */
  7830. A_UINT32 pn_fail;
  7831. /* MPDUs dropped due to unable to allocate memory */
  7832. A_UINT32 store_fail;
  7833. /* Number of times the tid pool alloc succeeded */
  7834. A_UINT32 tid_pool_alloc_succ;
  7835. /* Number of times the MPDU pool alloc succeeded */
  7836. A_UINT32 mpdu_pool_alloc_succ;
  7837. /* Number of times the MSDU pool alloc succeeded */
  7838. A_UINT32 msdu_pool_alloc_succ;
  7839. /* Number of times the tid pool alloc failed */
  7840. A_UINT32 tid_pool_alloc_fail;
  7841. /* Number of times the MPDU pool alloc failed */
  7842. A_UINT32 mpdu_pool_alloc_fail;
  7843. /* Number of times the MSDU pool alloc failed */
  7844. A_UINT32 msdu_pool_alloc_fail;
  7845. /* Number of times the tid pool freed */
  7846. A_UINT32 tid_pool_free;
  7847. /* Number of times the MPDU pool freed */
  7848. A_UINT32 mpdu_pool_free;
  7849. /* Number of times the MSDU pool freed */
  7850. A_UINT32 msdu_pool_free;
  7851. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7852. A_UINT32 msdu_queued;
  7853. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7854. A_UINT32 msdu_recycled;
  7855. /* Number of MPDUs with invalid peer but A2 found in AST */
  7856. A_UINT32 invalid_peer_a2_in_ast;
  7857. /* Number of MPDUs with invalid peer but A3 found in AST */
  7858. A_UINT32 invalid_peer_a3_in_ast;
  7859. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7860. A_UINT32 invalid_peer_bmc_mpdus;
  7861. /* Number of MSDUs with err attention word */
  7862. A_UINT32 rxdesc_err_att;
  7863. /* Number of MSDUs with flag of peer_idx_invalid */
  7864. A_UINT32 rxdesc_err_peer_idx_inv;
  7865. /* Number of MSDUs with flag of peer_idx_timeout */
  7866. A_UINT32 rxdesc_err_peer_idx_to;
  7867. /* Number of MSDUs with flag of overflow */
  7868. A_UINT32 rxdesc_err_ov;
  7869. /* Number of MSDUs with flag of msdu_length_err */
  7870. A_UINT32 rxdesc_err_msdu_len;
  7871. /* Number of MSDUs with flag of mpdu_length_err */
  7872. A_UINT32 rxdesc_err_mpdu_len;
  7873. /* Number of MSDUs with flag of tkip_mic_err */
  7874. A_UINT32 rxdesc_err_tkip_mic;
  7875. /* Number of MSDUs with flag of decrypt_err */
  7876. A_UINT32 rxdesc_err_decrypt;
  7877. /* Number of MSDUs with flag of fcs_err */
  7878. A_UINT32 rxdesc_err_fcs;
  7879. /* Number of Unicast (bc_mc bit is not set in attention word)
  7880. * frames with invalid peer handler
  7881. */
  7882. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7883. /* Number of unicast frame directly (direct bit is set in attention word)
  7884. * to DUT with invalid peer handler
  7885. */
  7886. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7887. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7888. * frames with invalid peer handler
  7889. */
  7890. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7891. /* Number of MSDUs dropped due to no first MSDU flag */
  7892. A_UINT32 rxdesc_no_1st_msdu;
  7893. /* Number of MSDUs droped due to ring overflow */
  7894. A_UINT32 msdu_drop_ring_ov;
  7895. /* Number of MSDUs dropped due to FC mismatch */
  7896. A_UINT32 msdu_drop_fc_mismatch;
  7897. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7898. A_UINT32 msdu_drop_mgmt_remote_ring;
  7899. /* Number of MSDUs dropped due to errors not reported in attention word */
  7900. A_UINT32 msdu_drop_misc;
  7901. /* Number of MSDUs go to offload before reorder */
  7902. A_UINT32 offload_msdu_wal;
  7903. /* Number of data frame dropped by offload after reorder */
  7904. A_UINT32 offload_msdu_reorder;
  7905. /* Number of MPDUs with sequence number in the past and within the BA window */
  7906. A_UINT32 dup_past_within_window;
  7907. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7908. A_UINT32 dup_past_outside_window;
  7909. /* Number of MSDUs with decrypt/MIC error */
  7910. A_UINT32 rxdesc_err_decrypt_mic;
  7911. /* Number of data MSDUs received on both local and remote rings */
  7912. A_UINT32 data_msdus_on_both_rings;
  7913. /* MPDUs never filled */
  7914. A_UINT32 holes_not_filled;
  7915. };
  7916. /*
  7917. * Rx Remote buffer statistics
  7918. * NB: all the fields must be defined in 4 octets size.
  7919. */
  7920. struct rx_remote_buffer_mgmt_stats {
  7921. /* Total number of MSDUs reaped for Rx processing */
  7922. A_UINT32 remote_reaped;
  7923. /* MSDUs recycled within firmware */
  7924. A_UINT32 remote_recycled;
  7925. /* MSDUs stored by Data Rx */
  7926. A_UINT32 data_rx_msdus_stored;
  7927. /* Number of HTT indications from WAL Rx MSDU */
  7928. A_UINT32 wal_rx_ind;
  7929. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7930. A_UINT32 wal_rx_ind_unconsumed;
  7931. /* Number of HTT indications from Data Rx MSDU */
  7932. A_UINT32 data_rx_ind;
  7933. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7934. A_UINT32 data_rx_ind_unconsumed;
  7935. /* Number of HTT indications from ATHBUF */
  7936. A_UINT32 athbuf_rx_ind;
  7937. /* Number of remote buffers requested for refill */
  7938. A_UINT32 refill_buf_req;
  7939. /* Number of remote buffers filled by the host */
  7940. A_UINT32 refill_buf_rsp;
  7941. /* Number of times MAC hw_index = f/w write_index */
  7942. A_INT32 mac_no_bufs;
  7943. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7944. A_INT32 fw_indices_equal;
  7945. /* Number of times f/w finds no buffers to post */
  7946. A_INT32 host_no_bufs;
  7947. };
  7948. /*
  7949. * TXBF MU/SU packets and NDPA statistics
  7950. * NB: all the fields must be defined in 4 octets size.
  7951. */
  7952. struct rx_txbf_musu_ndpa_pkts_stats {
  7953. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7954. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7955. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7956. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7957. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7958. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7959. };
  7960. /*
  7961. * htt_dbg_stats_status -
  7962. * present - The requested stats have been delivered in full.
  7963. * This indicates that either the stats information was contained
  7964. * in its entirety within this message, or else this message
  7965. * completes the delivery of the requested stats info that was
  7966. * partially delivered through earlier STATS_CONF messages.
  7967. * partial - The requested stats have been delivered in part.
  7968. * One or more subsequent STATS_CONF messages with the same
  7969. * cookie value will be sent to deliver the remainder of the
  7970. * information.
  7971. * error - The requested stats could not be delivered, for example due
  7972. * to a shortage of memory to construct a message holding the
  7973. * requested stats.
  7974. * invalid - The requested stat type is either not recognized, or the
  7975. * target is configured to not gather the stats type in question.
  7976. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7977. * series_done - This special value indicates that no further stats info
  7978. * elements are present within a series of stats info elems
  7979. * (within a stats upload confirmation message).
  7980. */
  7981. enum htt_dbg_stats_status {
  7982. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7983. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7984. HTT_DBG_STATS_STATUS_ERROR = 2,
  7985. HTT_DBG_STATS_STATUS_INVALID = 3,
  7986. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7987. };
  7988. /**
  7989. * @brief target -> host statistics upload
  7990. *
  7991. * @details
  7992. * The following field definitions describe the format of the HTT target
  7993. * to host stats upload confirmation message.
  7994. * The message contains a cookie echoed from the HTT host->target stats
  7995. * upload request, which identifies which request the confirmation is
  7996. * for, and a series of tag-length-value stats information elements.
  7997. * The tag-length header for each stats info element also includes a
  7998. * status field, to indicate whether the request for the stat type in
  7999. * question was fully met, partially met, unable to be met, or invalid
  8000. * (if the stat type in question is disabled in the target).
  8001. * A special value of all 1's in this status field is used to indicate
  8002. * the end of the series of stats info elements.
  8003. *
  8004. *
  8005. * |31 16|15 8|7 5|4 0|
  8006. * |------------------------------------------------------------|
  8007. * | reserved | msg type |
  8008. * |------------------------------------------------------------|
  8009. * | cookie LSBs |
  8010. * |------------------------------------------------------------|
  8011. * | cookie MSBs |
  8012. * |------------------------------------------------------------|
  8013. * | stats entry length | reserved | S |stat type|
  8014. * |------------------------------------------------------------|
  8015. * | |
  8016. * | type-specific stats info |
  8017. * | |
  8018. * |------------------------------------------------------------|
  8019. * | stats entry length | reserved | S |stat type|
  8020. * |------------------------------------------------------------|
  8021. * | |
  8022. * | type-specific stats info |
  8023. * | |
  8024. * |------------------------------------------------------------|
  8025. * | n/a | reserved | 111 | n/a |
  8026. * |------------------------------------------------------------|
  8027. * Header fields:
  8028. * - MSG_TYPE
  8029. * Bits 7:0
  8030. * Purpose: identifies this is a statistics upload confirmation message
  8031. * Value: 0x9
  8032. * - COOKIE_LSBS
  8033. * Bits 31:0
  8034. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8035. * message with its preceding host->target stats request message.
  8036. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8037. * - COOKIE_MSBS
  8038. * Bits 31:0
  8039. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8040. * message with its preceding host->target stats request message.
  8041. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8042. *
  8043. * Stats Information Element tag-length header fields:
  8044. * - STAT_TYPE
  8045. * Bits 4:0
  8046. * Purpose: identifies the type of statistics info held in the
  8047. * following information element
  8048. * Value: htt_dbg_stats_type
  8049. * - STATUS
  8050. * Bits 7:5
  8051. * Purpose: indicate whether the requested stats are present
  8052. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8053. * the completion of the stats entry series
  8054. * - LENGTH
  8055. * Bits 31:16
  8056. * Purpose: indicate the stats information size
  8057. * Value: This field specifies the number of bytes of stats information
  8058. * that follows the element tag-length header.
  8059. * It is expected but not required that this length is a multiple of
  8060. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8061. * subsequent stats entry header will begin on a 4-byte aligned
  8062. * boundary.
  8063. */
  8064. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8065. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8066. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8067. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8068. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8069. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8070. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8071. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8072. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8073. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8074. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8075. do { \
  8076. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8077. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8078. } while (0)
  8079. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8080. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8081. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8082. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8085. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8086. } while (0)
  8087. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8088. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8089. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8090. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8091. do { \
  8092. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8093. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8094. } while (0)
  8095. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8096. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8097. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8098. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8099. #define HTT_MAX_AGGR 64
  8100. #define HTT_HL_MAX_AGGR 18
  8101. /**
  8102. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8103. *
  8104. * @details
  8105. * The following field definitions describe the format of the HTT host
  8106. * to target frag_desc/msdu_ext bank configuration message.
  8107. * The message contains the based address and the min and max id of the
  8108. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8109. * MSDU_EXT/FRAG_DESC.
  8110. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8111. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8112. * the hardware does the mapping/translation.
  8113. *
  8114. * Total banks that can be configured is configured to 16.
  8115. *
  8116. * This should be called before any TX has be initiated by the HTT
  8117. *
  8118. * |31 16|15 8|7 5|4 0|
  8119. * |------------------------------------------------------------|
  8120. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8121. * |------------------------------------------------------------|
  8122. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8123. #if HTT_PADDR64
  8124. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8125. #endif
  8126. * |------------------------------------------------------------|
  8127. * | ... |
  8128. * |------------------------------------------------------------|
  8129. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8130. #if HTT_PADDR64
  8131. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8132. #endif
  8133. * |------------------------------------------------------------|
  8134. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8135. * |------------------------------------------------------------|
  8136. * | ... |
  8137. * |------------------------------------------------------------|
  8138. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8139. * |------------------------------------------------------------|
  8140. * Header fields:
  8141. * - MSG_TYPE
  8142. * Bits 7:0
  8143. * Value: 0x6
  8144. * for systems with 64-bit format for bus addresses:
  8145. * - BANKx_BASE_ADDRESS_LO
  8146. * Bits 31:0
  8147. * Purpose: Provide a mechanism to specify the base address of the
  8148. * MSDU_EXT bank physical/bus address.
  8149. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8150. * - BANKx_BASE_ADDRESS_HI
  8151. * Bits 31:0
  8152. * Purpose: Provide a mechanism to specify the base address of the
  8153. * MSDU_EXT bank physical/bus address.
  8154. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8155. * for systems with 32-bit format for bus addresses:
  8156. * - BANKx_BASE_ADDRESS
  8157. * Bits 31:0
  8158. * Purpose: Provide a mechanism to specify the base address of the
  8159. * MSDU_EXT bank physical/bus address.
  8160. * Value: MSDU_EXT bank physical / bus address
  8161. * - BANKx_MIN_ID
  8162. * Bits 15:0
  8163. * Purpose: Provide a mechanism to specify the min index that needs to
  8164. * mapped.
  8165. * - BANKx_MAX_ID
  8166. * Bits 31:16
  8167. * Purpose: Provide a mechanism to specify the max index that needs to
  8168. * mapped.
  8169. *
  8170. */
  8171. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8172. * safe value.
  8173. * @note MAX supported banks is 16.
  8174. */
  8175. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8176. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8177. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8178. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8179. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8180. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8181. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8183. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8185. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8186. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8187. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8188. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8189. do { \
  8190. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8191. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8192. } while (0)
  8193. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8194. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8195. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8196. do { \
  8197. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8198. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8199. } while (0)
  8200. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8201. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8202. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8203. do { \
  8204. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8205. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8206. } while (0)
  8207. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8208. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8209. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8210. do { \
  8211. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8212. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8213. } while (0)
  8214. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8215. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8216. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8217. do { \
  8218. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8219. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8220. } while (0)
  8221. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8222. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8223. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8224. do { \
  8225. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8226. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8227. } while (0)
  8228. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8229. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8230. /*
  8231. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8232. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8233. * addresses are stored in a XXX-bit field.
  8234. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8235. * htt_tx_frag_desc64_bank_cfg_t structs.
  8236. */
  8237. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8238. _paddr_bits_, \
  8239. _paddr__bank_base_address_) \
  8240. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8241. /** word 0 \
  8242. * msg_type: 8, \
  8243. * pdev_id: 2, \
  8244. * swap: 1, \
  8245. * reserved0: 5, \
  8246. * num_banks: 8, \
  8247. * desc_size: 8; \
  8248. */ \
  8249. A_UINT32 word0; \
  8250. /* \
  8251. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8252. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8253. * the second A_UINT32). \
  8254. */ \
  8255. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8256. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8257. } POSTPACK
  8258. /* define htt_tx_frag_desc32_bank_cfg_t */
  8259. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8260. /* define htt_tx_frag_desc64_bank_cfg_t */
  8261. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8262. /*
  8263. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8264. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8265. */
  8266. #if HTT_PADDR64
  8267. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8268. #else
  8269. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8270. #endif
  8271. /**
  8272. * @brief target -> host HTT TX Credit total count update message definition
  8273. *
  8274. *|31 16|15|14 9| 8 |7 0 |
  8275. *|---------------------+--+----------+-------+----------|
  8276. *|cur htt credit delta | Q| reserved | sign | msg type |
  8277. *|------------------------------------------------------|
  8278. *
  8279. * Header fields:
  8280. * - MSG_TYPE
  8281. * Bits 7:0
  8282. * Purpose: identifies this as a htt tx credit delta update message
  8283. * Value: 0xe
  8284. * - SIGN
  8285. * Bits 8
  8286. * identifies whether credit delta is positive or negative
  8287. * Value:
  8288. * - 0x0: credit delta is positive, rebalance in some buffers
  8289. * - 0x1: credit delta is negative, rebalance out some buffers
  8290. * - reserved
  8291. * Bits 14:9
  8292. * Value: 0x0
  8293. * - TXQ_GRP
  8294. * Bit 15
  8295. * Purpose: indicates whether any tx queue group information elements
  8296. * are appended to the tx credit update message
  8297. * Value: 0 -> no tx queue group information element is present
  8298. * 1 -> a tx queue group information element immediately follows
  8299. * - DELTA_COUNT
  8300. * Bits 31:16
  8301. * Purpose: Specify current htt credit delta absolute count
  8302. */
  8303. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8304. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8305. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8306. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8307. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8308. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8309. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8310. do { \
  8311. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8312. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8313. } while (0)
  8314. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8315. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8316. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8317. do { \
  8318. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8319. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8320. } while (0)
  8321. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8322. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8323. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8324. do { \
  8325. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8326. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8327. } while (0)
  8328. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8329. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8330. #define HTT_TX_CREDIT_MSG_BYTES 4
  8331. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8332. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8333. /**
  8334. * @brief HTT WDI_IPA Operation Response Message
  8335. *
  8336. * @details
  8337. * HTT WDI_IPA Operation Response message is sent by target
  8338. * to host confirming suspend or resume operation.
  8339. * |31 24|23 16|15 8|7 0|
  8340. * |----------------+----------------+----------------+----------------|
  8341. * | op_code | Rsvd | msg_type |
  8342. * |-------------------------------------------------------------------|
  8343. * | Rsvd | Response len |
  8344. * |-------------------------------------------------------------------|
  8345. * | |
  8346. * | Response-type specific info |
  8347. * | |
  8348. * | |
  8349. * |-------------------------------------------------------------------|
  8350. * Header fields:
  8351. * - MSG_TYPE
  8352. * Bits 7:0
  8353. * Purpose: Identifies this as WDI_IPA Operation Response message
  8354. * value: = 0x13
  8355. * - OP_CODE
  8356. * Bits 31:16
  8357. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8358. * value: = enum htt_wdi_ipa_op_code
  8359. * - RSP_LEN
  8360. * Bits 16:0
  8361. * Purpose: length for the response-type specific info
  8362. * value: = length in bytes for response-type specific info
  8363. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8364. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8365. */
  8366. PREPACK struct htt_wdi_ipa_op_response_t
  8367. {
  8368. /* DWORD 0: flags and meta-data */
  8369. A_UINT32
  8370. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8371. reserved1: 8,
  8372. op_code: 16;
  8373. A_UINT32
  8374. rsp_len: 16,
  8375. reserved2: 16;
  8376. } POSTPACK;
  8377. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8378. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8379. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8380. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8381. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8382. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8383. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8384. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8385. do { \
  8386. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8387. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8388. } while (0)
  8389. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8390. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8391. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8392. do { \
  8393. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8394. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8395. } while (0)
  8396. enum htt_phy_mode {
  8397. htt_phy_mode_11a = 0,
  8398. htt_phy_mode_11g = 1,
  8399. htt_phy_mode_11b = 2,
  8400. htt_phy_mode_11g_only = 3,
  8401. htt_phy_mode_11na_ht20 = 4,
  8402. htt_phy_mode_11ng_ht20 = 5,
  8403. htt_phy_mode_11na_ht40 = 6,
  8404. htt_phy_mode_11ng_ht40 = 7,
  8405. htt_phy_mode_11ac_vht20 = 8,
  8406. htt_phy_mode_11ac_vht40 = 9,
  8407. htt_phy_mode_11ac_vht80 = 10,
  8408. htt_phy_mode_11ac_vht20_2g = 11,
  8409. htt_phy_mode_11ac_vht40_2g = 12,
  8410. htt_phy_mode_11ac_vht80_2g = 13,
  8411. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8412. htt_phy_mode_11ac_vht160 = 15,
  8413. htt_phy_mode_max,
  8414. };
  8415. /**
  8416. * @brief target -> host HTT channel change indication
  8417. * @details
  8418. * Specify when a channel change occurs.
  8419. * This allows the host to precisely determine which rx frames arrived
  8420. * on the old channel and which rx frames arrived on the new channel.
  8421. *
  8422. *|31 |7 0 |
  8423. *|-------------------------------------------+----------|
  8424. *| reserved | msg type |
  8425. *|------------------------------------------------------|
  8426. *| primary_chan_center_freq_mhz |
  8427. *|------------------------------------------------------|
  8428. *| contiguous_chan1_center_freq_mhz |
  8429. *|------------------------------------------------------|
  8430. *| contiguous_chan2_center_freq_mhz |
  8431. *|------------------------------------------------------|
  8432. *| phy_mode |
  8433. *|------------------------------------------------------|
  8434. *
  8435. * Header fields:
  8436. * - MSG_TYPE
  8437. * Bits 7:0
  8438. * Purpose: identifies this as a htt channel change indication message
  8439. * Value: 0x15
  8440. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8441. * Bits 31:0
  8442. * Purpose: identify the (center of the) new 20 MHz primary channel
  8443. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8444. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8445. * Bits 31:0
  8446. * Purpose: identify the (center of the) contiguous frequency range
  8447. * comprising the new channel.
  8448. * For example, if the new channel is a 80 MHz channel extending
  8449. * 60 MHz beyond the primary channel, this field would be 30 larger
  8450. * than the primary channel center frequency field.
  8451. * Value: center frequency of the contiguous frequency range comprising
  8452. * the full channel in MHz units
  8453. * (80+80 channels also use the CONTIG_CHAN2 field)
  8454. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8455. * Bits 31:0
  8456. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8457. * within a VHT 80+80 channel.
  8458. * This field is only relevant for VHT 80+80 channels.
  8459. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8460. * channel (arbitrary value for cases besides VHT 80+80)
  8461. * - PHY_MODE
  8462. * Bits 31:0
  8463. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8464. * and band
  8465. * Value: htt_phy_mode enum value
  8466. */
  8467. PREPACK struct htt_chan_change_t
  8468. {
  8469. /* DWORD 0: flags and meta-data */
  8470. A_UINT32
  8471. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8472. reserved1: 24;
  8473. A_UINT32 primary_chan_center_freq_mhz;
  8474. A_UINT32 contig_chan1_center_freq_mhz;
  8475. A_UINT32 contig_chan2_center_freq_mhz;
  8476. A_UINT32 phy_mode;
  8477. } POSTPACK;
  8478. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8479. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8480. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8481. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8482. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8483. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8484. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8485. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8486. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8489. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8490. } while (0)
  8491. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8492. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8493. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8494. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8495. do { \
  8496. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8497. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8498. } while (0)
  8499. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8500. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8501. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8502. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8503. do { \
  8504. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8505. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8506. } while (0)
  8507. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8508. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8509. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8510. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8511. do { \
  8512. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8513. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8514. } while (0)
  8515. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8516. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8517. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8518. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8519. /**
  8520. * @brief rx offload packet error message
  8521. *
  8522. * @details
  8523. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8524. * of target payload like mic err.
  8525. *
  8526. * |31 24|23 16|15 8|7 0|
  8527. * |----------------+----------------+----------------+----------------|
  8528. * | tid | vdev_id | msg_sub_type | msg_type |
  8529. * |-------------------------------------------------------------------|
  8530. * : (sub-type dependent content) :
  8531. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8532. * Header fields:
  8533. * - msg_type
  8534. * Bits 7:0
  8535. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8536. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8537. * - msg_sub_type
  8538. * Bits 15:8
  8539. * Purpose: Identifies which type of rx error is reported by this message
  8540. * value: htt_rx_ofld_pkt_err_type
  8541. * - vdev_id
  8542. * Bits 23:16
  8543. * Purpose: Identifies which vdev received the erroneous rx frame
  8544. * value:
  8545. * - tid
  8546. * Bits 31:24
  8547. * Purpose: Identifies the traffic type of the rx frame
  8548. * value:
  8549. *
  8550. * - The payload fields used if the sub-type == MIC error are shown below.
  8551. * Note - MIC err is per MSDU, while PN is per MPDU.
  8552. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8553. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8554. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8555. * instead of sending separate HTT messages for each wrong MSDU within
  8556. * the MPDU.
  8557. *
  8558. * |31 24|23 16|15 8|7 0|
  8559. * |----------------+----------------+----------------+----------------|
  8560. * | Rsvd | key_id | peer_id |
  8561. * |-------------------------------------------------------------------|
  8562. * | receiver MAC addr 31:0 |
  8563. * |-------------------------------------------------------------------|
  8564. * | Rsvd | receiver MAC addr 47:32 |
  8565. * |-------------------------------------------------------------------|
  8566. * | transmitter MAC addr 31:0 |
  8567. * |-------------------------------------------------------------------|
  8568. * | Rsvd | transmitter MAC addr 47:32 |
  8569. * |-------------------------------------------------------------------|
  8570. * | PN 31:0 |
  8571. * |-------------------------------------------------------------------|
  8572. * | Rsvd | PN 47:32 |
  8573. * |-------------------------------------------------------------------|
  8574. * - peer_id
  8575. * Bits 15:0
  8576. * Purpose: identifies which peer is frame is from
  8577. * value:
  8578. * - key_id
  8579. * Bits 23:16
  8580. * Purpose: identifies key_id of rx frame
  8581. * value:
  8582. * - RA_31_0 (receiver MAC addr 31:0)
  8583. * Bits 31:0
  8584. * Purpose: identifies by MAC address which vdev received the frame
  8585. * value: MAC address lower 4 bytes
  8586. * - RA_47_32 (receiver MAC addr 47:32)
  8587. * Bits 15:0
  8588. * Purpose: identifies by MAC address which vdev received the frame
  8589. * value: MAC address upper 2 bytes
  8590. * - TA_31_0 (transmitter MAC addr 31:0)
  8591. * Bits 31:0
  8592. * Purpose: identifies by MAC address which peer transmitted the frame
  8593. * value: MAC address lower 4 bytes
  8594. * - TA_47_32 (transmitter MAC addr 47:32)
  8595. * Bits 15:0
  8596. * Purpose: identifies by MAC address which peer transmitted the frame
  8597. * value: MAC address upper 2 bytes
  8598. * - PN_31_0
  8599. * Bits 31:0
  8600. * Purpose: Identifies pn of rx frame
  8601. * value: PN lower 4 bytes
  8602. * - PN_47_32
  8603. * Bits 15:0
  8604. * Purpose: Identifies pn of rx frame
  8605. * value:
  8606. * TKIP or CCMP: PN upper 2 bytes
  8607. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8608. */
  8609. enum htt_rx_ofld_pkt_err_type {
  8610. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8611. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8612. };
  8613. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8614. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8615. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8616. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8617. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8618. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8619. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8620. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8621. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8622. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8623. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8624. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8625. do { \
  8626. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8627. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8628. } while (0)
  8629. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8630. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8631. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8634. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8635. } while (0)
  8636. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8637. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8638. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8639. do { \
  8640. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8641. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8642. } while (0)
  8643. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8662. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8663. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8665. do { \
  8666. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8667. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8668. } while (0)
  8669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8670. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8671. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8673. do { \
  8674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8676. } while (0)
  8677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8678. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8679. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8681. do { \
  8682. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8683. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8684. } while (0)
  8685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8686. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8687. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8689. do { \
  8690. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8691. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8692. } while (0)
  8693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8694. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8695. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8697. do { \
  8698. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8699. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8700. } while (0)
  8701. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8702. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8703. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8704. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8705. do { \
  8706. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8707. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8708. } while (0)
  8709. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8710. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8711. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8712. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8713. do { \
  8714. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8715. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8716. } while (0)
  8717. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8718. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8719. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8720. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8721. do { \
  8722. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8723. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8724. } while (0)
  8725. /**
  8726. * @brief peer rate report message
  8727. *
  8728. * @details
  8729. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8730. * justified rate of all the peers.
  8731. *
  8732. * |31 24|23 16|15 8|7 0|
  8733. * |----------------+----------------+----------------+----------------|
  8734. * | peer_count | | msg_type |
  8735. * |-------------------------------------------------------------------|
  8736. * : Payload (variant number of peer rate report) :
  8737. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8738. * Header fields:
  8739. * - msg_type
  8740. * Bits 7:0
  8741. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8742. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8743. * - reserved
  8744. * Bits 15:8
  8745. * Purpose:
  8746. * value:
  8747. * - peer_count
  8748. * Bits 31:16
  8749. * Purpose: Specify how many peer rate report elements are present in the payload.
  8750. * value:
  8751. *
  8752. * Payload:
  8753. * There are variant number of peer rate report follow the first 32 bits.
  8754. * The peer rate report is defined as follows.
  8755. *
  8756. * |31 20|19 16|15 0|
  8757. * |-----------------------+---------+---------------------------------|-
  8758. * | reserved | phy | peer_id | \
  8759. * |-------------------------------------------------------------------| -> report #0
  8760. * | rate | /
  8761. * |-----------------------+---------+---------------------------------|-
  8762. * | reserved | phy | peer_id | \
  8763. * |-------------------------------------------------------------------| -> report #1
  8764. * | rate | /
  8765. * |-----------------------+---------+---------------------------------|-
  8766. * | reserved | phy | peer_id | \
  8767. * |-------------------------------------------------------------------| -> report #2
  8768. * | rate | /
  8769. * |-------------------------------------------------------------------|-
  8770. * : :
  8771. * : :
  8772. * : :
  8773. * :-------------------------------------------------------------------:
  8774. *
  8775. * - peer_id
  8776. * Bits 15:0
  8777. * Purpose: identify the peer
  8778. * value:
  8779. * - phy
  8780. * Bits 19:16
  8781. * Purpose: identify which phy is in use
  8782. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8783. * Please see enum htt_peer_report_phy_type for detail.
  8784. * - reserved
  8785. * Bits 31:20
  8786. * Purpose:
  8787. * value:
  8788. * - rate
  8789. * Bits 31:0
  8790. * Purpose: represent the justified rate of the peer specified by peer_id
  8791. * value:
  8792. */
  8793. enum htt_peer_rate_report_phy_type {
  8794. HTT_PEER_RATE_REPORT_11B = 0,
  8795. HTT_PEER_RATE_REPORT_11A_G,
  8796. HTT_PEER_RATE_REPORT_11N,
  8797. HTT_PEER_RATE_REPORT_11AC,
  8798. };
  8799. #define HTT_PEER_RATE_REPORT_SIZE 8
  8800. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8801. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8802. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8803. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8804. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8805. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8806. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8807. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8808. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8809. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8810. do { \
  8811. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8812. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8813. } while (0)
  8814. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8815. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8816. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8817. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8820. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8821. } while (0)
  8822. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8823. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8824. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8825. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8826. do { \
  8827. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8828. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8829. } while (0)
  8830. /**
  8831. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8832. *
  8833. * @details
  8834. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8835. * a flow of descriptors.
  8836. *
  8837. * This message is in TLV format and indicates the parameters to be setup a
  8838. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8839. * receive descriptors from a specified pool.
  8840. *
  8841. * The message would appear as follows:
  8842. *
  8843. * |31 24|23 16|15 8|7 0|
  8844. * |----------------+----------------+----------------+----------------|
  8845. * header | reserved | num_flows | msg_type |
  8846. * |-------------------------------------------------------------------|
  8847. * | |
  8848. * : payload :
  8849. * | |
  8850. * |-------------------------------------------------------------------|
  8851. *
  8852. * The header field is one DWORD long and is interpreted as follows:
  8853. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8854. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8855. * this message
  8856. * b'16-31 - reserved: These bits are reserved for future use
  8857. *
  8858. * Payload:
  8859. * The payload would contain multiple objects of the following structure. Each
  8860. * object represents a flow.
  8861. *
  8862. * |31 24|23 16|15 8|7 0|
  8863. * |----------------+----------------+----------------+----------------|
  8864. * header | reserved | num_flows | msg_type |
  8865. * |-------------------------------------------------------------------|
  8866. * payload0| flow_type |
  8867. * |-------------------------------------------------------------------|
  8868. * | flow_id |
  8869. * |-------------------------------------------------------------------|
  8870. * | reserved0 | flow_pool_id |
  8871. * |-------------------------------------------------------------------|
  8872. * | reserved1 | flow_pool_size |
  8873. * |-------------------------------------------------------------------|
  8874. * | reserved2 |
  8875. * |-------------------------------------------------------------------|
  8876. * payload1| flow_type |
  8877. * |-------------------------------------------------------------------|
  8878. * | flow_id |
  8879. * |-------------------------------------------------------------------|
  8880. * | reserved0 | flow_pool_id |
  8881. * |-------------------------------------------------------------------|
  8882. * | reserved1 | flow_pool_size |
  8883. * |-------------------------------------------------------------------|
  8884. * | reserved2 |
  8885. * |-------------------------------------------------------------------|
  8886. * | . |
  8887. * | . |
  8888. * | . |
  8889. * |-------------------------------------------------------------------|
  8890. *
  8891. * Each payload is 5 DWORDS long and is interpreted as follows:
  8892. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8893. * this flow is associated. It can be VDEV, peer,
  8894. * or tid (AC). Based on enum htt_flow_type.
  8895. *
  8896. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8897. * object. For flow_type vdev it is set to the
  8898. * vdevid, for peer it is peerid and for tid, it is
  8899. * tid_num.
  8900. *
  8901. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8902. * in the host for this flow
  8903. * b'16:31 - reserved0: This field in reserved for the future. In case
  8904. * we have a hierarchical implementation (HCM) of
  8905. * pools, it can be used to indicate the ID of the
  8906. * parent-pool.
  8907. *
  8908. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8909. * Descriptors for this flow will be
  8910. * allocated from this pool in the host.
  8911. * b'16:31 - reserved1: This field in reserved for the future. In case
  8912. * we have a hierarchical implementation of pools,
  8913. * it can be used to indicate the max number of
  8914. * descriptors in the pool. The b'0:15 can be used
  8915. * to indicate min number of descriptors in the
  8916. * HCM scheme.
  8917. *
  8918. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8919. * we have a hierarchical implementation of pools,
  8920. * b'0:15 can be used to indicate the
  8921. * priority-based borrowing (PBB) threshold of
  8922. * the flow's pool. The b'16:31 are still left
  8923. * reserved.
  8924. */
  8925. enum htt_flow_type {
  8926. FLOW_TYPE_VDEV = 0,
  8927. /* Insert new flow types above this line */
  8928. };
  8929. PREPACK struct htt_flow_pool_map_payload_t {
  8930. A_UINT32 flow_type;
  8931. A_UINT32 flow_id;
  8932. A_UINT32 flow_pool_id:16,
  8933. reserved0:16;
  8934. A_UINT32 flow_pool_size:16,
  8935. reserved1:16;
  8936. A_UINT32 reserved2;
  8937. } POSTPACK;
  8938. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8939. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8940. (sizeof(struct htt_flow_pool_map_payload_t))
  8941. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8942. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8943. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8944. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8945. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8946. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8947. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8949. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8950. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8951. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8952. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8953. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8954. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8955. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8956. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8957. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8958. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8959. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8960. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8961. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8962. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8963. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8964. do { \
  8965. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8966. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8967. } while (0)
  8968. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8969. do { \
  8970. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8971. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8972. } while (0)
  8973. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8976. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8977. } while (0)
  8978. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8981. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8982. } while (0)
  8983. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8986. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8987. } while (0)
  8988. /**
  8989. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8990. *
  8991. * @details
  8992. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8993. * down a flow of descriptors.
  8994. * This message indicates that for the flow (whose ID is provided) is wanting
  8995. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8996. * pool of descriptors from where descriptors are being allocated for this
  8997. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8998. * be unmapped by the host.
  8999. *
  9000. * The message would appear as follows:
  9001. *
  9002. * |31 24|23 16|15 8|7 0|
  9003. * |----------------+----------------+----------------+----------------|
  9004. * | reserved0 | msg_type |
  9005. * |-------------------------------------------------------------------|
  9006. * | flow_type |
  9007. * |-------------------------------------------------------------------|
  9008. * | flow_id |
  9009. * |-------------------------------------------------------------------|
  9010. * | reserved1 | flow_pool_id |
  9011. * |-------------------------------------------------------------------|
  9012. *
  9013. * The message is interpreted as follows:
  9014. * dword0 - b'0:7 - msg_type: This will be set to
  9015. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9016. * b'8:31 - reserved0: Reserved for future use
  9017. *
  9018. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9019. * this flow is associated. It can be VDEV, peer,
  9020. * or tid (AC). Based on enum htt_flow_type.
  9021. *
  9022. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9023. * object. For flow_type vdev it is set to the
  9024. * vdevid, for peer it is peerid and for tid, it is
  9025. * tid_num.
  9026. *
  9027. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9028. * used in the host for this flow
  9029. * b'16:31 - reserved0: This field in reserved for the future.
  9030. *
  9031. */
  9032. PREPACK struct htt_flow_pool_unmap_t {
  9033. A_UINT32 msg_type:8,
  9034. reserved0:24;
  9035. A_UINT32 flow_type;
  9036. A_UINT32 flow_id;
  9037. A_UINT32 flow_pool_id:16,
  9038. reserved1:16;
  9039. } POSTPACK;
  9040. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9041. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9042. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9043. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9044. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9045. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9046. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9047. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9048. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9049. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9050. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9051. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9052. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9053. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9054. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9055. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9058. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9059. } while (0)
  9060. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9061. do { \
  9062. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9063. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9064. } while (0)
  9065. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9066. do { \
  9067. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9068. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9069. } while (0)
  9070. /**
  9071. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9072. *
  9073. * @details
  9074. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9075. * SRNG ring setup is done
  9076. *
  9077. * This message indicates whether the last setup operation is successful.
  9078. * It will be sent to host when host set respose_required bit in
  9079. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9080. * The message would appear as follows:
  9081. *
  9082. * |31 24|23 16|15 8|7 0|
  9083. * |--------------- +----------------+----------------+----------------|
  9084. * | setup_status | ring_id | pdev_id | msg_type |
  9085. * |-------------------------------------------------------------------|
  9086. *
  9087. * The message is interpreted as follows:
  9088. * dword0 - b'0:7 - msg_type: This will be set to
  9089. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9090. * b'8:15 - pdev_id:
  9091. * 0 (for rings at SOC/UMAC level),
  9092. * 1/2/3 mac id (for rings at LMAC level)
  9093. * b'16:23 - ring_id: Identify the ring which is set up
  9094. * More details can be got from enum htt_srng_ring_id
  9095. * b'24:31 - setup_status: Indicate status of setup operation
  9096. * Refer to htt_ring_setup_status
  9097. */
  9098. PREPACK struct htt_sring_setup_done_t {
  9099. A_UINT32 msg_type: 8,
  9100. pdev_id: 8,
  9101. ring_id: 8,
  9102. setup_status: 8;
  9103. } POSTPACK;
  9104. enum htt_ring_setup_status {
  9105. htt_ring_setup_status_ok = 0,
  9106. htt_ring_setup_status_error,
  9107. };
  9108. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9109. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9110. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9111. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9112. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9113. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9114. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9115. do { \
  9116. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9117. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9118. } while (0)
  9119. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9120. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9121. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9122. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9123. HTT_SRING_SETUP_DONE_RING_ID_S)
  9124. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9125. do { \
  9126. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9127. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9128. } while (0)
  9129. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9130. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9131. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9132. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9133. HTT_SRING_SETUP_DONE_STATUS_S)
  9134. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9135. do { \
  9136. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9137. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9138. } while (0)
  9139. /**
  9140. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9141. *
  9142. * @details
  9143. * HTT TX map flow entry with tqm flow pointer
  9144. * Sent from firmware to host to add tqm flow pointer in corresponding
  9145. * flow search entry. Flow metadata is replayed back to host as part of this
  9146. * struct to enable host to find the specific flow search entry
  9147. *
  9148. * The message would appear as follows:
  9149. *
  9150. * |31 28|27 18|17 14|13 8|7 0|
  9151. * |-------+------------------------------------------+----------------|
  9152. * | rsvd0 | fse_hsh_idx | msg_type |
  9153. * |-------------------------------------------------------------------|
  9154. * | rsvd1 | tid | peer_id |
  9155. * |-------------------------------------------------------------------|
  9156. * | tqm_flow_pntr_lo |
  9157. * |-------------------------------------------------------------------|
  9158. * | tqm_flow_pntr_hi |
  9159. * |-------------------------------------------------------------------|
  9160. * | fse_meta_data |
  9161. * |-------------------------------------------------------------------|
  9162. *
  9163. * The message is interpreted as follows:
  9164. *
  9165. * dword0 - b'0:7 - msg_type: This will be set to
  9166. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9167. *
  9168. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9169. * for this flow entry
  9170. *
  9171. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9172. *
  9173. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9174. *
  9175. * dword1 - b'14:17 - tid
  9176. *
  9177. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9178. *
  9179. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9180. *
  9181. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9182. *
  9183. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9184. * given by host
  9185. */
  9186. PREPACK struct htt_tx_map_flow_info {
  9187. A_UINT32
  9188. msg_type: 8,
  9189. fse_hsh_idx: 20,
  9190. rsvd0: 4;
  9191. A_UINT32
  9192. peer_id: 14,
  9193. tid: 4,
  9194. rsvd1: 14;
  9195. A_UINT32 tqm_flow_pntr_lo;
  9196. A_UINT32 tqm_flow_pntr_hi;
  9197. struct htt_tx_flow_metadata fse_meta_data;
  9198. } POSTPACK;
  9199. /* DWORD 0 */
  9200. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9201. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9202. /* DWORD 1 */
  9203. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9204. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9205. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9206. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9207. /* DWORD 0 */
  9208. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9209. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9210. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9211. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9212. do { \
  9213. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9214. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9215. } while (0)
  9216. /* DWORD 1 */
  9217. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9218. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9219. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9220. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9223. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9224. } while (0)
  9225. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9226. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9227. HTT_TX_MAP_FLOW_INFO_TID_S)
  9228. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9231. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9232. } while (0)
  9233. /*
  9234. * htt_dbg_ext_stats_status -
  9235. * present - The requested stats have been delivered in full.
  9236. * This indicates that either the stats information was contained
  9237. * in its entirety within this message, or else this message
  9238. * completes the delivery of the requested stats info that was
  9239. * partially delivered through earlier STATS_CONF messages.
  9240. * partial - The requested stats have been delivered in part.
  9241. * One or more subsequent STATS_CONF messages with the same
  9242. * cookie value will be sent to deliver the remainder of the
  9243. * information.
  9244. * error - The requested stats could not be delivered, for example due
  9245. * to a shortage of memory to construct a message holding the
  9246. * requested stats.
  9247. * invalid - The requested stat type is either not recognized, or the
  9248. * target is configured to not gather the stats type in question.
  9249. */
  9250. enum htt_dbg_ext_stats_status {
  9251. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9252. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9253. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9254. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9255. };
  9256. /**
  9257. * @brief target -> host ppdu stats upload
  9258. *
  9259. * @details
  9260. * The following field definitions describe the format of the HTT target
  9261. * to host ppdu stats indication message.
  9262. *
  9263. *
  9264. * |31 16|15 12|11 10|9 8|7 0 |
  9265. * |----------------------------------------------------------------------|
  9266. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9267. * |----------------------------------------------------------------------|
  9268. * | ppdu_id |
  9269. * |----------------------------------------------------------------------|
  9270. * | Timestamp in us |
  9271. * |----------------------------------------------------------------------|
  9272. * | reserved |
  9273. * |----------------------------------------------------------------------|
  9274. * | type-specific stats info |
  9275. * | (see htt_ppdu_stats.h) |
  9276. * |----------------------------------------------------------------------|
  9277. * Header fields:
  9278. * - MSG_TYPE
  9279. * Bits 7:0
  9280. * Purpose: Identifies this is a PPDU STATS indication
  9281. * message.
  9282. * Value: 0x1d
  9283. * - mac_id
  9284. * Bits 9:8
  9285. * Purpose: mac_id of this ppdu_id
  9286. * Value: 0-3
  9287. * - pdev_id
  9288. * Bits 11:10
  9289. * Purpose: pdev_id of this ppdu_id
  9290. * Value: 0-3
  9291. * 0 (for rings at SOC level),
  9292. * 1/2/3 PDEV -> 0/1/2
  9293. * - payload_size
  9294. * Bits 31:16
  9295. * Purpose: total tlv size
  9296. * Value: payload_size in bytes
  9297. */
  9298. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9299. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9300. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9301. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9302. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9303. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9304. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9305. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9306. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9307. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9308. do { \
  9309. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9310. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9311. } while (0)
  9312. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9313. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9314. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9315. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9316. do { \
  9317. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9318. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9319. } while (0)
  9320. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9321. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9322. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9323. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9324. do { \
  9325. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9326. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9327. } while (0)
  9328. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9329. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9330. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9331. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9332. do { \
  9333. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9334. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9335. } while (0)
  9336. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9337. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9338. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9339. /* htt_t2h_ppdu_stats_ind_hdr_t
  9340. * This struct contains the fields within the header of the
  9341. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9342. * stats info.
  9343. * This struct assumes little-endian layout, and thus is only
  9344. * suitable for use within processors known to be little-endian
  9345. * (such as the target).
  9346. * In contrast, the above macros provide endian-portable methods
  9347. * to get and set the bitfields within this PPDU_STATS_IND header.
  9348. */
  9349. typedef struct {
  9350. A_UINT32 msg_type: 8, /* bits 7:0 */
  9351. mac_id: 2, /* bits 9:8 */
  9352. pdev_id: 2, /* bits 11:10 */
  9353. reserved1: 4, /* bits 15:12 */
  9354. payload_size: 16; /* bits 31:16 */
  9355. A_UINT32 ppdu_id;
  9356. A_UINT32 timestamp_us;
  9357. A_UINT32 reserved2;
  9358. } htt_t2h_ppdu_stats_ind_hdr_t;
  9359. /**
  9360. * @brief target -> host extended statistics upload
  9361. *
  9362. * @details
  9363. * The following field definitions describe the format of the HTT target
  9364. * to host stats upload confirmation message.
  9365. * The message contains a cookie echoed from the HTT host->target stats
  9366. * upload request, which identifies which request the confirmation is
  9367. * for, and a single stats can span over multiple HTT stats indication
  9368. * due to the HTT message size limitation so every HTT ext stats indication
  9369. * will have tag-length-value stats information elements.
  9370. * The tag-length header for each HTT stats IND message also includes a
  9371. * status field, to indicate whether the request for the stat type in
  9372. * question was fully met, partially met, unable to be met, or invalid
  9373. * (if the stat type in question is disabled in the target).
  9374. * A Done bit 1's indicate the end of the of stats info elements.
  9375. *
  9376. *
  9377. * |31 16|15 12|11|10 8|7 5|4 0|
  9378. * |--------------------------------------------------------------|
  9379. * | reserved | msg type |
  9380. * |--------------------------------------------------------------|
  9381. * | cookie LSBs |
  9382. * |--------------------------------------------------------------|
  9383. * | cookie MSBs |
  9384. * |--------------------------------------------------------------|
  9385. * | stats entry length | rsvd | D| S | stat type |
  9386. * |--------------------------------------------------------------|
  9387. * | type-specific stats info |
  9388. * | (see htt_stats.h) |
  9389. * |--------------------------------------------------------------|
  9390. * Header fields:
  9391. * - MSG_TYPE
  9392. * Bits 7:0
  9393. * Purpose: Identifies this is a extended statistics upload confirmation
  9394. * message.
  9395. * Value: 0x1c
  9396. * - COOKIE_LSBS
  9397. * Bits 31:0
  9398. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9399. * message with its preceding host->target stats request message.
  9400. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9401. * - COOKIE_MSBS
  9402. * Bits 31:0
  9403. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9404. * message with its preceding host->target stats request message.
  9405. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9406. *
  9407. * Stats Information Element tag-length header fields:
  9408. * - STAT_TYPE
  9409. * Bits 7:0
  9410. * Purpose: identifies the type of statistics info held in the
  9411. * following information element
  9412. * Value: htt_dbg_ext_stats_type
  9413. * - STATUS
  9414. * Bits 10:8
  9415. * Purpose: indicate whether the requested stats are present
  9416. * Value: htt_dbg_ext_stats_status
  9417. * - DONE
  9418. * Bits 11
  9419. * Purpose:
  9420. * Indicates the completion of the stats entry, this will be the last
  9421. * stats conf HTT segment for the requested stats type.
  9422. * Value:
  9423. * 0 -> the stats retrieval is ongoing
  9424. * 1 -> the stats retrieval is complete
  9425. * - LENGTH
  9426. * Bits 31:16
  9427. * Purpose: indicate the stats information size
  9428. * Value: This field specifies the number of bytes of stats information
  9429. * that follows the element tag-length header.
  9430. * It is expected but not required that this length is a multiple of
  9431. * 4 bytes.
  9432. */
  9433. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9434. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9435. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9436. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9437. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9438. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9439. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9440. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9441. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9442. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9443. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9444. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9445. do { \
  9446. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9447. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9448. } while (0)
  9449. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9450. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9451. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9452. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9453. do { \
  9454. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9455. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9456. } while (0)
  9457. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9458. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9459. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9460. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9461. do { \
  9462. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9463. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9464. } while (0)
  9465. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9466. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9467. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9468. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9469. do { \
  9470. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9471. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9472. } while (0)
  9473. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9474. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9475. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9476. typedef enum {
  9477. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9478. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9479. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9480. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9481. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9482. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9483. /* Reserved from 128 - 255 for target internal use.*/
  9484. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9485. } HTT_PEER_TYPE;
  9486. /** 2 word representation of MAC addr */
  9487. typedef struct {
  9488. /** upper 4 bytes of MAC address */
  9489. A_UINT32 mac_addr31to0;
  9490. /** lower 2 bytes of MAC address */
  9491. A_UINT32 mac_addr47to32;
  9492. } htt_mac_addr;
  9493. /** macro to convert MAC address from char array to HTT word format */
  9494. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9495. (phtt_mac_addr)->mac_addr31to0 = \
  9496. (((c_macaddr)[0] << 0) | \
  9497. ((c_macaddr)[1] << 8) | \
  9498. ((c_macaddr)[2] << 16) | \
  9499. ((c_macaddr)[3] << 24)); \
  9500. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9501. } while (0)
  9502. /**
  9503. * @brief target -> host monitor mac header indication message
  9504. *
  9505. * @details
  9506. * The following diagram shows the format of the monitor mac header message
  9507. * sent from the target to the host.
  9508. * This message is primarily sent when promiscuous rx mode is enabled.
  9509. * One message is sent per rx PPDU.
  9510. *
  9511. * |31 24|23 16|15 8|7 0|
  9512. * |-------------------------------------------------------------|
  9513. * | peer_id | reserved0 | msg_type |
  9514. * |-------------------------------------------------------------|
  9515. * | reserved1 | num_mpdu |
  9516. * |-------------------------------------------------------------|
  9517. * | struct hw_rx_desc |
  9518. * | (see wal_rx_desc.h) |
  9519. * |-------------------------------------------------------------|
  9520. * | struct ieee80211_frame_addr4 |
  9521. * | (see ieee80211_defs.h) |
  9522. * |-------------------------------------------------------------|
  9523. * | struct ieee80211_frame_addr4 |
  9524. * | (see ieee80211_defs.h) |
  9525. * |-------------------------------------------------------------|
  9526. * | ...... |
  9527. * |-------------------------------------------------------------|
  9528. *
  9529. * Header fields:
  9530. * - msg_type
  9531. * Bits 7:0
  9532. * Purpose: Identifies this is a monitor mac header indication message.
  9533. * Value: 0x20
  9534. * - peer_id
  9535. * Bits 31:16
  9536. * Purpose: Software peer id given by host during association,
  9537. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9538. * for rx PPDUs received from unassociated peers.
  9539. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9540. * - num_mpdu
  9541. * Bits 15:0
  9542. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9543. * delivered within the message.
  9544. * Value: 1 to 32
  9545. * num_mpdu is limited to a maximum value of 32, due to buffer
  9546. * size limits. For PPDUs with more than 32 MPDUs, only the
  9547. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9548. * the PPDU will be provided.
  9549. */
  9550. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9551. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9552. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9553. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9554. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9555. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9556. do { \
  9557. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9558. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9559. } while (0)
  9560. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9561. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9562. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9563. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9564. do { \
  9565. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9566. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9567. } while (0)
  9568. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9569. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9570. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9571. /**
  9572. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9573. *
  9574. * @details
  9575. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9576. * the flow pool associated with the specified ID is resized
  9577. *
  9578. * The message would appear as follows:
  9579. *
  9580. * |31 16|15 8|7 0|
  9581. * |---------------------------------+----------------+----------------|
  9582. * | reserved0 | Msg type |
  9583. * |-------------------------------------------------------------------|
  9584. * | flow pool new size | flow pool ID |
  9585. * |-------------------------------------------------------------------|
  9586. *
  9587. * The message is interpreted as follows:
  9588. * b'0:7 - msg_type: This will be set to
  9589. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9590. *
  9591. * b'0:15 - flow pool ID: Existing flow pool ID
  9592. *
  9593. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9594. *
  9595. */
  9596. PREPACK struct htt_flow_pool_resize_t {
  9597. A_UINT32 msg_type:8,
  9598. reserved0:24;
  9599. A_UINT32 flow_pool_id:16,
  9600. flow_pool_new_size:16;
  9601. } POSTPACK;
  9602. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9603. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9604. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9605. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9606. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9607. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9608. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9609. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9610. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9611. do { \
  9612. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9613. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9614. } while (0)
  9615. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9616. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9617. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9618. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9619. do { \
  9620. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9621. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9622. } while (0)
  9623. /**
  9624. * @brief host -> target channel change message
  9625. *
  9626. * @details
  9627. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9628. * to associate RX frames to correct channel they were received on.
  9629. * The following field definitions describe the format of the HTT target
  9630. * to host channel change message.
  9631. * |31 16|15 8|7 5|4 0|
  9632. * |------------------------------------------------------------|
  9633. * | reserved | MSG_TYPE |
  9634. * |------------------------------------------------------------|
  9635. * | CHAN_MHZ |
  9636. * |------------------------------------------------------------|
  9637. * | BAND_CENTER_FREQ1 |
  9638. * |------------------------------------------------------------|
  9639. * | BAND_CENTER_FREQ2 |
  9640. * |------------------------------------------------------------|
  9641. * | CHAN_PHY_MODE |
  9642. * |------------------------------------------------------------|
  9643. * Header fields:
  9644. * - MSG_TYPE
  9645. * Bits 7:0
  9646. * Value: 0xf
  9647. * - CHAN_MHZ
  9648. * Bits 31:0
  9649. * Purpose: frequency of the primary 20mhz channel.
  9650. * - BAND_CENTER_FREQ1
  9651. * Bits 31:0
  9652. * Purpose: centre frequency of the full channel.
  9653. * - BAND_CENTER_FREQ2
  9654. * Bits 31:0
  9655. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9656. * - CHAN_PHY_MODE
  9657. * Bits 31:0
  9658. * Purpose: phy mode of the channel.
  9659. */
  9660. PREPACK struct htt_chan_change_msg {
  9661. A_UINT32 chan_mhz; /* frequency in mhz */
  9662. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9663. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9664. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9665. } POSTPACK;
  9666. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9667. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9668. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9669. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9670. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9671. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9672. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9673. /*
  9674. * The read and write indices point to the data within the host buffer.
  9675. * Because the first 4 bytes of the host buffer is used for the read index and
  9676. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9677. * The read index and write index are the byte offsets from the base of the
  9678. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9679. * Refer the ASCII text picture below.
  9680. */
  9681. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9682. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9683. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9684. /*
  9685. ***************************************************************************
  9686. *
  9687. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9688. *
  9689. ***************************************************************************
  9690. *
  9691. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9692. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9693. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9694. * written into the Host memory region mentioned below.
  9695. *
  9696. * Read index is updated by the Host. At any point of time, the read index will
  9697. * indicate the index that will next be read by the Host. The read index is
  9698. * in units of bytes offset from the base of the meta-data buffer.
  9699. *
  9700. * Write index is updated by the FW. At any point of time, the write index will
  9701. * indicate from where the FW can start writing any new data. The write index is
  9702. * in units of bytes offset from the base of the meta-data buffer.
  9703. *
  9704. * If the Host is not fast enough in reading the CFR data, any new capture data
  9705. * would be dropped if there is no space left to write the new captures.
  9706. *
  9707. * The last 4 bytes of the memory region will have the magic pattern
  9708. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9709. * not overrun the host buffer.
  9710. *
  9711. * ,--------------------. read and write indices store the
  9712. * | | byte offset from the base of the
  9713. * | ,--------+--------. meta-data buffer to the next
  9714. * | | | | location within the data buffer
  9715. * | | v v that will be read / written
  9716. * ************************************************************************
  9717. * * Read * Write * * Magic *
  9718. * * index * index * CFR data1 ...... CFR data N * pattern *
  9719. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9720. * ************************************************************************
  9721. * |<---------- data buffer ---------->|
  9722. *
  9723. * |<----------------- meta-data buffer allocated in Host ----------------|
  9724. *
  9725. * Note:
  9726. * - Considering the 4 bytes needed to store the Read index (R) and the
  9727. * Write index (W), the initial value is as follows:
  9728. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9729. * - Buffer empty condition:
  9730. * R = W
  9731. *
  9732. * Regarding CFR data format:
  9733. * --------------------------
  9734. *
  9735. * Each CFR tone is stored in HW as 16-bits with the following format:
  9736. * {bits[15:12], bits[11:6], bits[5:0]} =
  9737. * {unsigned exponent (4 bits),
  9738. * signed mantissa_real (6 bits),
  9739. * signed mantissa_imag (6 bits)}
  9740. *
  9741. * CFR_real = mantissa_real * 2^(exponent-5)
  9742. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9743. *
  9744. *
  9745. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9746. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9747. *
  9748. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9749. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9750. * .
  9751. * .
  9752. * .
  9753. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9754. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9755. */
  9756. /* Bandwidth of peer CFR captures */
  9757. typedef enum {
  9758. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9759. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9760. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9761. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9762. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9763. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9764. } HTT_PEER_CFR_CAPTURE_BW;
  9765. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9766. * was captured
  9767. */
  9768. typedef enum {
  9769. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9770. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9771. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9772. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9773. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9774. } HTT_PEER_CFR_CAPTURE_MODE;
  9775. typedef enum {
  9776. /* This message type is currently used for the below purpose:
  9777. *
  9778. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9779. * wmi_peer_cfr_capture_cmd.
  9780. * If payload_present bit is set to 0 then the associated memory region
  9781. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9782. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9783. * message; the CFR dump will be present at the end of the message,
  9784. * after the chan_phy_mode.
  9785. */
  9786. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9787. /* Always keep this last */
  9788. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9789. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9790. /**
  9791. * @brief target -> host CFR dump completion indication message definition
  9792. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9793. *
  9794. * @details
  9795. * The following diagram shows the format of the Channel Frequency Response
  9796. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9797. * the channel capture of a peer is copied by Firmware into the Host memory
  9798. *
  9799. * **************************************************************************
  9800. *
  9801. * Message format when the CFR capture message type is
  9802. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9803. *
  9804. * **************************************************************************
  9805. *
  9806. * |31 16|15 |8|7 0|
  9807. * |----------------------------------------------------------------|
  9808. * header: | reserved |P| msg_type |
  9809. * word 0 | | | |
  9810. * |----------------------------------------------------------------|
  9811. * payload: | cfr_capture_msg_type |
  9812. * word 1 | |
  9813. * |----------------------------------------------------------------|
  9814. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9815. * word 2 | | | | | | | | |
  9816. * |----------------------------------------------------------------|
  9817. * | mac_addr31to0 |
  9818. * word 3 | |
  9819. * |----------------------------------------------------------------|
  9820. * | unused / reserved | mac_addr47to32 |
  9821. * word 4 | | |
  9822. * |----------------------------------------------------------------|
  9823. * | index |
  9824. * word 5 | |
  9825. * |----------------------------------------------------------------|
  9826. * | length |
  9827. * word 6 | |
  9828. * |----------------------------------------------------------------|
  9829. * | timestamp |
  9830. * word 7 | |
  9831. * |----------------------------------------------------------------|
  9832. * | counter |
  9833. * word 8 | |
  9834. * |----------------------------------------------------------------|
  9835. * | chan_mhz |
  9836. * word 9 | |
  9837. * |----------------------------------------------------------------|
  9838. * | band_center_freq1 |
  9839. * word 10 | |
  9840. * |----------------------------------------------------------------|
  9841. * | band_center_freq2 |
  9842. * word 11 | |
  9843. * |----------------------------------------------------------------|
  9844. * | chan_phy_mode |
  9845. * word 12 | |
  9846. * |----------------------------------------------------------------|
  9847. * where,
  9848. * P - payload present bit (payload_present explained below)
  9849. * req_id - memory request id (mem_req_id explained below)
  9850. * S - status field (status explained below)
  9851. * capbw - capture bandwidth (capture_bw explained below)
  9852. * mode - mode of capture (mode explained below)
  9853. * sts - space time streams (sts_count explained below)
  9854. * chbw - channel bandwidth (channel_bw explained below)
  9855. * captype - capture type (cap_type explained below)
  9856. *
  9857. * The following field definitions describe the format of the CFR dump
  9858. * completion indication sent from the target to the host
  9859. *
  9860. * Header fields:
  9861. *
  9862. * Word 0
  9863. * - msg_type
  9864. * Bits 7:0
  9865. * Purpose: Identifies this as CFR TX completion indication
  9866. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  9867. * - payload_present
  9868. * Bit 8
  9869. * Purpose: Identifies how CFR data is sent to host
  9870. * Value: 0 - If CFR Payload is written to host memory
  9871. * 1 - If CFR Payload is sent as part of HTT message
  9872. * (This is the requirement for SDIO/USB where it is
  9873. * not possible to write CFR data to host memory)
  9874. * - reserved
  9875. * Bits 31:9
  9876. * Purpose: Reserved
  9877. * Value: 0
  9878. *
  9879. * Payload fields:
  9880. *
  9881. * Word 1
  9882. * - cfr_capture_msg_type
  9883. * Bits 31:0
  9884. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  9885. * to specify the format used for the remainder of the message
  9886. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9887. * (currently only MSG_TYPE_1 is defined)
  9888. *
  9889. * Word 2
  9890. * - mem_req_id
  9891. * Bits 6:0
  9892. * Purpose: Contain the mem request id of the region where the CFR capture
  9893. * has been stored - of type WMI_HOST_MEM_REQ_ID
  9894. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  9895. this value is invalid)
  9896. * - status
  9897. * Bit 7
  9898. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  9899. * Value: 1 (True) - Successful; 0 (False) - Not successful
  9900. * - capture_bw
  9901. * Bits 10:8
  9902. * Purpose: Carry the bandwidth of the CFR capture
  9903. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  9904. * - mode
  9905. * Bits 13:11
  9906. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  9907. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  9908. * - sts_count
  9909. * Bits 16:14
  9910. * Purpose: Carry the number of space time streams
  9911. * Value: Number of space time streams
  9912. * - channel_bw
  9913. * Bits 19:17
  9914. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  9915. * measurement
  9916. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  9917. * - cap_type
  9918. * Bits 23:20
  9919. * Purpose: Carry the type of the capture
  9920. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  9921. * - vdev_id
  9922. * Bits 31:24
  9923. * Purpose: Carry the virtual device id
  9924. * Value: vdev ID
  9925. *
  9926. * Word 3
  9927. * - mac_addr31to0
  9928. * Bits 31:0
  9929. * Purpose: Contain the bits 31:0 of the peer MAC address
  9930. * Value: Bits 31:0 of the peer MAC address
  9931. *
  9932. * Word 4
  9933. * - mac_addr47to32
  9934. * Bits 15:0
  9935. * Purpose: Contain the bits 47:32 of the peer MAC address
  9936. * Value: Bits 47:32 of the peer MAC address
  9937. *
  9938. * Word 5
  9939. * - index
  9940. * Bits 31:0
  9941. * Purpose: Contain the index at which this CFR dump was written in the Host
  9942. * allocated memory. This index is the number of bytes from the base address.
  9943. * Value: Index position
  9944. *
  9945. * Word 6
  9946. * - length
  9947. * Bits 31:0
  9948. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  9949. * Value: Length of the CFR capture of the peer
  9950. *
  9951. * Word 7
  9952. * - timestamp
  9953. * Bits 31:0
  9954. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  9955. * clock used for this timestamp is private to the target and not visible to
  9956. * the host i.e., Host can interpret only the relative timestamp deltas from
  9957. * one message to the next, but can't interpret the absolute timestamp from a
  9958. * single message.
  9959. * Value: Timestamp in microseconds
  9960. *
  9961. * Word 8
  9962. * - counter
  9963. * Bits 31:0
  9964. * Purpose: Carry the count of the current CFR capture from FW. This is
  9965. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  9966. * in host memory)
  9967. * Value: Count of the current CFR capture
  9968. *
  9969. * Word 9
  9970. * - chan_mhz
  9971. * Bits 31:0
  9972. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  9973. * Value: Primary 20 channel frequency
  9974. *
  9975. * Word 10
  9976. * - band_center_freq1
  9977. * Bits 31:0
  9978. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  9979. * Value: Center frequency 1 in MHz
  9980. *
  9981. * Word 11
  9982. * - band_center_freq2
  9983. * Bits 31:0
  9984. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  9985. * the VDEV
  9986. * 80plus80 mode
  9987. * Value: Center frequency 2 in MHz
  9988. *
  9989. * Word 12
  9990. * - chan_phy_mode
  9991. * Bits 31:0
  9992. * Purpose: Carry the phy mode of the channel, of the VDEV
  9993. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  9994. */
  9995. PREPACK struct htt_cfr_dump_ind_type_1 {
  9996. A_UINT32 mem_req_id:7,
  9997. status:1,
  9998. capture_bw:3,
  9999. mode:3,
  10000. sts_count:3,
  10001. channel_bw:3,
  10002. cap_type:4,
  10003. vdev_id:8;
  10004. htt_mac_addr addr;
  10005. A_UINT32 index;
  10006. A_UINT32 length;
  10007. A_UINT32 timestamp;
  10008. A_UINT32 counter;
  10009. struct htt_chan_change_msg chan;
  10010. } POSTPACK;
  10011. PREPACK struct htt_cfr_dump_compl_ind {
  10012. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10013. union {
  10014. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10015. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10016. /* If there is a need to change the memory layout and its associated
  10017. * HTT indication format, a new CFR capture message type can be
  10018. * introduced and added into this union.
  10019. */
  10020. };
  10021. } POSTPACK;
  10022. /*
  10023. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10024. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10025. */
  10026. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10027. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10028. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10031. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10032. } while(0)
  10033. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10034. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10035. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10036. /*
  10037. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10038. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10039. */
  10040. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10041. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10042. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10043. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10044. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10045. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10046. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10047. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10048. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10049. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10050. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10051. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10052. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10053. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10054. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10055. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10056. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10059. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10060. } while (0)
  10061. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10062. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10063. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10064. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10068. } while (0)
  10069. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10071. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10072. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10073. do { \
  10074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10076. } while (0)
  10077. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10079. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10080. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10081. do { \
  10082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10084. } while (0)
  10085. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10087. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10088. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10091. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10092. } while (0)
  10093. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10094. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10095. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10096. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10097. do { \
  10098. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10099. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10100. } while (0)
  10101. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10102. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10103. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10104. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10105. do { \
  10106. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10107. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10108. } while (0)
  10109. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10110. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10111. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10112. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10113. do { \
  10114. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10115. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10116. } while (0)
  10117. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10118. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10119. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10120. /**
  10121. * @brief target -> host peer (PPDU) stats message
  10122. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10123. * @details
  10124. * This message is generated by FW when FW is sending stats to host
  10125. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10126. * This message is sent autonomously by the target rather than upon request
  10127. * by the host.
  10128. * The following field definitions describe the format of the HTT target
  10129. * to host peer stats indication message.
  10130. *
  10131. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10132. * or more PPDU stats records.
  10133. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10134. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10135. * then the message would start with the
  10136. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10137. * below.
  10138. *
  10139. * |31 16|15|14|13 11|10 9|8|7 0|
  10140. * |-------------------------------------------------------------|
  10141. * | reserved |MSG_TYPE |
  10142. * |-------------------------------------------------------------|
  10143. * rec 0 | TLV header |
  10144. * rec 0 |-------------------------------------------------------------|
  10145. * rec 0 | ppdu successful bytes |
  10146. * rec 0 |-------------------------------------------------------------|
  10147. * rec 0 | ppdu retry bytes |
  10148. * rec 0 |-------------------------------------------------------------|
  10149. * rec 0 | ppdu failed bytes |
  10150. * rec 0 |-------------------------------------------------------------|
  10151. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10152. * rec 0 |-------------------------------------------------------------|
  10153. * rec 0 | retried MSDUs | successful MSDUs |
  10154. * rec 0 |-------------------------------------------------------------|
  10155. * rec 0 | TX duration | failed MSDUs |
  10156. * rec 0 |-------------------------------------------------------------|
  10157. * ...
  10158. * |-------------------------------------------------------------|
  10159. * rec N | TLV header |
  10160. * rec N |-------------------------------------------------------------|
  10161. * rec N | ppdu successful bytes |
  10162. * rec N |-------------------------------------------------------------|
  10163. * rec N | ppdu retry bytes |
  10164. * rec N |-------------------------------------------------------------|
  10165. * rec N | ppdu failed bytes |
  10166. * rec N |-------------------------------------------------------------|
  10167. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10168. * rec N |-------------------------------------------------------------|
  10169. * rec N | retried MSDUs | successful MSDUs |
  10170. * rec N |-------------------------------------------------------------|
  10171. * rec N | TX duration | failed MSDUs |
  10172. * rec N |-------------------------------------------------------------|
  10173. *
  10174. * where:
  10175. * A = is A-MPDU flag
  10176. * BA = block-ack failure flags
  10177. * BW = bandwidth spec
  10178. * SG = SGI enabled spec
  10179. * S = skipped rate ctrl
  10180. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10181. *
  10182. * Header
  10183. * ------
  10184. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10185. * dword0 - b'8:31 - reserved : Reserved for future use
  10186. *
  10187. * payload include below peer_stats information
  10188. * --------------------------------------------
  10189. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10190. * @tx_success_bytes : total successful bytes in the PPDU.
  10191. * @tx_retry_bytes : total retried bytes in the PPDU.
  10192. * @tx_failed_bytes : total failed bytes in the PPDU.
  10193. * @tx_ratecode : rate code used for the PPDU.
  10194. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10195. * @ba_ack_failed : BA/ACK failed for this PPDU
  10196. * b00 -> BA received
  10197. * b01 -> BA failed once
  10198. * b10 -> BA failed twice, when HW retry is enabled.
  10199. * @bw : BW
  10200. * b00 -> 20 MHz
  10201. * b01 -> 40 MHz
  10202. * b10 -> 80 MHz
  10203. * b11 -> 160 MHz (or 80+80)
  10204. * @sg : SGI enabled
  10205. * @s : skipped ratectrl
  10206. * @peer_id : peer id
  10207. * @tx_success_msdus : successful MSDUs
  10208. * @tx_retry_msdus : retried MSDUs
  10209. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10210. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10211. */
  10212. #endif