htt.h 503 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147
  1. /*
  2. * Copyright (c) 2011-2018 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. */
  171. #define HTT_CURRENT_VERSION_MAJOR 3
  172. #define HTT_CURRENT_VERSION_MINOR 59
  173. #define HTT_NUM_TX_FRAG_DESC 1024
  174. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  175. #define HTT_CHECK_SET_VAL(field, val) \
  176. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  177. /* macros to assist in sign-extending fields from HTT messages */
  178. #define HTT_SIGN_BIT_MASK(field) \
  179. ((field ## _M + (1 << field ## _S)) >> 1)
  180. #define HTT_SIGN_BIT(_val, field) \
  181. (_val & HTT_SIGN_BIT_MASK(field))
  182. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  183. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  184. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  185. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  186. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  187. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  188. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  189. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  190. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  191. /*
  192. * TEMPORARY:
  193. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  194. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  195. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  196. * updated.
  197. */
  198. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  199. /*
  200. * TEMPORARY:
  201. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  202. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  203. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  204. * updated.
  205. */
  206. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  207. /* HTT Access Category values */
  208. enum HTT_AC_WMM {
  209. /* WMM Access Categories */
  210. HTT_AC_WMM_BE = 0x0,
  211. HTT_AC_WMM_BK = 0x1,
  212. HTT_AC_WMM_VI = 0x2,
  213. HTT_AC_WMM_VO = 0x3,
  214. /* extension Access Categories */
  215. HTT_AC_EXT_NON_QOS = 0x4,
  216. HTT_AC_EXT_UCAST_MGMT = 0x5,
  217. HTT_AC_EXT_MCAST_DATA = 0x6,
  218. HTT_AC_EXT_MCAST_MGMT = 0x7,
  219. };
  220. enum HTT_AC_WMM_MASK {
  221. /* WMM Access Categories */
  222. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  223. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  224. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  225. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  226. /* extension Access Categories */
  227. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  228. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  229. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  230. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  231. };
  232. #define HTT_AC_MASK_WMM \
  233. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  234. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  235. #define HTT_AC_MASK_EXT \
  236. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  237. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  238. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  239. /*
  240. * htt_dbg_stats_type -
  241. * bit positions for each stats type within a stats type bitmask
  242. * The bitmask contains 24 bits.
  243. */
  244. enum htt_dbg_stats_type {
  245. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  246. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  247. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  248. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  249. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  250. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  251. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  252. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  253. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  254. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  255. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  256. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  257. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  258. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  259. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  260. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  261. /* bits 16-23 currently reserved */
  262. /* keep this last */
  263. HTT_DBG_NUM_STATS
  264. };
  265. /*=== HTT option selection TLVs ===
  266. * Certain HTT messages have alternatives or options.
  267. * For such cases, the host and target need to agree on which option to use.
  268. * Option specification TLVs can be appended to the VERSION_REQ and
  269. * VERSION_CONF messages to select options other than the default.
  270. * These TLVs are entirely optional - if they are not provided, there is a
  271. * well-defined default for each option. If they are provided, they can be
  272. * provided in any order. Each TLV can be present or absent independent of
  273. * the presence / absence of other TLVs.
  274. *
  275. * The HTT option selection TLVs use the following format:
  276. * |31 16|15 8|7 0|
  277. * |---------------------------------+----------------+----------------|
  278. * | value (payload) | length | tag |
  279. * |-------------------------------------------------------------------|
  280. * The value portion need not be only 2 bytes; it can be extended by any
  281. * integer number of 4-byte units. The total length of the TLV, including
  282. * the tag and length fields, must be a multiple of 4 bytes. The length
  283. * field specifies the total TLV size in 4-byte units. Thus, the typical
  284. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  285. * field, would store 0x1 in its length field, to show that the TLV occupies
  286. * a single 4-byte unit.
  287. */
  288. /*--- TLV header format - applies to all HTT option TLVs ---*/
  289. enum HTT_OPTION_TLV_TAGS {
  290. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  291. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  292. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  293. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  294. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  295. };
  296. PREPACK struct htt_option_tlv_header_t {
  297. A_UINT8 tag;
  298. A_UINT8 length;
  299. } POSTPACK;
  300. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  301. #define HTT_OPTION_TLV_TAG_S 0
  302. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  303. #define HTT_OPTION_TLV_LENGTH_S 8
  304. /*
  305. * value0 - 16 bit value field stored in word0
  306. * The TLV's value field may be longer than 2 bytes, in which case
  307. * the remainder of the value is stored in word1, word2, etc.
  308. */
  309. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  310. #define HTT_OPTION_TLV_VALUE0_S 16
  311. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  312. do { \
  313. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  314. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  315. } while (0)
  316. #define HTT_OPTION_TLV_TAG_GET(word) \
  317. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  318. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  319. do { \
  320. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  321. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  322. } while (0)
  323. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  324. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  325. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  326. do { \
  327. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  328. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  329. } while (0)
  330. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  331. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  332. /*--- format of specific HTT option TLVs ---*/
  333. /*
  334. * HTT option TLV for specifying LL bus address size
  335. * Some chips require bus addresses used by the target to access buffers
  336. * within the host's memory to be 32 bits; others require bus addresses
  337. * used by the target to access buffers within the host's memory to be
  338. * 64 bits.
  339. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  340. * a suffix to the VERSION_CONF message to specify which bus address format
  341. * the target requires.
  342. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  343. * default to providing bus addresses to the target in 32-bit format.
  344. */
  345. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  346. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  347. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  348. };
  349. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  350. struct htt_option_tlv_header_t hdr;
  351. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  352. } POSTPACK;
  353. /*
  354. * HTT option TLV for specifying whether HL systems should indicate
  355. * over-the-air tx completion for individual frames, or should instead
  356. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  357. * requests an OTA tx completion for a particular tx frame.
  358. * This option does not apply to LL systems, where the TX_COMPL_IND
  359. * is mandatory.
  360. * This option is primarily intended for HL systems in which the tx frame
  361. * downloads over the host --> target bus are as slow as or slower than
  362. * the transmissions over the WLAN PHY. For cases where the bus is faster
  363. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  364. * and consquently will send one TX_COMPL_IND message that covers several
  365. * tx frames. For cases where the WLAN PHY is faster than the bus,
  366. * the target will end up transmitting very short A-MPDUs, and consequently
  367. * sending many TX_COMPL_IND messages, which each cover a very small number
  368. * of tx frames.
  369. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  370. * a suffix to the VERSION_REQ message to request whether the host desires to
  371. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  372. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  373. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  374. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  375. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  376. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  377. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  378. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  379. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  380. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  381. * TLV.
  382. */
  383. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  384. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  385. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  386. };
  387. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  388. struct htt_option_tlv_header_t hdr;
  389. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  390. } POSTPACK;
  391. /*
  392. * HTT option TLV for specifying how many tx queue groups the target
  393. * may establish.
  394. * This TLV specifies the maximum value the target may send in the
  395. * txq_group_id field of any TXQ_GROUP information elements sent by
  396. * the target to the host. This allows the host to pre-allocate an
  397. * appropriate number of tx queue group structs.
  398. *
  399. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  400. * a suffix to the VERSION_REQ message to specify whether the host supports
  401. * tx queue groups at all, and if so if there is any limit on the number of
  402. * tx queue groups that the host supports.
  403. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  404. * a suffix to the VERSION_CONF message. If the host has specified in the
  405. * VER_REQ message a limit on the number of tx queue groups the host can
  406. * supprt, the target shall limit its specification of the maximum tx groups
  407. * to be no larger than this host-specified limit.
  408. *
  409. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  410. * shall preallocate 4 tx queue group structs, and the target shall not
  411. * specify a txq_group_id larger than 3.
  412. */
  413. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  414. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  415. /*
  416. * values 1 through N specify the max number of tx queue groups
  417. * the sender supports
  418. */
  419. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  420. };
  421. /* TEMPORARY backwards-compatibility alias for a typo fix -
  422. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  423. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  424. * to support the old name (with the typo) until all references to the
  425. * old name are replaced with the new name.
  426. */
  427. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  428. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  429. struct htt_option_tlv_header_t hdr;
  430. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  431. } POSTPACK;
  432. /*
  433. * HTT option TLV for specifying whether the target supports an extended
  434. * version of the HTT tx descriptor. If the target provides this TLV
  435. * and specifies in the TLV that the target supports an extended version
  436. * of the HTT tx descriptor, the target must check the "extension" bit in
  437. * the HTT tx descriptor, and if the extension bit is set, to expect a
  438. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  439. * descriptor. Furthermore, the target must provide room for the HTT
  440. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  441. * This option is intended for systems where the host needs to explicitly
  442. * control the transmission parameters such as tx power for individual
  443. * tx frames.
  444. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  445. * as a suffix to the VERSION_CONF message to explicitly specify whether
  446. * the target supports the HTT tx MSDU extension descriptor.
  447. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  448. * by the host as lack of target support for the HTT tx MSDU extension
  449. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  450. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  451. * the HTT tx MSDU extension descriptor.
  452. * The host is not required to provide the HTT tx MSDU extension descriptor
  453. * just because the target supports it; the target must check the
  454. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  455. * extension descriptor is present.
  456. */
  457. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  458. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  459. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  460. };
  461. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  462. struct htt_option_tlv_header_t hdr;
  463. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  464. } POSTPACK;
  465. /*=== host -> target messages ===============================================*/
  466. enum htt_h2t_msg_type {
  467. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  468. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  469. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  470. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  471. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  472. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  473. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  474. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  475. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  476. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  477. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  478. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  479. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  480. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  481. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  482. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  483. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  484. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  485. /* keep this last */
  486. HTT_H2T_NUM_MSGS
  487. };
  488. /*
  489. * HTT host to target message type -
  490. * stored in bits 7:0 of the first word of the message
  491. */
  492. #define HTT_H2T_MSG_TYPE_M 0xff
  493. #define HTT_H2T_MSG_TYPE_S 0
  494. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  495. do { \
  496. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  497. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  498. } while (0)
  499. #define HTT_H2T_MSG_TYPE_GET(word) \
  500. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  501. /**
  502. * @brief host -> target version number request message definition
  503. *
  504. * |31 24|23 16|15 8|7 0|
  505. * |----------------+----------------+----------------+----------------|
  506. * | reserved | msg type |
  507. * |-------------------------------------------------------------------|
  508. * : option request TLV (optional) |
  509. * :...................................................................:
  510. *
  511. * The VER_REQ message may consist of a single 4-byte word, or may be
  512. * extended with TLVs that specify which HTT options the host is requesting
  513. * from the target.
  514. * The following option TLVs may be appended to the VER_REQ message:
  515. * - HL_SUPPRESS_TX_COMPL_IND
  516. * - HL_MAX_TX_QUEUE_GROUPS
  517. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  518. * may be appended to the VER_REQ message (but only one TLV of each type).
  519. *
  520. * Header fields:
  521. * - MSG_TYPE
  522. * Bits 7:0
  523. * Purpose: identifies this as a version number request message
  524. * Value: 0x0
  525. */
  526. #define HTT_VER_REQ_BYTES 4
  527. /* TBDXXX: figure out a reasonable number */
  528. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  529. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  530. /**
  531. * @brief HTT tx MSDU descriptor
  532. *
  533. * @details
  534. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  535. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  536. * the target firmware needs for the FW's tx processing, particularly
  537. * for creating the HW msdu descriptor.
  538. * The same HTT tx descriptor is used for HL and LL systems, though
  539. * a few fields within the tx descriptor are used only by LL or
  540. * only by HL.
  541. * The HTT tx descriptor is defined in two manners: by a struct with
  542. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  543. * definitions.
  544. * The target should use the struct def, for simplicitly and clarity,
  545. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  546. * neutral. Specifically, the host shall use the get/set macros built
  547. * around the mask + shift defs.
  548. */
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  557. #define HTT_TX_VDEV_ID_WORD 0
  558. #define HTT_TX_VDEV_ID_MASK 0x3f
  559. #define HTT_TX_VDEV_ID_SHIFT 16
  560. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  561. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  562. #define HTT_TX_MSDU_LEN_DWORD 1
  563. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  564. /*
  565. * HTT_VAR_PADDR macros
  566. * Allow physical / bus addresses to be either a single 32-bit value,
  567. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  568. */
  569. #define HTT_VAR_PADDR32(var_name) \
  570. A_UINT32 var_name
  571. #define HTT_VAR_PADDR64_LE(var_name) \
  572. struct { \
  573. /* little-endian: lo precedes hi */ \
  574. A_UINT32 lo; \
  575. A_UINT32 hi; \
  576. } var_name
  577. /*
  578. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  579. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  580. * addresses are stored in a XXX-bit field.
  581. * This macro is used to define both htt_tx_msdu_desc32_t and
  582. * htt_tx_msdu_desc64_t structs.
  583. */
  584. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  585. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  586. { \
  587. /* DWORD 0: flags and meta-data */ \
  588. A_UINT32 \
  589. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  590. \
  591. /* pkt_subtype - \
  592. * Detailed specification of the tx frame contents, extending the \
  593. * general specification provided by pkt_type. \
  594. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  595. * pkt_type | pkt_subtype \
  596. * ============================================================== \
  597. * 802.3 | bit 0:3 - Reserved \
  598. * | bit 4: 0x0 - Copy-Engine Classification Results \
  599. * | not appended to the HTT message \
  600. * | 0x1 - Copy-Engine Classification Results \
  601. * | appended to the HTT message in the \
  602. * | format: \
  603. * | [HTT tx desc, frame header, \
  604. * | CE classification results] \
  605. * | The CE classification results begin \
  606. * | at the next 4-byte boundary after \
  607. * | the frame header. \
  608. * ------------+------------------------------------------------- \
  609. * Eth2 | bit 0:3 - Reserved \
  610. * | bit 4: 0x0 - Copy-Engine Classification Results \
  611. * | not appended to the HTT message \
  612. * | 0x1 - Copy-Engine Classification Results \
  613. * | appended to the HTT message. \
  614. * | See the above specification of the \
  615. * | CE classification results location. \
  616. * ------------+------------------------------------------------- \
  617. * native WiFi | bit 0:3 - Reserved \
  618. * | bit 4: 0x0 - Copy-Engine Classification Results \
  619. * | not appended to the HTT message \
  620. * | 0x1 - Copy-Engine Classification Results \
  621. * | appended to the HTT message. \
  622. * | See the above specification of the \
  623. * | CE classification results location. \
  624. * ------------+------------------------------------------------- \
  625. * mgmt | 0x0 - 802.11 MAC header absent \
  626. * | 0x1 - 802.11 MAC header present \
  627. * ------------+------------------------------------------------- \
  628. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  629. * | 0x1 - 802.11 MAC header present \
  630. * | bit 1: 0x0 - allow aggregation \
  631. * | 0x1 - don't allow aggregation \
  632. * | bit 2: 0x0 - perform encryption \
  633. * | 0x1 - don't perform encryption \
  634. * | bit 3: 0x0 - perform tx classification / queuing \
  635. * | 0x1 - don't perform tx classification; \
  636. * | insert the frame into the "misc" \
  637. * | tx queue \
  638. * | bit 4: 0x0 - Copy-Engine Classification Results \
  639. * | not appended to the HTT message \
  640. * | 0x1 - Copy-Engine Classification Results \
  641. * | appended to the HTT message. \
  642. * | See the above specification of the \
  643. * | CE classification results location. \
  644. */ \
  645. pkt_subtype: 5, \
  646. \
  647. /* pkt_type - \
  648. * General specification of the tx frame contents. \
  649. * The htt_pkt_type enum should be used to specify and check the \
  650. * value of this field. \
  651. */ \
  652. pkt_type: 3, \
  653. \
  654. /* vdev_id - \
  655. * ID for the vdev that is sending this tx frame. \
  656. * For certain non-standard packet types, e.g. pkt_type == raw \
  657. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  658. * This field is used primarily for determining where to queue \
  659. * broadcast and multicast frames. \
  660. */ \
  661. vdev_id: 6, \
  662. /* ext_tid - \
  663. * The extended traffic ID. \
  664. * If the TID is unknown, the extended TID is set to \
  665. * HTT_TX_EXT_TID_INVALID. \
  666. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  667. * value of the QoS TID. \
  668. * If the tx frame is non-QoS data, then the extended TID is set to \
  669. * HTT_TX_EXT_TID_NON_QOS. \
  670. * If the tx frame is multicast or broadcast, then the extended TID \
  671. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  672. */ \
  673. ext_tid: 5, \
  674. \
  675. /* postponed - \
  676. * This flag indicates whether the tx frame has been downloaded to \
  677. * the target before but discarded by the target, and now is being \
  678. * downloaded again; or if this is a new frame that is being \
  679. * downloaded for the first time. \
  680. * This flag allows the target to determine the correct order for \
  681. * transmitting new vs. old frames. \
  682. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  683. * This flag only applies to HL systems, since in LL systems, \
  684. * the tx flow control is handled entirely within the target. \
  685. */ \
  686. postponed: 1, \
  687. \
  688. /* extension - \
  689. * This flag indicates whether a HTT tx MSDU extension descriptor \
  690. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  691. * \
  692. * 0x0 - no extension MSDU descriptor is present \
  693. * 0x1 - an extension MSDU descriptor immediately follows the \
  694. * regular MSDU descriptor \
  695. */ \
  696. extension: 1, \
  697. \
  698. /* cksum_offload - \
  699. * This flag indicates whether checksum offload is enabled or not \
  700. * for this frame. Target FW use this flag to turn on HW checksumming \
  701. * 0x0 - No checksum offload \
  702. * 0x1 - L3 header checksum only \
  703. * 0x2 - L4 checksum only \
  704. * 0x3 - L3 header checksum + L4 checksum \
  705. */ \
  706. cksum_offload: 2, \
  707. \
  708. /* tx_comp_req - \
  709. * This flag indicates whether Tx Completion \
  710. * from fw is required or not. \
  711. * This flag is only relevant if tx completion is not \
  712. * universally enabled. \
  713. * For all LL systems, tx completion is mandatory, \
  714. * so this flag will be irrelevant. \
  715. * For HL systems tx completion is optional, but HL systems in which \
  716. * the bus throughput exceeds the WLAN throughput will \
  717. * probably want to always use tx completion, and thus \
  718. * would not check this flag. \
  719. * This flag is required when tx completions are not used universally, \
  720. * but are still required for certain tx frames for which \
  721. * an OTA delivery acknowledgment is needed by the host. \
  722. * In practice, this would be for HL systems in which the \
  723. * bus throughput is less than the WLAN throughput. \
  724. * \
  725. * 0x0 - Tx Completion Indication from Fw not required \
  726. * 0x1 - Tx Completion Indication from Fw is required \
  727. */ \
  728. tx_compl_req: 1; \
  729. \
  730. \
  731. /* DWORD 1: MSDU length and ID */ \
  732. A_UINT32 \
  733. len: 16, /* MSDU length, in bytes */ \
  734. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  735. * and this id is used to calculate fragmentation \
  736. * descriptor pointer inside the target based on \
  737. * the base address, configured inside the target. \
  738. */ \
  739. \
  740. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  741. /* frags_desc_ptr - \
  742. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  743. * where the tx frame's fragments reside in memory. \
  744. * This field only applies to LL systems, since in HL systems the \
  745. * (degenerate single-fragment) fragmentation descriptor is created \
  746. * within the target. \
  747. */ \
  748. _paddr__frags_desc_ptr_; \
  749. \
  750. /* DWORD 3 (or 4): peerid, chanfreq */ \
  751. /* \
  752. * Peer ID : Target can use this value to know which peer-id packet \
  753. * destined to. \
  754. * It's intended to be specified by host in case of NAWDS. \
  755. */ \
  756. A_UINT16 peerid; \
  757. \
  758. /* \
  759. * Channel frequency: This identifies the desired channel \
  760. * frequency (in mhz) for tx frames. This is used by FW to help \
  761. * determine when it is safe to transmit or drop frames for \
  762. * off-channel operation. \
  763. * The default value of zero indicates to FW that the corresponding \
  764. * VDEV's home channel (if there is one) is the desired channel \
  765. * frequency. \
  766. */ \
  767. A_UINT16 chanfreq; \
  768. \
  769. /* Reason reserved is commented is increasing the htt structure size \
  770. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  771. * A_UINT32 reserved_dword3_bits0_31; \
  772. */ \
  773. } POSTPACK
  774. /* define a htt_tx_msdu_desc32_t type */
  775. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  776. /* define a htt_tx_msdu_desc64_t type */
  777. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  778. /*
  779. * Make htt_tx_msdu_desc_t be an alias for either
  780. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  781. */
  782. #if HTT_PADDR64
  783. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  784. #else
  785. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  786. #endif
  787. /* decriptor information for Management frame*/
  788. /*
  789. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  790. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  791. */
  792. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  793. extern A_UINT32 mgmt_hdr_len;
  794. PREPACK struct htt_mgmt_tx_desc_t {
  795. A_UINT32 msg_type;
  796. #if HTT_PADDR64
  797. A_UINT64 frag_paddr; /* DMAble address of the data */
  798. #else
  799. A_UINT32 frag_paddr; /* DMAble address of the data */
  800. #endif
  801. A_UINT32 desc_id; /* returned to host during completion
  802. * to free the meory*/
  803. A_UINT32 len; /* Fragment length */
  804. A_UINT32 vdev_id; /* virtual device ID*/
  805. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  806. } POSTPACK;
  807. PREPACK struct htt_mgmt_tx_compl_ind {
  808. A_UINT32 desc_id;
  809. A_UINT32 status;
  810. } POSTPACK;
  811. /*
  812. * This SDU header size comes from the summation of the following:
  813. * 1. Max of:
  814. * a. Native WiFi header, for native WiFi frames: 24 bytes
  815. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  816. * b. 802.11 header, for raw frames: 36 bytes
  817. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  818. * QoS header, HT header)
  819. * c. 802.3 header, for ethernet frames: 14 bytes
  820. * (destination address, source address, ethertype / length)
  821. * 2. Max of:
  822. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  823. * b. IPv6 header, up through the Traffic Class: 2 bytes
  824. * 3. 802.1Q VLAN header: 4 bytes
  825. * 4. LLC/SNAP header: 8 bytes
  826. */
  827. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  828. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  829. #define HTT_TX_HDR_SIZE_ETHERNET 14
  830. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  831. A_COMPILE_TIME_ASSERT(
  832. htt_encap_hdr_size_max_check_nwifi,
  833. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  834. A_COMPILE_TIME_ASSERT(
  835. htt_encap_hdr_size_max_check_enet,
  836. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  837. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  838. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  839. #define HTT_TX_HDR_SIZE_802_1Q 4
  840. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  841. #define HTT_COMMON_TX_FRM_HDR_LEN \
  842. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  843. HTT_TX_HDR_SIZE_802_1Q + \
  844. HTT_TX_HDR_SIZE_LLC_SNAP)
  845. #define HTT_HL_TX_FRM_HDR_LEN \
  846. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  847. #define HTT_LL_TX_FRM_HDR_LEN \
  848. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  849. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  850. /* dword 0 */
  851. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  852. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  853. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  854. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  855. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  858. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  859. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  862. #define HTT_TX_DESC_PKT_TYPE_S 13
  863. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  866. #define HTT_TX_DESC_VDEV_ID_S 16
  867. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  868. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  870. #define HTT_TX_DESC_EXT_TID_S 22
  871. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  872. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  874. #define HTT_TX_DESC_POSTPONED_S 27
  875. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  876. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  878. #define HTT_TX_DESC_EXTENSION_S 28
  879. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  880. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  881. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  882. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  883. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  884. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  885. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  886. #define HTT_TX_DESC_TX_COMP_S 31
  887. /* dword 1 */
  888. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  889. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  890. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  891. #define HTT_TX_DESC_FRM_LEN_S 0
  892. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  893. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  894. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  895. #define HTT_TX_DESC_FRM_ID_S 16
  896. /* dword 2 */
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  899. /* for systems using 64-bit format for bus addresses */
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  903. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  904. /* for systems using 32-bit format for bus addresses */
  905. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  907. /* dword 3 */
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  911. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  913. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  914. #if HTT_PADDR64
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  917. #else
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  920. #endif
  921. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  922. #define HTT_TX_DESC_PEER_ID_S 0
  923. /*
  924. * TEMPORARY:
  925. * The original definitions for the PEER_ID fields contained typos
  926. * (with _DESC_PADDR appended to this PEER_ID field name).
  927. * Retain deprecated original names for PEER_ID fields until all code that
  928. * refers to them has been updated.
  929. */
  930. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  931. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  932. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  933. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  934. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  935. HTT_TX_DESC_PEER_ID_M
  936. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  937. HTT_TX_DESC_PEER_ID_S
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  941. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  943. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  944. #if HTT_PADDR64
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  947. #else
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  950. #endif
  951. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  952. #define HTT_TX_DESC_CHAN_FREQ_S 16
  953. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  954. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  955. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  956. do { \
  957. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  958. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  959. } while (0)
  960. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  961. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  962. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  963. do { \
  964. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  965. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  966. } while (0)
  967. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  968. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  969. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  970. do { \
  971. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  972. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  973. } while (0)
  974. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  975. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  976. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  977. do { \
  978. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  979. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  980. } while (0)
  981. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  982. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  983. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  984. do { \
  985. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  986. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  987. } while (0)
  988. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  989. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  990. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  991. do { \
  992. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  993. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  994. } while (0)
  995. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  996. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  997. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  998. do { \
  999. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1000. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1001. } while (0)
  1002. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1003. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1004. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1005. do { \
  1006. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1007. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1008. } while (0)
  1009. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1010. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1011. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1012. do { \
  1013. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1014. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1015. } while (0)
  1016. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1017. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1018. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1019. do { \
  1020. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1021. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1022. } while (0)
  1023. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1024. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1025. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1026. do { \
  1027. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1028. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1029. } while (0)
  1030. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1031. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1032. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1033. do { \
  1034. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1035. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1036. } while (0)
  1037. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1038. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1039. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1040. do { \
  1041. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1042. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1043. } while (0)
  1044. /* enums used in the HTT tx MSDU extension descriptor */
  1045. enum {
  1046. htt_tx_guard_interval_regular = 0,
  1047. htt_tx_guard_interval_short = 1,
  1048. };
  1049. enum {
  1050. htt_tx_preamble_type_ofdm = 0,
  1051. htt_tx_preamble_type_cck = 1,
  1052. htt_tx_preamble_type_ht = 2,
  1053. htt_tx_preamble_type_vht = 3,
  1054. };
  1055. enum {
  1056. htt_tx_bandwidth_5MHz = 0,
  1057. htt_tx_bandwidth_10MHz = 1,
  1058. htt_tx_bandwidth_20MHz = 2,
  1059. htt_tx_bandwidth_40MHz = 3,
  1060. htt_tx_bandwidth_80MHz = 4,
  1061. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1062. };
  1063. /**
  1064. * @brief HTT tx MSDU extension descriptor
  1065. * @details
  1066. * If the target supports HTT tx MSDU extension descriptors, the host has
  1067. * the option of appending the following struct following the regular
  1068. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1069. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1070. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1071. * tx specs for each frame.
  1072. */
  1073. PREPACK struct htt_tx_msdu_desc_ext_t {
  1074. /* DWORD 0: flags */
  1075. A_UINT32
  1076. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1077. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1078. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1079. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1080. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1081. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1082. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1083. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1084. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1085. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1086. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1087. /* DWORD 1: tx power, tx rate, tx BW */
  1088. A_UINT32
  1089. /* pwr -
  1090. * Specify what power the tx frame needs to be transmitted at.
  1091. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1092. * The value needs to be appropriately sign-extended when extracting
  1093. * the value from the message and storing it in a variable that is
  1094. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1095. * automatically handles this sign-extension.)
  1096. * If the transmission uses multiple tx chains, this power spec is
  1097. * the total transmit power, assuming incoherent combination of
  1098. * per-chain power to produce the total power.
  1099. */
  1100. pwr: 8,
  1101. /* mcs_mask -
  1102. * Specify the allowable values for MCS index (modulation and coding)
  1103. * to use for transmitting the frame.
  1104. *
  1105. * For HT / VHT preamble types, this mask directly corresponds to
  1106. * the HT or VHT MCS indices that are allowed. For each bit N set
  1107. * within the mask, MCS index N is allowed for transmitting the frame.
  1108. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1109. * rates versus OFDM rates, so the host has the option of specifying
  1110. * that the target must transmit the frame with CCK or OFDM rates
  1111. * (not HT or VHT), but leaving the decision to the target whether
  1112. * to use CCK or OFDM.
  1113. *
  1114. * For CCK and OFDM, the bits within this mask are interpreted as
  1115. * follows:
  1116. * bit 0 -> CCK 1 Mbps rate is allowed
  1117. * bit 1 -> CCK 2 Mbps rate is allowed
  1118. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1119. * bit 3 -> CCK 11 Mbps rate is allowed
  1120. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1121. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1122. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1123. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1124. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1125. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1126. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1127. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1128. *
  1129. * The MCS index specification needs to be compatible with the
  1130. * bandwidth mask specification. For example, a MCS index == 9
  1131. * specification is inconsistent with a preamble type == VHT,
  1132. * Nss == 1, and channel bandwidth == 20 MHz.
  1133. *
  1134. * Furthermore, the host has only a limited ability to specify to
  1135. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1136. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1137. */
  1138. mcs_mask: 12,
  1139. /* nss_mask -
  1140. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1141. * Each bit in this mask corresponds to a Nss value:
  1142. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1143. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1144. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1145. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1146. * The values in the Nss mask must be suitable for the recipient, e.g.
  1147. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1148. * recipient which only supports 2x2 MIMO.
  1149. */
  1150. nss_mask: 4,
  1151. /* guard_interval -
  1152. * Specify a htt_tx_guard_interval enum value to indicate whether
  1153. * the transmission should use a regular guard interval or a
  1154. * short guard interval.
  1155. */
  1156. guard_interval: 1,
  1157. /* preamble_type_mask -
  1158. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1159. * may choose from for transmitting this frame.
  1160. * The bits in this mask correspond to the values in the
  1161. * htt_tx_preamble_type enum. For example, to allow the target
  1162. * to transmit the frame as either CCK or OFDM, this field would
  1163. * be set to
  1164. * (1 << htt_tx_preamble_type_ofdm) |
  1165. * (1 << htt_tx_preamble_type_cck)
  1166. */
  1167. preamble_type_mask: 4,
  1168. reserved1_31_29: 3; /* unused, set to 0x0 */
  1169. /* DWORD 2: tx chain mask, tx retries */
  1170. A_UINT32
  1171. /* chain_mask - specify which chains to transmit from */
  1172. chain_mask: 4,
  1173. /* retry_limit -
  1174. * Specify the maximum number of transmissions, including the
  1175. * initial transmission, to attempt before giving up if no ack
  1176. * is received.
  1177. * If the tx rate is specified, then all retries shall use the
  1178. * same rate as the initial transmission.
  1179. * If no tx rate is specified, the target can choose whether to
  1180. * retain the original rate during the retransmissions, or to
  1181. * fall back to a more robust rate.
  1182. */
  1183. retry_limit: 4,
  1184. /* bandwidth_mask -
  1185. * Specify what channel widths may be used for the transmission.
  1186. * A value of zero indicates "don't care" - the target may choose
  1187. * the transmission bandwidth.
  1188. * The bits within this mask correspond to the htt_tx_bandwidth
  1189. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1190. * The bandwidth_mask must be consistent with the preamble_type_mask
  1191. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1192. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1193. */
  1194. bandwidth_mask: 6,
  1195. reserved2_31_14: 18; /* unused, set to 0x0 */
  1196. /* DWORD 3: tx expiry time (TSF) LSBs */
  1197. A_UINT32 expire_tsf_lo;
  1198. /* DWORD 4: tx expiry time (TSF) MSBs */
  1199. A_UINT32 expire_tsf_hi;
  1200. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1201. } POSTPACK;
  1202. /* DWORD 0 */
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1223. /* DWORD 1 */
  1224. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1225. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1226. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1227. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1228. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1229. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1230. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1231. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1232. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1233. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1234. /* DWORD 2 */
  1235. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1236. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1237. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1238. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1239. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1240. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1241. /* DWORD 0 */
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1243. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1244. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1246. do { \
  1247. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1248. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1249. } while (0)
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1251. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1252. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1254. do { \
  1255. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1256. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1257. } while (0)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1259. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1260. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1262. do { \
  1263. HTT_CHECK_SET_VAL( \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1265. ((_var) |= ((_val) \
  1266. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1267. } while (0)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1269. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL( \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1275. ((_var) |= ((_val) \
  1276. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1277. } while (0)
  1278. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1279. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1280. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1285. } while (0)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1287. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1288. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1293. } while (0)
  1294. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1295. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1296. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1298. do { \
  1299. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1300. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1301. } while (0)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1303. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1304. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1309. } while (0)
  1310. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1311. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1312. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1317. } while (0)
  1318. /* DWORD 1 */
  1319. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1323. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1324. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1325. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1326. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1327. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1328. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1335. } while (0)
  1336. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1337. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1338. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1339. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1342. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1343. } while (0)
  1344. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1345. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1346. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1347. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1348. do { \
  1349. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1350. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1351. } while (0)
  1352. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1353. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1354. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1355. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1356. do { \
  1357. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1358. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1359. } while (0)
  1360. /* DWORD 2 */
  1361. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1362. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1363. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1364. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1368. } while (0)
  1369. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1370. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1371. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1372. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1373. do { \
  1374. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1375. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1376. } while (0)
  1377. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1378. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1379. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1380. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1381. do { \
  1382. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1383. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1384. } while (0)
  1385. typedef enum {
  1386. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1387. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1388. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1389. } htt_11ax_ltf_subtype_t;
  1390. typedef enum {
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1393. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1394. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1396. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1397. } htt_tx_ext2_preamble_type_t;
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1410. /**
  1411. * @brief HTT tx MSDU extension descriptor v2
  1412. * @details
  1413. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1414. * is received as tcl_exit_base->host_meta_info in firmware.
  1415. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1416. * are already part of tcl_exit_base.
  1417. */
  1418. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1419. /* DWORD 0: flags */
  1420. A_UINT32
  1421. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1422. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1423. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1424. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1425. valid_retries : 1, /* if set, tx retries spec is valid */
  1426. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1427. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1428. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1429. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1430. valid_key_flags : 1, /* if set, key flags is valid */
  1431. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1432. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1433. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1434. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1435. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1436. 1 = ENCRYPT,
  1437. 2 ~ 3 - Reserved */
  1438. /* retry_limit -
  1439. * Specify the maximum number of transmissions, including the
  1440. * initial transmission, to attempt before giving up if no ack
  1441. * is received.
  1442. * If the tx rate is specified, then all retries shall use the
  1443. * same rate as the initial transmission.
  1444. * If no tx rate is specified, the target can choose whether to
  1445. * retain the original rate during the retransmissions, or to
  1446. * fall back to a more robust rate.
  1447. */
  1448. retry_limit : 4,
  1449. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1450. * Valid only for 11ax preamble types HE_SU
  1451. * and HE_EXT_SU
  1452. */
  1453. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1454. * Valid only for 11ax preamble types HE_SU
  1455. * and HE_EXT_SU
  1456. */
  1457. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1458. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1459. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1460. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1461. */
  1462. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1463. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1464. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1465. * Use cases:
  1466. * Any time firmware uses TQM-BYPASS for Data
  1467. * TID, firmware expect host to set this bit.
  1468. */
  1469. /* DWORD 1: tx power, tx rate */
  1470. A_UINT32
  1471. power : 8, /* unit of the power field is 0.5 dbm
  1472. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1473. * signed value ranging from -64dbm to 63.5 dbm
  1474. */
  1475. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1476. * Setting more than one MCS isn't currently
  1477. * supported by the target (but is supported
  1478. * in the interface in case in the future
  1479. * the target supports specifications of
  1480. * a limited set of MCS values.
  1481. */
  1482. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1483. * Setting more than one Nss isn't currently
  1484. * supported by the target (but is supported
  1485. * in the interface in case in the future
  1486. * the target supports specifications of
  1487. * a limited set of Nss values.
  1488. */
  1489. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1490. update_peer_cache : 1; /* When set these custom values will be
  1491. * used for all packets, until the next
  1492. * update via this ext header.
  1493. * This is to make sure not all packets
  1494. * need to include this header.
  1495. */
  1496. /* DWORD 2: tx chain mask, tx retries */
  1497. A_UINT32
  1498. /* chain_mask - specify which chains to transmit from */
  1499. chain_mask : 8,
  1500. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1501. * TODO: Update Enum values for key_flags
  1502. */
  1503. /*
  1504. * Channel frequency: This identifies the desired channel
  1505. * frequency (in MHz) for tx frames. This is used by FW to help
  1506. * determine when it is safe to transmit or drop frames for
  1507. * off-channel operation.
  1508. * The default value of zero indicates to FW that the corresponding
  1509. * VDEV's home channel (if there is one) is the desired channel
  1510. * frequency.
  1511. */
  1512. chanfreq : 16;
  1513. /* DWORD 3: tx expiry time (TSF) LSBs */
  1514. A_UINT32 expire_tsf_lo;
  1515. /* DWORD 4: tx expiry time (TSF) MSBs */
  1516. A_UINT32 expire_tsf_hi;
  1517. /* DWORD 5: reserved
  1518. * This structure can be expanded further up to 60 bytes
  1519. * by adding further DWORDs as needed.
  1520. */
  1521. A_UINT32
  1522. /* learning_frame
  1523. * When this flag is set, this frame will be dropped by FW
  1524. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1525. */
  1526. learning_frame : 1,
  1527. rsvd0 : 31;
  1528. } POSTPACK;
  1529. /* DWORD 0 */
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1556. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1557. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1558. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1559. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1560. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1561. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1562. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1563. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1564. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1565. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1566. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1567. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1568. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1569. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1570. /* DWORD 1 */
  1571. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1572. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1573. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1574. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1575. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1576. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1577. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1578. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1579. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1580. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1581. /* DWORD 2 */
  1582. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1583. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1584. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1585. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1586. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1587. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1588. /* DWORD 5 */
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1591. /* DWORD 0 */
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1593. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1594. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1596. do { \
  1597. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1598. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1599. } while (0)
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1601. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1602. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1604. do { \
  1605. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1606. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1607. } while (0)
  1608. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1610. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1612. do { \
  1613. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1614. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1615. } while (0)
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1617. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1618. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1620. do { \
  1621. HTT_CHECK_SET_VAL( \
  1622. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1623. ((_var) |= ((_val) \
  1624. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1625. } while (0)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1633. } while (0)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1635. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1636. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1638. do { \
  1639. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1640. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1641. } while (0)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1643. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1644. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1646. do { \
  1647. HTT_CHECK_SET_VAL( \
  1648. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1649. ((_var) |= ((_val) \
  1650. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1682. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1683. } while (0)
  1684. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1685. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1686. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1688. do { \
  1689. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1690. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1691. } while (0)
  1692. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1694. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1696. do { \
  1697. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1698. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1699. } while (0)
  1700. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1704. do { \
  1705. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1706. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1707. } while (0)
  1708. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1710. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1711. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1718. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1719. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1726. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1727. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1730. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1731. } while (0)
  1732. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1733. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1734. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1735. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1736. do { \
  1737. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1738. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1739. } while (0)
  1740. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1741. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1742. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1743. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1744. do { \
  1745. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1746. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1747. } while (0)
  1748. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1752. do { \
  1753. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1754. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1755. } while (0)
  1756. /* DWORD 1 */
  1757. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1761. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1762. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1763. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1764. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1765. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1766. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1767. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1768. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1769. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1770. do { \
  1771. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1772. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1773. } while (0)
  1774. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1775. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1776. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1777. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1778. do { \
  1779. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1780. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1781. } while (0)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1783. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1784. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1786. do { \
  1787. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1788. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1789. } while (0)
  1790. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1791. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1792. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1793. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1794. do { \
  1795. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1796. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1797. } while (0)
  1798. /* DWORD 2 */
  1799. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1806. } while (0)
  1807. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1814. } while (0)
  1815. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1822. } while (0)
  1823. /* DWORD 5 */
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1825. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1826. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1828. do { \
  1829. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1830. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1831. } while (0)
  1832. typedef enum {
  1833. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1834. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1835. } htt_tcl_metadata_type;
  1836. /**
  1837. * @brief HTT TCL command number format
  1838. * @details
  1839. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1840. * available to firmware as tcl_exit_base->tcl_status_number.
  1841. * For regular / multicast packets host will send vdev and mac id and for
  1842. * NAWDS packets, host will send peer id.
  1843. * A_UINT32 is used to avoid endianness conversion problems.
  1844. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1845. */
  1846. typedef struct {
  1847. A_UINT32
  1848. type: 1, /* vdev_id based or peer_id based */
  1849. rsvd: 31;
  1850. } htt_tx_tcl_vdev_or_peer_t;
  1851. typedef struct {
  1852. A_UINT32
  1853. type: 1, /* vdev_id based or peer_id based */
  1854. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1855. vdev_id: 8,
  1856. pdev_id: 2,
  1857. host_inspected:1,
  1858. rsvd: 19;
  1859. } htt_tx_tcl_vdev_metadata;
  1860. typedef struct {
  1861. A_UINT32
  1862. type: 1, /* vdev_id based or peer_id based */
  1863. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1864. peer_id: 14,
  1865. rsvd: 16;
  1866. } htt_tx_tcl_peer_metadata;
  1867. PREPACK struct htt_tx_tcl_metadata {
  1868. union {
  1869. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1870. htt_tx_tcl_vdev_metadata vdev_meta;
  1871. htt_tx_tcl_peer_metadata peer_meta;
  1872. };
  1873. } POSTPACK;
  1874. /* DWORD 0 */
  1875. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1876. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1877. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1878. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1879. /* VDEV metadata */
  1880. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1881. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1882. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1883. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1884. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1885. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1886. /* PEER metadata */
  1887. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1888. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1889. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1890. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1891. HTT_TX_TCL_METADATA_TYPE_S)
  1892. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1896. } while (0)
  1897. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1898. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1899. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1900. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1904. } while (0)
  1905. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1906. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1907. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1908. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1911. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1912. } while (0)
  1913. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1914. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1915. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1916. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1917. do { \
  1918. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1919. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1920. } while (0)
  1921. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1922. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1923. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1924. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1925. do { \
  1926. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1927. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1928. } while (0)
  1929. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1930. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1931. HTT_TX_TCL_METADATA_PEER_ID_S)
  1932. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1933. do { \
  1934. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1935. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1936. } while (0)
  1937. typedef enum {
  1938. HTT_TX_FW2WBM_TX_STATUS_OK,
  1939. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1940. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1941. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1942. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1943. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1944. HTT_TX_FW2WBM_TX_STATUS_MAX
  1945. } htt_tx_fw2wbm_tx_status_t;
  1946. typedef enum {
  1947. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1948. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1949. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1950. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1951. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1952. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1953. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1954. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1955. } htt_tx_fw2wbm_reinject_reason_t;
  1956. /**
  1957. * @brief HTT TX WBM Completion from firmware to host
  1958. * @details
  1959. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1960. * DWORD 3 and 4 for software based completions (Exception frames and
  1961. * TQM bypass frames)
  1962. * For software based completions, wbm_release_ring->release_source_module will
  1963. * be set to release_source_fw
  1964. */
  1965. PREPACK struct htt_tx_wbm_completion {
  1966. A_UINT32
  1967. sch_cmd_id: 24,
  1968. exception_frame: 1, /* If set, this packet was queued via exception path */
  1969. rsvd0_31_25: 7;
  1970. A_UINT32
  1971. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1972. * reception of an ACK or BA, this field indicates
  1973. * the RSSI of the received ACK or BA frame.
  1974. * When the frame is removed as result of a direct
  1975. * remove command from the SW, this field is set
  1976. * to 0x0 (which is never a valid value when real
  1977. * RSSI is available).
  1978. * Units: dB w.r.t noise floor
  1979. */
  1980. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1981. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1982. rsvd1_31_16: 16;
  1983. } POSTPACK;
  1984. /* DWORD 0 */
  1985. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1986. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1987. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1988. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1989. /* DWORD 1 */
  1990. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1991. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1992. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1993. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1994. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1995. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1996. /* DWORD 0 */
  1997. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1998. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1999. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2000. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2004. } while (0)
  2005. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2006. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2007. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2008. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2012. } while (0)
  2013. /* DWORD 1 */
  2014. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2015. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2016. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2017. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2021. } while (0)
  2022. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2023. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2024. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2025. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2029. } while (0)
  2030. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2031. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2032. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2033. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2034. do { \
  2035. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2036. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2037. } while (0)
  2038. /**
  2039. * @brief HTT TX WBM Completion from firmware to host
  2040. * @details
  2041. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2042. * (WBM) offload HW.
  2043. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2044. * For software based completions, release_source_module will
  2045. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2046. * struct wbm_release_ring and then switch to this after looking at
  2047. * release_source_module.
  2048. */
  2049. PREPACK struct htt_tx_wbm_completion_v2 {
  2050. A_UINT32
  2051. used_by_hw0; /* Refer to struct wbm_release_ring */
  2052. A_UINT32
  2053. used_by_hw1; /* Refer to struct wbm_release_ring */
  2054. A_UINT32
  2055. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2056. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2057. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2058. exception_frame: 1,
  2059. rsvd0: 12, /* For future use */
  2060. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2061. rsvd1: 1; /* For future use */
  2062. A_UINT32
  2063. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2064. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2065. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2066. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2067. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2068. */
  2069. A_UINT32
  2070. data1: 32;
  2071. A_UINT32
  2072. data2: 32;
  2073. A_UINT32
  2074. used_by_hw3; /* Refer to struct wbm_release_ring */
  2075. } POSTPACK;
  2076. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2077. /* DWORD 3 */
  2078. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2079. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2080. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2081. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2082. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2083. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2084. /* DWORD 3 */
  2085. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2086. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2087. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2088. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2092. } while (0)
  2093. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2094. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2095. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2096. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2100. } while (0)
  2101. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2102. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2103. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2104. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2108. } while (0)
  2109. /**
  2110. * @brief HTT TX WBM transmit status from firmware to host
  2111. * @details
  2112. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2113. * (WBM) offload HW.
  2114. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2115. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2116. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2117. */
  2118. PREPACK struct htt_tx_wbm_transmit_status {
  2119. A_UINT32
  2120. sch_cmd_id: 24,
  2121. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2122. * reception of an ACK or BA, this field indicates
  2123. * the RSSI of the received ACK or BA frame.
  2124. * When the frame is removed as result of a direct
  2125. * remove command from the SW, this field is set
  2126. * to 0x0 (which is never a valid value when real
  2127. * RSSI is available).
  2128. * Units: dB w.r.t noise floor
  2129. */
  2130. A_UINT32
  2131. sw_peer_id: 16,
  2132. tid_num: 5,
  2133. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2134. * and tid_num fields contain valid data.
  2135. * If this "valid" flag is not set, the
  2136. * sw_peer_id and tid_num fields must be ignored.
  2137. */
  2138. mcast: 1,
  2139. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2140. * contains valid data.
  2141. */
  2142. reserved0: 8;
  2143. A_UINT32
  2144. reserved1: 32;
  2145. } POSTPACK;
  2146. /* DWORD 4 */
  2147. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2148. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2149. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2150. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2151. /* DWORD 5 */
  2152. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2153. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2154. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2155. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2156. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2157. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2158. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2159. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2160. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2161. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2162. /* DWORD 4 */
  2163. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2164. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2165. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2166. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2170. } while (0)
  2171. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2172. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2173. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2174. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2178. } while (0)
  2179. /* DWORD 5 */
  2180. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2181. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2182. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2183. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2187. } while (0)
  2188. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2189. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2190. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2191. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2192. do { \
  2193. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2194. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2195. } while (0)
  2196. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2197. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2198. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2199. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2200. do { \
  2201. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2202. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2203. } while (0)
  2204. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2205. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2206. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2207. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2208. do { \
  2209. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2210. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2211. } while (0)
  2212. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2213. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2214. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2215. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2216. do { \
  2217. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2218. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2219. } while (0)
  2220. /**
  2221. * @brief HTT TX WBM reinject status from firmware to host
  2222. * @details
  2223. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2224. * (WBM) offload HW.
  2225. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2226. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2227. */
  2228. PREPACK struct htt_tx_wbm_reinject_status {
  2229. A_UINT32
  2230. reserved0: 32;
  2231. A_UINT32
  2232. reserved1: 32;
  2233. A_UINT32
  2234. reserved2: 32;
  2235. } POSTPACK;
  2236. /**
  2237. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2238. * @details
  2239. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2240. * (WBM) offload HW.
  2241. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2242. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2243. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2244. * STA side.
  2245. */
  2246. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2247. A_UINT32
  2248. mec_sa_addr_31_0;
  2249. A_UINT32
  2250. mec_sa_addr_47_32: 16,
  2251. sa_ast_index: 16;
  2252. A_UINT32
  2253. vdev_id: 8,
  2254. reserved0: 24;
  2255. } POSTPACK;
  2256. /* DWORD 4 - mec_sa_addr_31_0 */
  2257. /* DWORD 5 */
  2258. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2259. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2260. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2261. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2262. /* DWORD 6 */
  2263. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2264. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2265. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2267. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2268. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2272. } while (0)
  2273. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2274. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2275. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2276. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2280. } while (0)
  2281. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2282. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2283. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2284. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2288. } while (0)
  2289. typedef enum {
  2290. TX_FLOW_PRIORITY_BE,
  2291. TX_FLOW_PRIORITY_HIGH,
  2292. TX_FLOW_PRIORITY_LOW,
  2293. } htt_tx_flow_priority_t;
  2294. typedef enum {
  2295. TX_FLOW_LATENCY_SENSITIVE,
  2296. TX_FLOW_LATENCY_INSENSITIVE,
  2297. } htt_tx_flow_latency_t;
  2298. typedef enum {
  2299. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2300. TX_FLOW_INTERACTIVE_TRAFFIC,
  2301. TX_FLOW_PERIODIC_TRAFFIC,
  2302. TX_FLOW_BURSTY_TRAFFIC,
  2303. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2304. } htt_tx_flow_traffic_pattern_t;
  2305. /**
  2306. * @brief HTT TX Flow search metadata format
  2307. * @details
  2308. * Host will set this metadata in flow table's flow search entry along with
  2309. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2310. * firmware and TQM ring if the flow search entry wins.
  2311. * This metadata is available to firmware in that first MSDU's
  2312. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2313. * to one of the available flows for specific tid and returns the tqm flow
  2314. * pointer as part of htt_tx_map_flow_info message.
  2315. */
  2316. PREPACK struct htt_tx_flow_metadata {
  2317. A_UINT32
  2318. rsvd0_1_0: 2,
  2319. tid: 4,
  2320. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2321. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2322. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2323. * Else choose final tid based on latency, priority.
  2324. */
  2325. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2326. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2327. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2328. } POSTPACK;
  2329. /* DWORD 0 */
  2330. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2331. #define HTT_TX_FLOW_METADATA_TID_S 2
  2332. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2333. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2334. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2335. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2336. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2337. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2338. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2339. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2340. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2341. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2342. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2343. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2344. /* DWORD 0 */
  2345. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2346. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2347. HTT_TX_FLOW_METADATA_TID_S)
  2348. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2352. } while (0)
  2353. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2354. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2355. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2356. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2360. } while (0)
  2361. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2362. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2363. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2364. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2368. } while (0)
  2369. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2370. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2371. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2372. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2373. do { \
  2374. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2375. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2376. } while (0)
  2377. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2378. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2379. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2380. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2381. do { \
  2382. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2383. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2384. } while (0)
  2385. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2386. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2387. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2388. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2392. } while (0)
  2393. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2394. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2395. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2396. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2397. do { \
  2398. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2399. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2400. } while (0)
  2401. /**
  2402. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2403. *
  2404. * @details
  2405. * HTT wds entry from source port learning
  2406. * Host will learn wds entries from rx and send this message to firmware
  2407. * to enable firmware to configure/delete AST entries for wds clients.
  2408. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2409. * and when SA's entry is deleted, firmware removes this AST entry
  2410. *
  2411. * The message would appear as follows:
  2412. *
  2413. * |31 30|29 |17 16|15 8|7 0|
  2414. * |----------------+----------------+----------------+----------------|
  2415. * | rsvd0 |PDVID| vdev_id | msg_type |
  2416. * |-------------------------------------------------------------------|
  2417. * | sa_addr_31_0 |
  2418. * |-------------------------------------------------------------------|
  2419. * | | ta_peer_id | sa_addr_47_32 |
  2420. * |-------------------------------------------------------------------|
  2421. * Where PDVID = pdev_id
  2422. *
  2423. * The message is interpreted as follows:
  2424. *
  2425. * dword0 - b'0:7 - msg_type: This will be set to
  2426. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2427. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2428. *
  2429. * dword0 - b'8:15 - vdev_id
  2430. *
  2431. * dword0 - b'16:17 - pdev_id
  2432. *
  2433. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2434. *
  2435. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2436. *
  2437. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2438. *
  2439. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2440. */
  2441. PREPACK struct htt_wds_entry {
  2442. A_UINT32
  2443. msg_type: 8,
  2444. vdev_id: 8,
  2445. pdev_id: 2,
  2446. rsvd0: 14;
  2447. A_UINT32 sa_addr_31_0;
  2448. A_UINT32
  2449. sa_addr_47_32: 16,
  2450. ta_peer_id: 14,
  2451. rsvd2: 2;
  2452. } POSTPACK;
  2453. /* DWORD 0 */
  2454. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2455. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2456. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2457. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2458. /* DWORD 2 */
  2459. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2460. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2461. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2462. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2463. /* DWORD 0 */
  2464. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2465. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2466. HTT_WDS_ENTRY_VDEV_ID_S)
  2467. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2470. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2471. } while (0)
  2472. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2473. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2474. HTT_WDS_ENTRY_PDEV_ID_S)
  2475. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2476. do { \
  2477. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2478. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2479. } while (0)
  2480. /* DWORD 2 */
  2481. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2482. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2483. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2484. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2485. do { \
  2486. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2487. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2488. } while (0)
  2489. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2490. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2491. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2492. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2493. do { \
  2494. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2495. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2496. } while (0)
  2497. /**
  2498. * @brief MAC DMA rx ring setup specification
  2499. * @details
  2500. * To allow for dynamic rx ring reconfiguration and to avoid race
  2501. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2502. * it uses. Instead, it sends this message to the target, indicating how
  2503. * the rx ring used by the host should be set up and maintained.
  2504. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2505. * specifications.
  2506. *
  2507. * |31 16|15 8|7 0|
  2508. * |---------------------------------------------------------------|
  2509. * header: | reserved | num rings | msg type |
  2510. * |---------------------------------------------------------------|
  2511. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2512. #if HTT_PADDR64
  2513. * | FW_IDX shadow register physical address (bits 63:32) |
  2514. #endif
  2515. * |---------------------------------------------------------------|
  2516. * | rx ring base physical address (bits 31:0) |
  2517. #if HTT_PADDR64
  2518. * | rx ring base physical address (bits 63:32) |
  2519. #endif
  2520. * |---------------------------------------------------------------|
  2521. * | rx ring buffer size | rx ring length |
  2522. * |---------------------------------------------------------------|
  2523. * | FW_IDX initial value | enabled flags |
  2524. * |---------------------------------------------------------------|
  2525. * | MSDU payload offset | 802.11 header offset |
  2526. * |---------------------------------------------------------------|
  2527. * | PPDU end offset | PPDU start offset |
  2528. * |---------------------------------------------------------------|
  2529. * | MPDU end offset | MPDU start offset |
  2530. * |---------------------------------------------------------------|
  2531. * | MSDU end offset | MSDU start offset |
  2532. * |---------------------------------------------------------------|
  2533. * | frag info offset | rx attention offset |
  2534. * |---------------------------------------------------------------|
  2535. * payload 2, if present, has the same format as payload 1
  2536. * Header fields:
  2537. * - MSG_TYPE
  2538. * Bits 7:0
  2539. * Purpose: identifies this as an rx ring configuration message
  2540. * Value: 0x2
  2541. * - NUM_RINGS
  2542. * Bits 15:8
  2543. * Purpose: indicates whether the host is setting up one rx ring or two
  2544. * Value: 1 or 2
  2545. * Payload:
  2546. * for systems using 64-bit format for bus addresses:
  2547. * - IDX_SHADOW_REG_PADDR_LO
  2548. * Bits 31:0
  2549. * Value: lower 4 bytes of physical address of the host's
  2550. * FW_IDX shadow register
  2551. * - IDX_SHADOW_REG_PADDR_HI
  2552. * Bits 31:0
  2553. * Value: upper 4 bytes of physical address of the host's
  2554. * FW_IDX shadow register
  2555. * - RING_BASE_PADDR_LO
  2556. * Bits 31:0
  2557. * Value: lower 4 bytes of physical address of the host's rx ring
  2558. * - RING_BASE_PADDR_HI
  2559. * Bits 31:0
  2560. * Value: uppper 4 bytes of physical address of the host's rx ring
  2561. * for systems using 32-bit format for bus addresses:
  2562. * - IDX_SHADOW_REG_PADDR
  2563. * Bits 31:0
  2564. * Value: physical address of the host's FW_IDX shadow register
  2565. * - RING_BASE_PADDR
  2566. * Bits 31:0
  2567. * Value: physical address of the host's rx ring
  2568. * - RING_LEN
  2569. * Bits 15:0
  2570. * Value: number of elements in the rx ring
  2571. * - RING_BUF_SZ
  2572. * Bits 31:16
  2573. * Value: size of the buffers referenced by the rx ring, in byte units
  2574. * - ENABLED_FLAGS
  2575. * Bits 15:0
  2576. * Value: 1-bit flags to show whether different rx fields are enabled
  2577. * bit 0: 802.11 header enabled (1) or disabled (0)
  2578. * bit 1: MSDU payload enabled (1) or disabled (0)
  2579. * bit 2: PPDU start enabled (1) or disabled (0)
  2580. * bit 3: PPDU end enabled (1) or disabled (0)
  2581. * bit 4: MPDU start enabled (1) or disabled (0)
  2582. * bit 5: MPDU end enabled (1) or disabled (0)
  2583. * bit 6: MSDU start enabled (1) or disabled (0)
  2584. * bit 7: MSDU end enabled (1) or disabled (0)
  2585. * bit 8: rx attention enabled (1) or disabled (0)
  2586. * bit 9: frag info enabled (1) or disabled (0)
  2587. * bit 10: unicast rx enabled (1) or disabled (0)
  2588. * bit 11: multicast rx enabled (1) or disabled (0)
  2589. * bit 12: ctrl rx enabled (1) or disabled (0)
  2590. * bit 13: mgmt rx enabled (1) or disabled (0)
  2591. * bit 14: null rx enabled (1) or disabled (0)
  2592. * bit 15: phy data rx enabled (1) or disabled (0)
  2593. * - IDX_INIT_VAL
  2594. * Bits 31:16
  2595. * Purpose: Specify the initial value for the FW_IDX.
  2596. * Value: the number of buffers initially present in the host's rx ring
  2597. * - OFFSET_802_11_HDR
  2598. * Bits 15:0
  2599. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2600. * - OFFSET_MSDU_PAYLOAD
  2601. * Bits 31:16
  2602. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2603. * - OFFSET_PPDU_START
  2604. * Bits 15:0
  2605. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2606. * - OFFSET_PPDU_END
  2607. * Bits 31:16
  2608. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2609. * - OFFSET_MPDU_START
  2610. * Bits 15:0
  2611. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2612. * - OFFSET_MPDU_END
  2613. * Bits 31:16
  2614. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2615. * - OFFSET_MSDU_START
  2616. * Bits 15:0
  2617. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2618. * - OFFSET_MSDU_END
  2619. * Bits 31:16
  2620. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2621. * - OFFSET_RX_ATTN
  2622. * Bits 15:0
  2623. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2624. * - OFFSET_FRAG_INFO
  2625. * Bits 31:16
  2626. * Value: offset in QUAD-bytes of frag info table
  2627. */
  2628. /* header fields */
  2629. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2630. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2631. /* payload fields */
  2632. /* for systems using a 64-bit format for bus addresses */
  2633. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2635. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2636. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2637. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2638. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2639. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2641. /* for systems using a 32-bit format for bus addresses */
  2642. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2643. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2645. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2646. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2647. #define HTT_RX_RING_CFG_LEN_S 0
  2648. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2649. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2650. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2651. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2652. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2653. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2654. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2655. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2656. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2657. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2658. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2659. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2660. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2661. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2662. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2663. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2664. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2665. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2666. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2667. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2668. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2669. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2670. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2671. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2672. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2673. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2674. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2675. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2676. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2677. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2678. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2679. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2680. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2681. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2682. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2683. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2684. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2685. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2686. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2687. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2688. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2689. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2690. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2691. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2692. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2693. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2694. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2695. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2696. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2697. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2698. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2699. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2700. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2701. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2702. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2703. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2704. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2705. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2706. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2707. #if HTT_PADDR64
  2708. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2709. #else
  2710. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2711. #endif
  2712. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2713. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2714. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2715. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2716. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2717. do { \
  2718. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2719. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2720. } while (0)
  2721. /* degenerate case for 32-bit fields */
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2724. ((_var) = (_val))
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2727. ((_var) = (_val))
  2728. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2730. ((_var) = (_val))
  2731. /* degenerate case for 32-bit fields */
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2734. ((_var) = (_val))
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2737. ((_var) = (_val))
  2738. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2740. ((_var) = (_val))
  2741. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2742. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2743. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2746. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2747. } while (0)
  2748. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2749. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2750. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2753. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2754. } while (0)
  2755. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2756. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2757. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2758. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2761. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2762. } while (0)
  2763. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2764. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2765. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2766. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2769. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2770. } while (0)
  2771. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2772. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2773. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2774. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2777. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2778. } while (0)
  2779. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2780. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2781. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2782. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2785. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2786. } while (0)
  2787. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2788. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2789. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2790. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2793. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2794. } while (0)
  2795. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2796. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2797. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2798. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2801. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2802. } while (0)
  2803. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2805. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2806. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2809. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2810. } while (0)
  2811. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2812. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2813. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2814. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2817. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2818. } while (0)
  2819. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2820. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2821. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2822. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2825. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2826. } while (0)
  2827. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2828. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2829. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2830. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2837. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2838. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2845. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2846. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2853. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2854. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2861. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2862. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2869. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2870. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2877. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2878. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2885. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2886. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2893. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2894. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2898. } while (0)
  2899. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2900. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2901. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2902. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2905. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2906. } while (0)
  2907. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2908. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2909. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2910. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2911. do { \
  2912. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2913. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2914. } while (0)
  2915. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2916. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2917. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2918. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2919. do { \
  2920. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2921. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2922. } while (0)
  2923. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2924. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2925. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2926. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2927. do { \
  2928. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2929. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2930. } while (0)
  2931. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2932. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2933. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2934. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2935. do { \
  2936. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2937. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2938. } while (0)
  2939. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2940. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2941. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2942. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2943. do { \
  2944. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2945. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2946. } while (0)
  2947. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2948. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2949. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2950. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2953. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2954. } while (0)
  2955. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2956. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2957. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2958. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2961. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2962. } while (0)
  2963. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2964. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2965. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2966. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2969. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2970. } while (0)
  2971. /**
  2972. * @brief host -> target FW statistics retrieve
  2973. *
  2974. * @details
  2975. * The following field definitions describe the format of the HTT host
  2976. * to target FW stats retrieve message. The message specifies the type of
  2977. * stats host wants to retrieve.
  2978. *
  2979. * |31 24|23 16|15 8|7 0|
  2980. * |-----------------------------------------------------------|
  2981. * | stats types request bitmask | msg type |
  2982. * |-----------------------------------------------------------|
  2983. * | stats types reset bitmask | reserved |
  2984. * |-----------------------------------------------------------|
  2985. * | stats type | config value |
  2986. * |-----------------------------------------------------------|
  2987. * | cookie LSBs |
  2988. * |-----------------------------------------------------------|
  2989. * | cookie MSBs |
  2990. * |-----------------------------------------------------------|
  2991. * Header fields:
  2992. * - MSG_TYPE
  2993. * Bits 7:0
  2994. * Purpose: identifies this is a stats upload request message
  2995. * Value: 0x3
  2996. * - UPLOAD_TYPES
  2997. * Bits 31:8
  2998. * Purpose: identifies which types of FW statistics to upload
  2999. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3000. * - RESET_TYPES
  3001. * Bits 31:8
  3002. * Purpose: identifies which types of FW statistics to reset
  3003. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3004. * - CFG_VAL
  3005. * Bits 23:0
  3006. * Purpose: give an opaque configuration value to the specified stats type
  3007. * Value: stats-type specific configuration value
  3008. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3009. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3010. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3011. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3012. * - CFG_STAT_TYPE
  3013. * Bits 31:24
  3014. * Purpose: specify which stats type (if any) the config value applies to
  3015. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3016. * a valid configuration specification
  3017. * - COOKIE_LSBS
  3018. * Bits 31:0
  3019. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3020. * message with its preceding host->target stats request message.
  3021. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3022. * - COOKIE_MSBS
  3023. * Bits 31:0
  3024. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3025. * message with its preceding host->target stats request message.
  3026. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3027. */
  3028. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3029. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3030. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3031. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3032. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3033. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3034. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3035. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3036. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3037. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3038. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3039. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3040. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3041. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3044. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3045. } while (0)
  3046. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3047. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3048. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3049. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3050. do { \
  3051. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3052. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3053. } while (0)
  3054. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3055. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3056. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3057. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3060. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3061. } while (0)
  3062. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3063. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3064. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3065. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3066. do { \
  3067. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3068. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3069. } while (0)
  3070. /**
  3071. * @brief host -> target HTT out-of-band sync request
  3072. *
  3073. * @details
  3074. * The HTT SYNC tells the target to suspend processing of subsequent
  3075. * HTT host-to-target messages until some other target agent locally
  3076. * informs the target HTT FW that the current sync counter is equal to
  3077. * or greater than (in a modulo sense) the sync counter specified in
  3078. * the SYNC message.
  3079. * This allows other host-target components to synchronize their operation
  3080. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3081. * security key has been downloaded to and activated by the target.
  3082. * In the absence of any explicit synchronization counter value
  3083. * specification, the target HTT FW will use zero as the default current
  3084. * sync value.
  3085. *
  3086. * |31 24|23 16|15 8|7 0|
  3087. * |-----------------------------------------------------------|
  3088. * | reserved | sync count | msg type |
  3089. * |-----------------------------------------------------------|
  3090. * Header fields:
  3091. * - MSG_TYPE
  3092. * Bits 7:0
  3093. * Purpose: identifies this as a sync message
  3094. * Value: 0x4
  3095. * - SYNC_COUNT
  3096. * Bits 15:8
  3097. * Purpose: specifies what sync value the HTT FW will wait for from
  3098. * an out-of-band specification to resume its operation
  3099. * Value: in-band sync counter value to compare against the out-of-band
  3100. * counter spec.
  3101. * The HTT target FW will suspend its host->target message processing
  3102. * as long as
  3103. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3104. */
  3105. #define HTT_H2T_SYNC_MSG_SZ 4
  3106. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3107. #define HTT_H2T_SYNC_COUNT_S 8
  3108. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3109. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3110. HTT_H2T_SYNC_COUNT_S)
  3111. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3112. do { \
  3113. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3114. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3115. } while (0)
  3116. /**
  3117. * @brief HTT aggregation configuration
  3118. */
  3119. #define HTT_AGGR_CFG_MSG_SZ 4
  3120. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3121. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3122. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3125. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3126. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3128. do { \
  3129. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3130. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3131. } while (0)
  3132. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3133. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3134. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3135. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3136. do { \
  3137. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3138. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3139. } while (0)
  3140. /**
  3141. * @brief host -> target HTT configure max amsdu info per vdev
  3142. *
  3143. * @details
  3144. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3145. *
  3146. * |31 21|20 16|15 8|7 0|
  3147. * |-----------------------------------------------------------|
  3148. * | reserved | vdev id | max amsdu | msg type |
  3149. * |-----------------------------------------------------------|
  3150. * Header fields:
  3151. * - MSG_TYPE
  3152. * Bits 7:0
  3153. * Purpose: identifies this as a aggr cfg ex message
  3154. * Value: 0xa
  3155. * - MAX_NUM_AMSDU_SUBFRM
  3156. * Bits 15:8
  3157. * Purpose: max MSDUs per A-MSDU
  3158. * - VDEV_ID
  3159. * Bits 20:16
  3160. * Purpose: ID of the vdev to which this limit is applied
  3161. */
  3162. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3163. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3164. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3165. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3166. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3167. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3168. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3169. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3170. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3171. do { \
  3172. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3173. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3174. } while (0)
  3175. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3176. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3177. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3178. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3179. do { \
  3180. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3181. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3182. } while (0)
  3183. /**
  3184. * @brief HTT WDI_IPA Config Message
  3185. *
  3186. * @details
  3187. * The HTT WDI_IPA config message is created/sent by host at driver
  3188. * init time. It contains information about data structures used on
  3189. * WDI_IPA TX and RX path.
  3190. * TX CE ring is used for pushing packet metadata from IPA uC
  3191. * to WLAN FW
  3192. * TX Completion ring is used for generating TX completions from
  3193. * WLAN FW to IPA uC
  3194. * RX Indication ring is used for indicating RX packets from FW
  3195. * to IPA uC
  3196. * RX Ring2 is used as either completion ring or as second
  3197. * indication ring. when Ring2 is used as completion ring, IPA uC
  3198. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3199. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3200. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3201. * indicated in RX Indication ring. Please see WDI_IPA specification
  3202. * for more details.
  3203. * |31 24|23 16|15 8|7 0|
  3204. * |----------------+----------------+----------------+----------------|
  3205. * | tx pkt pool size | Rsvd | msg_type |
  3206. * |-------------------------------------------------------------------|
  3207. * | tx comp ring base (bits 31:0) |
  3208. #if HTT_PADDR64
  3209. * | tx comp ring base (bits 63:32) |
  3210. #endif
  3211. * |-------------------------------------------------------------------|
  3212. * | tx comp ring size |
  3213. * |-------------------------------------------------------------------|
  3214. * | tx comp WR_IDX physical address (bits 31:0) |
  3215. #if HTT_PADDR64
  3216. * | tx comp WR_IDX physical address (bits 63:32) |
  3217. #endif
  3218. * |-------------------------------------------------------------------|
  3219. * | tx CE WR_IDX physical address (bits 31:0) |
  3220. #if HTT_PADDR64
  3221. * | tx CE WR_IDX physical address (bits 63:32) |
  3222. #endif
  3223. * |-------------------------------------------------------------------|
  3224. * | rx indication ring base (bits 31:0) |
  3225. #if HTT_PADDR64
  3226. * | rx indication ring base (bits 63:32) |
  3227. #endif
  3228. * |-------------------------------------------------------------------|
  3229. * | rx indication ring size |
  3230. * |-------------------------------------------------------------------|
  3231. * | rx ind RD_IDX physical address (bits 31:0) |
  3232. #if HTT_PADDR64
  3233. * | rx ind RD_IDX physical address (bits 63:32) |
  3234. #endif
  3235. * |-------------------------------------------------------------------|
  3236. * | rx ind WR_IDX physical address (bits 31:0) |
  3237. #if HTT_PADDR64
  3238. * | rx ind WR_IDX physical address (bits 63:32) |
  3239. #endif
  3240. * |-------------------------------------------------------------------|
  3241. * |-------------------------------------------------------------------|
  3242. * | rx ring2 base (bits 31:0) |
  3243. #if HTT_PADDR64
  3244. * | rx ring2 base (bits 63:32) |
  3245. #endif
  3246. * |-------------------------------------------------------------------|
  3247. * | rx ring2 size |
  3248. * |-------------------------------------------------------------------|
  3249. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3250. #if HTT_PADDR64
  3251. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3252. #endif
  3253. * |-------------------------------------------------------------------|
  3254. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3255. #if HTT_PADDR64
  3256. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3257. #endif
  3258. * |-------------------------------------------------------------------|
  3259. *
  3260. * Header fields:
  3261. * Header fields:
  3262. * - MSG_TYPE
  3263. * Bits 7:0
  3264. * Purpose: Identifies this as WDI_IPA config message
  3265. * value: = 0x8
  3266. * - TX_PKT_POOL_SIZE
  3267. * Bits 15:0
  3268. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3269. * WDI_IPA TX path
  3270. * For systems using 32-bit format for bus addresses:
  3271. * - TX_COMP_RING_BASE_ADDR
  3272. * Bits 31:0
  3273. * Purpose: TX Completion Ring base address in DDR
  3274. * - TX_COMP_RING_SIZE
  3275. * Bits 31:0
  3276. * Purpose: TX Completion Ring size (must be power of 2)
  3277. * - TX_COMP_WR_IDX_ADDR
  3278. * Bits 31:0
  3279. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3280. * updates the Write Index for WDI_IPA TX completion ring
  3281. * - TX_CE_WR_IDX_ADDR
  3282. * Bits 31:0
  3283. * Purpose: DDR address where IPA uC
  3284. * updates the WR Index for TX CE ring
  3285. * (needed for fusion platforms)
  3286. * - RX_IND_RING_BASE_ADDR
  3287. * Bits 31:0
  3288. * Purpose: RX Indication Ring base address in DDR
  3289. * - RX_IND_RING_SIZE
  3290. * Bits 31:0
  3291. * Purpose: RX Indication Ring size
  3292. * - RX_IND_RD_IDX_ADDR
  3293. * Bits 31:0
  3294. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3295. * RX indication ring
  3296. * - RX_IND_WR_IDX_ADDR
  3297. * Bits 31:0
  3298. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3299. * updates the Write Index for WDI_IPA RX indication ring
  3300. * - RX_RING2_BASE_ADDR
  3301. * Bits 31:0
  3302. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3303. * - RX_RING2_SIZE
  3304. * Bits 31:0
  3305. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3306. * - RX_RING2_RD_IDX_ADDR
  3307. * Bits 31:0
  3308. * Purpose: If Second RX ring is Indication ring, DDR address where
  3309. * IPA uC updates the Read Index for Ring2.
  3310. * If Second RX ring is completion ring, this is NOT used
  3311. * - RX_RING2_WR_IDX_ADDR
  3312. * Bits 31:0
  3313. * Purpose: If Second RX ring is Indication ring, DDR address where
  3314. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3315. * If second RX ring is completion ring, DDR address where
  3316. * IPA uC updates the Write Index for Ring 2.
  3317. * For systems using 64-bit format for bus addresses:
  3318. * - TX_COMP_RING_BASE_ADDR_LO
  3319. * Bits 31:0
  3320. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3321. * - TX_COMP_RING_BASE_ADDR_HI
  3322. * Bits 31:0
  3323. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3324. * - TX_COMP_RING_SIZE
  3325. * Bits 31:0
  3326. * Purpose: TX Completion Ring size (must be power of 2)
  3327. * - TX_COMP_WR_IDX_ADDR_LO
  3328. * Bits 31:0
  3329. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3330. * Lower 4 bytes of DDR address where WIFI FW
  3331. * updates the Write Index for WDI_IPA TX completion ring
  3332. * - TX_COMP_WR_IDX_ADDR_HI
  3333. * Bits 31:0
  3334. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3335. * Higher 4 bytes of DDR address where WIFI FW
  3336. * updates the Write Index for WDI_IPA TX completion ring
  3337. * - TX_CE_WR_IDX_ADDR_LO
  3338. * Bits 31:0
  3339. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3340. * updates the WR Index for TX CE ring
  3341. * (needed for fusion platforms)
  3342. * - TX_CE_WR_IDX_ADDR_HI
  3343. * Bits 31:0
  3344. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3345. * updates the WR Index for TX CE ring
  3346. * (needed for fusion platforms)
  3347. * - RX_IND_RING_BASE_ADDR_LO
  3348. * Bits 31:0
  3349. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3350. * - RX_IND_RING_BASE_ADDR_HI
  3351. * Bits 31:0
  3352. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3353. * - RX_IND_RING_SIZE
  3354. * Bits 31:0
  3355. * Purpose: RX Indication Ring size
  3356. * - RX_IND_RD_IDX_ADDR_LO
  3357. * Bits 31:0
  3358. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3359. * for WDI_IPA RX indication ring
  3360. * - RX_IND_RD_IDX_ADDR_HI
  3361. * Bits 31:0
  3362. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3363. * for WDI_IPA RX indication ring
  3364. * - RX_IND_WR_IDX_ADDR_LO
  3365. * Bits 31:0
  3366. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3367. * Lower 4 bytes of DDR address where WIFI FW
  3368. * updates the Write Index for WDI_IPA RX indication ring
  3369. * - RX_IND_WR_IDX_ADDR_HI
  3370. * Bits 31:0
  3371. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3372. * Higher 4 bytes of DDR address where WIFI FW
  3373. * updates the Write Index for WDI_IPA RX indication ring
  3374. * - RX_RING2_BASE_ADDR_LO
  3375. * Bits 31:0
  3376. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3377. * - RX_RING2_BASE_ADDR_HI
  3378. * Bits 31:0
  3379. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3380. * - RX_RING2_SIZE
  3381. * Bits 31:0
  3382. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3383. * - RX_RING2_RD_IDX_ADDR_LO
  3384. * Bits 31:0
  3385. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3386. * DDR address where IPA uC updates the Read Index for Ring2.
  3387. * If Second RX ring is completion ring, this is NOT used
  3388. * - RX_RING2_RD_IDX_ADDR_HI
  3389. * Bits 31:0
  3390. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3391. * DDR address where IPA uC updates the Read Index for Ring2.
  3392. * If Second RX ring is completion ring, this is NOT used
  3393. * - RX_RING2_WR_IDX_ADDR_LO
  3394. * Bits 31:0
  3395. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3396. * DDR address where WIFI FW updates the Write Index
  3397. * for WDI_IPA RX ring2
  3398. * If second RX ring is completion ring, lower 4 bytes of
  3399. * DDR address where IPA uC updates the Write Index for Ring 2.
  3400. * - RX_RING2_WR_IDX_ADDR_HI
  3401. * Bits 31:0
  3402. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3403. * DDR address where WIFI FW updates the Write Index
  3404. * for WDI_IPA RX ring2
  3405. * If second RX ring is completion ring, higher 4 bytes of
  3406. * DDR address where IPA uC updates the Write Index for Ring 2.
  3407. */
  3408. #if HTT_PADDR64
  3409. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3410. #else
  3411. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3412. #endif
  3413. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3414. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3431. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3451. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3452. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3454. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3475. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3476. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3477. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3480. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3481. } while (0)
  3482. /* for systems using 32-bit format for bus addr */
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3484. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3488. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3489. } while (0)
  3490. /* for systems using 64-bit format for bus addr */
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3492. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3496. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3497. } while (0)
  3498. /* for systems using 64-bit format for bus addr */
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3500. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3504. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3505. } while (0)
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3507. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3511. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3512. } while (0)
  3513. /* for systems using 32-bit format for bus addr */
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3515. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3516. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3519. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3520. } while (0)
  3521. /* for systems using 64-bit format for bus addr */
  3522. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3523. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3524. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3527. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3528. } while (0)
  3529. /* for systems using 64-bit format for bus addr */
  3530. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3531. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3532. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3535. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3536. } while (0)
  3537. /* for systems using 32-bit format for bus addr */
  3538. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3539. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3540. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3543. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3544. } while (0)
  3545. /* for systems using 64-bit format for bus addr */
  3546. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3547. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3548. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3551. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3552. } while (0)
  3553. /* for systems using 64-bit format for bus addr */
  3554. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3555. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3556. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3559. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3560. } while (0)
  3561. /* for systems using 32-bit format for bus addr */
  3562. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3564. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3568. } while (0)
  3569. /* for systems using 64-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3572. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3580. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3584. } while (0)
  3585. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3586. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3587. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3590. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3591. } while (0)
  3592. /* for systems using 32-bit format for bus addr */
  3593. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3594. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3595. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3598. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3599. } while (0)
  3600. /* for systems using 64-bit format for bus addr */
  3601. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3602. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3603. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3604. do { \
  3605. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3606. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3607. } while (0)
  3608. /* for systems using 64-bit format for bus addr */
  3609. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3611. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3614. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3615. } while (0)
  3616. /* for systems using 32-bit format for bus addr */
  3617. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3618. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3619. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3622. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3623. } while (0)
  3624. /* for systems using 64-bit format for bus addr */
  3625. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3626. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3627. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3630. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3631. } while (0)
  3632. /* for systems using 64-bit format for bus addr */
  3633. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3634. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3635. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3639. } while (0)
  3640. /* for systems using 32-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3643. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3647. } while (0)
  3648. /* for systems using 64-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3651. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3659. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3663. } while (0)
  3664. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3665. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3666. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3669. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3670. } while (0)
  3671. /* for systems using 32-bit format for bus addr */
  3672. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3673. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3674. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3677. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3678. } while (0)
  3679. /* for systems using 64-bit format for bus addr */
  3680. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3681. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3682. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3685. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3686. } while (0)
  3687. /* for systems using 64-bit format for bus addr */
  3688. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3689. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3690. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3693. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3694. } while (0)
  3695. /* for systems using 32-bit format for bus addr */
  3696. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3697. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3698. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3699. do { \
  3700. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3701. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3702. } while (0)
  3703. /* for systems using 64-bit format for bus addr */
  3704. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3705. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3706. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3707. do { \
  3708. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3709. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3710. } while (0)
  3711. /* for systems using 64-bit format for bus addr */
  3712. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3713. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3714. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3715. do { \
  3716. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3717. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3718. } while (0)
  3719. /*
  3720. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3721. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3722. * addresses are stored in a XXX-bit field.
  3723. * This macro is used to define both htt_wdi_ipa_config32_t and
  3724. * htt_wdi_ipa_config64_t structs.
  3725. */
  3726. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3727. _paddr__tx_comp_ring_base_addr_, \
  3728. _paddr__tx_comp_wr_idx_addr_, \
  3729. _paddr__tx_ce_wr_idx_addr_, \
  3730. _paddr__rx_ind_ring_base_addr_, \
  3731. _paddr__rx_ind_rd_idx_addr_, \
  3732. _paddr__rx_ind_wr_idx_addr_, \
  3733. _paddr__rx_ring2_base_addr_,\
  3734. _paddr__rx_ring2_rd_idx_addr_,\
  3735. _paddr__rx_ring2_wr_idx_addr_) \
  3736. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3737. { \
  3738. /* DWORD 0: flags and meta-data */ \
  3739. A_UINT32 \
  3740. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3741. reserved: 8, \
  3742. tx_pkt_pool_size: 16;\
  3743. /* DWORD 1 */\
  3744. _paddr__tx_comp_ring_base_addr_;\
  3745. /* DWORD 2 (or 3)*/\
  3746. A_UINT32 tx_comp_ring_size;\
  3747. /* DWORD 3 (or 4)*/\
  3748. _paddr__tx_comp_wr_idx_addr_;\
  3749. /* DWORD 4 (or 6)*/\
  3750. _paddr__tx_ce_wr_idx_addr_;\
  3751. /* DWORD 5 (or 8)*/\
  3752. _paddr__rx_ind_ring_base_addr_;\
  3753. /* DWORD 6 (or 10)*/\
  3754. A_UINT32 rx_ind_ring_size;\
  3755. /* DWORD 7 (or 11)*/\
  3756. _paddr__rx_ind_rd_idx_addr_;\
  3757. /* DWORD 8 (or 13)*/\
  3758. _paddr__rx_ind_wr_idx_addr_;\
  3759. /* DWORD 9 (or 15)*/\
  3760. _paddr__rx_ring2_base_addr_;\
  3761. /* DWORD 10 (or 17) */\
  3762. A_UINT32 rx_ring2_size;\
  3763. /* DWORD 11 (or 18) */\
  3764. _paddr__rx_ring2_rd_idx_addr_;\
  3765. /* DWORD 12 (or 20) */\
  3766. _paddr__rx_ring2_wr_idx_addr_;\
  3767. } POSTPACK
  3768. /* define a htt_wdi_ipa_config32_t type */
  3769. 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));
  3770. /* define a htt_wdi_ipa_config64_t type */
  3771. 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));
  3772. #if HTT_PADDR64
  3773. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3774. #else
  3775. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3776. #endif
  3777. enum htt_wdi_ipa_op_code {
  3778. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3779. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3780. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3781. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3782. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3783. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3784. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3785. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3786. /* keep this last */
  3787. HTT_WDI_IPA_OPCODE_MAX
  3788. };
  3789. /**
  3790. * @brief HTT WDI_IPA Operation Request Message
  3791. *
  3792. * @details
  3793. * HTT WDI_IPA Operation Request message is sent by host
  3794. * to either suspend or resume WDI_IPA TX or RX path.
  3795. * |31 24|23 16|15 8|7 0|
  3796. * |----------------+----------------+----------------+----------------|
  3797. * | op_code | Rsvd | msg_type |
  3798. * |-------------------------------------------------------------------|
  3799. *
  3800. * Header fields:
  3801. * - MSG_TYPE
  3802. * Bits 7:0
  3803. * Purpose: Identifies this as WDI_IPA Operation Request message
  3804. * value: = 0x9
  3805. * - OP_CODE
  3806. * Bits 31:16
  3807. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3808. * value: = enum htt_wdi_ipa_op_code
  3809. */
  3810. PREPACK struct htt_wdi_ipa_op_request_t
  3811. {
  3812. /* DWORD 0: flags and meta-data */
  3813. A_UINT32
  3814. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3815. reserved: 8,
  3816. op_code: 16;
  3817. } POSTPACK;
  3818. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3819. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3820. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3821. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3822. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3823. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3824. do { \
  3825. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3826. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3827. } while (0)
  3828. /*
  3829. * @brief host -> target HTT_SRING_SETUP message
  3830. *
  3831. * @details
  3832. * After target is booted up, Host can send SRING setup message for
  3833. * each host facing LMAC SRING. Target setups up HW registers based
  3834. * on setup message and confirms back to Host if response_required is set.
  3835. * Host should wait for confirmation message before sending new SRING
  3836. * setup message
  3837. *
  3838. * The message would appear as follows:
  3839. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3840. * |--------------- +-----------------+----------------+------------------|
  3841. * | ring_type | ring_id | pdev_id | msg_type |
  3842. * |----------------------------------------------------------------------|
  3843. * | ring_base_addr_lo |
  3844. * |----------------------------------------------------------------------|
  3845. * | ring_base_addr_hi |
  3846. * |----------------------------------------------------------------------|
  3847. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3848. * |----------------------------------------------------------------------|
  3849. * | ring_head_offset32_remote_addr_lo |
  3850. * |----------------------------------------------------------------------|
  3851. * | ring_head_offset32_remote_addr_hi |
  3852. * |----------------------------------------------------------------------|
  3853. * | ring_tail_offset32_remote_addr_lo |
  3854. * |----------------------------------------------------------------------|
  3855. * | ring_tail_offset32_remote_addr_hi |
  3856. * |----------------------------------------------------------------------|
  3857. * | ring_msi_addr_lo |
  3858. * |----------------------------------------------------------------------|
  3859. * | ring_msi_addr_hi |
  3860. * |----------------------------------------------------------------------|
  3861. * | ring_msi_data |
  3862. * |----------------------------------------------------------------------|
  3863. * | intr_timer_th |IM| intr_batch_counter_th |
  3864. * |----------------------------------------------------------------------|
  3865. * | reserved |RR|PTCF| intr_low_threshold |
  3866. * |----------------------------------------------------------------------|
  3867. * Where
  3868. * IM = sw_intr_mode
  3869. * RR = response_required
  3870. * PTCF = prefetch_timer_cfg
  3871. *
  3872. * The message is interpreted as follows:
  3873. * dword0 - b'0:7 - msg_type: This will be set to
  3874. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3875. * b'8:15 - pdev_id:
  3876. * 0 (for rings at SOC/UMAC level),
  3877. * 1/2/3 mac id (for rings at LMAC level)
  3878. * b'16:23 - ring_id: identify which ring is to setup,
  3879. * more details can be got from enum htt_srng_ring_id
  3880. * b'24:31 - ring_type: identify type of host rings,
  3881. * more details can be got from enum htt_srng_ring_type
  3882. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3883. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3884. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3885. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3886. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3887. * SW_TO_HW_RING.
  3888. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3889. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3890. * Lower 32 bits of memory address of the remote variable
  3891. * storing the 4-byte word offset that identifies the head
  3892. * element within the ring.
  3893. * (The head offset variable has type A_UINT32.)
  3894. * Valid for HW_TO_SW and SW_TO_SW rings.
  3895. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3896. * Upper 32 bits of memory address of the remote variable
  3897. * storing the 4-byte word offset that identifies the head
  3898. * element within the ring.
  3899. * (The head offset variable has type A_UINT32.)
  3900. * Valid for HW_TO_SW and SW_TO_SW rings.
  3901. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3902. * Lower 32 bits of memory address of the remote variable
  3903. * storing the 4-byte word offset that identifies the tail
  3904. * element within the ring.
  3905. * (The tail offset variable has type A_UINT32.)
  3906. * Valid for HW_TO_SW and SW_TO_SW rings.
  3907. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3908. * Upper 32 bits of memory address of the remote variable
  3909. * storing the 4-byte word offset that identifies the tail
  3910. * element within the ring.
  3911. * (The tail offset variable has type A_UINT32.)
  3912. * Valid for HW_TO_SW and SW_TO_SW rings.
  3913. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3914. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3915. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3916. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3917. * dword10 - b'0:31 - ring_msi_data: MSI data
  3918. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3919. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3920. * dword11 - b'0:14 - intr_batch_counter_th:
  3921. * batch counter threshold is in units of 4-byte words.
  3922. * HW internally maintains and increments batch count.
  3923. * (see SRING spec for detail description).
  3924. * When batch count reaches threshold value, an interrupt
  3925. * is generated by HW.
  3926. * b'15 - sw_intr_mode:
  3927. * This configuration shall be static.
  3928. * Only programmed at power up.
  3929. * 0: generate pulse style sw interrupts
  3930. * 1: generate level style sw interrupts
  3931. * b'16:31 - intr_timer_th:
  3932. * The timer init value when timer is idle or is
  3933. * initialized to start downcounting.
  3934. * In 8us units (to cover a range of 0 to 524 ms)
  3935. * dword12 - b'0:15 - intr_low_threshold:
  3936. * Used only by Consumer ring to generate ring_sw_int_p.
  3937. * Ring entries low threshold water mark, that is used
  3938. * in combination with the interrupt timer as well as
  3939. * the the clearing of the level interrupt.
  3940. * b'16:18 - prefetch_timer_cfg:
  3941. * Used only by Consumer ring to set timer mode to
  3942. * support Application prefetch handling.
  3943. * The external tail offset/pointer will be updated
  3944. * at following intervals:
  3945. * 3'b000: (Prefetch feature disabled; used only for debug)
  3946. * 3'b001: 1 usec
  3947. * 3'b010: 4 usec
  3948. * 3'b011: 8 usec (default)
  3949. * 3'b100: 16 usec
  3950. * Others: Reserverd
  3951. * b'19 - response_required:
  3952. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3953. * b'20:31 - reserved: reserved for future use
  3954. */
  3955. PREPACK struct htt_sring_setup_t {
  3956. A_UINT32 msg_type: 8,
  3957. pdev_id: 8,
  3958. ring_id: 8,
  3959. ring_type: 8;
  3960. A_UINT32 ring_base_addr_lo;
  3961. A_UINT32 ring_base_addr_hi;
  3962. A_UINT32 ring_size: 16,
  3963. ring_entry_size: 8,
  3964. ring_misc_cfg_flag: 8;
  3965. A_UINT32 ring_head_offset32_remote_addr_lo;
  3966. A_UINT32 ring_head_offset32_remote_addr_hi;
  3967. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3968. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3969. A_UINT32 ring_msi_addr_lo;
  3970. A_UINT32 ring_msi_addr_hi;
  3971. A_UINT32 ring_msi_data;
  3972. A_UINT32 intr_batch_counter_th: 15,
  3973. sw_intr_mode: 1,
  3974. intr_timer_th: 16;
  3975. A_UINT32 intr_low_threshold: 16,
  3976. prefetch_timer_cfg: 3,
  3977. response_required: 1,
  3978. reserved1: 12;
  3979. } POSTPACK;
  3980. enum htt_srng_ring_type {
  3981. HTT_HW_TO_SW_RING = 0,
  3982. HTT_SW_TO_HW_RING,
  3983. HTT_SW_TO_SW_RING,
  3984. /* Insert new ring types above this line */
  3985. };
  3986. enum htt_srng_ring_id {
  3987. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3988. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3989. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3990. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3991. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3992. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3993. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3994. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3995. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  3996. /* Add Other SRING which can't be directly configured by host software above this line */
  3997. };
  3998. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3999. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4000. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4001. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4002. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4003. HTT_SRING_SETUP_PDEV_ID_S)
  4004. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4005. do { \
  4006. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4007. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4008. } while (0)
  4009. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4010. #define HTT_SRING_SETUP_RING_ID_S 16
  4011. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4012. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4013. HTT_SRING_SETUP_RING_ID_S)
  4014. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4015. do { \
  4016. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4017. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4018. } while (0)
  4019. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4020. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4021. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4022. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4023. HTT_SRING_SETUP_RING_TYPE_S)
  4024. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4025. do { \
  4026. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4027. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4028. } while (0)
  4029. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4030. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4031. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4032. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4033. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4035. do { \
  4036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4037. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4038. } while (0)
  4039. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4040. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4041. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4042. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4043. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4044. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4045. do { \
  4046. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4047. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4048. } while (0)
  4049. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4050. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4051. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4052. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4053. HTT_SRING_SETUP_RING_SIZE_S)
  4054. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4055. do { \
  4056. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4057. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4058. } while (0)
  4059. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4060. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4061. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4062. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4063. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4064. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4065. do { \
  4066. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4067. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4068. } while (0)
  4069. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4070. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4071. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4072. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4073. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4074. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4075. do { \
  4076. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4077. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4078. } while (0)
  4079. /* This control bit is applicable to only Producer, which updates Ring ID field
  4080. * of each descriptor before pushing into the ring.
  4081. * 0: updates ring_id(default)
  4082. * 1: ring_id updating disabled */
  4083. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4084. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4085. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4086. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4087. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4088. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4089. do { \
  4090. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4091. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4092. } while (0)
  4093. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4094. * of each descriptor before pushing into the ring.
  4095. * 0: updates Loopcnt(default)
  4096. * 1: Loopcnt updating disabled */
  4097. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4098. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4099. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4100. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4101. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4105. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4106. } while (0)
  4107. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4108. * into security_id port of GXI/AXI. */
  4109. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4110. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4111. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4112. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4113. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4117. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4118. } while (0)
  4119. /* During MSI write operation, SRNG drives value of this register bit into
  4120. * swap bit of GXI/AXI. */
  4121. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4122. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4123. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4124. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4125. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4126. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4129. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4130. } while (0)
  4131. /* During Pointer write operation, SRNG drives value of this register bit into
  4132. * swap bit of GXI/AXI. */
  4133. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4134. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4135. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4136. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4137. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4138. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4141. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4142. } while (0)
  4143. /* During any data or TLV write operation, SRNG drives value of this register
  4144. * bit into swap bit of GXI/AXI. */
  4145. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4146. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4147. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4149. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4157. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4158. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4159. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4160. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4161. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4165. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4166. } while (0)
  4167. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4168. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4169. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4170. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4171. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4172. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4175. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4176. } while (0)
  4177. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4178. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4179. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4180. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4181. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4185. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4186. } while (0)
  4187. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4188. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4189. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4190. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4191. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4192. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4193. do { \
  4194. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4195. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4196. } while (0)
  4197. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4198. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4199. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4200. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4201. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4203. do { \
  4204. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4205. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4206. } while (0)
  4207. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4208. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4209. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4210. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4211. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4212. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4215. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4216. } while (0)
  4217. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4218. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4219. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4220. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4221. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4222. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4225. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4226. } while (0)
  4227. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4228. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4229. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4230. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4231. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4232. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4235. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4236. } while (0)
  4237. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4238. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4239. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4240. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4241. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4242. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4243. do { \
  4244. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4245. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4246. } while (0)
  4247. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4248. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4249. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4250. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4251. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4252. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4255. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4256. } while (0)
  4257. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4258. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4259. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4260. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4261. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4262. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4263. do { \
  4264. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4265. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4266. } while (0)
  4267. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4268. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4269. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4270. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4271. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4272. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4275. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4276. } while (0)
  4277. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4278. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4279. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4280. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4281. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4282. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4285. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4286. } while (0)
  4287. /**
  4288. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4289. *
  4290. * @details
  4291. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4292. * configure RXDMA rings.
  4293. * The configuration is per ring based and includes both packet subtypes
  4294. * and PPDU/MPDU TLVs.
  4295. *
  4296. * The message would appear as follows:
  4297. *
  4298. * |31 26|25|24|23 16|15 8|7 0|
  4299. * |-----------------+----------------+----------------+---------------|
  4300. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4301. * |-------------------------------------------------------------------|
  4302. * | rsvd2 | ring_buffer_size |
  4303. * |-------------------------------------------------------------------|
  4304. * | packet_type_enable_flags_0 |
  4305. * |-------------------------------------------------------------------|
  4306. * | packet_type_enable_flags_1 |
  4307. * |-------------------------------------------------------------------|
  4308. * | packet_type_enable_flags_2 |
  4309. * |-------------------------------------------------------------------|
  4310. * | packet_type_enable_flags_3 |
  4311. * |-------------------------------------------------------------------|
  4312. * | tlv_filter_in_flags |
  4313. * |-------------------------------------------------------------------|
  4314. * Where:
  4315. * PS = pkt_swap
  4316. * SS = status_swap
  4317. * The message is interpreted as follows:
  4318. * dword0 - b'0:7 - msg_type: This will be set to
  4319. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4320. * b'8:15 - pdev_id:
  4321. * 0 (for rings at SOC/UMAC level),
  4322. * 1/2/3 mac id (for rings at LMAC level)
  4323. * b'16:23 - ring_id : Identify the ring to configure.
  4324. * More details can be got from enum htt_srng_ring_id
  4325. * b'24 - status_swap: 1 is to swap status TLV
  4326. * b'25 - pkt_swap: 1 is to swap packet TLV
  4327. * b'26:31 - rsvd1: reserved for future use
  4328. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4329. * in byte units.
  4330. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4331. * - b'16:31 - rsvd2: Reserved for future use
  4332. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4333. * Enable MGMT packet from 0b0000 to 0b1001
  4334. * bits from low to high: FP, MD, MO - 3 bits
  4335. * FP: Filter_Pass
  4336. * MD: Monitor_Direct
  4337. * MO: Monitor_Other
  4338. * 10 mgmt subtypes * 3 bits -> 30 bits
  4339. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4340. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4341. * Enable MGMT packet from 0b1010 to 0b1111
  4342. * bits from low to high: FP, MD, MO - 3 bits
  4343. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4344. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4345. * Enable CTRL packet from 0b0000 to 0b1001
  4346. * bits from low to high: FP, MD, MO - 3 bits
  4347. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4348. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4349. * Enable CTRL packet from 0b1010 to 0b1111,
  4350. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4351. * bits from low to high: FP, MD, MO - 3 bits
  4352. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4353. * dword6 - b'0:31 - tlv_filter_in_flags:
  4354. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4355. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4356. */
  4357. PREPACK struct htt_rx_ring_selection_cfg_t {
  4358. A_UINT32 msg_type: 8,
  4359. pdev_id: 8,
  4360. ring_id: 8,
  4361. status_swap: 1,
  4362. pkt_swap: 1,
  4363. rsvd1: 6;
  4364. A_UINT32 ring_buffer_size: 16,
  4365. rsvd2: 16;
  4366. A_UINT32 packet_type_enable_flags_0;
  4367. A_UINT32 packet_type_enable_flags_1;
  4368. A_UINT32 packet_type_enable_flags_2;
  4369. A_UINT32 packet_type_enable_flags_3;
  4370. A_UINT32 tlv_filter_in_flags;
  4371. } POSTPACK;
  4372. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4373. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4374. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4375. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4376. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4377. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4378. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4379. do { \
  4380. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4381. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4382. } while (0)
  4383. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4384. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4385. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4386. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4387. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4388. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4389. do { \
  4390. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4391. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4392. } while (0)
  4393. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4394. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4395. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4396. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4397. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4398. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4399. do { \
  4400. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4401. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4402. } while (0)
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4406. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4407. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4409. do { \
  4410. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4411. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4412. } while (0)
  4413. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4414. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4415. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4416. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4417. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4418. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4419. do { \
  4420. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4421. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4422. } while (0)
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4426. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4427. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4429. do { \
  4430. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4431. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4432. } while (0)
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4436. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4437. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4439. do { \
  4440. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4441. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4442. } while (0)
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4446. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4447. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4449. do { \
  4450. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4451. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4452. } while (0)
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4456. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4457. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4459. do { \
  4460. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4461. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4462. } while (0)
  4463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4466. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4467. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4469. do { \
  4470. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4471. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4472. } while (0)
  4473. /*
  4474. * Subtype based MGMT frames enable bits.
  4475. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4476. */
  4477. /* association request */
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4484. /* association response */
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4491. /* Reassociation request */
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4498. /* Reassociation response */
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4505. /* Probe request */
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4512. /* Probe response */
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4519. /* Timing Advertisement */
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4526. /* Reserved */
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4533. /* Beacon */
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4540. /* ATIM */
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4547. /* Disassociation */
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4554. /* Authentication */
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4561. /* Deauthentication */
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4568. /* Action */
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4575. /* Action No Ack */
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4582. /* Reserved */
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4589. /*
  4590. * Subtype based CTRL frames enable bits.
  4591. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4592. */
  4593. /* Reserved */
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4600. /* Reserved */
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4607. /* Reserved */
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4614. /* Reserved */
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4621. /* Reserved */
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4628. /* Reserved */
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4635. /* Reserved */
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4642. /* Control Wrapper */
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4649. /* Block Ack Request */
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4656. /* Block Ack*/
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4663. /* PS-POLL */
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4670. /* RTS */
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4677. /* CTS */
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4684. /* ACK */
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4691. /* CF-END */
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4698. /* CF-END + CF-ACK */
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4705. /* Multicast data */
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4712. /* Unicast data */
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4719. /* NULL data */
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(httsym, value); \
  4729. (word) |= (value) << httsym##_S; \
  4730. } while (0)
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4732. (((word) & httsym##_M) >> httsym##_S)
  4733. #define htt_rx_ring_pkt_enable_subtype_set( \
  4734. word, flag, mode, type, subtype, val) \
  4735. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4736. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4737. #define htt_rx_ring_pkt_enable_subtype_get( \
  4738. word, flag, mode, type, subtype) \
  4739. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4740. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4741. /* Definition to filter in TLVs */
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4763. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4764. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4765. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4766. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4767. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4768. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(httsym, enable); \
  4771. (word) |= (enable) << httsym##_S; \
  4772. } while (0)
  4773. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4774. (((word) & httsym##_M) >> httsym##_S)
  4775. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4776. HTT_RX_RING_TLV_ENABLE_SET( \
  4777. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4778. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4779. HTT_RX_RING_TLV_ENABLE_GET( \
  4780. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4781. /**
  4782. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4783. * host --> target Receive Flow Steering configuration message definition.
  4784. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4785. * The reason for this is we want RFS to be configured and ready before MAC
  4786. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4787. *
  4788. * |31 24|23 16|15 9|8|7 0|
  4789. * |----------------+----------------+----------------+----------------|
  4790. * | reserved |E| msg type |
  4791. * |-------------------------------------------------------------------|
  4792. * Where E = RFS enable flag
  4793. *
  4794. * The RFS_CONFIG message consists of a single 4-byte word.
  4795. *
  4796. * Header fields:
  4797. * - MSG_TYPE
  4798. * Bits 7:0
  4799. * Purpose: identifies this as a RFS config msg
  4800. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4801. * - RFS_CONFIG
  4802. * Bit 8
  4803. * Purpose: Tells target whether to enable (1) or disable (0)
  4804. * flow steering feature when sending rx indication messages to host
  4805. */
  4806. #define HTT_H2T_RFS_CONFIG_M 0x100
  4807. #define HTT_H2T_RFS_CONFIG_S 8
  4808. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4809. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4810. HTT_H2T_RFS_CONFIG_S)
  4811. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4814. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4815. } while (0)
  4816. #define HTT_RFS_CFG_REQ_BYTES 4
  4817. /**
  4818. * @brief host -> target FW extended statistics retrieve
  4819. *
  4820. * @details
  4821. * The following field definitions describe the format of the HTT host
  4822. * to target FW extended stats retrieve message.
  4823. * The message specifies the type of stats the host wants to retrieve.
  4824. *
  4825. * |31 24|23 16|15 8|7 0|
  4826. * |-----------------------------------------------------------|
  4827. * | reserved | stats type | pdev_mask | msg type |
  4828. * |-----------------------------------------------------------|
  4829. * | config param [0] |
  4830. * |-----------------------------------------------------------|
  4831. * | config param [1] |
  4832. * |-----------------------------------------------------------|
  4833. * | config param [2] |
  4834. * |-----------------------------------------------------------|
  4835. * | config param [3] |
  4836. * |-----------------------------------------------------------|
  4837. * | reserved |
  4838. * |-----------------------------------------------------------|
  4839. * | cookie LSBs |
  4840. * |-----------------------------------------------------------|
  4841. * | cookie MSBs |
  4842. * |-----------------------------------------------------------|
  4843. * Header fields:
  4844. * - MSG_TYPE
  4845. * Bits 7:0
  4846. * Purpose: identifies this is a extended stats upload request message
  4847. * Value: 0x10
  4848. * - PDEV_MASK
  4849. * Bits 8:15
  4850. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4851. * Value: This is a overloaded field, refer to usage and interpretation of
  4852. * PDEV in interface document.
  4853. * Bit 8 : Reserved for SOC stats
  4854. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4855. * Indicates MACID_MASK in DBS
  4856. * - STATS_TYPE
  4857. * Bits 23:16
  4858. * Purpose: identifies which FW statistics to upload
  4859. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4860. * - Reserved
  4861. * Bits 31:24
  4862. * - CONFIG_PARAM [0]
  4863. * Bits 31:0
  4864. * Purpose: give an opaque configuration value to the specified stats type
  4865. * Value: stats-type specific configuration value
  4866. * Refer to htt_stats.h for interpretation for each stats sub_type
  4867. * - CONFIG_PARAM [1]
  4868. * Bits 31:0
  4869. * Purpose: give an opaque configuration value to the specified stats type
  4870. * Value: stats-type specific configuration value
  4871. * Refer to htt_stats.h for interpretation for each stats sub_type
  4872. * - CONFIG_PARAM [2]
  4873. * Bits 31:0
  4874. * Purpose: give an opaque configuration value to the specified stats type
  4875. * Value: stats-type specific configuration value
  4876. * Refer to htt_stats.h for interpretation for each stats sub_type
  4877. * - CONFIG_PARAM [3]
  4878. * Bits 31:0
  4879. * Purpose: give an opaque configuration value to the specified stats type
  4880. * Value: stats-type specific configuration value
  4881. * Refer to htt_stats.h for interpretation for each stats sub_type
  4882. * - Reserved [31:0] for future use.
  4883. * - COOKIE_LSBS
  4884. * Bits 31:0
  4885. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4886. * message with its preceding host->target stats request message.
  4887. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4888. * - COOKIE_MSBS
  4889. * Bits 31:0
  4890. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4891. * message with its preceding host->target stats request message.
  4892. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4893. */
  4894. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4895. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4896. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4897. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4898. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4899. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4900. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4901. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4902. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4903. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4904. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4905. do { \
  4906. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4907. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4908. } while (0)
  4909. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4910. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4911. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4912. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4915. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4916. } while (0)
  4917. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4918. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4919. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4920. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4923. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4924. } while (0)
  4925. /**
  4926. * @brief host -> target FW PPDU_STATS request message
  4927. *
  4928. * @details
  4929. * The following field definitions describe the format of the HTT host
  4930. * to target FW for PPDU_STATS_CFG msg.
  4931. * The message allows the host to configure the PPDU_STATS_IND messages
  4932. * produced by the target.
  4933. *
  4934. * |31 24|23 16|15 8|7 0|
  4935. * |-----------------------------------------------------------|
  4936. * | REQ bit mask | pdev_mask | msg type |
  4937. * |-----------------------------------------------------------|
  4938. * Header fields:
  4939. * - MSG_TYPE
  4940. * Bits 7:0
  4941. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4942. * Value: 0x11
  4943. * - PDEV_MASK
  4944. * Bits 8:15
  4945. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4946. * Value: This is a overloaded field, refer to usage and interpretation of
  4947. * PDEV in interface document.
  4948. * Bit 8 : Reserved for SOC stats
  4949. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4950. * Indicates MACID_MASK in DBS
  4951. * - REQ_TLV_BIT_MASK
  4952. * Bits 16:31
  4953. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4954. * needs to be included in the target's PPDU_STATS_IND messages.
  4955. * Value: refer htt_ppdu_stats_tlv_tag_t
  4956. *
  4957. */
  4958. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4959. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4960. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4961. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4962. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4963. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4964. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4965. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4966. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4969. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4970. } while (0)
  4971. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4972. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4973. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4974. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4977. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4978. } while (0)
  4979. /*=== target -> host messages ===============================================*/
  4980. enum htt_t2h_msg_type {
  4981. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4982. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4983. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4984. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4985. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4986. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4987. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4988. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4989. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4990. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4991. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4992. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4993. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4994. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4995. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4996. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4997. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4998. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4999. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5000. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5001. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5002. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5003. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5004. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5005. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5006. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5007. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5008. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5009. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5010. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5011. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5012. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5013. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5014. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5015. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5016. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5017. HTT_T2H_MSG_TYPE_TEST,
  5018. /* keep this last */
  5019. HTT_T2H_NUM_MSGS
  5020. };
  5021. /*
  5022. * HTT target to host message type -
  5023. * stored in bits 7:0 of the first word of the message
  5024. */
  5025. #define HTT_T2H_MSG_TYPE_M 0xff
  5026. #define HTT_T2H_MSG_TYPE_S 0
  5027. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5028. do { \
  5029. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5030. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5031. } while (0)
  5032. #define HTT_T2H_MSG_TYPE_GET(word) \
  5033. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5034. /**
  5035. * @brief target -> host version number confirmation message definition
  5036. *
  5037. * |31 24|23 16|15 8|7 0|
  5038. * |----------------+----------------+----------------+----------------|
  5039. * | reserved | major number | minor number | msg type |
  5040. * |-------------------------------------------------------------------|
  5041. * : option request TLV (optional) |
  5042. * :...................................................................:
  5043. *
  5044. * The VER_CONF message may consist of a single 4-byte word, or may be
  5045. * extended with TLVs that specify HTT options selected by the target.
  5046. * The following option TLVs may be appended to the VER_CONF message:
  5047. * - LL_BUS_ADDR_SIZE
  5048. * - HL_SUPPRESS_TX_COMPL_IND
  5049. * - MAX_TX_QUEUE_GROUPS
  5050. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5051. * may be appended to the VER_CONF message (but only one TLV of each type).
  5052. *
  5053. * Header fields:
  5054. * - MSG_TYPE
  5055. * Bits 7:0
  5056. * Purpose: identifies this as a version number confirmation message
  5057. * Value: 0x0
  5058. * - VER_MINOR
  5059. * Bits 15:8
  5060. * Purpose: Specify the minor number of the HTT message library version
  5061. * in use by the target firmware.
  5062. * The minor number specifies the specific revision within a range
  5063. * of fundamentally compatible HTT message definition revisions.
  5064. * Compatible revisions involve adding new messages or perhaps
  5065. * adding new fields to existing messages, in a backwards-compatible
  5066. * manner.
  5067. * Incompatible revisions involve changing the message type values,
  5068. * or redefining existing messages.
  5069. * Value: minor number
  5070. * - VER_MAJOR
  5071. * Bits 15:8
  5072. * Purpose: Specify the major number of the HTT message library version
  5073. * in use by the target firmware.
  5074. * The major number specifies the family of minor revisions that are
  5075. * fundamentally compatible with each other, but not with prior or
  5076. * later families.
  5077. * Value: major number
  5078. */
  5079. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5080. #define HTT_VER_CONF_MINOR_S 8
  5081. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5082. #define HTT_VER_CONF_MAJOR_S 16
  5083. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5084. do { \
  5085. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5086. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5087. } while (0)
  5088. #define HTT_VER_CONF_MINOR_GET(word) \
  5089. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5090. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5091. do { \
  5092. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5093. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5094. } while (0)
  5095. #define HTT_VER_CONF_MAJOR_GET(word) \
  5096. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5097. #define HTT_VER_CONF_BYTES 4
  5098. /**
  5099. * @brief - target -> host HTT Rx In order indication message
  5100. *
  5101. * @details
  5102. *
  5103. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5104. * |----------------+-------------------+---------------------+---------------|
  5105. * | peer ID | P| F| O| ext TID | msg type |
  5106. * |--------------------------------------------------------------------------|
  5107. * | MSDU count | Reserved | vdev id |
  5108. * |--------------------------------------------------------------------------|
  5109. * | MSDU 0 bus address (bits 31:0) |
  5110. #if HTT_PADDR64
  5111. * | MSDU 0 bus address (bits 63:32) |
  5112. #endif
  5113. * |--------------------------------------------------------------------------|
  5114. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5115. * |--------------------------------------------------------------------------|
  5116. * | MSDU 1 bus address (bits 31:0) |
  5117. #if HTT_PADDR64
  5118. * | MSDU 1 bus address (bits 63:32) |
  5119. #endif
  5120. * |--------------------------------------------------------------------------|
  5121. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5122. * |--------------------------------------------------------------------------|
  5123. */
  5124. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5125. *
  5126. * @details
  5127. * bits
  5128. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5129. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5130. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5131. * | | frag | | | | fail |chksum fail|
  5132. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5133. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5134. */
  5135. struct htt_rx_in_ord_paddr_ind_hdr_t
  5136. {
  5137. A_UINT32 /* word 0 */
  5138. msg_type: 8,
  5139. ext_tid: 5,
  5140. offload: 1,
  5141. frag: 1,
  5142. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5143. peer_id: 16;
  5144. A_UINT32 /* word 1 */
  5145. vap_id: 8,
  5146. reserved_1: 8,
  5147. msdu_cnt: 16;
  5148. };
  5149. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5150. {
  5151. A_UINT32 dma_addr;
  5152. A_UINT32
  5153. length: 16,
  5154. fw_desc: 8,
  5155. msdu_info:8;
  5156. };
  5157. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5158. {
  5159. A_UINT32 dma_addr_lo;
  5160. A_UINT32 dma_addr_hi;
  5161. A_UINT32
  5162. length: 16,
  5163. fw_desc: 8,
  5164. msdu_info:8;
  5165. };
  5166. #if HTT_PADDR64
  5167. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5168. #else
  5169. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5170. #endif
  5171. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5172. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5177. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5178. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5179. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5180. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5182. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5183. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5184. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5185. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5186. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5187. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5188. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5189. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5190. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5191. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5192. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5195. /* for systems using 64-bit format for bus addresses */
  5196. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5197. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5199. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5200. /* for systems using 32-bit format for bus addresses */
  5201. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5202. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5205. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5206. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5207. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5208. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5209. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5210. do { \
  5211. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5212. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5213. } while (0)
  5214. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5215. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5216. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5217. do { \
  5218. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5219. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5220. } while (0)
  5221. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5222. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5223. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5224. do { \
  5225. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5226. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5227. } while (0)
  5228. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5229. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5230. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5231. do { \
  5232. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5233. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5234. } while (0)
  5235. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5236. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5237. /* for systems using 64-bit format for bus addresses */
  5238. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5239. do { \
  5240. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5241. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5242. } while (0)
  5243. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5244. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5245. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5246. do { \
  5247. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5248. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5249. } while (0)
  5250. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5251. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5252. /* for systems using 32-bit format for bus addresses */
  5253. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5254. do { \
  5255. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5256. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5257. } while (0)
  5258. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5259. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5260. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5261. do { \
  5262. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5263. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5264. } while (0)
  5265. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5266. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5267. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5268. do { \
  5269. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5270. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5271. } while (0)
  5272. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5273. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5274. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5275. do { \
  5276. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5277. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5278. } while (0)
  5279. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5280. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5281. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5284. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5285. } while (0)
  5286. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5287. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5288. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5291. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5292. } while (0)
  5293. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5294. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5295. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5296. do { \
  5297. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5298. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5299. } while (0)
  5300. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5301. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5302. /* definitions used within target -> host rx indication message */
  5303. PREPACK struct htt_rx_ind_hdr_prefix_t
  5304. {
  5305. A_UINT32 /* word 0 */
  5306. msg_type: 8,
  5307. ext_tid: 5,
  5308. release_valid: 1,
  5309. flush_valid: 1,
  5310. reserved0: 1,
  5311. peer_id: 16;
  5312. A_UINT32 /* word 1 */
  5313. flush_start_seq_num: 6,
  5314. flush_end_seq_num: 6,
  5315. release_start_seq_num: 6,
  5316. release_end_seq_num: 6,
  5317. num_mpdu_ranges: 8;
  5318. } POSTPACK;
  5319. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5320. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5321. #define HTT_TGT_RSSI_INVALID 0x80
  5322. PREPACK struct htt_rx_ppdu_desc_t
  5323. {
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5325. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5328. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5329. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5330. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5331. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5332. A_UINT32 /* word 0 */
  5333. rssi_cmb: 8,
  5334. timestamp_submicrosec: 8,
  5335. phy_err_code: 8,
  5336. phy_err: 1,
  5337. legacy_rate: 4,
  5338. legacy_rate_sel: 1,
  5339. end_valid: 1,
  5340. start_valid: 1;
  5341. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5342. union {
  5343. A_UINT32 /* word 1 */
  5344. rssi0_pri20: 8,
  5345. rssi0_ext20: 8,
  5346. rssi0_ext40: 8,
  5347. rssi0_ext80: 8;
  5348. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5349. } u0;
  5350. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5351. union {
  5352. A_UINT32 /* word 2 */
  5353. rssi1_pri20: 8,
  5354. rssi1_ext20: 8,
  5355. rssi1_ext40: 8,
  5356. rssi1_ext80: 8;
  5357. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5358. } u1;
  5359. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5360. union {
  5361. A_UINT32 /* word 3 */
  5362. rssi2_pri20: 8,
  5363. rssi2_ext20: 8,
  5364. rssi2_ext40: 8,
  5365. rssi2_ext80: 8;
  5366. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5367. } u2;
  5368. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5369. union {
  5370. A_UINT32 /* word 4 */
  5371. rssi3_pri20: 8,
  5372. rssi3_ext20: 8,
  5373. rssi3_ext40: 8,
  5374. rssi3_ext80: 8;
  5375. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5376. } u3;
  5377. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5378. A_UINT32 tsf32; /* word 5 */
  5379. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5380. A_UINT32 timestamp_microsec; /* word 6 */
  5381. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5382. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5383. A_UINT32 /* word 7 */
  5384. vht_sig_a1: 24,
  5385. preamble_type: 8;
  5386. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5387. A_UINT32 /* word 8 */
  5388. vht_sig_a2: 24,
  5389. reserved0: 8;
  5390. } POSTPACK;
  5391. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5392. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5393. PREPACK struct htt_rx_ind_hdr_suffix_t
  5394. {
  5395. A_UINT32 /* word 0 */
  5396. fw_rx_desc_bytes: 16,
  5397. reserved0: 16;
  5398. } POSTPACK;
  5399. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5400. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5401. PREPACK struct htt_rx_ind_hdr_t
  5402. {
  5403. struct htt_rx_ind_hdr_prefix_t prefix;
  5404. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5405. struct htt_rx_ind_hdr_suffix_t suffix;
  5406. } POSTPACK;
  5407. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5408. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5409. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5410. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5411. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5412. /*
  5413. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5414. * the offset into the HTT rx indication message at which the
  5415. * FW rx PPDU descriptor resides
  5416. */
  5417. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5418. /*
  5419. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5420. * the offset into the HTT rx indication message at which the
  5421. * header suffix (FW rx MSDU byte count) resides
  5422. */
  5423. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5424. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5425. /*
  5426. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5427. * the offset into the HTT rx indication message at which the per-MSDU
  5428. * information starts
  5429. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5430. * per-MSDU information portion of the message. The per-MSDU info itself
  5431. * starts at byte 12.
  5432. */
  5433. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5434. /**
  5435. * @brief target -> host rx indication message definition
  5436. *
  5437. * @details
  5438. * The following field definitions describe the format of the rx indication
  5439. * message sent from the target to the host.
  5440. * The message consists of three major sections:
  5441. * 1. a fixed-length header
  5442. * 2. a variable-length list of firmware rx MSDU descriptors
  5443. * 3. one or more 4-octet MPDU range information elements
  5444. * The fixed length header itself has two sub-sections
  5445. * 1. the message meta-information, including identification of the
  5446. * sender and type of the received data, and a 4-octet flush/release IE
  5447. * 2. the firmware rx PPDU descriptor
  5448. *
  5449. * The format of the message is depicted below.
  5450. * in this depiction, the following abbreviations are used for information
  5451. * elements within the message:
  5452. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5453. * elements associated with the PPDU start are valid.
  5454. * Specifically, the following fields are valid only if SV is set:
  5455. * RSSI (all variants), L, legacy rate, preamble type, service,
  5456. * VHT-SIG-A
  5457. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5458. * elements associated with the PPDU end are valid.
  5459. * Specifically, the following fields are valid only if EV is set:
  5460. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5461. * - L - Legacy rate selector - if legacy rates are used, this flag
  5462. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5463. * (L == 0) PHY.
  5464. * - P - PHY error flag - boolean indication of whether the rx frame had
  5465. * a PHY error
  5466. *
  5467. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5468. * |----------------+-------------------+---------------------+---------------|
  5469. * | peer ID | |RV|FV| ext TID | msg type |
  5470. * |--------------------------------------------------------------------------|
  5471. * | num | release | release | flush | flush |
  5472. * | MPDU | end | start | end | start |
  5473. * | ranges | seq num | seq num | seq num | seq num |
  5474. * |==========================================================================|
  5475. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5476. * |V|V| | rate | | | timestamp | RSSI |
  5477. * |--------------------------------------------------------------------------|
  5478. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5479. * |--------------------------------------------------------------------------|
  5480. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5481. * |--------------------------------------------------------------------------|
  5482. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5483. * |--------------------------------------------------------------------------|
  5484. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5485. * |--------------------------------------------------------------------------|
  5486. * | TSF LSBs |
  5487. * |--------------------------------------------------------------------------|
  5488. * | microsec timestamp |
  5489. * |--------------------------------------------------------------------------|
  5490. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5491. * |--------------------------------------------------------------------------|
  5492. * | service | HT-SIG / VHT-SIG-A2 |
  5493. * |==========================================================================|
  5494. * | reserved | FW rx desc bytes |
  5495. * |--------------------------------------------------------------------------|
  5496. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5497. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5498. * |--------------------------------------------------------------------------|
  5499. * : : :
  5500. * |--------------------------------------------------------------------------|
  5501. * | alignment | MSDU Rx |
  5502. * | padding | desc Bn |
  5503. * |--------------------------------------------------------------------------|
  5504. * | reserved | MPDU range status | MPDU count |
  5505. * |--------------------------------------------------------------------------|
  5506. * : reserved : MPDU range status : MPDU count :
  5507. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5508. *
  5509. * Header fields:
  5510. * - MSG_TYPE
  5511. * Bits 7:0
  5512. * Purpose: identifies this as an rx indication message
  5513. * Value: 0x1
  5514. * - EXT_TID
  5515. * Bits 12:8
  5516. * Purpose: identify the traffic ID of the rx data, including
  5517. * special "extended" TID values for multicast, broadcast, and
  5518. * non-QoS data frames
  5519. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5520. * - FLUSH_VALID (FV)
  5521. * Bit 13
  5522. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5523. * is valid
  5524. * Value:
  5525. * 1 -> flush IE is valid and needs to be processed
  5526. * 0 -> flush IE is not valid and should be ignored
  5527. * - REL_VALID (RV)
  5528. * Bit 13
  5529. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5530. * is valid
  5531. * Value:
  5532. * 1 -> release IE is valid and needs to be processed
  5533. * 0 -> release IE is not valid and should be ignored
  5534. * - PEER_ID
  5535. * Bits 31:16
  5536. * Purpose: Identify, by ID, which peer sent the rx data
  5537. * Value: ID of the peer who sent the rx data
  5538. * - FLUSH_SEQ_NUM_START
  5539. * Bits 5:0
  5540. * Purpose: Indicate the start of a series of MPDUs to flush
  5541. * Not all MPDUs within this series are necessarily valid - the host
  5542. * must check each sequence number within this range to see if the
  5543. * corresponding MPDU is actually present.
  5544. * This field is only valid if the FV bit is set.
  5545. * Value:
  5546. * The sequence number for the first MPDUs to check to flush.
  5547. * The sequence number is masked by 0x3f.
  5548. * - FLUSH_SEQ_NUM_END
  5549. * Bits 11:6
  5550. * Purpose: Indicate the end of a series of MPDUs to flush
  5551. * Value:
  5552. * The sequence number one larger than the sequence number of the
  5553. * last MPDU to check to flush.
  5554. * The sequence number is masked by 0x3f.
  5555. * Not all MPDUs within this series are necessarily valid - the host
  5556. * must check each sequence number within this range to see if the
  5557. * corresponding MPDU is actually present.
  5558. * This field is only valid if the FV bit is set.
  5559. * - REL_SEQ_NUM_START
  5560. * Bits 17:12
  5561. * Purpose: Indicate the start of a series of MPDUs to release.
  5562. * All MPDUs within this series are present and valid - the host
  5563. * need not check each sequence number within this range to see if
  5564. * the corresponding MPDU is actually present.
  5565. * This field is only valid if the RV bit is set.
  5566. * Value:
  5567. * The sequence number for the first MPDUs to check to release.
  5568. * The sequence number is masked by 0x3f.
  5569. * - REL_SEQ_NUM_END
  5570. * Bits 23:18
  5571. * Purpose: Indicate the end of a series of MPDUs to release.
  5572. * Value:
  5573. * The sequence number one larger than the sequence number of the
  5574. * last MPDU to check to release.
  5575. * The sequence number is masked by 0x3f.
  5576. * All MPDUs within this series are present and valid - the host
  5577. * need not check each sequence number within this range to see if
  5578. * the corresponding MPDU is actually present.
  5579. * This field is only valid if the RV bit is set.
  5580. * - NUM_MPDU_RANGES
  5581. * Bits 31:24
  5582. * Purpose: Indicate how many ranges of MPDUs are present.
  5583. * Each MPDU range consists of a series of contiguous MPDUs within the
  5584. * rx frame sequence which all have the same MPDU status.
  5585. * Value: 1-63 (typically a small number, like 1-3)
  5586. *
  5587. * Rx PPDU descriptor fields:
  5588. * - RSSI_CMB
  5589. * Bits 7:0
  5590. * Purpose: Combined RSSI from all active rx chains, across the active
  5591. * bandwidth.
  5592. * Value: RSSI dB units w.r.t. noise floor
  5593. * - TIMESTAMP_SUBMICROSEC
  5594. * Bits 15:8
  5595. * Purpose: high-resolution timestamp
  5596. * Value:
  5597. * Sub-microsecond time of PPDU reception.
  5598. * This timestamp ranges from [0,MAC clock MHz).
  5599. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5600. * to form a high-resolution, large range rx timestamp.
  5601. * - PHY_ERR_CODE
  5602. * Bits 23:16
  5603. * Purpose:
  5604. * If the rx frame processing resulted in a PHY error, indicate what
  5605. * type of rx PHY error occurred.
  5606. * Value:
  5607. * This field is valid if the "P" (PHY_ERR) flag is set.
  5608. * TBD: document/specify the values for this field
  5609. * - PHY_ERR
  5610. * Bit 24
  5611. * Purpose: indicate whether the rx PPDU had a PHY error
  5612. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5613. * - LEGACY_RATE
  5614. * Bits 28:25
  5615. * Purpose:
  5616. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5617. * specify which rate was used.
  5618. * Value:
  5619. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5620. * flag.
  5621. * If LEGACY_RATE_SEL is 0:
  5622. * 0x8: OFDM 48 Mbps
  5623. * 0x9: OFDM 24 Mbps
  5624. * 0xA: OFDM 12 Mbps
  5625. * 0xB: OFDM 6 Mbps
  5626. * 0xC: OFDM 54 Mbps
  5627. * 0xD: OFDM 36 Mbps
  5628. * 0xE: OFDM 18 Mbps
  5629. * 0xF: OFDM 9 Mbps
  5630. * If LEGACY_RATE_SEL is 1:
  5631. * 0x8: CCK 11 Mbps long preamble
  5632. * 0x9: CCK 5.5 Mbps long preamble
  5633. * 0xA: CCK 2 Mbps long preamble
  5634. * 0xB: CCK 1 Mbps long preamble
  5635. * 0xC: CCK 11 Mbps short preamble
  5636. * 0xD: CCK 5.5 Mbps short preamble
  5637. * 0xE: CCK 2 Mbps short preamble
  5638. * - LEGACY_RATE_SEL
  5639. * Bit 29
  5640. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5641. * Value:
  5642. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5643. * used a legacy rate.
  5644. * 0 -> OFDM, 1 -> CCK
  5645. * - END_VALID
  5646. * Bit 30
  5647. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5648. * the start of the PPDU are valid. Specifically, the following
  5649. * fields are only valid if END_VALID is set:
  5650. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5651. * TIMESTAMP_SUBMICROSEC
  5652. * Value:
  5653. * 0 -> rx PPDU desc end fields are not valid
  5654. * 1 -> rx PPDU desc end fields are valid
  5655. * - START_VALID
  5656. * Bit 31
  5657. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5658. * the end of the PPDU are valid. Specifically, the following
  5659. * fields are only valid if START_VALID is set:
  5660. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5661. * VHT-SIG-A
  5662. * Value:
  5663. * 0 -> rx PPDU desc start fields are not valid
  5664. * 1 -> rx PPDU desc start fields are valid
  5665. * - RSSI0_PRI20
  5666. * Bits 7:0
  5667. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5668. * Value: RSSI dB units w.r.t. noise floor
  5669. *
  5670. * - RSSI0_EXT20
  5671. * Bits 7:0
  5672. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5673. * (if the rx bandwidth was >= 40 MHz)
  5674. * Value: RSSI dB units w.r.t. noise floor
  5675. * - RSSI0_EXT40
  5676. * Bits 7:0
  5677. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5678. * (if the rx bandwidth was >= 80 MHz)
  5679. * Value: RSSI dB units w.r.t. noise floor
  5680. * - RSSI0_EXT80
  5681. * Bits 7:0
  5682. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5683. * (if the rx bandwidth was >= 160 MHz)
  5684. * Value: RSSI dB units w.r.t. noise floor
  5685. *
  5686. * - RSSI1_PRI20
  5687. * Bits 7:0
  5688. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5689. * Value: RSSI dB units w.r.t. noise floor
  5690. * - RSSI1_EXT20
  5691. * Bits 7:0
  5692. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5693. * (if the rx bandwidth was >= 40 MHz)
  5694. * Value: RSSI dB units w.r.t. noise floor
  5695. * - RSSI1_EXT40
  5696. * Bits 7:0
  5697. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5698. * (if the rx bandwidth was >= 80 MHz)
  5699. * Value: RSSI dB units w.r.t. noise floor
  5700. * - RSSI1_EXT80
  5701. * Bits 7:0
  5702. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5703. * (if the rx bandwidth was >= 160 MHz)
  5704. * Value: RSSI dB units w.r.t. noise floor
  5705. *
  5706. * - RSSI2_PRI20
  5707. * Bits 7:0
  5708. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5709. * Value: RSSI dB units w.r.t. noise floor
  5710. * - RSSI2_EXT20
  5711. * Bits 7:0
  5712. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5713. * (if the rx bandwidth was >= 40 MHz)
  5714. * Value: RSSI dB units w.r.t. noise floor
  5715. * - RSSI2_EXT40
  5716. * Bits 7:0
  5717. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5718. * (if the rx bandwidth was >= 80 MHz)
  5719. * Value: RSSI dB units w.r.t. noise floor
  5720. * - RSSI2_EXT80
  5721. * Bits 7:0
  5722. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5723. * (if the rx bandwidth was >= 160 MHz)
  5724. * Value: RSSI dB units w.r.t. noise floor
  5725. *
  5726. * - RSSI3_PRI20
  5727. * Bits 7:0
  5728. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5729. * Value: RSSI dB units w.r.t. noise floor
  5730. * - RSSI3_EXT20
  5731. * Bits 7:0
  5732. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5733. * (if the rx bandwidth was >= 40 MHz)
  5734. * Value: RSSI dB units w.r.t. noise floor
  5735. * - RSSI3_EXT40
  5736. * Bits 7:0
  5737. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5738. * (if the rx bandwidth was >= 80 MHz)
  5739. * Value: RSSI dB units w.r.t. noise floor
  5740. * - RSSI3_EXT80
  5741. * Bits 7:0
  5742. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5743. * (if the rx bandwidth was >= 160 MHz)
  5744. * Value: RSSI dB units w.r.t. noise floor
  5745. *
  5746. * - TSF32
  5747. * Bits 31:0
  5748. * Purpose: specify the time the rx PPDU was received, in TSF units
  5749. * Value: 32 LSBs of the TSF
  5750. * - TIMESTAMP_MICROSEC
  5751. * Bits 31:0
  5752. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5753. * Value: PPDU rx time, in microseconds
  5754. * - VHT_SIG_A1
  5755. * Bits 23:0
  5756. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5757. * from the rx PPDU
  5758. * Value:
  5759. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5760. * VHT-SIG-A1 data.
  5761. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5762. * first 24 bits of the HT-SIG data.
  5763. * Otherwise, this field is invalid.
  5764. * Refer to the the 802.11 protocol for the definition of the
  5765. * HT-SIG and VHT-SIG-A1 fields
  5766. * - VHT_SIG_A2
  5767. * Bits 23:0
  5768. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5769. * from the rx PPDU
  5770. * Value:
  5771. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5772. * VHT-SIG-A2 data.
  5773. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5774. * last 24 bits of the HT-SIG data.
  5775. * Otherwise, this field is invalid.
  5776. * Refer to the the 802.11 protocol for the definition of the
  5777. * HT-SIG and VHT-SIG-A2 fields
  5778. * - PREAMBLE_TYPE
  5779. * Bits 31:24
  5780. * Purpose: indicate the PHY format of the received burst
  5781. * Value:
  5782. * 0x4: Legacy (OFDM/CCK)
  5783. * 0x8: HT
  5784. * 0x9: HT with TxBF
  5785. * 0xC: VHT
  5786. * 0xD: VHT with TxBF
  5787. * - SERVICE
  5788. * Bits 31:24
  5789. * Purpose: TBD
  5790. * Value: TBD
  5791. *
  5792. * Rx MSDU descriptor fields:
  5793. * - FW_RX_DESC_BYTES
  5794. * Bits 15:0
  5795. * Purpose: Indicate how many bytes in the Rx indication are used for
  5796. * FW Rx descriptors
  5797. *
  5798. * Payload fields:
  5799. * - MPDU_COUNT
  5800. * Bits 7:0
  5801. * Purpose: Indicate how many sequential MPDUs share the same status.
  5802. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5803. * - MPDU_STATUS
  5804. * Bits 15:8
  5805. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5806. * received successfully.
  5807. * Value:
  5808. * 0x1: success
  5809. * 0x2: FCS error
  5810. * 0x3: duplicate error
  5811. * 0x4: replay error
  5812. * 0x5: invalid peer
  5813. */
  5814. /* header fields */
  5815. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5816. #define HTT_RX_IND_EXT_TID_S 8
  5817. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5818. #define HTT_RX_IND_FLUSH_VALID_S 13
  5819. #define HTT_RX_IND_REL_VALID_M 0x4000
  5820. #define HTT_RX_IND_REL_VALID_S 14
  5821. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5822. #define HTT_RX_IND_PEER_ID_S 16
  5823. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5824. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5825. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5826. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5827. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5828. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5829. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5830. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5831. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5832. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5833. /* rx PPDU descriptor fields */
  5834. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5835. #define HTT_RX_IND_RSSI_CMB_S 0
  5836. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5837. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5838. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5839. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5840. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5841. #define HTT_RX_IND_PHY_ERR_S 24
  5842. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5843. #define HTT_RX_IND_LEGACY_RATE_S 25
  5844. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5845. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5846. #define HTT_RX_IND_END_VALID_M 0x40000000
  5847. #define HTT_RX_IND_END_VALID_S 30
  5848. #define HTT_RX_IND_START_VALID_M 0x80000000
  5849. #define HTT_RX_IND_START_VALID_S 31
  5850. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5851. #define HTT_RX_IND_RSSI_PRI20_S 0
  5852. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5853. #define HTT_RX_IND_RSSI_EXT20_S 8
  5854. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5855. #define HTT_RX_IND_RSSI_EXT40_S 16
  5856. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5857. #define HTT_RX_IND_RSSI_EXT80_S 24
  5858. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5859. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5860. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5861. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5862. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5863. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5864. #define HTT_RX_IND_SERVICE_M 0xff000000
  5865. #define HTT_RX_IND_SERVICE_S 24
  5866. /* rx MSDU descriptor fields */
  5867. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5868. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5869. /* payload fields */
  5870. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5871. #define HTT_RX_IND_MPDU_COUNT_S 0
  5872. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5873. #define HTT_RX_IND_MPDU_STATUS_S 8
  5874. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5875. do { \
  5876. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5877. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5878. } while (0)
  5879. #define HTT_RX_IND_EXT_TID_GET(word) \
  5880. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5881. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5882. do { \
  5883. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5884. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5885. } while (0)
  5886. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5887. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5888. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5889. do { \
  5890. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5891. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5892. } while (0)
  5893. #define HTT_RX_IND_REL_VALID_GET(word) \
  5894. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5895. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5896. do { \
  5897. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5898. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5899. } while (0)
  5900. #define HTT_RX_IND_PEER_ID_GET(word) \
  5901. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5902. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5903. do { \
  5904. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5905. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5906. } while (0)
  5907. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5908. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5909. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5910. do { \
  5911. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5912. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5913. } while (0)
  5914. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5915. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5916. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5917. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5920. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5921. } while (0)
  5922. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5923. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5924. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5925. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5926. do { \
  5927. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5928. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5929. } while (0)
  5930. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5931. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5932. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5933. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5934. do { \
  5935. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5936. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5937. } while (0)
  5938. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5939. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5940. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5941. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5942. do { \
  5943. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5944. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5945. } while (0)
  5946. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5947. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5948. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5949. /* FW rx PPDU descriptor fields */
  5950. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5951. do { \
  5952. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5953. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5954. } while (0)
  5955. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5956. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5957. HTT_RX_IND_RSSI_CMB_S)
  5958. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5959. do { \
  5960. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5961. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5962. } while (0)
  5963. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5964. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5965. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5966. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5967. do { \
  5968. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5969. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5970. } while (0)
  5971. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5972. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5973. HTT_RX_IND_PHY_ERR_CODE_S)
  5974. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5977. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5978. } while (0)
  5979. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5980. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5981. HTT_RX_IND_PHY_ERR_S)
  5982. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5985. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5986. } while (0)
  5987. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5988. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5989. HTT_RX_IND_LEGACY_RATE_S)
  5990. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5991. do { \
  5992. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5993. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5994. } while (0)
  5995. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5996. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5997. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5998. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5999. do { \
  6000. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6001. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6002. } while (0)
  6003. #define HTT_RX_IND_END_VALID_GET(word) \
  6004. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6005. HTT_RX_IND_END_VALID_S)
  6006. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6007. do { \
  6008. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6009. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6010. } while (0)
  6011. #define HTT_RX_IND_START_VALID_GET(word) \
  6012. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6013. HTT_RX_IND_START_VALID_S)
  6014. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6015. do { \
  6016. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6017. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6018. } while (0)
  6019. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6020. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6021. HTT_RX_IND_RSSI_PRI20_S)
  6022. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6025. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6026. } while (0)
  6027. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6028. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6029. HTT_RX_IND_RSSI_EXT20_S)
  6030. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6033. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6034. } while (0)
  6035. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6036. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6037. HTT_RX_IND_RSSI_EXT40_S)
  6038. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6041. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6042. } while (0)
  6043. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6044. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6045. HTT_RX_IND_RSSI_EXT80_S)
  6046. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6049. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6050. } while (0)
  6051. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6052. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6053. HTT_RX_IND_VHT_SIG_A1_S)
  6054. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6055. do { \
  6056. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6057. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6058. } while (0)
  6059. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6060. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6061. HTT_RX_IND_VHT_SIG_A2_S)
  6062. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6063. do { \
  6064. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6065. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6066. } while (0)
  6067. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6068. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6069. HTT_RX_IND_PREAMBLE_TYPE_S)
  6070. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6073. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6074. } while (0)
  6075. #define HTT_RX_IND_SERVICE_GET(word) \
  6076. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6077. HTT_RX_IND_SERVICE_S)
  6078. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6081. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6082. } while (0)
  6083. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6084. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6085. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6086. do { \
  6087. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6088. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6089. } while (0)
  6090. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6091. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6092. #define HTT_RX_IND_HL_BYTES \
  6093. (HTT_RX_IND_HDR_BYTES + \
  6094. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6095. 4 /* single MPDU range information element */)
  6096. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6097. /* Could we use one macro entry? */
  6098. #define HTT_WORD_SET(word, field, value) \
  6099. do { \
  6100. HTT_CHECK_SET_VAL(field, value); \
  6101. (word) |= ((value) << field ## _S); \
  6102. } while (0)
  6103. #define HTT_WORD_GET(word, field) \
  6104. (((word) & field ## _M) >> field ## _S)
  6105. PREPACK struct hl_htt_rx_ind_base {
  6106. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6107. } POSTPACK;
  6108. /*
  6109. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6110. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6111. * HL host needed info. The field is just after the msdu fw rx desc.
  6112. */
  6113. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6114. struct htt_rx_ind_hl_rx_desc_t {
  6115. A_UINT8 ver;
  6116. A_UINT8 len;
  6117. struct {
  6118. A_UINT8
  6119. first_msdu: 1,
  6120. last_msdu: 1,
  6121. c3_failed: 1,
  6122. c4_failed: 1,
  6123. ipv6: 1,
  6124. tcp: 1,
  6125. udp: 1,
  6126. reserved: 1;
  6127. } flags;
  6128. };
  6129. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6130. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6131. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6132. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6133. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6134. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6135. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6136. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6137. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6138. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6139. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6140. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6141. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6142. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6143. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6144. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6145. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6146. /* This structure is used in HL, the basic descriptor information
  6147. * used by host. the structure is translated by FW from HW desc
  6148. * or generated by FW. But in HL monitor mode, the host would use
  6149. * the same structure with LL.
  6150. */
  6151. PREPACK struct hl_htt_rx_desc_base {
  6152. A_UINT32
  6153. seq_num:12,
  6154. encrypted:1,
  6155. chan_info_present:1,
  6156. resv0:2,
  6157. mcast_bcast:1,
  6158. fragment:1,
  6159. key_id_oct:8,
  6160. resv1:6;
  6161. A_UINT32
  6162. pn_31_0;
  6163. union {
  6164. struct {
  6165. A_UINT16 pn_47_32;
  6166. A_UINT16 pn_63_48;
  6167. } pn16;
  6168. A_UINT32 pn_63_32;
  6169. } u0;
  6170. A_UINT32
  6171. pn_95_64;
  6172. A_UINT32
  6173. pn_127_96;
  6174. } POSTPACK;
  6175. /*
  6176. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6177. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6178. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6179. * Please see htt_chan_change_t for description of the fields.
  6180. */
  6181. PREPACK struct htt_chan_info_t
  6182. {
  6183. A_UINT32 primary_chan_center_freq_mhz: 16,
  6184. contig_chan1_center_freq_mhz: 16;
  6185. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6186. phy_mode: 8,
  6187. reserved: 8;
  6188. } POSTPACK;
  6189. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6190. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6191. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6192. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6193. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6194. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6195. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6196. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6197. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6198. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6199. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6200. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6201. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6202. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6203. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6204. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6205. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6206. /* Channel information */
  6207. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6208. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6209. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6210. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6211. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6212. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6213. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6214. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6215. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6218. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6219. } while (0)
  6220. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6221. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6222. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6225. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6226. } while (0)
  6227. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6228. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6229. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6232. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6233. } while (0)
  6234. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6235. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6236. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6237. do { \
  6238. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6239. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6240. } while (0)
  6241. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6242. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6243. /*
  6244. * @brief target -> host rx reorder flush message definition
  6245. *
  6246. * @details
  6247. * The following field definitions describe the format of the rx flush
  6248. * message sent from the target to the host.
  6249. * The message consists of a 4-octet header, followed by one or more
  6250. * 4-octet payload information elements.
  6251. *
  6252. * |31 24|23 8|7 0|
  6253. * |--------------------------------------------------------------|
  6254. * | TID | peer ID | msg type |
  6255. * |--------------------------------------------------------------|
  6256. * | seq num end | seq num start | MPDU status | reserved |
  6257. * |--------------------------------------------------------------|
  6258. * First DWORD:
  6259. * - MSG_TYPE
  6260. * Bits 7:0
  6261. * Purpose: identifies this as an rx flush message
  6262. * Value: 0x2
  6263. * - PEER_ID
  6264. * Bits 23:8 (only bits 18:8 actually used)
  6265. * Purpose: identify which peer's rx data is being flushed
  6266. * Value: (rx) peer ID
  6267. * - TID
  6268. * Bits 31:24 (only bits 27:24 actually used)
  6269. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6270. * Value: traffic identifier
  6271. * Second DWORD:
  6272. * - MPDU_STATUS
  6273. * Bits 15:8
  6274. * Purpose:
  6275. * Indicate whether the flushed MPDUs should be discarded or processed.
  6276. * Value:
  6277. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6278. * stages of rx processing
  6279. * other: discard the MPDUs
  6280. * It is anticipated that flush messages will always have
  6281. * MPDU status == 1, but the status flag is included for
  6282. * flexibility.
  6283. * - SEQ_NUM_START
  6284. * Bits 23:16
  6285. * Purpose:
  6286. * Indicate the start of a series of consecutive MPDUs being flushed.
  6287. * Not all MPDUs within this range are necessarily valid - the host
  6288. * must check each sequence number within this range to see if the
  6289. * corresponding MPDU is actually present.
  6290. * Value:
  6291. * The sequence number for the first MPDU in the sequence.
  6292. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6293. * - SEQ_NUM_END
  6294. * Bits 30:24
  6295. * Purpose:
  6296. * Indicate the end of a series of consecutive MPDUs being flushed.
  6297. * Value:
  6298. * The sequence number one larger than the sequence number of the
  6299. * last MPDU being flushed.
  6300. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6301. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6302. * are to be released for further rx processing.
  6303. * Not all MPDUs within this range are necessarily valid - the host
  6304. * must check each sequence number within this range to see if the
  6305. * corresponding MPDU is actually present.
  6306. */
  6307. /* first DWORD */
  6308. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6309. #define HTT_RX_FLUSH_PEER_ID_S 8
  6310. #define HTT_RX_FLUSH_TID_M 0xff000000
  6311. #define HTT_RX_FLUSH_TID_S 24
  6312. /* second DWORD */
  6313. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6314. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6315. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6316. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6317. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6318. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6319. #define HTT_RX_FLUSH_BYTES 8
  6320. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6323. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6324. } while (0)
  6325. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6326. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6327. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6328. do { \
  6329. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6330. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6331. } while (0)
  6332. #define HTT_RX_FLUSH_TID_GET(word) \
  6333. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6334. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6337. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6338. } while (0)
  6339. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6340. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6341. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6344. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6345. } while (0)
  6346. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6347. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6348. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6349. do { \
  6350. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6351. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6352. } while (0)
  6353. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6354. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6355. /*
  6356. * @brief target -> host rx pn check indication message
  6357. *
  6358. * @details
  6359. * The following field definitions describe the format of the Rx PN check
  6360. * indication message sent from the target to the host.
  6361. * The message consists of a 4-octet header, followed by the start and
  6362. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6363. * IE is one octet containing the sequence number that failed the PN
  6364. * check.
  6365. *
  6366. * |31 24|23 8|7 0|
  6367. * |--------------------------------------------------------------|
  6368. * | TID | peer ID | msg type |
  6369. * |--------------------------------------------------------------|
  6370. * | Reserved | PN IE count | seq num end | seq num start|
  6371. * |--------------------------------------------------------------|
  6372. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6373. * |--------------------------------------------------------------|
  6374. * First DWORD:
  6375. * - MSG_TYPE
  6376. * Bits 7:0
  6377. * Purpose: Identifies this as an rx pn check indication message
  6378. * Value: 0x2
  6379. * - PEER_ID
  6380. * Bits 23:8 (only bits 18:8 actually used)
  6381. * Purpose: identify which peer
  6382. * Value: (rx) peer ID
  6383. * - TID
  6384. * Bits 31:24 (only bits 27:24 actually used)
  6385. * Purpose: identify traffic identifier
  6386. * Value: traffic identifier
  6387. * Second DWORD:
  6388. * - SEQ_NUM_START
  6389. * Bits 7:0
  6390. * Purpose:
  6391. * Indicates the starting sequence number of the MPDU in this
  6392. * series of MPDUs that went though PN check.
  6393. * Value:
  6394. * The sequence number for the first MPDU in the sequence.
  6395. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6396. * - SEQ_NUM_END
  6397. * Bits 15:8
  6398. * Purpose:
  6399. * Indicates the ending sequence number of the MPDU in this
  6400. * series of MPDUs that went though PN check.
  6401. * Value:
  6402. * The sequence number one larger then the sequence number of the last
  6403. * MPDU being flushed.
  6404. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6405. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6406. * for invalid PN numbers and are ready to be released for further processing.
  6407. * Not all MPDUs within this range are necessarily valid - the host
  6408. * must check each sequence number within this range to see if the
  6409. * corresponding MPDU is actually present.
  6410. * - PN_IE_COUNT
  6411. * Bits 23:16
  6412. * Purpose:
  6413. * Used to determine the variable number of PN information elements in this
  6414. * message
  6415. *
  6416. * PN information elements:
  6417. * - PN_IE_x-
  6418. * Purpose:
  6419. * Each PN information element contains the sequence number of the MPDU that
  6420. * has failed the target PN check.
  6421. * Value:
  6422. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6423. * that failed the PN check.
  6424. */
  6425. /* first DWORD */
  6426. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6427. #define HTT_RX_PN_IND_PEER_ID_S 8
  6428. #define HTT_RX_PN_IND_TID_M 0xff000000
  6429. #define HTT_RX_PN_IND_TID_S 24
  6430. /* second DWORD */
  6431. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6432. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6433. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6434. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6435. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6436. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6437. #define HTT_RX_PN_IND_BYTES 8
  6438. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6441. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6442. } while (0)
  6443. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6444. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6445. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6446. do { \
  6447. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6448. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6449. } while (0)
  6450. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6451. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6452. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6455. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6456. } while (0)
  6457. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6458. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6459. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6460. do { \
  6461. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6462. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6463. } while (0)
  6464. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6465. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6466. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6467. do { \
  6468. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6469. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6470. } while (0)
  6471. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6472. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6473. /*
  6474. * @brief target -> host rx offload deliver message for LL system
  6475. *
  6476. * @details
  6477. * In a low latency system this message is sent whenever the offload
  6478. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6479. * The DMA of the actual packets into host memory is done before sending out
  6480. * this message. This message indicates only how many MSDUs to reap. The
  6481. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6482. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6483. * DMA'd by the MAC directly into host memory these packets do not contain
  6484. * the MAC descriptors in the header portion of the packet. Instead they contain
  6485. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6486. * message, the packets are delivered directly to the NW stack without going
  6487. * through the regular reorder buffering and PN checking path since it has
  6488. * already been done in target.
  6489. *
  6490. * |31 24|23 16|15 8|7 0|
  6491. * |-----------------------------------------------------------------------|
  6492. * | Total MSDU count | reserved | msg type |
  6493. * |-----------------------------------------------------------------------|
  6494. *
  6495. * @brief target -> host rx offload deliver message for HL system
  6496. *
  6497. * @details
  6498. * In a high latency system this message is sent whenever the offload manager
  6499. * flushes out the packets it has coalesced in its coalescing buffer. The
  6500. * actual packets are also carried along with this message. When the host
  6501. * receives this message, it is expected to deliver these packets to the NW
  6502. * stack directly instead of routing them through the reorder buffering and
  6503. * PN checking path since it has already been done in target.
  6504. *
  6505. * |31 24|23 16|15 8|7 0|
  6506. * |-----------------------------------------------------------------------|
  6507. * | Total MSDU count | reserved | msg type |
  6508. * |-----------------------------------------------------------------------|
  6509. * | peer ID | MSDU length |
  6510. * |-----------------------------------------------------------------------|
  6511. * | MSDU payload | FW Desc | tid | vdev ID |
  6512. * |-----------------------------------------------------------------------|
  6513. * | MSDU payload contd. |
  6514. * |-----------------------------------------------------------------------|
  6515. * | peer ID | MSDU length |
  6516. * |-----------------------------------------------------------------------|
  6517. * | MSDU payload | FW Desc | tid | vdev ID |
  6518. * |-----------------------------------------------------------------------|
  6519. * | MSDU payload contd. |
  6520. * |-----------------------------------------------------------------------|
  6521. *
  6522. */
  6523. /* first DWORD */
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6537. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6539. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6543. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6544. } while (0)
  6545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6546. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6548. do { \
  6549. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6550. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6551. } while (0)
  6552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6553. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6555. do { \
  6556. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6557. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6558. } while (0)
  6559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6560. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6564. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6565. } while (0)
  6566. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6567. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6568. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6571. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6572. } while (0)
  6573. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6574. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6575. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6576. do { \
  6577. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6578. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6579. } while (0)
  6580. /**
  6581. * @brief target -> host rx peer map/unmap message definition
  6582. *
  6583. * @details
  6584. * The following diagram shows the format of the rx peer map message sent
  6585. * from the target to the host. This layout assumes the target operates
  6586. * as little-endian.
  6587. *
  6588. * This message always contains a SW peer ID. The main purpose of the
  6589. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6590. * with, so that the host can use that peer ID to determine which peer
  6591. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6592. * other purposes, such as identifying during tx completions which peer
  6593. * the tx frames in question were transmitted to.
  6594. *
  6595. * In certain generations of chips, the peer map message also contains
  6596. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6597. * to identify which peer the frame needs to be forwarded to (i.e. the
  6598. * peer assocated with the Destination MAC Address within the packet),
  6599. * and particularly which vdev needs to transmit the frame (for cases
  6600. * of inter-vdev rx --> tx forwarding).
  6601. * This DA-based peer ID that is provided for certain rx frames
  6602. * (the rx frames that need to be re-transmitted as tx frames)
  6603. * is the ID that the HW uses for referring to the peer in question,
  6604. * rather than the peer ID that the SW+FW use to refer to the peer.
  6605. *
  6606. *
  6607. * |31 24|23 16|15 8|7 0|
  6608. * |-----------------------------------------------------------------------|
  6609. * | SW peer ID | VDEV ID | msg type |
  6610. * |-----------------------------------------------------------------------|
  6611. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6612. * |-----------------------------------------------------------------------|
  6613. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6614. * |-----------------------------------------------------------------------|
  6615. *
  6616. *
  6617. * The following diagram shows the format of the rx peer unmap message sent
  6618. * from the target to the host.
  6619. *
  6620. * |31 24|23 16|15 8|7 0|
  6621. * |-----------------------------------------------------------------------|
  6622. * | SW peer ID | VDEV ID | msg type |
  6623. * |-----------------------------------------------------------------------|
  6624. *
  6625. * The following field definitions describe the format of the rx peer map
  6626. * and peer unmap messages sent from the target to the host.
  6627. * - MSG_TYPE
  6628. * Bits 7:0
  6629. * Purpose: identifies this as an rx peer map or peer unmap message
  6630. * Value: peer map -> 0x3, peer unmap -> 0x4
  6631. * - VDEV_ID
  6632. * Bits 15:8
  6633. * Purpose: Indicates which virtual device the peer is associated
  6634. * with.
  6635. * Value: vdev ID (used in the host to look up the vdev object)
  6636. * - PEER_ID (a.k.a. SW_PEER_ID)
  6637. * Bits 31:16
  6638. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6639. * freeing (unmap)
  6640. * Value: (rx) peer ID
  6641. * - MAC_ADDR_L32 (peer map only)
  6642. * Bits 31:0
  6643. * Purpose: Identifies which peer node the peer ID is for.
  6644. * Value: lower 4 bytes of peer node's MAC address
  6645. * - MAC_ADDR_U16 (peer map only)
  6646. * Bits 15:0
  6647. * Purpose: Identifies which peer node the peer ID is for.
  6648. * Value: upper 2 bytes of peer node's MAC address
  6649. * - HW_PEER_ID
  6650. * Bits 31:16
  6651. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6652. * address, so for rx frames marked for rx --> tx forwarding, the
  6653. * host can determine from the HW peer ID provided as meta-data with
  6654. * the rx frame which peer the frame is supposed to be forwarded to.
  6655. * Value: ID used by the MAC HW to identify the peer
  6656. */
  6657. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6658. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6659. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6660. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6661. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6662. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6663. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6664. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6665. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6666. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6667. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6668. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6669. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6670. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6673. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6674. } while (0)
  6675. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6676. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6677. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6678. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6679. do { \
  6680. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6681. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6682. } while (0)
  6683. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6684. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6685. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6686. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6687. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6688. do { \
  6689. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6690. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6691. } while (0)
  6692. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6693. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6694. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6695. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6696. #define HTT_RX_PEER_MAP_BYTES 12
  6697. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6698. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6699. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6700. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6701. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6702. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6703. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6704. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6705. #define HTT_RX_PEER_UNMAP_BYTES 4
  6706. /**
  6707. * @brief target -> host rx peer map V2 message definition
  6708. *
  6709. * @details
  6710. * The following diagram shows the format of the rx peer map v2 message sent
  6711. * from the target to the host. This layout assumes the target operates
  6712. * as little-endian.
  6713. *
  6714. * This message always contains a SW peer ID. The main purpose of the
  6715. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6716. * with, so that the host can use that peer ID to determine which peer
  6717. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6718. * other purposes, such as identifying during tx completions which peer
  6719. * the tx frames in question were transmitted to.
  6720. *
  6721. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6722. * is used during rx --> tx frame forwarding to identify which peer the
  6723. * frame needs to be forwarded to (i.e. the peer assocated with the
  6724. * Destination MAC Address within the packet), and particularly which vdev
  6725. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6726. * This DA-based peer ID that is provided for certain rx frames
  6727. * (the rx frames that need to be re-transmitted as tx frames)
  6728. * is the ID that the HW uses for referring to the peer in question,
  6729. * rather than the peer ID that the SW+FW use to refer to the peer.
  6730. *
  6731. *
  6732. * |31 24|23 16|15 8|7 0|
  6733. * |-----------------------------------------------------------------------|
  6734. * | SW peer ID | VDEV ID | msg type |
  6735. * |-----------------------------------------------------------------------|
  6736. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6737. * |-----------------------------------------------------------------------|
  6738. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6739. * |-----------------------------------------------------------------------|
  6740. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6741. * |-----------------------------------------------------------------------|
  6742. * | Reserved_0 |
  6743. * |-----------------------------------------------------------------------|
  6744. * | Reserved_1 |
  6745. * |-----------------------------------------------------------------------|
  6746. * | Reserved_2 |
  6747. * |-----------------------------------------------------------------------|
  6748. * | Reserved_3 |
  6749. * |-----------------------------------------------------------------------|
  6750. *
  6751. *
  6752. * The following field definitions describe the format of the rx peer map v2
  6753. * messages sent from the target to the host.
  6754. * - MSG_TYPE
  6755. * Bits 7:0
  6756. * Purpose: identifies this as an rx peer map v2 message
  6757. * Value: peer map v2 -> 0x1e
  6758. * - VDEV_ID
  6759. * Bits 15:8
  6760. * Purpose: Indicates which virtual device the peer is associated with.
  6761. * Value: vdev ID (used in the host to look up the vdev object)
  6762. * - SW_PEER_ID
  6763. * Bits 31:16
  6764. * Purpose: The peer ID (index) that WAL is allocating
  6765. * Value: (rx) peer ID
  6766. * - MAC_ADDR_L32
  6767. * Bits 31:0
  6768. * Purpose: Identifies which peer node the peer ID is for.
  6769. * Value: lower 4 bytes of peer node's MAC address
  6770. * - MAC_ADDR_U16
  6771. * Bits 15:0
  6772. * Purpose: Identifies which peer node the peer ID is for.
  6773. * Value: upper 2 bytes of peer node's MAC address
  6774. * - HW_PEER_ID
  6775. * Bits 31:16
  6776. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6777. * address, so for rx frames marked for rx --> tx forwarding, the
  6778. * host can determine from the HW peer ID provided as meta-data with
  6779. * the rx frame which peer the frame is supposed to be forwarded to.
  6780. * Value: ID used by the MAC HW to identify the peer
  6781. * - AST_HASH_VALUE
  6782. * Bits 15:0
  6783. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6784. * override feature.
  6785. * - NEXT_HOP
  6786. * Bit 16
  6787. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6788. * (Wireless Distribution System).
  6789. */
  6790. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6791. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6792. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6793. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6794. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6795. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6796. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6797. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6798. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6799. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6800. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6801. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6802. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6803. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6804. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6805. do { \
  6806. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6807. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6808. } while (0)
  6809. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6810. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6811. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6812. do { \
  6813. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6814. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6815. } while (0)
  6816. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6817. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6818. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6819. do { \
  6820. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6821. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6822. } while (0)
  6823. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6824. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6825. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6828. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6829. } while (0)
  6830. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6831. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6832. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6833. do { \
  6834. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6835. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6836. } while (0)
  6837. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6838. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6839. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6840. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6841. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6842. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6843. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6844. /**
  6845. * @brief target -> host rx peer unmap V2 message definition
  6846. *
  6847. *
  6848. * The following diagram shows the format of the rx peer unmap message sent
  6849. * from the target to the host.
  6850. *
  6851. * |31 24|23 16|15 8|7 0|
  6852. * |-----------------------------------------------------------------------|
  6853. * | SW peer ID | VDEV ID | msg type |
  6854. * |-----------------------------------------------------------------------|
  6855. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6856. * |-----------------------------------------------------------------------|
  6857. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6858. * |-----------------------------------------------------------------------|
  6859. * | Peer Delete Duration |
  6860. * |-----------------------------------------------------------------------|
  6861. * | Reserved_0 |
  6862. * |-----------------------------------------------------------------------|
  6863. * | Reserved_1 |
  6864. * |-----------------------------------------------------------------------|
  6865. * | Reserved_2 |
  6866. * |-----------------------------------------------------------------------|
  6867. *
  6868. *
  6869. * The following field definitions describe the format of the rx peer unmap
  6870. * messages sent from the target to the host.
  6871. * - MSG_TYPE
  6872. * Bits 7:0
  6873. * Purpose: identifies this as an rx peer unmap v2 message
  6874. * Value: peer unmap v2 -> 0x1f
  6875. * - VDEV_ID
  6876. * Bits 15:8
  6877. * Purpose: Indicates which virtual device the peer is associated
  6878. * with.
  6879. * Value: vdev ID (used in the host to look up the vdev object)
  6880. * - SW_PEER_ID
  6881. * Bits 31:16
  6882. * Purpose: The peer ID (index) that WAL is freeing
  6883. * Value: (rx) peer ID
  6884. * - MAC_ADDR_L32
  6885. * Bits 31:0
  6886. * Purpose: Identifies which peer node the peer ID is for.
  6887. * Value: lower 4 bytes of peer node's MAC address
  6888. * - MAC_ADDR_U16
  6889. * Bits 15:0
  6890. * Purpose: Identifies which peer node the peer ID is for.
  6891. * Value: upper 2 bytes of peer node's MAC address
  6892. * - NEXT_HOP
  6893. * Bits 16
  6894. * Purpose: Bit indicates next_hop AST entry used for WDS
  6895. * (Wireless Distribution System).
  6896. * - PEER_DELETE_DURATION
  6897. * Bits 31:0
  6898. * Purpose: Time taken to delete peer, in msec,
  6899. * Used for monitoring / debugging PEER delete response delay
  6900. */
  6901. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6902. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6903. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6904. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6905. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6906. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6907. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6908. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6909. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6910. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6911. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6912. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6913. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6914. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6915. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6916. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6917. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6918. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6919. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6920. do { \
  6921. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6922. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6923. } while (0)
  6924. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6925. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6926. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6927. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6928. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6929. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6930. /**
  6931. * @brief target -> host message specifying security parameters
  6932. *
  6933. * @details
  6934. * The following diagram shows the format of the security specification
  6935. * message sent from the target to the host.
  6936. * This security specification message tells the host whether a PN check is
  6937. * necessary on rx data frames, and if so, how large the PN counter is.
  6938. * This message also tells the host about the security processing to apply
  6939. * to defragmented rx frames - specifically, whether a Message Integrity
  6940. * Check is required, and the Michael key to use.
  6941. *
  6942. * |31 24|23 16|15|14 8|7 0|
  6943. * |-----------------------------------------------------------------------|
  6944. * | peer ID | U| security type | msg type |
  6945. * |-----------------------------------------------------------------------|
  6946. * | Michael Key K0 |
  6947. * |-----------------------------------------------------------------------|
  6948. * | Michael Key K1 |
  6949. * |-----------------------------------------------------------------------|
  6950. * | WAPI RSC Low0 |
  6951. * |-----------------------------------------------------------------------|
  6952. * | WAPI RSC Low1 |
  6953. * |-----------------------------------------------------------------------|
  6954. * | WAPI RSC Hi0 |
  6955. * |-----------------------------------------------------------------------|
  6956. * | WAPI RSC Hi1 |
  6957. * |-----------------------------------------------------------------------|
  6958. *
  6959. * The following field definitions describe the format of the security
  6960. * indication message sent from the target to the host.
  6961. * - MSG_TYPE
  6962. * Bits 7:0
  6963. * Purpose: identifies this as a security specification message
  6964. * Value: 0xb
  6965. * - SEC_TYPE
  6966. * Bits 14:8
  6967. * Purpose: specifies which type of security applies to the peer
  6968. * Value: htt_sec_type enum value
  6969. * - UNICAST
  6970. * Bit 15
  6971. * Purpose: whether this security is applied to unicast or multicast data
  6972. * Value: 1 -> unicast, 0 -> multicast
  6973. * - PEER_ID
  6974. * Bits 31:16
  6975. * Purpose: The ID number for the peer the security specification is for
  6976. * Value: peer ID
  6977. * - MICHAEL_KEY_K0
  6978. * Bits 31:0
  6979. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6980. * Value: Michael Key K0 (if security type is TKIP)
  6981. * - MICHAEL_KEY_K1
  6982. * Bits 31:0
  6983. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6984. * Value: Michael Key K1 (if security type is TKIP)
  6985. * - WAPI_RSC_LOW0
  6986. * Bits 31:0
  6987. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6988. * Value: WAPI RSC Low0 (if security type is WAPI)
  6989. * - WAPI_RSC_LOW1
  6990. * Bits 31:0
  6991. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6992. * Value: WAPI RSC Low1 (if security type is WAPI)
  6993. * - WAPI_RSC_HI0
  6994. * Bits 31:0
  6995. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6996. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6997. * - WAPI_RSC_HI1
  6998. * Bits 31:0
  6999. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7000. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7001. */
  7002. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7003. #define HTT_SEC_IND_SEC_TYPE_S 8
  7004. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7005. #define HTT_SEC_IND_UNICAST_S 15
  7006. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7007. #define HTT_SEC_IND_PEER_ID_S 16
  7008. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7009. do { \
  7010. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7011. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7012. } while (0)
  7013. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7014. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7015. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7016. do { \
  7017. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7018. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7019. } while (0)
  7020. #define HTT_SEC_IND_UNICAST_GET(word) \
  7021. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7022. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7023. do { \
  7024. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7025. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7026. } while (0)
  7027. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7028. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7029. #define HTT_SEC_IND_BYTES 28
  7030. /**
  7031. * @brief target -> host rx ADDBA / DELBA message definitions
  7032. *
  7033. * @details
  7034. * The following diagram shows the format of the rx ADDBA message sent
  7035. * from the target to the host:
  7036. *
  7037. * |31 20|19 16|15 8|7 0|
  7038. * |---------------------------------------------------------------------|
  7039. * | peer ID | TID | window size | msg type |
  7040. * |---------------------------------------------------------------------|
  7041. *
  7042. * The following diagram shows the format of the rx DELBA message sent
  7043. * from the target to the host:
  7044. *
  7045. * |31 20|19 16|15 10|9 8|7 0|
  7046. * |---------------------------------------------------------------------|
  7047. * | peer ID | TID | reserved | IR| msg type |
  7048. * |---------------------------------------------------------------------|
  7049. *
  7050. * The following field definitions describe the format of the rx ADDBA
  7051. * and DELBA messages sent from the target to the host.
  7052. * - MSG_TYPE
  7053. * Bits 7:0
  7054. * Purpose: identifies this as an rx ADDBA or DELBA message
  7055. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7056. * - IR (initiator / recipient)
  7057. * Bits 9:8 (DELBA only)
  7058. * Purpose: specify whether the DELBA handshake was initiated by the
  7059. * local STA/AP, or by the peer STA/AP
  7060. * Value:
  7061. * 0 - unspecified
  7062. * 1 - initiator (a.k.a. originator)
  7063. * 2 - recipient (a.k.a. responder)
  7064. * 3 - unused / reserved
  7065. * - WIN_SIZE
  7066. * Bits 15:8 (ADDBA only)
  7067. * Purpose: Specifies the length of the block ack window (max = 64).
  7068. * Value:
  7069. * block ack window length specified by the received ADDBA
  7070. * management message.
  7071. * - TID
  7072. * Bits 19:16
  7073. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7074. * Value:
  7075. * TID specified by the received ADDBA or DELBA management message.
  7076. * - PEER_ID
  7077. * Bits 31:20
  7078. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7079. * Value:
  7080. * ID (hash value) used by the host for fast, direct lookup of
  7081. * host SW peer info, including rx reorder states.
  7082. */
  7083. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7084. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7085. #define HTT_RX_ADDBA_TID_M 0xf0000
  7086. #define HTT_RX_ADDBA_TID_S 16
  7087. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7088. #define HTT_RX_ADDBA_PEER_ID_S 20
  7089. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7090. do { \
  7091. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7092. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7093. } while (0)
  7094. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7095. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7096. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7097. do { \
  7098. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7099. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7100. } while (0)
  7101. #define HTT_RX_ADDBA_TID_GET(word) \
  7102. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7103. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7104. do { \
  7105. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7106. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7107. } while (0)
  7108. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7109. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7110. #define HTT_RX_ADDBA_BYTES 4
  7111. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7112. #define HTT_RX_DELBA_INITIATOR_S 8
  7113. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7114. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7115. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7116. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7117. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7118. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7119. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7120. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7121. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7122. do { \
  7123. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7124. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7125. } while (0)
  7126. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7127. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7128. #define HTT_RX_DELBA_BYTES 4
  7129. /**
  7130. * @brief tx queue group information element definition
  7131. *
  7132. * @details
  7133. * The following diagram shows the format of the tx queue group
  7134. * information element, which can be included in target --> host
  7135. * messages to specify the number of tx "credits" (tx descriptors
  7136. * for LL, or tx buffers for HL) available to a particular group
  7137. * of host-side tx queues, and which host-side tx queues belong to
  7138. * the group.
  7139. *
  7140. * |31|30 24|23 16|15|14|13 0|
  7141. * |------------------------------------------------------------------------|
  7142. * | X| reserved | tx queue grp ID | A| S| credit count |
  7143. * |------------------------------------------------------------------------|
  7144. * | vdev ID mask | AC mask |
  7145. * |------------------------------------------------------------------------|
  7146. *
  7147. * The following definitions describe the fields within the tx queue group
  7148. * information element:
  7149. * - credit_count
  7150. * Bits 13:1
  7151. * Purpose: specify how many tx credits are available to the tx queue group
  7152. * Value: An absolute or relative, positive or negative credit value
  7153. * The 'A' bit specifies whether the value is absolute or relative.
  7154. * The 'S' bit specifies whether the value is positive or negative.
  7155. * A negative value can only be relative, not absolute.
  7156. * An absolute value replaces any prior credit value the host has for
  7157. * the tx queue group in question.
  7158. * A relative value is added to the prior credit value the host has for
  7159. * the tx queue group in question.
  7160. * - sign
  7161. * Bit 14
  7162. * Purpose: specify whether the credit count is positive or negative
  7163. * Value: 0 -> positive, 1 -> negative
  7164. * - absolute
  7165. * Bit 15
  7166. * Purpose: specify whether the credit count is absolute or relative
  7167. * Value: 0 -> relative, 1 -> absolute
  7168. * - txq_group_id
  7169. * Bits 23:16
  7170. * Purpose: indicate which tx queue group's credit and/or membership are
  7171. * being specified
  7172. * Value: 0 to max_tx_queue_groups-1
  7173. * - reserved
  7174. * Bits 30:16
  7175. * Value: 0x0
  7176. * - eXtension
  7177. * Bit 31
  7178. * Purpose: specify whether another tx queue group info element follows
  7179. * Value: 0 -> no more tx queue group information elements
  7180. * 1 -> another tx queue group information element immediately follows
  7181. * - ac_mask
  7182. * Bits 15:0
  7183. * Purpose: specify which Access Categories belong to the tx queue group
  7184. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7185. * the tx queue group.
  7186. * The AC bit-mask values are obtained by left-shifting by the
  7187. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7188. * - vdev_id_mask
  7189. * Bits 31:16
  7190. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7191. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7192. * belong to the tx queue group.
  7193. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7194. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7195. */
  7196. PREPACK struct htt_txq_group {
  7197. A_UINT32
  7198. credit_count: 14,
  7199. sign: 1,
  7200. absolute: 1,
  7201. tx_queue_group_id: 8,
  7202. reserved0: 7,
  7203. extension: 1;
  7204. A_UINT32
  7205. ac_mask: 16,
  7206. vdev_id_mask: 16;
  7207. } POSTPACK;
  7208. /* first word */
  7209. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7210. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7211. #define HTT_TXQ_GROUP_SIGN_S 14
  7212. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7213. #define HTT_TXQ_GROUP_ABS_S 15
  7214. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7215. #define HTT_TXQ_GROUP_ID_S 16
  7216. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7217. #define HTT_TXQ_GROUP_EXT_S 31
  7218. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7219. /* second word */
  7220. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7221. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7222. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7223. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7224. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7225. do { \
  7226. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7227. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7228. } while (0)
  7229. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7230. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7231. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7232. do { \
  7233. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7234. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7235. } while (0)
  7236. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7237. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7238. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7239. do { \
  7240. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7241. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7242. } while (0)
  7243. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7244. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7245. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7246. do { \
  7247. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7248. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7249. } while (0)
  7250. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7251. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7252. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7253. do { \
  7254. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7255. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7256. } while (0)
  7257. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7258. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7259. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7260. do { \
  7261. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7262. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7263. } while (0)
  7264. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7265. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7266. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7267. do { \
  7268. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7269. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7270. } while (0)
  7271. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7272. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7273. /**
  7274. * @brief target -> host TX completion indication message definition
  7275. *
  7276. * @details
  7277. * The following diagram shows the format of the TX completion indication sent
  7278. * from the target to the host
  7279. *
  7280. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7281. * |-------------------------------------------------------------|
  7282. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7283. * |-------------------------------------------------------------|
  7284. * payload: | MSDU1 ID | MSDU0 ID |
  7285. * |-------------------------------------------------------------|
  7286. * : MSDU3 ID : MSDU2 ID :
  7287. * |-------------------------------------------------------------|
  7288. * | struct htt_tx_compl_ind_append_retries |
  7289. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7290. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7291. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7292. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7293. * |-------------------------------------------------------------|
  7294. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7295. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7296. * Where:
  7297. * A0 = append (a.k.a. append0)
  7298. * A1 = append1
  7299. * TP = MSDU tx power presence
  7300. * A2 = append2
  7301. *
  7302. * The following field definitions describe the format of the TX completion
  7303. * indication sent from the target to the host
  7304. * Header fields:
  7305. * - msg_type
  7306. * Bits 7:0
  7307. * Purpose: identifies this as HTT TX completion indication
  7308. * Value: 0x7
  7309. * - status
  7310. * Bits 10:8
  7311. * Purpose: the TX completion status of payload fragmentations descriptors
  7312. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7313. * - tid
  7314. * Bits 14:11
  7315. * Purpose: the tid associated with those fragmentation descriptors. It is
  7316. * valid or not, depending on the tid_invalid bit.
  7317. * Value: 0 to 15
  7318. * - tid_invalid
  7319. * Bits 15:15
  7320. * Purpose: this bit indicates whether the tid field is valid or not
  7321. * Value: 0 indicates valid; 1 indicates invalid
  7322. * - num
  7323. * Bits 23:16
  7324. * Purpose: the number of payload in this indication
  7325. * Value: 1 to 255
  7326. * - append (a.k.a. append0)
  7327. * Bits 24:24
  7328. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7329. * the number of tx retries for one MSDU at the end of this message
  7330. * Value: 0 indicates no appending; 1 indicates appending
  7331. * - append1
  7332. * Bits 25:25
  7333. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7334. * contains the timestamp info for each TX msdu id in payload.
  7335. * The order of the timestamps matches the order of the MSDU IDs.
  7336. * Note that a big-endian host needs to account for the reordering
  7337. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7338. * conversion) when determining which tx timestamp corresponds to
  7339. * which MSDU ID.
  7340. * Value: 0 indicates no appending; 1 indicates appending
  7341. * - msdu_tx_power_presence
  7342. * Bits 26:26
  7343. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7344. * for each MSDU referenced by the TX_COMPL_IND message.
  7345. * The tx power is reported in 0.5 dBm units.
  7346. * The order of the per-MSDU tx power reports matches the order
  7347. * of the MSDU IDs.
  7348. * Note that a big-endian host needs to account for the reordering
  7349. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7350. * conversion) when determining which Tx Power corresponds to
  7351. * which MSDU ID.
  7352. * Value: 0 indicates MSDU tx power reports are not appended,
  7353. * 1 indicates MSDU tx power reports are appended
  7354. * - append2
  7355. * Bits 27:27
  7356. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7357. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7358. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7359. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7360. * for each MSDU, for convenience.
  7361. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7362. * this append2 bit is set).
  7363. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7364. * dB above the noise floor.
  7365. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7366. * 1 indicates MSDU ACK RSSI values are appended.
  7367. * Payload fields:
  7368. * - hmsdu_id
  7369. * Bits 15:0
  7370. * Purpose: this ID is used to track the Tx buffer in host
  7371. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7372. */
  7373. #define HTT_TX_COMPL_IND_STATUS_S 8
  7374. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7375. #define HTT_TX_COMPL_IND_TID_S 11
  7376. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7377. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7378. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7379. #define HTT_TX_COMPL_IND_NUM_S 16
  7380. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7381. #define HTT_TX_COMPL_IND_APPEND_S 24
  7382. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7383. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7384. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7385. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7386. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7387. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7388. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7389. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7390. do { \
  7391. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7392. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7393. } while (0)
  7394. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7395. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7396. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7397. do { \
  7398. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7399. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7400. } while (0)
  7401. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7402. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7403. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7404. do { \
  7405. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7406. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7407. } while (0)
  7408. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7409. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7410. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7411. do { \
  7412. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7413. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7414. } while (0)
  7415. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7416. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7417. HTT_TX_COMPL_IND_TID_INV_S)
  7418. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7421. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7422. } while (0)
  7423. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7424. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7425. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7426. do { \
  7427. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7428. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7429. } while (0)
  7430. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7431. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7432. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7435. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7436. } while (0)
  7437. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7438. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7439. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7442. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7443. } while (0)
  7444. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7445. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7446. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7447. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7448. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7449. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7450. #define HTT_TX_COMPL_IND_STAT_OK 0
  7451. /* DISCARD:
  7452. * current meaning:
  7453. * MSDUs were queued for transmission but filtered by HW or SW
  7454. * without any over the air attempts
  7455. * legacy meaning (HL Rome):
  7456. * MSDUs were discarded by the target FW without any over the air
  7457. * attempts due to lack of space
  7458. */
  7459. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7460. /* NO_ACK:
  7461. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7462. */
  7463. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7464. /* POSTPONE:
  7465. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7466. * be downloaded again later (in the appropriate order), when they are
  7467. * deliverable.
  7468. */
  7469. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7470. /*
  7471. * The PEER_DEL tx completion status is used for HL cases
  7472. * where the peer the frame is for has been deleted.
  7473. * The host has already discarded its copy of the frame, but
  7474. * it still needs the tx completion to restore its credit.
  7475. */
  7476. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7477. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7478. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7479. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7480. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7481. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7482. PREPACK struct htt_tx_compl_ind_base {
  7483. A_UINT32 hdr;
  7484. A_UINT16 payload[1/*or more*/];
  7485. } POSTPACK;
  7486. PREPACK struct htt_tx_compl_ind_append_retries {
  7487. A_UINT16 msdu_id;
  7488. A_UINT8 tx_retries;
  7489. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7490. 0: this is the last append_retries struct */
  7491. } POSTPACK;
  7492. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7493. A_UINT32 timestamp[1/*or more*/];
  7494. } POSTPACK;
  7495. /**
  7496. * @brief target -> host rate-control update indication message
  7497. *
  7498. * @details
  7499. * The following diagram shows the format of the RC Update message
  7500. * sent from the target to the host, while processing the tx-completion
  7501. * of a transmitted PPDU.
  7502. *
  7503. * |31 24|23 16|15 8|7 0|
  7504. * |-------------------------------------------------------------|
  7505. * | peer ID | vdev ID | msg_type |
  7506. * |-------------------------------------------------------------|
  7507. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7508. * |-------------------------------------------------------------|
  7509. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7510. * |-------------------------------------------------------------|
  7511. * | : |
  7512. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7513. * | : |
  7514. * |-------------------------------------------------------------|
  7515. * | : |
  7516. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7517. * | : |
  7518. * |-------------------------------------------------------------|
  7519. * : :
  7520. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7521. *
  7522. */
  7523. typedef struct {
  7524. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7525. A_UINT32 rate_code_flags;
  7526. A_UINT32 flags; /* Encodes information such as excessive
  7527. retransmission, aggregate, some info
  7528. from .11 frame control,
  7529. STBC, LDPC, (SGI and Tx Chain Mask
  7530. are encoded in ptx_rc->flags field),
  7531. AMPDU truncation (BT/time based etc.),
  7532. RTS/CTS attempt */
  7533. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7534. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7535. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7536. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7537. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7538. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7539. } HTT_RC_TX_DONE_PARAMS;
  7540. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7541. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7542. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7543. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7544. #define HTT_RC_UPDATE_VDEVID_S 8
  7545. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7546. #define HTT_RC_UPDATE_PEERID_S 16
  7547. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7548. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7549. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7550. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7551. do { \
  7552. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7553. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7554. } while (0)
  7555. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7556. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7557. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7558. do { \
  7559. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7560. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7561. } while (0)
  7562. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7563. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7564. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7565. do { \
  7566. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7567. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7568. } while (0)
  7569. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7570. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7571. /**
  7572. * @brief target -> host rx fragment indication message definition
  7573. *
  7574. * @details
  7575. * The following field definitions describe the format of the rx fragment
  7576. * indication message sent from the target to the host.
  7577. * The rx fragment indication message shares the format of the
  7578. * rx indication message, but not all fields from the rx indication message
  7579. * are relevant to the rx fragment indication message.
  7580. *
  7581. *
  7582. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7583. * |-----------+-------------------+---------------------+-------------|
  7584. * | peer ID | |FV| ext TID | msg type |
  7585. * |-------------------------------------------------------------------|
  7586. * | | flush | flush |
  7587. * | | end | start |
  7588. * | | seq num | seq num |
  7589. * |-------------------------------------------------------------------|
  7590. * | reserved | FW rx desc bytes |
  7591. * |-------------------------------------------------------------------|
  7592. * | | FW MSDU Rx |
  7593. * | | desc B0 |
  7594. * |-------------------------------------------------------------------|
  7595. * Header fields:
  7596. * - MSG_TYPE
  7597. * Bits 7:0
  7598. * Purpose: identifies this as an rx fragment indication message
  7599. * Value: 0xa
  7600. * - EXT_TID
  7601. * Bits 12:8
  7602. * Purpose: identify the traffic ID of the rx data, including
  7603. * special "extended" TID values for multicast, broadcast, and
  7604. * non-QoS data frames
  7605. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7606. * - FLUSH_VALID (FV)
  7607. * Bit 13
  7608. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7609. * is valid
  7610. * Value:
  7611. * 1 -> flush IE is valid and needs to be processed
  7612. * 0 -> flush IE is not valid and should be ignored
  7613. * - PEER_ID
  7614. * Bits 31:16
  7615. * Purpose: Identify, by ID, which peer sent the rx data
  7616. * Value: ID of the peer who sent the rx data
  7617. * - FLUSH_SEQ_NUM_START
  7618. * Bits 5:0
  7619. * Purpose: Indicate the start of a series of MPDUs to flush
  7620. * Not all MPDUs within this series are necessarily valid - the host
  7621. * must check each sequence number within this range to see if the
  7622. * corresponding MPDU is actually present.
  7623. * This field is only valid if the FV bit is set.
  7624. * Value:
  7625. * The sequence number for the first MPDUs to check to flush.
  7626. * The sequence number is masked by 0x3f.
  7627. * - FLUSH_SEQ_NUM_END
  7628. * Bits 11:6
  7629. * Purpose: Indicate the end of a series of MPDUs to flush
  7630. * Value:
  7631. * The sequence number one larger than the sequence number of the
  7632. * last MPDU to check to flush.
  7633. * The sequence number is masked by 0x3f.
  7634. * Not all MPDUs within this series are necessarily valid - the host
  7635. * must check each sequence number within this range to see if the
  7636. * corresponding MPDU is actually present.
  7637. * This field is only valid if the FV bit is set.
  7638. * Rx descriptor fields:
  7639. * - FW_RX_DESC_BYTES
  7640. * Bits 15:0
  7641. * Purpose: Indicate how many bytes in the Rx indication are used for
  7642. * FW Rx descriptors
  7643. * Value: 1
  7644. */
  7645. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7646. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7647. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7648. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7649. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7650. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7651. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7652. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7653. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7654. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7655. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7656. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7657. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7658. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7659. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7660. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7661. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7662. #define HTT_RX_FRAG_IND_BYTES \
  7663. (4 /* msg hdr */ + \
  7664. 4 /* flush spec */ + \
  7665. 4 /* (unused) FW rx desc bytes spec */ + \
  7666. 4 /* FW rx desc */)
  7667. /**
  7668. * @brief target -> host test message definition
  7669. *
  7670. * @details
  7671. * The following field definitions describe the format of the test
  7672. * message sent from the target to the host.
  7673. * The message consists of a 4-octet header, followed by a variable
  7674. * number of 32-bit integer values, followed by a variable number
  7675. * of 8-bit character values.
  7676. *
  7677. * |31 16|15 8|7 0|
  7678. * |-----------------------------------------------------------|
  7679. * | num chars | num ints | msg type |
  7680. * |-----------------------------------------------------------|
  7681. * | int 0 |
  7682. * |-----------------------------------------------------------|
  7683. * | int 1 |
  7684. * |-----------------------------------------------------------|
  7685. * | ... |
  7686. * |-----------------------------------------------------------|
  7687. * | char 3 | char 2 | char 1 | char 0 |
  7688. * |-----------------------------------------------------------|
  7689. * | | | ... | char 4 |
  7690. * |-----------------------------------------------------------|
  7691. * - MSG_TYPE
  7692. * Bits 7:0
  7693. * Purpose: identifies this as a test message
  7694. * Value: HTT_MSG_TYPE_TEST
  7695. * - NUM_INTS
  7696. * Bits 15:8
  7697. * Purpose: indicate how many 32-bit integers follow the message header
  7698. * - NUM_CHARS
  7699. * Bits 31:16
  7700. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7701. */
  7702. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7703. #define HTT_RX_TEST_NUM_INTS_S 8
  7704. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7705. #define HTT_RX_TEST_NUM_CHARS_S 16
  7706. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7709. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7710. } while (0)
  7711. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7712. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7713. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7714. do { \
  7715. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7716. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7717. } while (0)
  7718. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7719. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7720. /**
  7721. * @brief target -> host packet log message
  7722. *
  7723. * @details
  7724. * The following field definitions describe the format of the packet log
  7725. * message sent from the target to the host.
  7726. * The message consists of a 4-octet header,followed by a variable number
  7727. * of 32-bit character values.
  7728. *
  7729. * |31 16|15 12|11 10|9 8|7 0|
  7730. * |------------------------------------------------------------------|
  7731. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7732. * |------------------------------------------------------------------|
  7733. * | payload |
  7734. * |------------------------------------------------------------------|
  7735. * - MSG_TYPE
  7736. * Bits 7:0
  7737. * Purpose: identifies this as a pktlog message
  7738. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7739. * - mac_id
  7740. * Bits 9:8
  7741. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7742. * Value: 0-3
  7743. * - pdev_id
  7744. * Bits 11:10
  7745. * Purpose: pdev_id
  7746. * Value: 0-3
  7747. * 0 (for rings at SOC level),
  7748. * 1/2/3 PDEV -> 0/1/2
  7749. * - payload_size
  7750. * Bits 31:16
  7751. * Purpose: explicitly specify the payload size
  7752. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7753. */
  7754. PREPACK struct htt_pktlog_msg {
  7755. A_UINT32 header;
  7756. A_UINT32 payload[1/* or more */];
  7757. } POSTPACK;
  7758. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7759. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7760. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7761. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7762. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7763. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7764. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7765. do { \
  7766. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7767. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7768. } while (0)
  7769. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7770. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7771. HTT_T2H_PKTLOG_MAC_ID_S)
  7772. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7775. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7776. } while (0)
  7777. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7778. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7779. HTT_T2H_PKTLOG_PDEV_ID_S)
  7780. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7781. do { \
  7782. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7783. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7784. } while (0)
  7785. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7786. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7787. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7788. /*
  7789. * Rx reorder statistics
  7790. * NB: all the fields must be defined in 4 octets size.
  7791. */
  7792. struct rx_reorder_stats {
  7793. /* Non QoS MPDUs received */
  7794. A_UINT32 deliver_non_qos;
  7795. /* MPDUs received in-order */
  7796. A_UINT32 deliver_in_order;
  7797. /* Flush due to reorder timer expired */
  7798. A_UINT32 deliver_flush_timeout;
  7799. /* Flush due to move out of window */
  7800. A_UINT32 deliver_flush_oow;
  7801. /* Flush due to DELBA */
  7802. A_UINT32 deliver_flush_delba;
  7803. /* MPDUs dropped due to FCS error */
  7804. A_UINT32 fcs_error;
  7805. /* MPDUs dropped due to monitor mode non-data packet */
  7806. A_UINT32 mgmt_ctrl;
  7807. /* Unicast-data MPDUs dropped due to invalid peer */
  7808. A_UINT32 invalid_peer;
  7809. /* MPDUs dropped due to duplication (non aggregation) */
  7810. A_UINT32 dup_non_aggr;
  7811. /* MPDUs dropped due to processed before */
  7812. A_UINT32 dup_past;
  7813. /* MPDUs dropped due to duplicate in reorder queue */
  7814. A_UINT32 dup_in_reorder;
  7815. /* Reorder timeout happened */
  7816. A_UINT32 reorder_timeout;
  7817. /* invalid bar ssn */
  7818. A_UINT32 invalid_bar_ssn;
  7819. /* reorder reset due to bar ssn */
  7820. A_UINT32 ssn_reset;
  7821. /* Flush due to delete peer */
  7822. A_UINT32 deliver_flush_delpeer;
  7823. /* Flush due to offload*/
  7824. A_UINT32 deliver_flush_offload;
  7825. /* Flush due to out of buffer*/
  7826. A_UINT32 deliver_flush_oob;
  7827. /* MPDUs dropped due to PN check fail */
  7828. A_UINT32 pn_fail;
  7829. /* MPDUs dropped due to unable to allocate memory */
  7830. A_UINT32 store_fail;
  7831. /* Number of times the tid pool alloc succeeded */
  7832. A_UINT32 tid_pool_alloc_succ;
  7833. /* Number of times the MPDU pool alloc succeeded */
  7834. A_UINT32 mpdu_pool_alloc_succ;
  7835. /* Number of times the MSDU pool alloc succeeded */
  7836. A_UINT32 msdu_pool_alloc_succ;
  7837. /* Number of times the tid pool alloc failed */
  7838. A_UINT32 tid_pool_alloc_fail;
  7839. /* Number of times the MPDU pool alloc failed */
  7840. A_UINT32 mpdu_pool_alloc_fail;
  7841. /* Number of times the MSDU pool alloc failed */
  7842. A_UINT32 msdu_pool_alloc_fail;
  7843. /* Number of times the tid pool freed */
  7844. A_UINT32 tid_pool_free;
  7845. /* Number of times the MPDU pool freed */
  7846. A_UINT32 mpdu_pool_free;
  7847. /* Number of times the MSDU pool freed */
  7848. A_UINT32 msdu_pool_free;
  7849. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7850. A_UINT32 msdu_queued;
  7851. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7852. A_UINT32 msdu_recycled;
  7853. /* Number of MPDUs with invalid peer but A2 found in AST */
  7854. A_UINT32 invalid_peer_a2_in_ast;
  7855. /* Number of MPDUs with invalid peer but A3 found in AST */
  7856. A_UINT32 invalid_peer_a3_in_ast;
  7857. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7858. A_UINT32 invalid_peer_bmc_mpdus;
  7859. /* Number of MSDUs with err attention word */
  7860. A_UINT32 rxdesc_err_att;
  7861. /* Number of MSDUs with flag of peer_idx_invalid */
  7862. A_UINT32 rxdesc_err_peer_idx_inv;
  7863. /* Number of MSDUs with flag of peer_idx_timeout */
  7864. A_UINT32 rxdesc_err_peer_idx_to;
  7865. /* Number of MSDUs with flag of overflow */
  7866. A_UINT32 rxdesc_err_ov;
  7867. /* Number of MSDUs with flag of msdu_length_err */
  7868. A_UINT32 rxdesc_err_msdu_len;
  7869. /* Number of MSDUs with flag of mpdu_length_err */
  7870. A_UINT32 rxdesc_err_mpdu_len;
  7871. /* Number of MSDUs with flag of tkip_mic_err */
  7872. A_UINT32 rxdesc_err_tkip_mic;
  7873. /* Number of MSDUs with flag of decrypt_err */
  7874. A_UINT32 rxdesc_err_decrypt;
  7875. /* Number of MSDUs with flag of fcs_err */
  7876. A_UINT32 rxdesc_err_fcs;
  7877. /* Number of Unicast (bc_mc bit is not set in attention word)
  7878. * frames with invalid peer handler
  7879. */
  7880. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7881. /* Number of unicast frame directly (direct bit is set in attention word)
  7882. * to DUT with invalid peer handler
  7883. */
  7884. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7885. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7886. * frames with invalid peer handler
  7887. */
  7888. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7889. /* Number of MSDUs dropped due to no first MSDU flag */
  7890. A_UINT32 rxdesc_no_1st_msdu;
  7891. /* Number of MSDUs droped due to ring overflow */
  7892. A_UINT32 msdu_drop_ring_ov;
  7893. /* Number of MSDUs dropped due to FC mismatch */
  7894. A_UINT32 msdu_drop_fc_mismatch;
  7895. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7896. A_UINT32 msdu_drop_mgmt_remote_ring;
  7897. /* Number of MSDUs dropped due to errors not reported in attention word */
  7898. A_UINT32 msdu_drop_misc;
  7899. /* Number of MSDUs go to offload before reorder */
  7900. A_UINT32 offload_msdu_wal;
  7901. /* Number of data frame dropped by offload after reorder */
  7902. A_UINT32 offload_msdu_reorder;
  7903. /* Number of MPDUs with sequence number in the past and within the BA window */
  7904. A_UINT32 dup_past_within_window;
  7905. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7906. A_UINT32 dup_past_outside_window;
  7907. /* Number of MSDUs with decrypt/MIC error */
  7908. A_UINT32 rxdesc_err_decrypt_mic;
  7909. /* Number of data MSDUs received on both local and remote rings */
  7910. A_UINT32 data_msdus_on_both_rings;
  7911. /* MPDUs never filled */
  7912. A_UINT32 holes_not_filled;
  7913. };
  7914. /*
  7915. * Rx Remote buffer statistics
  7916. * NB: all the fields must be defined in 4 octets size.
  7917. */
  7918. struct rx_remote_buffer_mgmt_stats {
  7919. /* Total number of MSDUs reaped for Rx processing */
  7920. A_UINT32 remote_reaped;
  7921. /* MSDUs recycled within firmware */
  7922. A_UINT32 remote_recycled;
  7923. /* MSDUs stored by Data Rx */
  7924. A_UINT32 data_rx_msdus_stored;
  7925. /* Number of HTT indications from WAL Rx MSDU */
  7926. A_UINT32 wal_rx_ind;
  7927. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7928. A_UINT32 wal_rx_ind_unconsumed;
  7929. /* Number of HTT indications from Data Rx MSDU */
  7930. A_UINT32 data_rx_ind;
  7931. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7932. A_UINT32 data_rx_ind_unconsumed;
  7933. /* Number of HTT indications from ATHBUF */
  7934. A_UINT32 athbuf_rx_ind;
  7935. /* Number of remote buffers requested for refill */
  7936. A_UINT32 refill_buf_req;
  7937. /* Number of remote buffers filled by the host */
  7938. A_UINT32 refill_buf_rsp;
  7939. /* Number of times MAC hw_index = f/w write_index */
  7940. A_INT32 mac_no_bufs;
  7941. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7942. A_INT32 fw_indices_equal;
  7943. /* Number of times f/w finds no buffers to post */
  7944. A_INT32 host_no_bufs;
  7945. };
  7946. /*
  7947. * TXBF MU/SU packets and NDPA statistics
  7948. * NB: all the fields must be defined in 4 octets size.
  7949. */
  7950. struct rx_txbf_musu_ndpa_pkts_stats {
  7951. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7952. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7953. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7954. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7955. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7956. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7957. };
  7958. /*
  7959. * htt_dbg_stats_status -
  7960. * present - The requested stats have been delivered in full.
  7961. * This indicates that either the stats information was contained
  7962. * in its entirety within this message, or else this message
  7963. * completes the delivery of the requested stats info that was
  7964. * partially delivered through earlier STATS_CONF messages.
  7965. * partial - The requested stats have been delivered in part.
  7966. * One or more subsequent STATS_CONF messages with the same
  7967. * cookie value will be sent to deliver the remainder of the
  7968. * information.
  7969. * error - The requested stats could not be delivered, for example due
  7970. * to a shortage of memory to construct a message holding the
  7971. * requested stats.
  7972. * invalid - The requested stat type is either not recognized, or the
  7973. * target is configured to not gather the stats type in question.
  7974. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7975. * series_done - This special value indicates that no further stats info
  7976. * elements are present within a series of stats info elems
  7977. * (within a stats upload confirmation message).
  7978. */
  7979. enum htt_dbg_stats_status {
  7980. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7981. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7982. HTT_DBG_STATS_STATUS_ERROR = 2,
  7983. HTT_DBG_STATS_STATUS_INVALID = 3,
  7984. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7985. };
  7986. /**
  7987. * @brief target -> host statistics upload
  7988. *
  7989. * @details
  7990. * The following field definitions describe the format of the HTT target
  7991. * to host stats upload confirmation message.
  7992. * The message contains a cookie echoed from the HTT host->target stats
  7993. * upload request, which identifies which request the confirmation is
  7994. * for, and a series of tag-length-value stats information elements.
  7995. * The tag-length header for each stats info element also includes a
  7996. * status field, to indicate whether the request for the stat type in
  7997. * question was fully met, partially met, unable to be met, or invalid
  7998. * (if the stat type in question is disabled in the target).
  7999. * A special value of all 1's in this status field is used to indicate
  8000. * the end of the series of stats info elements.
  8001. *
  8002. *
  8003. * |31 16|15 8|7 5|4 0|
  8004. * |------------------------------------------------------------|
  8005. * | reserved | msg type |
  8006. * |------------------------------------------------------------|
  8007. * | cookie LSBs |
  8008. * |------------------------------------------------------------|
  8009. * | cookie MSBs |
  8010. * |------------------------------------------------------------|
  8011. * | stats entry length | reserved | S |stat type|
  8012. * |------------------------------------------------------------|
  8013. * | |
  8014. * | type-specific stats info |
  8015. * | |
  8016. * |------------------------------------------------------------|
  8017. * | stats entry length | reserved | S |stat type|
  8018. * |------------------------------------------------------------|
  8019. * | |
  8020. * | type-specific stats info |
  8021. * | |
  8022. * |------------------------------------------------------------|
  8023. * | n/a | reserved | 111 | n/a |
  8024. * |------------------------------------------------------------|
  8025. * Header fields:
  8026. * - MSG_TYPE
  8027. * Bits 7:0
  8028. * Purpose: identifies this is a statistics upload confirmation message
  8029. * Value: 0x9
  8030. * - COOKIE_LSBS
  8031. * Bits 31:0
  8032. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8033. * message with its preceding host->target stats request message.
  8034. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8035. * - COOKIE_MSBS
  8036. * Bits 31:0
  8037. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8038. * message with its preceding host->target stats request message.
  8039. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8040. *
  8041. * Stats Information Element tag-length header fields:
  8042. * - STAT_TYPE
  8043. * Bits 4:0
  8044. * Purpose: identifies the type of statistics info held in the
  8045. * following information element
  8046. * Value: htt_dbg_stats_type
  8047. * - STATUS
  8048. * Bits 7:5
  8049. * Purpose: indicate whether the requested stats are present
  8050. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8051. * the completion of the stats entry series
  8052. * - LENGTH
  8053. * Bits 31:16
  8054. * Purpose: indicate the stats information size
  8055. * Value: This field specifies the number of bytes of stats information
  8056. * that follows the element tag-length header.
  8057. * It is expected but not required that this length is a multiple of
  8058. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8059. * subsequent stats entry header will begin on a 4-byte aligned
  8060. * boundary.
  8061. */
  8062. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8063. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8064. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8065. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8066. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8067. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8068. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8069. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8070. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8071. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8072. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8073. do { \
  8074. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8075. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8076. } while (0)
  8077. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8078. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8079. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8080. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8081. do { \
  8082. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8083. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8084. } while (0)
  8085. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8086. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8087. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8088. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8089. do { \
  8090. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8091. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8092. } while (0)
  8093. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8094. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8095. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8096. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8097. #define HTT_MAX_AGGR 64
  8098. #define HTT_HL_MAX_AGGR 18
  8099. /**
  8100. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8101. *
  8102. * @details
  8103. * The following field definitions describe the format of the HTT host
  8104. * to target frag_desc/msdu_ext bank configuration message.
  8105. * The message contains the based address and the min and max id of the
  8106. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8107. * MSDU_EXT/FRAG_DESC.
  8108. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8109. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8110. * the hardware does the mapping/translation.
  8111. *
  8112. * Total banks that can be configured is configured to 16.
  8113. *
  8114. * This should be called before any TX has be initiated by the HTT
  8115. *
  8116. * |31 16|15 8|7 5|4 0|
  8117. * |------------------------------------------------------------|
  8118. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8119. * |------------------------------------------------------------|
  8120. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8121. #if HTT_PADDR64
  8122. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8123. #endif
  8124. * |------------------------------------------------------------|
  8125. * | ... |
  8126. * |------------------------------------------------------------|
  8127. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8128. #if HTT_PADDR64
  8129. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8130. #endif
  8131. * |------------------------------------------------------------|
  8132. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8133. * |------------------------------------------------------------|
  8134. * | ... |
  8135. * |------------------------------------------------------------|
  8136. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8137. * |------------------------------------------------------------|
  8138. * Header fields:
  8139. * - MSG_TYPE
  8140. * Bits 7:0
  8141. * Value: 0x6
  8142. * for systems with 64-bit format for bus addresses:
  8143. * - BANKx_BASE_ADDRESS_LO
  8144. * Bits 31:0
  8145. * Purpose: Provide a mechanism to specify the base address of the
  8146. * MSDU_EXT bank physical/bus address.
  8147. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8148. * - BANKx_BASE_ADDRESS_HI
  8149. * Bits 31:0
  8150. * Purpose: Provide a mechanism to specify the base address of the
  8151. * MSDU_EXT bank physical/bus address.
  8152. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8153. * for systems with 32-bit format for bus addresses:
  8154. * - BANKx_BASE_ADDRESS
  8155. * Bits 31:0
  8156. * Purpose: Provide a mechanism to specify the base address of the
  8157. * MSDU_EXT bank physical/bus address.
  8158. * Value: MSDU_EXT bank physical / bus address
  8159. * - BANKx_MIN_ID
  8160. * Bits 15:0
  8161. * Purpose: Provide a mechanism to specify the min index that needs to
  8162. * mapped.
  8163. * - BANKx_MAX_ID
  8164. * Bits 31:16
  8165. * Purpose: Provide a mechanism to specify the max index that needs to
  8166. * mapped.
  8167. *
  8168. */
  8169. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8170. * safe value.
  8171. * @note MAX supported banks is 16.
  8172. */
  8173. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8174. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8175. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8176. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8177. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8178. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8179. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8180. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8181. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8182. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8183. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8184. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8185. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8186. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8187. do { \
  8188. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8189. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8190. } while (0)
  8191. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8192. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8193. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8194. do { \
  8195. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8196. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8197. } while (0)
  8198. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8199. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8200. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8201. do { \
  8202. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8203. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8204. } while (0)
  8205. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8206. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8207. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8208. do { \
  8209. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8210. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8211. } while (0)
  8212. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8213. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8214. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8215. do { \
  8216. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8217. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8218. } while (0)
  8219. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8220. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8221. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8222. do { \
  8223. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8224. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8225. } while (0)
  8226. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8227. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8228. /*
  8229. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8230. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8231. * addresses are stored in a XXX-bit field.
  8232. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8233. * htt_tx_frag_desc64_bank_cfg_t structs.
  8234. */
  8235. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8236. _paddr_bits_, \
  8237. _paddr__bank_base_address_) \
  8238. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8239. /** word 0 \
  8240. * msg_type: 8, \
  8241. * pdev_id: 2, \
  8242. * swap: 1, \
  8243. * reserved0: 5, \
  8244. * num_banks: 8, \
  8245. * desc_size: 8; \
  8246. */ \
  8247. A_UINT32 word0; \
  8248. /* \
  8249. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8250. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8251. * the second A_UINT32). \
  8252. */ \
  8253. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8254. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8255. } POSTPACK
  8256. /* define htt_tx_frag_desc32_bank_cfg_t */
  8257. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8258. /* define htt_tx_frag_desc64_bank_cfg_t */
  8259. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8260. /*
  8261. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8262. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8263. */
  8264. #if HTT_PADDR64
  8265. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8266. #else
  8267. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8268. #endif
  8269. /**
  8270. * @brief target -> host HTT TX Credit total count update message definition
  8271. *
  8272. *|31 16|15|14 9| 8 |7 0 |
  8273. *|---------------------+--+----------+-------+----------|
  8274. *|cur htt credit delta | Q| reserved | sign | msg type |
  8275. *|------------------------------------------------------|
  8276. *
  8277. * Header fields:
  8278. * - MSG_TYPE
  8279. * Bits 7:0
  8280. * Purpose: identifies this as a htt tx credit delta update message
  8281. * Value: 0xe
  8282. * - SIGN
  8283. * Bits 8
  8284. * identifies whether credit delta is positive or negative
  8285. * Value:
  8286. * - 0x0: credit delta is positive, rebalance in some buffers
  8287. * - 0x1: credit delta is negative, rebalance out some buffers
  8288. * - reserved
  8289. * Bits 14:9
  8290. * Value: 0x0
  8291. * - TXQ_GRP
  8292. * Bit 15
  8293. * Purpose: indicates whether any tx queue group information elements
  8294. * are appended to the tx credit update message
  8295. * Value: 0 -> no tx queue group information element is present
  8296. * 1 -> a tx queue group information element immediately follows
  8297. * - DELTA_COUNT
  8298. * Bits 31:16
  8299. * Purpose: Specify current htt credit delta absolute count
  8300. */
  8301. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8302. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8303. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8304. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8305. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8306. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8307. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8308. do { \
  8309. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8310. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8311. } while (0)
  8312. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8313. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8314. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8315. do { \
  8316. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8317. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8318. } while (0)
  8319. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8320. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8321. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8322. do { \
  8323. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8324. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8325. } while (0)
  8326. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8327. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8328. #define HTT_TX_CREDIT_MSG_BYTES 4
  8329. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8330. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8331. /**
  8332. * @brief HTT WDI_IPA Operation Response Message
  8333. *
  8334. * @details
  8335. * HTT WDI_IPA Operation Response message is sent by target
  8336. * to host confirming suspend or resume operation.
  8337. * |31 24|23 16|15 8|7 0|
  8338. * |----------------+----------------+----------------+----------------|
  8339. * | op_code | Rsvd | msg_type |
  8340. * |-------------------------------------------------------------------|
  8341. * | Rsvd | Response len |
  8342. * |-------------------------------------------------------------------|
  8343. * | |
  8344. * | Response-type specific info |
  8345. * | |
  8346. * | |
  8347. * |-------------------------------------------------------------------|
  8348. * Header fields:
  8349. * - MSG_TYPE
  8350. * Bits 7:0
  8351. * Purpose: Identifies this as WDI_IPA Operation Response message
  8352. * value: = 0x13
  8353. * - OP_CODE
  8354. * Bits 31:16
  8355. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8356. * value: = enum htt_wdi_ipa_op_code
  8357. * - RSP_LEN
  8358. * Bits 16:0
  8359. * Purpose: length for the response-type specific info
  8360. * value: = length in bytes for response-type specific info
  8361. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8362. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8363. */
  8364. PREPACK struct htt_wdi_ipa_op_response_t
  8365. {
  8366. /* DWORD 0: flags and meta-data */
  8367. A_UINT32
  8368. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8369. reserved1: 8,
  8370. op_code: 16;
  8371. A_UINT32
  8372. rsp_len: 16,
  8373. reserved2: 16;
  8374. } POSTPACK;
  8375. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8376. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8377. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8378. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8379. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8380. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8381. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8382. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8383. do { \
  8384. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8385. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8386. } while (0)
  8387. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8388. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8389. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8390. do { \
  8391. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8392. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8393. } while (0)
  8394. enum htt_phy_mode {
  8395. htt_phy_mode_11a = 0,
  8396. htt_phy_mode_11g = 1,
  8397. htt_phy_mode_11b = 2,
  8398. htt_phy_mode_11g_only = 3,
  8399. htt_phy_mode_11na_ht20 = 4,
  8400. htt_phy_mode_11ng_ht20 = 5,
  8401. htt_phy_mode_11na_ht40 = 6,
  8402. htt_phy_mode_11ng_ht40 = 7,
  8403. htt_phy_mode_11ac_vht20 = 8,
  8404. htt_phy_mode_11ac_vht40 = 9,
  8405. htt_phy_mode_11ac_vht80 = 10,
  8406. htt_phy_mode_11ac_vht20_2g = 11,
  8407. htt_phy_mode_11ac_vht40_2g = 12,
  8408. htt_phy_mode_11ac_vht80_2g = 13,
  8409. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8410. htt_phy_mode_11ac_vht160 = 15,
  8411. htt_phy_mode_max,
  8412. };
  8413. /**
  8414. * @brief target -> host HTT channel change indication
  8415. * @details
  8416. * Specify when a channel change occurs.
  8417. * This allows the host to precisely determine which rx frames arrived
  8418. * on the old channel and which rx frames arrived on the new channel.
  8419. *
  8420. *|31 |7 0 |
  8421. *|-------------------------------------------+----------|
  8422. *| reserved | msg type |
  8423. *|------------------------------------------------------|
  8424. *| primary_chan_center_freq_mhz |
  8425. *|------------------------------------------------------|
  8426. *| contiguous_chan1_center_freq_mhz |
  8427. *|------------------------------------------------------|
  8428. *| contiguous_chan2_center_freq_mhz |
  8429. *|------------------------------------------------------|
  8430. *| phy_mode |
  8431. *|------------------------------------------------------|
  8432. *
  8433. * Header fields:
  8434. * - MSG_TYPE
  8435. * Bits 7:0
  8436. * Purpose: identifies this as a htt channel change indication message
  8437. * Value: 0x15
  8438. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8439. * Bits 31:0
  8440. * Purpose: identify the (center of the) new 20 MHz primary channel
  8441. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8442. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8443. * Bits 31:0
  8444. * Purpose: identify the (center of the) contiguous frequency range
  8445. * comprising the new channel.
  8446. * For example, if the new channel is a 80 MHz channel extending
  8447. * 60 MHz beyond the primary channel, this field would be 30 larger
  8448. * than the primary channel center frequency field.
  8449. * Value: center frequency of the contiguous frequency range comprising
  8450. * the full channel in MHz units
  8451. * (80+80 channels also use the CONTIG_CHAN2 field)
  8452. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8453. * Bits 31:0
  8454. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8455. * within a VHT 80+80 channel.
  8456. * This field is only relevant for VHT 80+80 channels.
  8457. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8458. * channel (arbitrary value for cases besides VHT 80+80)
  8459. * - PHY_MODE
  8460. * Bits 31:0
  8461. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8462. * and band
  8463. * Value: htt_phy_mode enum value
  8464. */
  8465. PREPACK struct htt_chan_change_t
  8466. {
  8467. /* DWORD 0: flags and meta-data */
  8468. A_UINT32
  8469. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8470. reserved1: 24;
  8471. A_UINT32 primary_chan_center_freq_mhz;
  8472. A_UINT32 contig_chan1_center_freq_mhz;
  8473. A_UINT32 contig_chan2_center_freq_mhz;
  8474. A_UINT32 phy_mode;
  8475. } POSTPACK;
  8476. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8477. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8478. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8479. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8480. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8481. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8482. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8483. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8484. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8485. do { \
  8486. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8487. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8488. } while (0)
  8489. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8490. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8491. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8492. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8493. do { \
  8494. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8495. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8496. } while (0)
  8497. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8498. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8499. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8500. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8503. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8504. } while (0)
  8505. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8506. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8507. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8508. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8511. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8512. } while (0)
  8513. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8514. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8515. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8516. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8517. /**
  8518. * @brief rx offload packet error message
  8519. *
  8520. * @details
  8521. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8522. * of target payload like mic err.
  8523. *
  8524. * |31 24|23 16|15 8|7 0|
  8525. * |----------------+----------------+----------------+----------------|
  8526. * | tid | vdev_id | msg_sub_type | msg_type |
  8527. * |-------------------------------------------------------------------|
  8528. * : (sub-type dependent content) :
  8529. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8530. * Header fields:
  8531. * - msg_type
  8532. * Bits 7:0
  8533. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8534. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8535. * - msg_sub_type
  8536. * Bits 15:8
  8537. * Purpose: Identifies which type of rx error is reported by this message
  8538. * value: htt_rx_ofld_pkt_err_type
  8539. * - vdev_id
  8540. * Bits 23:16
  8541. * Purpose: Identifies which vdev received the erroneous rx frame
  8542. * value:
  8543. * - tid
  8544. * Bits 31:24
  8545. * Purpose: Identifies the traffic type of the rx frame
  8546. * value:
  8547. *
  8548. * - The payload fields used if the sub-type == MIC error are shown below.
  8549. * Note - MIC err is per MSDU, while PN is per MPDU.
  8550. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8551. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8552. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8553. * instead of sending separate HTT messages for each wrong MSDU within
  8554. * the MPDU.
  8555. *
  8556. * |31 24|23 16|15 8|7 0|
  8557. * |----------------+----------------+----------------+----------------|
  8558. * | Rsvd | key_id | peer_id |
  8559. * |-------------------------------------------------------------------|
  8560. * | receiver MAC addr 31:0 |
  8561. * |-------------------------------------------------------------------|
  8562. * | Rsvd | receiver MAC addr 47:32 |
  8563. * |-------------------------------------------------------------------|
  8564. * | transmitter MAC addr 31:0 |
  8565. * |-------------------------------------------------------------------|
  8566. * | Rsvd | transmitter MAC addr 47:32 |
  8567. * |-------------------------------------------------------------------|
  8568. * | PN 31:0 |
  8569. * |-------------------------------------------------------------------|
  8570. * | Rsvd | PN 47:32 |
  8571. * |-------------------------------------------------------------------|
  8572. * - peer_id
  8573. * Bits 15:0
  8574. * Purpose: identifies which peer is frame is from
  8575. * value:
  8576. * - key_id
  8577. * Bits 23:16
  8578. * Purpose: identifies key_id of rx frame
  8579. * value:
  8580. * - RA_31_0 (receiver MAC addr 31:0)
  8581. * Bits 31:0
  8582. * Purpose: identifies by MAC address which vdev received the frame
  8583. * value: MAC address lower 4 bytes
  8584. * - RA_47_32 (receiver MAC addr 47:32)
  8585. * Bits 15:0
  8586. * Purpose: identifies by MAC address which vdev received the frame
  8587. * value: MAC address upper 2 bytes
  8588. * - TA_31_0 (transmitter MAC addr 31:0)
  8589. * Bits 31:0
  8590. * Purpose: identifies by MAC address which peer transmitted the frame
  8591. * value: MAC address lower 4 bytes
  8592. * - TA_47_32 (transmitter MAC addr 47:32)
  8593. * Bits 15:0
  8594. * Purpose: identifies by MAC address which peer transmitted the frame
  8595. * value: MAC address upper 2 bytes
  8596. * - PN_31_0
  8597. * Bits 31:0
  8598. * Purpose: Identifies pn of rx frame
  8599. * value: PN lower 4 bytes
  8600. * - PN_47_32
  8601. * Bits 15:0
  8602. * Purpose: Identifies pn of rx frame
  8603. * value:
  8604. * TKIP or CCMP: PN upper 2 bytes
  8605. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8606. */
  8607. enum htt_rx_ofld_pkt_err_type {
  8608. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8609. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8610. };
  8611. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8612. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8613. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8614. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8615. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8616. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8617. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8618. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8619. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8620. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8621. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8622. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8623. do { \
  8624. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8625. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8626. } while (0)
  8627. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8628. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8629. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8630. do { \
  8631. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8632. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8633. } while (0)
  8634. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8635. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8636. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8637. do { \
  8638. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8639. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8640. } while (0)
  8641. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8643. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8660. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8661. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8662. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8663. do { \
  8664. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8665. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8666. } while (0)
  8667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8668. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8669. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8671. do { \
  8672. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8673. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8674. } while (0)
  8675. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8676. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8677. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8679. do { \
  8680. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8681. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8682. } while (0)
  8683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8684. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8685. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8689. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8690. } while (0)
  8691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8692. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8693. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8697. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8698. } while (0)
  8699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8700. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8701. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8705. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8706. } while (0)
  8707. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8708. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8709. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8713. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8714. } while (0)
  8715. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8716. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8717. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8719. do { \
  8720. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8721. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8722. } while (0)
  8723. /**
  8724. * @brief peer rate report message
  8725. *
  8726. * @details
  8727. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8728. * justified rate of all the peers.
  8729. *
  8730. * |31 24|23 16|15 8|7 0|
  8731. * |----------------+----------------+----------------+----------------|
  8732. * | peer_count | | msg_type |
  8733. * |-------------------------------------------------------------------|
  8734. * : Payload (variant number of peer rate report) :
  8735. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8736. * Header fields:
  8737. * - msg_type
  8738. * Bits 7:0
  8739. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8740. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8741. * - reserved
  8742. * Bits 15:8
  8743. * Purpose:
  8744. * value:
  8745. * - peer_count
  8746. * Bits 31:16
  8747. * Purpose: Specify how many peer rate report elements are present in the payload.
  8748. * value:
  8749. *
  8750. * Payload:
  8751. * There are variant number of peer rate report follow the first 32 bits.
  8752. * The peer rate report is defined as follows.
  8753. *
  8754. * |31 20|19 16|15 0|
  8755. * |-----------------------+---------+---------------------------------|-
  8756. * | reserved | phy | peer_id | \
  8757. * |-------------------------------------------------------------------| -> report #0
  8758. * | rate | /
  8759. * |-----------------------+---------+---------------------------------|-
  8760. * | reserved | phy | peer_id | \
  8761. * |-------------------------------------------------------------------| -> report #1
  8762. * | rate | /
  8763. * |-----------------------+---------+---------------------------------|-
  8764. * | reserved | phy | peer_id | \
  8765. * |-------------------------------------------------------------------| -> report #2
  8766. * | rate | /
  8767. * |-------------------------------------------------------------------|-
  8768. * : :
  8769. * : :
  8770. * : :
  8771. * :-------------------------------------------------------------------:
  8772. *
  8773. * - peer_id
  8774. * Bits 15:0
  8775. * Purpose: identify the peer
  8776. * value:
  8777. * - phy
  8778. * Bits 19:16
  8779. * Purpose: identify which phy is in use
  8780. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8781. * Please see enum htt_peer_report_phy_type for detail.
  8782. * - reserved
  8783. * Bits 31:20
  8784. * Purpose:
  8785. * value:
  8786. * - rate
  8787. * Bits 31:0
  8788. * Purpose: represent the justified rate of the peer specified by peer_id
  8789. * value:
  8790. */
  8791. enum htt_peer_rate_report_phy_type {
  8792. HTT_PEER_RATE_REPORT_11B = 0,
  8793. HTT_PEER_RATE_REPORT_11A_G,
  8794. HTT_PEER_RATE_REPORT_11N,
  8795. HTT_PEER_RATE_REPORT_11AC,
  8796. };
  8797. #define HTT_PEER_RATE_REPORT_SIZE 8
  8798. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8799. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8800. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8801. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8802. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8803. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8804. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8805. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8806. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8807. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8810. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8811. } while (0)
  8812. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8813. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8814. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8815. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8816. do { \
  8817. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8818. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8819. } while (0)
  8820. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8821. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8822. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8823. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8824. do { \
  8825. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8826. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8827. } while (0)
  8828. /**
  8829. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8830. *
  8831. * @details
  8832. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8833. * a flow of descriptors.
  8834. *
  8835. * This message is in TLV format and indicates the parameters to be setup a
  8836. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8837. * receive descriptors from a specified pool.
  8838. *
  8839. * The message would appear as follows:
  8840. *
  8841. * |31 24|23 16|15 8|7 0|
  8842. * |----------------+----------------+----------------+----------------|
  8843. * header | reserved | num_flows | msg_type |
  8844. * |-------------------------------------------------------------------|
  8845. * | |
  8846. * : payload :
  8847. * | |
  8848. * |-------------------------------------------------------------------|
  8849. *
  8850. * The header field is one DWORD long and is interpreted as follows:
  8851. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8852. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8853. * this message
  8854. * b'16-31 - reserved: These bits are reserved for future use
  8855. *
  8856. * Payload:
  8857. * The payload would contain multiple objects of the following structure. Each
  8858. * object represents a flow.
  8859. *
  8860. * |31 24|23 16|15 8|7 0|
  8861. * |----------------+----------------+----------------+----------------|
  8862. * header | reserved | num_flows | msg_type |
  8863. * |-------------------------------------------------------------------|
  8864. * payload0| flow_type |
  8865. * |-------------------------------------------------------------------|
  8866. * | flow_id |
  8867. * |-------------------------------------------------------------------|
  8868. * | reserved0 | flow_pool_id |
  8869. * |-------------------------------------------------------------------|
  8870. * | reserved1 | flow_pool_size |
  8871. * |-------------------------------------------------------------------|
  8872. * | reserved2 |
  8873. * |-------------------------------------------------------------------|
  8874. * payload1| flow_type |
  8875. * |-------------------------------------------------------------------|
  8876. * | flow_id |
  8877. * |-------------------------------------------------------------------|
  8878. * | reserved0 | flow_pool_id |
  8879. * |-------------------------------------------------------------------|
  8880. * | reserved1 | flow_pool_size |
  8881. * |-------------------------------------------------------------------|
  8882. * | reserved2 |
  8883. * |-------------------------------------------------------------------|
  8884. * | . |
  8885. * | . |
  8886. * | . |
  8887. * |-------------------------------------------------------------------|
  8888. *
  8889. * Each payload is 5 DWORDS long and is interpreted as follows:
  8890. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8891. * this flow is associated. It can be VDEV, peer,
  8892. * or tid (AC). Based on enum htt_flow_type.
  8893. *
  8894. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8895. * object. For flow_type vdev it is set to the
  8896. * vdevid, for peer it is peerid and for tid, it is
  8897. * tid_num.
  8898. *
  8899. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8900. * in the host for this flow
  8901. * b'16:31 - reserved0: This field in reserved for the future. In case
  8902. * we have a hierarchical implementation (HCM) of
  8903. * pools, it can be used to indicate the ID of the
  8904. * parent-pool.
  8905. *
  8906. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8907. * Descriptors for this flow will be
  8908. * allocated from this pool in the host.
  8909. * b'16:31 - reserved1: This field in reserved for the future. In case
  8910. * we have a hierarchical implementation of pools,
  8911. * it can be used to indicate the max number of
  8912. * descriptors in the pool. The b'0:15 can be used
  8913. * to indicate min number of descriptors in the
  8914. * HCM scheme.
  8915. *
  8916. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8917. * we have a hierarchical implementation of pools,
  8918. * b'0:15 can be used to indicate the
  8919. * priority-based borrowing (PBB) threshold of
  8920. * the flow's pool. The b'16:31 are still left
  8921. * reserved.
  8922. */
  8923. enum htt_flow_type {
  8924. FLOW_TYPE_VDEV = 0,
  8925. /* Insert new flow types above this line */
  8926. };
  8927. PREPACK struct htt_flow_pool_map_payload_t {
  8928. A_UINT32 flow_type;
  8929. A_UINT32 flow_id;
  8930. A_UINT32 flow_pool_id:16,
  8931. reserved0:16;
  8932. A_UINT32 flow_pool_size:16,
  8933. reserved1:16;
  8934. A_UINT32 reserved2;
  8935. } POSTPACK;
  8936. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8937. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8938. (sizeof(struct htt_flow_pool_map_payload_t))
  8939. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8940. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8941. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8942. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8943. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8944. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8945. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8946. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8947. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8949. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8950. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8951. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8952. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8953. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8954. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8955. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8956. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8957. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8958. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8959. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8960. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8961. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8962. do { \
  8963. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8964. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8965. } while (0)
  8966. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8967. do { \
  8968. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8969. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8970. } while (0)
  8971. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8974. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8975. } while (0)
  8976. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8977. do { \
  8978. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8979. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8980. } while (0)
  8981. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8984. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8985. } while (0)
  8986. /**
  8987. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8988. *
  8989. * @details
  8990. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8991. * down a flow of descriptors.
  8992. * This message indicates that for the flow (whose ID is provided) is wanting
  8993. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8994. * pool of descriptors from where descriptors are being allocated for this
  8995. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8996. * be unmapped by the host.
  8997. *
  8998. * The message would appear as follows:
  8999. *
  9000. * |31 24|23 16|15 8|7 0|
  9001. * |----------------+----------------+----------------+----------------|
  9002. * | reserved0 | msg_type |
  9003. * |-------------------------------------------------------------------|
  9004. * | flow_type |
  9005. * |-------------------------------------------------------------------|
  9006. * | flow_id |
  9007. * |-------------------------------------------------------------------|
  9008. * | reserved1 | flow_pool_id |
  9009. * |-------------------------------------------------------------------|
  9010. *
  9011. * The message is interpreted as follows:
  9012. * dword0 - b'0:7 - msg_type: This will be set to
  9013. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9014. * b'8:31 - reserved0: Reserved for future use
  9015. *
  9016. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9017. * this flow is associated. It can be VDEV, peer,
  9018. * or tid (AC). Based on enum htt_flow_type.
  9019. *
  9020. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9021. * object. For flow_type vdev it is set to the
  9022. * vdevid, for peer it is peerid and for tid, it is
  9023. * tid_num.
  9024. *
  9025. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9026. * used in the host for this flow
  9027. * b'16:31 - reserved0: This field in reserved for the future.
  9028. *
  9029. */
  9030. PREPACK struct htt_flow_pool_unmap_t {
  9031. A_UINT32 msg_type:8,
  9032. reserved0:24;
  9033. A_UINT32 flow_type;
  9034. A_UINT32 flow_id;
  9035. A_UINT32 flow_pool_id:16,
  9036. reserved1:16;
  9037. } POSTPACK;
  9038. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9039. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9040. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9041. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9042. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9043. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9044. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9045. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9046. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9047. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9048. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9049. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9050. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9051. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9052. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9053. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9054. do { \
  9055. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9056. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9057. } while (0)
  9058. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9059. do { \
  9060. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9061. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9062. } while (0)
  9063. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9064. do { \
  9065. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9066. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9067. } while (0)
  9068. /**
  9069. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9070. *
  9071. * @details
  9072. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9073. * SRNG ring setup is done
  9074. *
  9075. * This message indicates whether the last setup operation is successful.
  9076. * It will be sent to host when host set respose_required bit in
  9077. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9078. * The message would appear as follows:
  9079. *
  9080. * |31 24|23 16|15 8|7 0|
  9081. * |--------------- +----------------+----------------+----------------|
  9082. * | setup_status | ring_id | pdev_id | msg_type |
  9083. * |-------------------------------------------------------------------|
  9084. *
  9085. * The message is interpreted as follows:
  9086. * dword0 - b'0:7 - msg_type: This will be set to
  9087. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9088. * b'8:15 - pdev_id:
  9089. * 0 (for rings at SOC/UMAC level),
  9090. * 1/2/3 mac id (for rings at LMAC level)
  9091. * b'16:23 - ring_id: Identify the ring which is set up
  9092. * More details can be got from enum htt_srng_ring_id
  9093. * b'24:31 - setup_status: Indicate status of setup operation
  9094. * Refer to htt_ring_setup_status
  9095. */
  9096. PREPACK struct htt_sring_setup_done_t {
  9097. A_UINT32 msg_type: 8,
  9098. pdev_id: 8,
  9099. ring_id: 8,
  9100. setup_status: 8;
  9101. } POSTPACK;
  9102. enum htt_ring_setup_status {
  9103. htt_ring_setup_status_ok = 0,
  9104. htt_ring_setup_status_error,
  9105. };
  9106. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9107. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9108. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9109. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9110. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9111. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9112. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9113. do { \
  9114. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9115. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9116. } while (0)
  9117. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9118. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9119. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9120. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9121. HTT_SRING_SETUP_DONE_RING_ID_S)
  9122. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9123. do { \
  9124. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9125. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9126. } while (0)
  9127. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9128. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9129. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9130. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9131. HTT_SRING_SETUP_DONE_STATUS_S)
  9132. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9133. do { \
  9134. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9135. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9136. } while (0)
  9137. /**
  9138. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9139. *
  9140. * @details
  9141. * HTT TX map flow entry with tqm flow pointer
  9142. * Sent from firmware to host to add tqm flow pointer in corresponding
  9143. * flow search entry. Flow metadata is replayed back to host as part of this
  9144. * struct to enable host to find the specific flow search entry
  9145. *
  9146. * The message would appear as follows:
  9147. *
  9148. * |31 28|27 18|17 14|13 8|7 0|
  9149. * |-------+------------------------------------------+----------------|
  9150. * | rsvd0 | fse_hsh_idx | msg_type |
  9151. * |-------------------------------------------------------------------|
  9152. * | rsvd1 | tid | peer_id |
  9153. * |-------------------------------------------------------------------|
  9154. * | tqm_flow_pntr_lo |
  9155. * |-------------------------------------------------------------------|
  9156. * | tqm_flow_pntr_hi |
  9157. * |-------------------------------------------------------------------|
  9158. * | fse_meta_data |
  9159. * |-------------------------------------------------------------------|
  9160. *
  9161. * The message is interpreted as follows:
  9162. *
  9163. * dword0 - b'0:7 - msg_type: This will be set to
  9164. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9165. *
  9166. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9167. * for this flow entry
  9168. *
  9169. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9170. *
  9171. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9172. *
  9173. * dword1 - b'14:17 - tid
  9174. *
  9175. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9176. *
  9177. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9178. *
  9179. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9180. *
  9181. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9182. * given by host
  9183. */
  9184. PREPACK struct htt_tx_map_flow_info {
  9185. A_UINT32
  9186. msg_type: 8,
  9187. fse_hsh_idx: 20,
  9188. rsvd0: 4;
  9189. A_UINT32
  9190. peer_id: 14,
  9191. tid: 4,
  9192. rsvd1: 14;
  9193. A_UINT32 tqm_flow_pntr_lo;
  9194. A_UINT32 tqm_flow_pntr_hi;
  9195. struct htt_tx_flow_metadata fse_meta_data;
  9196. } POSTPACK;
  9197. /* DWORD 0 */
  9198. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9199. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9200. /* DWORD 1 */
  9201. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9202. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9203. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9204. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9205. /* DWORD 0 */
  9206. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9207. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9208. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9209. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9210. do { \
  9211. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9212. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9213. } while (0)
  9214. /* DWORD 1 */
  9215. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9216. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9217. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9218. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9219. do { \
  9220. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9221. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9222. } while (0)
  9223. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9224. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9225. HTT_TX_MAP_FLOW_INFO_TID_S)
  9226. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9227. do { \
  9228. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9229. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9230. } while (0)
  9231. /*
  9232. * htt_dbg_ext_stats_status -
  9233. * present - The requested stats have been delivered in full.
  9234. * This indicates that either the stats information was contained
  9235. * in its entirety within this message, or else this message
  9236. * completes the delivery of the requested stats info that was
  9237. * partially delivered through earlier STATS_CONF messages.
  9238. * partial - The requested stats have been delivered in part.
  9239. * One or more subsequent STATS_CONF messages with the same
  9240. * cookie value will be sent to deliver the remainder of the
  9241. * information.
  9242. * error - The requested stats could not be delivered, for example due
  9243. * to a shortage of memory to construct a message holding the
  9244. * requested stats.
  9245. * invalid - The requested stat type is either not recognized, or the
  9246. * target is configured to not gather the stats type in question.
  9247. */
  9248. enum htt_dbg_ext_stats_status {
  9249. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9250. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9251. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9252. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9253. };
  9254. /**
  9255. * @brief target -> host ppdu stats upload
  9256. *
  9257. * @details
  9258. * The following field definitions describe the format of the HTT target
  9259. * to host ppdu stats indication message.
  9260. *
  9261. *
  9262. * |31 16|15 12|11 10|9 8|7 0 |
  9263. * |----------------------------------------------------------------------|
  9264. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9265. * |----------------------------------------------------------------------|
  9266. * | ppdu_id |
  9267. * |----------------------------------------------------------------------|
  9268. * | Timestamp in us |
  9269. * |----------------------------------------------------------------------|
  9270. * | reserved |
  9271. * |----------------------------------------------------------------------|
  9272. * | type-specific stats info |
  9273. * | (see htt_ppdu_stats.h) |
  9274. * |----------------------------------------------------------------------|
  9275. * Header fields:
  9276. * - MSG_TYPE
  9277. * Bits 7:0
  9278. * Purpose: Identifies this is a PPDU STATS indication
  9279. * message.
  9280. * Value: 0x1d
  9281. * - mac_id
  9282. * Bits 9:8
  9283. * Purpose: mac_id of this ppdu_id
  9284. * Value: 0-3
  9285. * - pdev_id
  9286. * Bits 11:10
  9287. * Purpose: pdev_id of this ppdu_id
  9288. * Value: 0-3
  9289. * 0 (for rings at SOC level),
  9290. * 1/2/3 PDEV -> 0/1/2
  9291. * - payload_size
  9292. * Bits 31:16
  9293. * Purpose: total tlv size
  9294. * Value: payload_size in bytes
  9295. */
  9296. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9297. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9298. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9299. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9300. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9301. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9302. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9303. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9304. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9305. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9308. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9309. } while (0)
  9310. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9311. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9312. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9313. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9314. do { \
  9315. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9316. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9317. } while (0)
  9318. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9319. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9320. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9321. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9322. do { \
  9323. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9324. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9325. } while (0)
  9326. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9327. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9328. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9329. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9330. do { \
  9331. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9332. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9333. } while (0)
  9334. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9335. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9336. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9337. /**
  9338. * @brief target -> host extended statistics upload
  9339. *
  9340. * @details
  9341. * The following field definitions describe the format of the HTT target
  9342. * to host stats upload confirmation message.
  9343. * The message contains a cookie echoed from the HTT host->target stats
  9344. * upload request, which identifies which request the confirmation is
  9345. * for, and a single stats can span over multiple HTT stats indication
  9346. * due to the HTT message size limitation so every HTT ext stats indication
  9347. * will have tag-length-value stats information elements.
  9348. * The tag-length header for each HTT stats IND message also includes a
  9349. * status field, to indicate whether the request for the stat type in
  9350. * question was fully met, partially met, unable to be met, or invalid
  9351. * (if the stat type in question is disabled in the target).
  9352. * A Done bit 1's indicate the end of the of stats info elements.
  9353. *
  9354. *
  9355. * |31 16|15 12|11|10 8|7 5|4 0|
  9356. * |--------------------------------------------------------------|
  9357. * | reserved | msg type |
  9358. * |--------------------------------------------------------------|
  9359. * | cookie LSBs |
  9360. * |--------------------------------------------------------------|
  9361. * | cookie MSBs |
  9362. * |--------------------------------------------------------------|
  9363. * | stats entry length | rsvd | D| S | stat type |
  9364. * |--------------------------------------------------------------|
  9365. * | type-specific stats info |
  9366. * | (see htt_stats.h) |
  9367. * |--------------------------------------------------------------|
  9368. * Header fields:
  9369. * - MSG_TYPE
  9370. * Bits 7:0
  9371. * Purpose: Identifies this is a extended statistics upload confirmation
  9372. * message.
  9373. * Value: 0x1c
  9374. * - COOKIE_LSBS
  9375. * Bits 31:0
  9376. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9377. * message with its preceding host->target stats request message.
  9378. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9379. * - COOKIE_MSBS
  9380. * Bits 31:0
  9381. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9382. * message with its preceding host->target stats request message.
  9383. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9384. *
  9385. * Stats Information Element tag-length header fields:
  9386. * - STAT_TYPE
  9387. * Bits 7:0
  9388. * Purpose: identifies the type of statistics info held in the
  9389. * following information element
  9390. * Value: htt_dbg_ext_stats_type
  9391. * - STATUS
  9392. * Bits 10:8
  9393. * Purpose: indicate whether the requested stats are present
  9394. * Value: htt_dbg_ext_stats_status
  9395. * - DONE
  9396. * Bits 11
  9397. * Purpose:
  9398. * Indicates the completion of the stats entry, this will be the last
  9399. * stats conf HTT segment for the requested stats type.
  9400. * Value:
  9401. * 0 -> the stats retrieval is ongoing
  9402. * 1 -> the stats retrieval is complete
  9403. * - LENGTH
  9404. * Bits 31:16
  9405. * Purpose: indicate the stats information size
  9406. * Value: This field specifies the number of bytes of stats information
  9407. * that follows the element tag-length header.
  9408. * It is expected but not required that this length is a multiple of
  9409. * 4 bytes.
  9410. */
  9411. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9412. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9413. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9414. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9415. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9416. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9417. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9418. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9419. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9420. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9421. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9422. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9423. do { \
  9424. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9425. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9426. } while (0)
  9427. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9428. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9429. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9430. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9431. do { \
  9432. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9433. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9434. } while (0)
  9435. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9436. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9437. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9438. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9439. do { \
  9440. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9441. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9442. } while (0)
  9443. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9444. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9445. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9446. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9447. do { \
  9448. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9449. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9450. } while (0)
  9451. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9452. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9453. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9454. typedef enum {
  9455. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9456. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9457. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9458. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9459. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9460. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9461. /* Reserved from 128 - 255 for target internal use.*/
  9462. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9463. } HTT_PEER_TYPE;
  9464. /** 2 word representation of MAC addr */
  9465. typedef struct {
  9466. /** upper 4 bytes of MAC address */
  9467. A_UINT32 mac_addr31to0;
  9468. /** lower 2 bytes of MAC address */
  9469. A_UINT32 mac_addr47to32;
  9470. } htt_mac_addr;
  9471. /** macro to convert MAC address from char array to HTT word format */
  9472. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9473. (phtt_mac_addr)->mac_addr31to0 = \
  9474. (((c_macaddr)[0] << 0) | \
  9475. ((c_macaddr)[1] << 8) | \
  9476. ((c_macaddr)[2] << 16) | \
  9477. ((c_macaddr)[3] << 24)); \
  9478. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9479. } while (0)
  9480. /**
  9481. * @brief target -> host monitor mac header indication message
  9482. *
  9483. * @details
  9484. * The following diagram shows the format of the monitor mac header message
  9485. * sent from the target to the host.
  9486. * This message is primarily sent when promiscuous rx mode is enabled.
  9487. * One message is sent per rx PPDU.
  9488. *
  9489. * |31 24|23 16|15 8|7 0|
  9490. * |-------------------------------------------------------------|
  9491. * | peer_id | reserved0 | msg_type |
  9492. * |-------------------------------------------------------------|
  9493. * | reserved1 | num_mpdu |
  9494. * |-------------------------------------------------------------|
  9495. * | struct hw_rx_desc |
  9496. * | (see wal_rx_desc.h) |
  9497. * |-------------------------------------------------------------|
  9498. * | struct ieee80211_frame_addr4 |
  9499. * | (see ieee80211_defs.h) |
  9500. * |-------------------------------------------------------------|
  9501. * | struct ieee80211_frame_addr4 |
  9502. * | (see ieee80211_defs.h) |
  9503. * |-------------------------------------------------------------|
  9504. * | ...... |
  9505. * |-------------------------------------------------------------|
  9506. *
  9507. * Header fields:
  9508. * - msg_type
  9509. * Bits 7:0
  9510. * Purpose: Identifies this is a monitor mac header indication message.
  9511. * Value: 0x20
  9512. * - peer_id
  9513. * Bits 31:16
  9514. * Purpose: Software peer id given by host during association,
  9515. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9516. * for rx PPDUs received from unassociated peers.
  9517. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9518. * - num_mpdu
  9519. * Bits 15:0
  9520. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9521. * delivered within the message.
  9522. * Value: 1 to 32
  9523. * num_mpdu is limited to a maximum value of 32, due to buffer
  9524. * size limits. For PPDUs with more than 32 MPDUs, only the
  9525. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9526. * the PPDU will be provided.
  9527. */
  9528. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9529. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9530. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9531. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9532. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9533. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9534. do { \
  9535. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9536. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9537. } while (0)
  9538. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9539. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9540. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9541. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9542. do { \
  9543. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9544. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9545. } while (0)
  9546. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9547. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9548. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9549. /**
  9550. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9551. *
  9552. * @details
  9553. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9554. * the flow pool associated with the specified ID is resized
  9555. *
  9556. * The message would appear as follows:
  9557. *
  9558. * |31 16|15 8|7 0|
  9559. * |---------------------------------+----------------+----------------|
  9560. * | reserved0 | Msg type |
  9561. * |-------------------------------------------------------------------|
  9562. * | flow pool new size | flow pool ID |
  9563. * |-------------------------------------------------------------------|
  9564. *
  9565. * The message is interpreted as follows:
  9566. * b'0:7 - msg_type: This will be set to
  9567. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9568. *
  9569. * b'0:15 - flow pool ID: Existing flow pool ID
  9570. *
  9571. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9572. *
  9573. */
  9574. PREPACK struct htt_flow_pool_resize_t {
  9575. A_UINT32 msg_type:8,
  9576. reserved0:24;
  9577. A_UINT32 flow_pool_id:16,
  9578. flow_pool_new_size:16;
  9579. } POSTPACK;
  9580. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9581. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9582. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9583. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9584. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9585. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9586. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9587. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9588. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9589. do { \
  9590. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9591. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9592. } while (0)
  9593. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9594. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9595. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9596. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9599. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9600. } while (0)
  9601. /**
  9602. * @brief host -> target channel change message
  9603. *
  9604. * @details
  9605. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9606. * to associate RX frames to correct channel they were received on.
  9607. * The following field definitions describe the format of the HTT target
  9608. * to host channel change message.
  9609. * |31 16|15 8|7 5|4 0|
  9610. * |------------------------------------------------------------|
  9611. * | reserved | MSG_TYPE |
  9612. * |------------------------------------------------------------|
  9613. * | CHAN_MHZ |
  9614. * |------------------------------------------------------------|
  9615. * | BAND_CENTER_FREQ1 |
  9616. * |------------------------------------------------------------|
  9617. * | BAND_CENTER_FREQ2 |
  9618. * |------------------------------------------------------------|
  9619. * | CHAN_PHY_MODE |
  9620. * |------------------------------------------------------------|
  9621. * Header fields:
  9622. * - MSG_TYPE
  9623. * Bits 7:0
  9624. * Value: 0xf
  9625. * - CHAN_MHZ
  9626. * Bits 31:0
  9627. * Purpose: frequency of the primary 20mhz channel.
  9628. * - BAND_CENTER_FREQ1
  9629. * Bits 31:0
  9630. * Purpose: centre frequency of the full channel.
  9631. * - BAND_CENTER_FREQ2
  9632. * Bits 31:0
  9633. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9634. * - CHAN_PHY_MODE
  9635. * Bits 31:0
  9636. * Purpose: phy mode of the channel.
  9637. */
  9638. PREPACK struct htt_chan_change_msg {
  9639. A_UINT32 chan_mhz; /* frequency in mhz */
  9640. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9641. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9642. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9643. } POSTPACK;
  9644. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9645. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9646. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9647. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9648. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9649. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9650. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9651. /*
  9652. * The read and write indices point to the data within the host buffer.
  9653. * Because the first 4 bytes of the host buffer is used for the read index and
  9654. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9655. * The read index and write index are the byte offsets from the base of the
  9656. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9657. * Refer the ASCII text picture below.
  9658. */
  9659. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9660. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9661. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9662. /*
  9663. ***************************************************************************
  9664. *
  9665. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9666. *
  9667. ***************************************************************************
  9668. *
  9669. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9670. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9671. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9672. * written into the Host memory region mentioned below.
  9673. *
  9674. * Read index is updated by the Host. At any point of time, the read index will
  9675. * indicate the index that will next be read by the Host. The read index is
  9676. * in units of bytes offset from the base of the meta-data buffer.
  9677. *
  9678. * Write index is updated by the FW. At any point of time, the write index will
  9679. * indicate from where the FW can start writing any new data. The write index is
  9680. * in units of bytes offset from the base of the meta-data buffer.
  9681. *
  9682. * If the Host is not fast enough in reading the CFR data, any new capture data
  9683. * would be dropped if there is no space left to write the new captures.
  9684. *
  9685. * The last 4 bytes of the memory region will have the magic pattern
  9686. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9687. * not overrun the host buffer.
  9688. *
  9689. * ,--------------------. read and write indices store the
  9690. * | | byte offset from the base of the
  9691. * | ,--------+--------. meta-data buffer to the next
  9692. * | | | | location within the data buffer
  9693. * | | v v that will be read / written
  9694. * ************************************************************************
  9695. * * Read * Write * * Magic *
  9696. * * index * index * CFR data1 ...... CFR data N * pattern *
  9697. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9698. * ************************************************************************
  9699. * |<---------- data buffer ---------->|
  9700. *
  9701. * |<----------------- meta-data buffer allocated in Host ----------------|
  9702. *
  9703. * Note:
  9704. * - Considering the 4 bytes needed to store the Read index (R) and the
  9705. * Write index (W), the initial value is as follows:
  9706. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9707. * - Buffer empty condition:
  9708. * R = W
  9709. *
  9710. * Regarding CFR data format:
  9711. * --------------------------
  9712. *
  9713. * Each CFR tone is stored in HW as 16-bits with the following format:
  9714. * {bits[15:12], bits[11:6], bits[5:0]} =
  9715. * {unsigned exponent (4 bits),
  9716. * signed mantissa_real (6 bits),
  9717. * signed mantissa_imag (6 bits)}
  9718. *
  9719. * CFR_real = mantissa_real * 2^(exponent-5)
  9720. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9721. *
  9722. *
  9723. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9724. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9725. *
  9726. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9727. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9728. * .
  9729. * .
  9730. * .
  9731. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9732. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9733. */
  9734. /* Bandwidth of peer CFR captures */
  9735. typedef enum {
  9736. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9737. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9738. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9739. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9740. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9741. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9742. } HTT_PEER_CFR_CAPTURE_BW;
  9743. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9744. * was captured
  9745. */
  9746. typedef enum {
  9747. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9748. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9749. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9750. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9751. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9752. } HTT_PEER_CFR_CAPTURE_MODE;
  9753. typedef enum {
  9754. /* This message type is currently used for the below purpose:
  9755. *
  9756. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9757. * wmi_peer_cfr_capture_cmd.
  9758. * If payload_present bit is set to 0 then the associated memory region
  9759. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9760. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9761. * message; the CFR dump will be present at the end of the message,
  9762. * after the chan_phy_mode.
  9763. */
  9764. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9765. /* Always keep this last */
  9766. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9767. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9768. /**
  9769. * @brief target -> host CFR dump completion indication message definition
  9770. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9771. *
  9772. * @details
  9773. * The following diagram shows the format of the Channel Frequency Response
  9774. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9775. * the channel capture of a peer is copied by Firmware into the Host memory
  9776. *
  9777. * **************************************************************************
  9778. *
  9779. * Message format when the CFR capture message type is
  9780. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9781. *
  9782. * **************************************************************************
  9783. *
  9784. * |31 16|15 |8|7 0|
  9785. * |----------------------------------------------------------------|
  9786. * header: | reserved |P| msg_type |
  9787. * word 0 | | | |
  9788. * |----------------------------------------------------------------|
  9789. * payload: | cfr_capture_msg_type |
  9790. * word 1 | |
  9791. * |----------------------------------------------------------------|
  9792. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9793. * word 2 | | | | | | | | |
  9794. * |----------------------------------------------------------------|
  9795. * | mac_addr31to0 |
  9796. * word 3 | |
  9797. * |----------------------------------------------------------------|
  9798. * | unused / reserved | mac_addr47to32 |
  9799. * word 4 | | |
  9800. * |----------------------------------------------------------------|
  9801. * | index |
  9802. * word 5 | |
  9803. * |----------------------------------------------------------------|
  9804. * | length |
  9805. * word 6 | |
  9806. * |----------------------------------------------------------------|
  9807. * | timestamp |
  9808. * word 7 | |
  9809. * |----------------------------------------------------------------|
  9810. * | counter |
  9811. * word 8 | |
  9812. * |----------------------------------------------------------------|
  9813. * | chan_mhz |
  9814. * word 9 | |
  9815. * |----------------------------------------------------------------|
  9816. * | band_center_freq1 |
  9817. * word 10 | |
  9818. * |----------------------------------------------------------------|
  9819. * | band_center_freq2 |
  9820. * word 11 | |
  9821. * |----------------------------------------------------------------|
  9822. * | chan_phy_mode |
  9823. * word 12 | |
  9824. * |----------------------------------------------------------------|
  9825. * where,
  9826. * P - payload present bit (payload_present explained below)
  9827. * req_id - memory request id (mem_req_id explained below)
  9828. * S - status field (status explained below)
  9829. * capbw - capture bandwidth (capture_bw explained below)
  9830. * mode - mode of capture (mode explained below)
  9831. * sts - space time streams (sts_count explained below)
  9832. * chbw - channel bandwidth (channel_bw explained below)
  9833. * captype - capture type (cap_type explained below)
  9834. *
  9835. * The following field definitions describe the format of the CFR dump
  9836. * completion indication sent from the target to the host
  9837. *
  9838. * Header fields:
  9839. *
  9840. * Word 0
  9841. * - msg_type
  9842. * Bits 7:0
  9843. * Purpose: Identifies this as CFR TX completion indication
  9844. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  9845. * - payload_present
  9846. * Bit 8
  9847. * Purpose: Identifies how CFR data is sent to host
  9848. * Value: 0 - If CFR Payload is written to host memory
  9849. * 1 - If CFR Payload is sent as part of HTT message
  9850. * (This is the requirement for SDIO/USB where it is
  9851. * not possible to write CFR data to host memory)
  9852. * - reserved
  9853. * Bits 31:9
  9854. * Purpose: Reserved
  9855. * Value: 0
  9856. *
  9857. * Payload fields:
  9858. *
  9859. * Word 1
  9860. * - cfr_capture_msg_type
  9861. * Bits 31:0
  9862. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  9863. * to specify the format used for the remainder of the message
  9864. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  9865. * (currently only MSG_TYPE_1 is defined)
  9866. *
  9867. * Word 2
  9868. * - mem_req_id
  9869. * Bits 6:0
  9870. * Purpose: Contain the mem request id of the region where the CFR capture
  9871. * has been stored - of type WMI_HOST_MEM_REQ_ID
  9872. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  9873. this value is invalid)
  9874. * - status
  9875. * Bit 7
  9876. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  9877. * Value: 1 (True) - Successful; 0 (False) - Not successful
  9878. * - capture_bw
  9879. * Bits 10:8
  9880. * Purpose: Carry the bandwidth of the CFR capture
  9881. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  9882. * - mode
  9883. * Bits 13:11
  9884. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  9885. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  9886. * - sts_count
  9887. * Bits 16:14
  9888. * Purpose: Carry the number of space time streams
  9889. * Value: Number of space time streams
  9890. * - channel_bw
  9891. * Bits 19:17
  9892. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  9893. * measurement
  9894. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  9895. * - cap_type
  9896. * Bits 23:20
  9897. * Purpose: Carry the type of the capture
  9898. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  9899. * - vdev_id
  9900. * Bits 31:24
  9901. * Purpose: Carry the virtual device id
  9902. * Value: vdev ID
  9903. *
  9904. * Word 3
  9905. * - mac_addr31to0
  9906. * Bits 31:0
  9907. * Purpose: Contain the bits 31:0 of the peer MAC address
  9908. * Value: Bits 31:0 of the peer MAC address
  9909. *
  9910. * Word 4
  9911. * - mac_addr47to32
  9912. * Bits 15:0
  9913. * Purpose: Contain the bits 47:32 of the peer MAC address
  9914. * Value: Bits 47:32 of the peer MAC address
  9915. *
  9916. * Word 5
  9917. * - index
  9918. * Bits 31:0
  9919. * Purpose: Contain the index at which this CFR dump was written in the Host
  9920. * allocated memory. This index is the number of bytes from the base address.
  9921. * Value: Index position
  9922. *
  9923. * Word 6
  9924. * - length
  9925. * Bits 31:0
  9926. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  9927. * Value: Length of the CFR capture of the peer
  9928. *
  9929. * Word 7
  9930. * - timestamp
  9931. * Bits 31:0
  9932. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  9933. * clock used for this timestamp is private to the target and not visible to
  9934. * the host i.e., Host can interpret only the relative timestamp deltas from
  9935. * one message to the next, but can't interpret the absolute timestamp from a
  9936. * single message.
  9937. * Value: Timestamp in microseconds
  9938. *
  9939. * Word 8
  9940. * - counter
  9941. * Bits 31:0
  9942. * Purpose: Carry the count of the current CFR capture from FW. This is
  9943. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  9944. * in host memory)
  9945. * Value: Count of the current CFR capture
  9946. *
  9947. * Word 9
  9948. * - chan_mhz
  9949. * Bits 31:0
  9950. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  9951. * Value: Primary 20 channel frequency
  9952. *
  9953. * Word 10
  9954. * - band_center_freq1
  9955. * Bits 31:0
  9956. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  9957. * Value: Center frequency 1 in MHz
  9958. *
  9959. * Word 11
  9960. * - band_center_freq2
  9961. * Bits 31:0
  9962. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  9963. * the VDEV
  9964. * 80plus80 mode
  9965. * Value: Center frequency 2 in MHz
  9966. *
  9967. * Word 12
  9968. * - chan_phy_mode
  9969. * Bits 31:0
  9970. * Purpose: Carry the phy mode of the channel, of the VDEV
  9971. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  9972. */
  9973. PREPACK struct htt_cfr_dump_ind_type_1 {
  9974. A_UINT32 mem_req_id:7,
  9975. status:1,
  9976. capture_bw:3,
  9977. mode:3,
  9978. sts_count:3,
  9979. channel_bw:3,
  9980. cap_type:4,
  9981. vdev_id:8;
  9982. htt_mac_addr addr;
  9983. A_UINT32 index;
  9984. A_UINT32 length;
  9985. A_UINT32 timestamp;
  9986. A_UINT32 counter;
  9987. struct htt_chan_change_msg chan;
  9988. } POSTPACK;
  9989. PREPACK struct htt_cfr_dump_compl_ind {
  9990. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  9991. union {
  9992. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  9993. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  9994. /* If there is a need to change the memory layout and its associated
  9995. * HTT indication format, a new CFR capture message type can be
  9996. * introduced and added into this union.
  9997. */
  9998. };
  9999. } POSTPACK;
  10000. /*
  10001. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10002. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10003. */
  10004. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10005. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10006. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10009. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10010. } while(0)
  10011. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10012. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10013. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10014. /*
  10015. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10016. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10017. */
  10018. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10019. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10020. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10021. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10022. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10023. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10024. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10025. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10026. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10027. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10028. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10029. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10030. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10031. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10032. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10033. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10034. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10035. do { \
  10036. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10037. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10038. } while (0)
  10039. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10040. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10041. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10042. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10045. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10046. } while (0)
  10047. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10048. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10049. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10050. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10053. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10054. } while (0)
  10055. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10056. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10057. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10058. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10059. do { \
  10060. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10061. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10062. } while (0)
  10063. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10064. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10065. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10066. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10067. do { \
  10068. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10069. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10070. } while (0)
  10071. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10072. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10073. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10074. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10077. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10078. } while (0)
  10079. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10080. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10081. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10082. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10083. do { \
  10084. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10085. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10086. } while (0)
  10087. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10088. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10089. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10090. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10091. do { \
  10092. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10093. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10094. } while (0)
  10095. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10096. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10097. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10098. #endif