htt.h 479 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592
  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. */
  167. #define HTT_CURRENT_VERSION_MAJOR 3
  168. #define HTT_CURRENT_VERSION_MINOR 55
  169. #define HTT_NUM_TX_FRAG_DESC 1024
  170. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  171. #define HTT_CHECK_SET_VAL(field, val) \
  172. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  173. /* macros to assist in sign-extending fields from HTT messages */
  174. #define HTT_SIGN_BIT_MASK(field) \
  175. ((field ## _M + (1 << field ## _S)) >> 1)
  176. #define HTT_SIGN_BIT(_val, field) \
  177. (_val & HTT_SIGN_BIT_MASK(field))
  178. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  179. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  180. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  181. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  182. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  183. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  184. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  185. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  186. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  187. /*
  188. * TEMPORARY:
  189. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  190. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  191. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  192. * updated.
  193. */
  194. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  195. /*
  196. * TEMPORARY:
  197. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  198. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  199. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  200. * updated.
  201. */
  202. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  203. /* HTT Access Category values */
  204. enum HTT_AC_WMM {
  205. /* WMM Access Categories */
  206. HTT_AC_WMM_BE = 0x0,
  207. HTT_AC_WMM_BK = 0x1,
  208. HTT_AC_WMM_VI = 0x2,
  209. HTT_AC_WMM_VO = 0x3,
  210. /* extension Access Categories */
  211. HTT_AC_EXT_NON_QOS = 0x4,
  212. HTT_AC_EXT_UCAST_MGMT = 0x5,
  213. HTT_AC_EXT_MCAST_DATA = 0x6,
  214. HTT_AC_EXT_MCAST_MGMT = 0x7,
  215. };
  216. enum HTT_AC_WMM_MASK {
  217. /* WMM Access Categories */
  218. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  219. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  220. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  221. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  222. /* extension Access Categories */
  223. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  224. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  225. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  226. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  227. };
  228. #define HTT_AC_MASK_WMM \
  229. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  230. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  231. #define HTT_AC_MASK_EXT \
  232. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  233. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  234. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  235. /*
  236. * htt_dbg_stats_type -
  237. * bit positions for each stats type within a stats type bitmask
  238. * The bitmask contains 24 bits.
  239. */
  240. enum htt_dbg_stats_type {
  241. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  242. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  243. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  244. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  245. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  246. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  247. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  248. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  249. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  250. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  251. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  252. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  253. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  254. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  255. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  256. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  257. /* bits 16-23 currently reserved */
  258. /* keep this last */
  259. HTT_DBG_NUM_STATS
  260. };
  261. /*=== HTT option selection TLVs ===
  262. * Certain HTT messages have alternatives or options.
  263. * For such cases, the host and target need to agree on which option to use.
  264. * Option specification TLVs can be appended to the VERSION_REQ and
  265. * VERSION_CONF messages to select options other than the default.
  266. * These TLVs are entirely optional - if they are not provided, there is a
  267. * well-defined default for each option. If they are provided, they can be
  268. * provided in any order. Each TLV can be present or absent independent of
  269. * the presence / absence of other TLVs.
  270. *
  271. * The HTT option selection TLVs use the following format:
  272. * |31 16|15 8|7 0|
  273. * |---------------------------------+----------------+----------------|
  274. * | value (payload) | length | tag |
  275. * |-------------------------------------------------------------------|
  276. * The value portion need not be only 2 bytes; it can be extended by any
  277. * integer number of 4-byte units. The total length of the TLV, including
  278. * the tag and length fields, must be a multiple of 4 bytes. The length
  279. * field specifies the total TLV size in 4-byte units. Thus, the typical
  280. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  281. * field, would store 0x1 in its length field, to show that the TLV occupies
  282. * a single 4-byte unit.
  283. */
  284. /*--- TLV header format - applies to all HTT option TLVs ---*/
  285. enum HTT_OPTION_TLV_TAGS {
  286. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  287. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  288. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  289. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  290. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  291. };
  292. PREPACK struct htt_option_tlv_header_t {
  293. A_UINT8 tag;
  294. A_UINT8 length;
  295. } POSTPACK;
  296. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  297. #define HTT_OPTION_TLV_TAG_S 0
  298. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  299. #define HTT_OPTION_TLV_LENGTH_S 8
  300. /*
  301. * value0 - 16 bit value field stored in word0
  302. * The TLV's value field may be longer than 2 bytes, in which case
  303. * the remainder of the value is stored in word1, word2, etc.
  304. */
  305. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  306. #define HTT_OPTION_TLV_VALUE0_S 16
  307. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  308. do { \
  309. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  310. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  311. } while (0)
  312. #define HTT_OPTION_TLV_TAG_GET(word) \
  313. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  314. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  315. do { \
  316. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  317. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  318. } while (0)
  319. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  320. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  321. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  322. do { \
  323. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  324. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  325. } while (0)
  326. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  327. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  328. /*--- format of specific HTT option TLVs ---*/
  329. /*
  330. * HTT option TLV for specifying LL bus address size
  331. * Some chips require bus addresses used by the target to access buffers
  332. * within the host's memory to be 32 bits; others require bus addresses
  333. * used by the target to access buffers within the host's memory to be
  334. * 64 bits.
  335. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  336. * a suffix to the VERSION_CONF message to specify which bus address format
  337. * the target requires.
  338. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  339. * default to providing bus addresses to the target in 32-bit format.
  340. */
  341. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  342. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  343. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  344. };
  345. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  346. struct htt_option_tlv_header_t hdr;
  347. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  348. } POSTPACK;
  349. /*
  350. * HTT option TLV for specifying whether HL systems should indicate
  351. * over-the-air tx completion for individual frames, or should instead
  352. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  353. * requests an OTA tx completion for a particular tx frame.
  354. * This option does not apply to LL systems, where the TX_COMPL_IND
  355. * is mandatory.
  356. * This option is primarily intended for HL systems in which the tx frame
  357. * downloads over the host --> target bus are as slow as or slower than
  358. * the transmissions over the WLAN PHY. For cases where the bus is faster
  359. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  360. * and consquently will send one TX_COMPL_IND message that covers several
  361. * tx frames. For cases where the WLAN PHY is faster than the bus,
  362. * the target will end up transmitting very short A-MPDUs, and consequently
  363. * sending many TX_COMPL_IND messages, which each cover a very small number
  364. * of tx frames.
  365. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  366. * a suffix to the VERSION_REQ message to request whether the host desires to
  367. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  368. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  369. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  370. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  371. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  372. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  373. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  374. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  375. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  376. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  377. * TLV.
  378. */
  379. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  380. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  381. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  382. };
  383. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  384. struct htt_option_tlv_header_t hdr;
  385. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  386. } POSTPACK;
  387. /*
  388. * HTT option TLV for specifying how many tx queue groups the target
  389. * may establish.
  390. * This TLV specifies the maximum value the target may send in the
  391. * txq_group_id field of any TXQ_GROUP information elements sent by
  392. * the target to the host. This allows the host to pre-allocate an
  393. * appropriate number of tx queue group structs.
  394. *
  395. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  396. * a suffix to the VERSION_REQ message to specify whether the host supports
  397. * tx queue groups at all, and if so if there is any limit on the number of
  398. * tx queue groups that the host supports.
  399. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  400. * a suffix to the VERSION_CONF message. If the host has specified in the
  401. * VER_REQ message a limit on the number of tx queue groups the host can
  402. * supprt, the target shall limit its specification of the maximum tx groups
  403. * to be no larger than this host-specified limit.
  404. *
  405. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  406. * shall preallocate 4 tx queue group structs, and the target shall not
  407. * specify a txq_group_id larger than 3.
  408. */
  409. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  410. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  411. /*
  412. * values 1 through N specify the max number of tx queue groups
  413. * the sender supports
  414. */
  415. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  416. };
  417. /* TEMPORARY backwards-compatibility alias for a typo fix -
  418. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  419. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  420. * to support the old name (with the typo) until all references to the
  421. * old name are replaced with the new name.
  422. */
  423. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  424. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  425. struct htt_option_tlv_header_t hdr;
  426. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  427. } POSTPACK;
  428. /*
  429. * HTT option TLV for specifying whether the target supports an extended
  430. * version of the HTT tx descriptor. If the target provides this TLV
  431. * and specifies in the TLV that the target supports an extended version
  432. * of the HTT tx descriptor, the target must check the "extension" bit in
  433. * the HTT tx descriptor, and if the extension bit is set, to expect a
  434. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  435. * descriptor. Furthermore, the target must provide room for the HTT
  436. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  437. * This option is intended for systems where the host needs to explicitly
  438. * control the transmission parameters such as tx power for individual
  439. * tx frames.
  440. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  441. * as a suffix to the VERSION_CONF message to explicitly specify whether
  442. * the target supports the HTT tx MSDU extension descriptor.
  443. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  444. * by the host as lack of target support for the HTT tx MSDU extension
  445. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  446. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  447. * the HTT tx MSDU extension descriptor.
  448. * The host is not required to provide the HTT tx MSDU extension descriptor
  449. * just because the target supports it; the target must check the
  450. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  451. * extension descriptor is present.
  452. */
  453. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  454. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  455. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  456. };
  457. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  458. struct htt_option_tlv_header_t hdr;
  459. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  460. } POSTPACK;
  461. /*=== host -> target messages ===============================================*/
  462. enum htt_h2t_msg_type {
  463. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  464. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  465. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  466. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  467. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  468. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  469. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  470. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  471. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  472. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  473. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  474. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  475. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  476. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  477. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  478. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  479. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  480. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  481. /* keep this last */
  482. HTT_H2T_NUM_MSGS
  483. };
  484. /*
  485. * HTT host to target message type -
  486. * stored in bits 7:0 of the first word of the message
  487. */
  488. #define HTT_H2T_MSG_TYPE_M 0xff
  489. #define HTT_H2T_MSG_TYPE_S 0
  490. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  491. do { \
  492. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  493. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  494. } while (0)
  495. #define HTT_H2T_MSG_TYPE_GET(word) \
  496. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  497. /**
  498. * @brief host -> target version number request message definition
  499. *
  500. * |31 24|23 16|15 8|7 0|
  501. * |----------------+----------------+----------------+----------------|
  502. * | reserved | msg type |
  503. * |-------------------------------------------------------------------|
  504. * : option request TLV (optional) |
  505. * :...................................................................:
  506. *
  507. * The VER_REQ message may consist of a single 4-byte word, or may be
  508. * extended with TLVs that specify which HTT options the host is requesting
  509. * from the target.
  510. * The following option TLVs may be appended to the VER_REQ message:
  511. * - HL_SUPPRESS_TX_COMPL_IND
  512. * - HL_MAX_TX_QUEUE_GROUPS
  513. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  514. * may be appended to the VER_REQ message (but only one TLV of each type).
  515. *
  516. * Header fields:
  517. * - MSG_TYPE
  518. * Bits 7:0
  519. * Purpose: identifies this as a version number request message
  520. * Value: 0x0
  521. */
  522. #define HTT_VER_REQ_BYTES 4
  523. /* TBDXXX: figure out a reasonable number */
  524. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  525. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  526. /**
  527. * @brief HTT tx MSDU descriptor
  528. *
  529. * @details
  530. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  531. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  532. * the target firmware needs for the FW's tx processing, particularly
  533. * for creating the HW msdu descriptor.
  534. * The same HTT tx descriptor is used for HL and LL systems, though
  535. * a few fields within the tx descriptor are used only by LL or
  536. * only by HL.
  537. * The HTT tx descriptor is defined in two manners: by a struct with
  538. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  539. * definitions.
  540. * The target should use the struct def, for simplicitly and clarity,
  541. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  542. * neutral. Specifically, the host shall use the get/set macros built
  543. * around the mask + shift defs.
  544. */
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  551. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  552. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  553. #define HTT_TX_VDEV_ID_WORD 0
  554. #define HTT_TX_VDEV_ID_MASK 0x3f
  555. #define HTT_TX_VDEV_ID_SHIFT 16
  556. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  557. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  558. #define HTT_TX_MSDU_LEN_DWORD 1
  559. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  560. /*
  561. * HTT_VAR_PADDR macros
  562. * Allow physical / bus addresses to be either a single 32-bit value,
  563. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  564. */
  565. #define HTT_VAR_PADDR32(var_name) \
  566. A_UINT32 var_name
  567. #define HTT_VAR_PADDR64_LE(var_name) \
  568. struct { \
  569. /* little-endian: lo precedes hi */ \
  570. A_UINT32 lo; \
  571. A_UINT32 hi; \
  572. } var_name
  573. /*
  574. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  575. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  576. * addresses are stored in a XXX-bit field.
  577. * This macro is used to define both htt_tx_msdu_desc32_t and
  578. * htt_tx_msdu_desc64_t structs.
  579. */
  580. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  581. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  582. { \
  583. /* DWORD 0: flags and meta-data */ \
  584. A_UINT32 \
  585. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  586. \
  587. /* pkt_subtype - \
  588. * Detailed specification of the tx frame contents, extending the \
  589. * general specification provided by pkt_type. \
  590. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  591. * pkt_type | pkt_subtype \
  592. * ============================================================== \
  593. * 802.3 | bit 0:3 - Reserved \
  594. * | bit 4: 0x0 - Copy-Engine Classification Results \
  595. * | not appended to the HTT message \
  596. * | 0x1 - Copy-Engine Classification Results \
  597. * | appended to the HTT message in the \
  598. * | format: \
  599. * | [HTT tx desc, frame header, \
  600. * | CE classification results] \
  601. * | The CE classification results begin \
  602. * | at the next 4-byte boundary after \
  603. * | the frame header. \
  604. * ------------+------------------------------------------------- \
  605. * Eth2 | bit 0:3 - Reserved \
  606. * | bit 4: 0x0 - Copy-Engine Classification Results \
  607. * | not appended to the HTT message \
  608. * | 0x1 - Copy-Engine Classification Results \
  609. * | appended to the HTT message. \
  610. * | See the above specification of the \
  611. * | CE classification results location. \
  612. * ------------+------------------------------------------------- \
  613. * native WiFi | bit 0:3 - Reserved \
  614. * | bit 4: 0x0 - Copy-Engine Classification Results \
  615. * | not appended to the HTT message \
  616. * | 0x1 - Copy-Engine Classification Results \
  617. * | appended to the HTT message. \
  618. * | See the above specification of the \
  619. * | CE classification results location. \
  620. * ------------+------------------------------------------------- \
  621. * mgmt | 0x0 - 802.11 MAC header absent \
  622. * | 0x1 - 802.11 MAC header present \
  623. * ------------+------------------------------------------------- \
  624. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  625. * | 0x1 - 802.11 MAC header present \
  626. * | bit 1: 0x0 - allow aggregation \
  627. * | 0x1 - don't allow aggregation \
  628. * | bit 2: 0x0 - perform encryption \
  629. * | 0x1 - don't perform encryption \
  630. * | bit 3: 0x0 - perform tx classification / queuing \
  631. * | 0x1 - don't perform tx classification; \
  632. * | insert the frame into the "misc" \
  633. * | tx queue \
  634. * | bit 4: 0x0 - Copy-Engine Classification Results \
  635. * | not appended to the HTT message \
  636. * | 0x1 - Copy-Engine Classification Results \
  637. * | appended to the HTT message. \
  638. * | See the above specification of the \
  639. * | CE classification results location. \
  640. */ \
  641. pkt_subtype: 5, \
  642. \
  643. /* pkt_type - \
  644. * General specification of the tx frame contents. \
  645. * The htt_pkt_type enum should be used to specify and check the \
  646. * value of this field. \
  647. */ \
  648. pkt_type: 3, \
  649. \
  650. /* vdev_id - \
  651. * ID for the vdev that is sending this tx frame. \
  652. * For certain non-standard packet types, e.g. pkt_type == raw \
  653. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  654. * This field is used primarily for determining where to queue \
  655. * broadcast and multicast frames. \
  656. */ \
  657. vdev_id: 6, \
  658. /* ext_tid - \
  659. * The extended traffic ID. \
  660. * If the TID is unknown, the extended TID is set to \
  661. * HTT_TX_EXT_TID_INVALID. \
  662. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  663. * value of the QoS TID. \
  664. * If the tx frame is non-QoS data, then the extended TID is set to \
  665. * HTT_TX_EXT_TID_NON_QOS. \
  666. * If the tx frame is multicast or broadcast, then the extended TID \
  667. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  668. */ \
  669. ext_tid: 5, \
  670. \
  671. /* postponed - \
  672. * This flag indicates whether the tx frame has been downloaded to \
  673. * the target before but discarded by the target, and now is being \
  674. * downloaded again; or if this is a new frame that is being \
  675. * downloaded for the first time. \
  676. * This flag allows the target to determine the correct order for \
  677. * transmitting new vs. old frames. \
  678. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  679. * This flag only applies to HL systems, since in LL systems, \
  680. * the tx flow control is handled entirely within the target. \
  681. */ \
  682. postponed: 1, \
  683. \
  684. /* extension - \
  685. * This flag indicates whether a HTT tx MSDU extension descriptor \
  686. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  687. * \
  688. * 0x0 - no extension MSDU descriptor is present \
  689. * 0x1 - an extension MSDU descriptor immediately follows the \
  690. * regular MSDU descriptor \
  691. */ \
  692. extension: 1, \
  693. \
  694. /* cksum_offload - \
  695. * This flag indicates whether checksum offload is enabled or not \
  696. * for this frame. Target FW use this flag to turn on HW checksumming \
  697. * 0x0 - No checksum offload \
  698. * 0x1 - L3 header checksum only \
  699. * 0x2 - L4 checksum only \
  700. * 0x3 - L3 header checksum + L4 checksum \
  701. */ \
  702. cksum_offload: 2, \
  703. \
  704. /* tx_comp_req - \
  705. * This flag indicates whether Tx Completion \
  706. * from fw is required or not. \
  707. * This flag is only relevant if tx completion is not \
  708. * universally enabled. \
  709. * For all LL systems, tx completion is mandatory, \
  710. * so this flag will be irrelevant. \
  711. * For HL systems tx completion is optional, but HL systems in which \
  712. * the bus throughput exceeds the WLAN throughput will \
  713. * probably want to always use tx completion, and thus \
  714. * would not check this flag. \
  715. * This flag is required when tx completions are not used universally, \
  716. * but are still required for certain tx frames for which \
  717. * an OTA delivery acknowledgment is needed by the host. \
  718. * In practice, this would be for HL systems in which the \
  719. * bus throughput is less than the WLAN throughput. \
  720. * \
  721. * 0x0 - Tx Completion Indication from Fw not required \
  722. * 0x1 - Tx Completion Indication from Fw is required \
  723. */ \
  724. tx_compl_req: 1; \
  725. \
  726. \
  727. /* DWORD 1: MSDU length and ID */ \
  728. A_UINT32 \
  729. len: 16, /* MSDU length, in bytes */ \
  730. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  731. * and this id is used to calculate fragmentation \
  732. * descriptor pointer inside the target based on \
  733. * the base address, configured inside the target. \
  734. */ \
  735. \
  736. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  737. /* frags_desc_ptr - \
  738. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  739. * where the tx frame's fragments reside in memory. \
  740. * This field only applies to LL systems, since in HL systems the \
  741. * (degenerate single-fragment) fragmentation descriptor is created \
  742. * within the target. \
  743. */ \
  744. _paddr__frags_desc_ptr_; \
  745. \
  746. /* DWORD 3 (or 4): peerid, chanfreq */ \
  747. /* \
  748. * Peer ID : Target can use this value to know which peer-id packet \
  749. * destined to. \
  750. * It's intended to be specified by host in case of NAWDS. \
  751. */ \
  752. A_UINT16 peerid; \
  753. \
  754. /* \
  755. * Channel frequency: This identifies the desired channel \
  756. * frequency (in mhz) for tx frames. This is used by FW to help \
  757. * determine when it is safe to transmit or drop frames for \
  758. * off-channel operation. \
  759. * The default value of zero indicates to FW that the corresponding \
  760. * VDEV's home channel (if there is one) is the desired channel \
  761. * frequency. \
  762. */ \
  763. A_UINT16 chanfreq; \
  764. \
  765. /* Reason reserved is commented is increasing the htt structure size \
  766. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  767. * A_UINT32 reserved_dword3_bits0_31; \
  768. */ \
  769. } POSTPACK
  770. /* define a htt_tx_msdu_desc32_t type */
  771. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  772. /* define a htt_tx_msdu_desc64_t type */
  773. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  774. /*
  775. * Make htt_tx_msdu_desc_t be an alias for either
  776. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  777. */
  778. #if HTT_PADDR64
  779. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  780. #else
  781. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  782. #endif
  783. /* decriptor information for Management frame*/
  784. /*
  785. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  786. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  787. */
  788. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  789. extern A_UINT32 mgmt_hdr_len;
  790. PREPACK struct htt_mgmt_tx_desc_t {
  791. A_UINT32 msg_type;
  792. #if HTT_PADDR64
  793. A_UINT64 frag_paddr; /* DMAble address of the data */
  794. #else
  795. A_UINT32 frag_paddr; /* DMAble address of the data */
  796. #endif
  797. A_UINT32 desc_id; /* returned to host during completion
  798. * to free the meory*/
  799. A_UINT32 len; /* Fragment length */
  800. A_UINT32 vdev_id; /* virtual device ID*/
  801. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  802. } POSTPACK;
  803. PREPACK struct htt_mgmt_tx_compl_ind {
  804. A_UINT32 desc_id;
  805. A_UINT32 status;
  806. } POSTPACK;
  807. /*
  808. * This SDU header size comes from the summation of the following:
  809. * 1. Max of:
  810. * a. Native WiFi header, for native WiFi frames: 24 bytes
  811. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  812. * b. 802.11 header, for raw frames: 36 bytes
  813. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  814. * QoS header, HT header)
  815. * c. 802.3 header, for ethernet frames: 14 bytes
  816. * (destination address, source address, ethertype / length)
  817. * 2. Max of:
  818. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  819. * b. IPv6 header, up through the Traffic Class: 2 bytes
  820. * 3. 802.1Q VLAN header: 4 bytes
  821. * 4. LLC/SNAP header: 8 bytes
  822. */
  823. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  824. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  825. #define HTT_TX_HDR_SIZE_ETHERNET 14
  826. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  827. A_COMPILE_TIME_ASSERT(
  828. htt_encap_hdr_size_max_check_nwifi,
  829. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  830. A_COMPILE_TIME_ASSERT(
  831. htt_encap_hdr_size_max_check_enet,
  832. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  833. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  834. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  835. #define HTT_TX_HDR_SIZE_802_1Q 4
  836. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  837. #define HTT_COMMON_TX_FRM_HDR_LEN \
  838. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  839. HTT_TX_HDR_SIZE_802_1Q + \
  840. HTT_TX_HDR_SIZE_LLC_SNAP)
  841. #define HTT_HL_TX_FRM_HDR_LEN \
  842. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  843. #define HTT_LL_TX_FRM_HDR_LEN \
  844. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  845. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  846. /* dword 0 */
  847. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  848. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  849. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  850. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  851. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  852. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  853. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  854. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  855. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  858. #define HTT_TX_DESC_PKT_TYPE_S 13
  859. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  862. #define HTT_TX_DESC_VDEV_ID_S 16
  863. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  866. #define HTT_TX_DESC_EXT_TID_S 22
  867. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  868. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  870. #define HTT_TX_DESC_POSTPONED_S 27
  871. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  872. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  874. #define HTT_TX_DESC_EXTENSION_S 28
  875. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  876. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  878. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  879. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  880. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  881. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  882. #define HTT_TX_DESC_TX_COMP_S 31
  883. /* dword 1 */
  884. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  885. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  886. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  887. #define HTT_TX_DESC_FRM_LEN_S 0
  888. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  889. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  890. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  891. #define HTT_TX_DESC_FRM_ID_S 16
  892. /* dword 2 */
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  895. /* for systems using 64-bit format for bus addresses */
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  900. /* for systems using 32-bit format for bus addresses */
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  903. /* dword 3 */
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  907. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  909. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  910. #if HTT_PADDR64
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  913. #else
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  915. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  916. #endif
  917. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  918. #define HTT_TX_DESC_PEER_ID_S 0
  919. /*
  920. * TEMPORARY:
  921. * The original definitions for the PEER_ID fields contained typos
  922. * (with _DESC_PADDR appended to this PEER_ID field name).
  923. * Retain deprecated original names for PEER_ID fields until all code that
  924. * refers to them has been updated.
  925. */
  926. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  927. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  928. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  929. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  930. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  931. HTT_TX_DESC_PEER_ID_M
  932. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  933. HTT_TX_DESC_PEER_ID_S
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  937. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  939. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  940. #if HTT_PADDR64
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  943. #else
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  945. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  946. #endif
  947. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  948. #define HTT_TX_DESC_CHAN_FREQ_S 16
  949. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  950. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  951. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  952. do { \
  953. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  954. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  955. } while (0)
  956. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  957. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  958. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  961. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  962. } while (0)
  963. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  964. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  965. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  966. do { \
  967. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  968. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  969. } while (0)
  970. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  971. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  972. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  973. do { \
  974. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  975. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  976. } while (0)
  977. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  978. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  979. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  980. do { \
  981. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  982. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  983. } while (0)
  984. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  985. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  986. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  987. do { \
  988. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  989. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  990. } while (0)
  991. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  992. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  993. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  999. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1000. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1007. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1014. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1021. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1028. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1035. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1039. } while (0)
  1040. /* enums used in the HTT tx MSDU extension descriptor */
  1041. enum {
  1042. htt_tx_guard_interval_regular = 0,
  1043. htt_tx_guard_interval_short = 1,
  1044. };
  1045. enum {
  1046. htt_tx_preamble_type_ofdm = 0,
  1047. htt_tx_preamble_type_cck = 1,
  1048. htt_tx_preamble_type_ht = 2,
  1049. htt_tx_preamble_type_vht = 3,
  1050. };
  1051. enum {
  1052. htt_tx_bandwidth_5MHz = 0,
  1053. htt_tx_bandwidth_10MHz = 1,
  1054. htt_tx_bandwidth_20MHz = 2,
  1055. htt_tx_bandwidth_40MHz = 3,
  1056. htt_tx_bandwidth_80MHz = 4,
  1057. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1058. };
  1059. /**
  1060. * @brief HTT tx MSDU extension descriptor
  1061. * @details
  1062. * If the target supports HTT tx MSDU extension descriptors, the host has
  1063. * the option of appending the following struct following the regular
  1064. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1065. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1066. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1067. * tx specs for each frame.
  1068. */
  1069. PREPACK struct htt_tx_msdu_desc_ext_t {
  1070. /* DWORD 0: flags */
  1071. A_UINT32
  1072. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1073. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1074. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1075. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1076. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1077. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1078. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1079. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1080. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1081. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1082. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1083. /* DWORD 1: tx power, tx rate, tx BW */
  1084. A_UINT32
  1085. /* pwr -
  1086. * Specify what power the tx frame needs to be transmitted at.
  1087. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1088. * The value needs to be appropriately sign-extended when extracting
  1089. * the value from the message and storing it in a variable that is
  1090. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1091. * automatically handles this sign-extension.)
  1092. * If the transmission uses multiple tx chains, this power spec is
  1093. * the total transmit power, assuming incoherent combination of
  1094. * per-chain power to produce the total power.
  1095. */
  1096. pwr: 8,
  1097. /* mcs_mask -
  1098. * Specify the allowable values for MCS index (modulation and coding)
  1099. * to use for transmitting the frame.
  1100. *
  1101. * For HT / VHT preamble types, this mask directly corresponds to
  1102. * the HT or VHT MCS indices that are allowed. For each bit N set
  1103. * within the mask, MCS index N is allowed for transmitting the frame.
  1104. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1105. * rates versus OFDM rates, so the host has the option of specifying
  1106. * that the target must transmit the frame with CCK or OFDM rates
  1107. * (not HT or VHT), but leaving the decision to the target whether
  1108. * to use CCK or OFDM.
  1109. *
  1110. * For CCK and OFDM, the bits within this mask are interpreted as
  1111. * follows:
  1112. * bit 0 -> CCK 1 Mbps rate is allowed
  1113. * bit 1 -> CCK 2 Mbps rate is allowed
  1114. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1115. * bit 3 -> CCK 11 Mbps rate is allowed
  1116. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1117. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1118. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1119. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1120. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1121. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1122. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1123. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1124. *
  1125. * The MCS index specification needs to be compatible with the
  1126. * bandwidth mask specification. For example, a MCS index == 9
  1127. * specification is inconsistent with a preamble type == VHT,
  1128. * Nss == 1, and channel bandwidth == 20 MHz.
  1129. *
  1130. * Furthermore, the host has only a limited ability to specify to
  1131. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1132. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1133. */
  1134. mcs_mask: 12,
  1135. /* nss_mask -
  1136. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1137. * Each bit in this mask corresponds to a Nss value:
  1138. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1139. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1140. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1141. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1142. * The values in the Nss mask must be suitable for the recipient, e.g.
  1143. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1144. * recipient which only supports 2x2 MIMO.
  1145. */
  1146. nss_mask: 4,
  1147. /* guard_interval -
  1148. * Specify a htt_tx_guard_interval enum value to indicate whether
  1149. * the transmission should use a regular guard interval or a
  1150. * short guard interval.
  1151. */
  1152. guard_interval: 1,
  1153. /* preamble_type_mask -
  1154. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1155. * may choose from for transmitting this frame.
  1156. * The bits in this mask correspond to the values in the
  1157. * htt_tx_preamble_type enum. For example, to allow the target
  1158. * to transmit the frame as either CCK or OFDM, this field would
  1159. * be set to
  1160. * (1 << htt_tx_preamble_type_ofdm) |
  1161. * (1 << htt_tx_preamble_type_cck)
  1162. */
  1163. preamble_type_mask: 4,
  1164. reserved1_31_29: 3; /* unused, set to 0x0 */
  1165. /* DWORD 2: tx chain mask, tx retries */
  1166. A_UINT32
  1167. /* chain_mask - specify which chains to transmit from */
  1168. chain_mask: 4,
  1169. /* retry_limit -
  1170. * Specify the maximum number of transmissions, including the
  1171. * initial transmission, to attempt before giving up if no ack
  1172. * is received.
  1173. * If the tx rate is specified, then all retries shall use the
  1174. * same rate as the initial transmission.
  1175. * If no tx rate is specified, the target can choose whether to
  1176. * retain the original rate during the retransmissions, or to
  1177. * fall back to a more robust rate.
  1178. */
  1179. retry_limit: 4,
  1180. /* bandwidth_mask -
  1181. * Specify what channel widths may be used for the transmission.
  1182. * A value of zero indicates "don't care" - the target may choose
  1183. * the transmission bandwidth.
  1184. * The bits within this mask correspond to the htt_tx_bandwidth
  1185. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1186. * The bandwidth_mask must be consistent with the preamble_type_mask
  1187. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1188. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1189. */
  1190. bandwidth_mask: 6,
  1191. reserved2_31_14: 18; /* unused, set to 0x0 */
  1192. /* DWORD 3: tx expiry time (TSF) LSBs */
  1193. A_UINT32 expire_tsf_lo;
  1194. /* DWORD 4: tx expiry time (TSF) MSBs */
  1195. A_UINT32 expire_tsf_hi;
  1196. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1197. } POSTPACK;
  1198. /* DWORD 0 */
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1219. /* DWORD 1 */
  1220. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1221. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1222. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1223. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1224. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1225. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1226. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1227. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1228. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1229. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1230. /* DWORD 2 */
  1231. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1232. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1233. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1234. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1235. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1236. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1237. /* DWORD 0 */
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1239. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1240. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1242. do { \
  1243. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1244. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1245. } while (0)
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1247. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1248. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1250. do { \
  1251. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1252. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1253. } while (0)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1255. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1256. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL( \
  1260. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1261. ((_var) |= ((_val) \
  1262. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL( \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1271. ((_var) |= ((_val) \
  1272. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1273. } while (0)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1275. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1276. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1280. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1281. } while (0)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1283. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1284. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1297. } while (0)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1313. } while (0)
  1314. /* DWORD 1 */
  1315. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1319. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1320. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1321. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1322. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1323. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1324. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1325. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1326. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1327. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1331. } while (0)
  1332. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1333. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1334. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1335. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1339. } while (0)
  1340. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1355. } while (0)
  1356. /* DWORD 2 */
  1357. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1364. } while (0)
  1365. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1366. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1367. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1368. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1372. } while (0)
  1373. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1380. } while (0)
  1381. typedef enum {
  1382. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1383. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1384. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1385. } htt_11ax_ltf_subtype_t;
  1386. typedef enum {
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1391. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1392. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1393. } htt_tx_ext2_preamble_type_t;
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1406. /**
  1407. * @brief HTT tx MSDU extension descriptor v2
  1408. * @details
  1409. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1410. * is received as tcl_exit_base->host_meta_info in firmware.
  1411. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1412. * are already part of tcl_exit_base.
  1413. */
  1414. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1415. /* DWORD 0: flags */
  1416. A_UINT32
  1417. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1418. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1419. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1420. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1421. valid_retries : 1, /* if set, tx retries spec is valid */
  1422. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1423. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1424. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1425. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1426. valid_key_flags : 1, /* if set, key flags is valid */
  1427. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1428. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1429. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1430. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1431. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1432. 1 = ENCRYPT,
  1433. 2 ~ 3 - Reserved */
  1434. /* retry_limit -
  1435. * Specify the maximum number of transmissions, including the
  1436. * initial transmission, to attempt before giving up if no ack
  1437. * is received.
  1438. * If the tx rate is specified, then all retries shall use the
  1439. * same rate as the initial transmission.
  1440. * If no tx rate is specified, the target can choose whether to
  1441. * retain the original rate during the retransmissions, or to
  1442. * fall back to a more robust rate.
  1443. */
  1444. retry_limit : 4,
  1445. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1446. * Valid only for 11ax preamble types HE_SU
  1447. * and HE_EXT_SU
  1448. */
  1449. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1450. * Valid only for 11ax preamble types HE_SU
  1451. * and HE_EXT_SU
  1452. */
  1453. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1454. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1455. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1456. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1457. */
  1458. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1459. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1460. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1461. * Use cases:
  1462. * Any time firmware uses TQM-BYPASS for Data
  1463. * TID, firmware expect host to set this bit.
  1464. */
  1465. /* DWORD 1: tx power, tx rate */
  1466. A_UINT32
  1467. power : 8, /* unit of the power field is 0.5 dbm
  1468. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1469. * signed value ranging from -64dbm to 63.5 dbm
  1470. */
  1471. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1472. * Setting more than one MCS isn't currently
  1473. * supported by the target (but is supported
  1474. * in the interface in case in the future
  1475. * the target supports specifications of
  1476. * a limited set of MCS values.
  1477. */
  1478. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1479. * Setting more than one Nss isn't currently
  1480. * supported by the target (but is supported
  1481. * in the interface in case in the future
  1482. * the target supports specifications of
  1483. * a limited set of Nss values.
  1484. */
  1485. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1486. update_peer_cache : 1; /* When set these custom values will be
  1487. * used for all packets, until the next
  1488. * update via this ext header.
  1489. * This is to make sure not all packets
  1490. * need to include this header.
  1491. */
  1492. /* DWORD 2: tx chain mask, tx retries */
  1493. A_UINT32
  1494. /* chain_mask - specify which chains to transmit from */
  1495. chain_mask : 8,
  1496. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1497. * TODO: Update Enum values for key_flags
  1498. */
  1499. /*
  1500. * Channel frequency: This identifies the desired channel
  1501. * frequency (in MHz) for tx frames. This is used by FW to help
  1502. * determine when it is safe to transmit or drop frames for
  1503. * off-channel operation.
  1504. * The default value of zero indicates to FW that the corresponding
  1505. * VDEV's home channel (if there is one) is the desired channel
  1506. * frequency.
  1507. */
  1508. chanfreq : 16;
  1509. /* DWORD 3: tx expiry time (TSF) LSBs */
  1510. A_UINT32 expire_tsf_lo;
  1511. /* DWORD 4: tx expiry time (TSF) MSBs */
  1512. A_UINT32 expire_tsf_hi;
  1513. /* DWORD 5: reserved
  1514. * This structure can be expanded further up to 60 bytes
  1515. * by adding further DWORDs as needed.
  1516. */
  1517. A_UINT32
  1518. /* learning_frame
  1519. * When this flag is set, this frame will be dropped by FW
  1520. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1521. */
  1522. learning_frame : 1,
  1523. rsvd0 : 31;
  1524. } POSTPACK;
  1525. /* DWORD 0 */
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1552. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1553. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1554. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1555. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1556. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1557. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1558. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1559. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1560. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1561. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1562. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1563. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1564. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1565. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1566. /* DWORD 1 */
  1567. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1568. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1569. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1570. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1571. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1572. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1573. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1574. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1575. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1576. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1577. /* DWORD 2 */
  1578. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1579. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1580. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1581. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1582. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1583. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1584. /* DWORD 5 */
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1587. /* DWORD 0 */
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1590. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1595. } while (0)
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1598. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1602. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1606. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1614. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL( \
  1618. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1619. ((_var) |= ((_val) \
  1620. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1624. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1632. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1640. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL( \
  1644. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1645. ((_var) |= ((_val) \
  1646. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1674. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1678. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1679. } while (0)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1681. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1684. do { \
  1685. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1686. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1687. } while (0)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1690. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1698. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1699. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1706. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1707. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1735. } while (0)
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1737. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1738. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1739. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1740. do { \
  1741. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1742. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1743. } while (0)
  1744. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1751. } while (0)
  1752. /* DWORD 1 */
  1753. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1754. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1755. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1756. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1757. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1758. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1759. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1760. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1761. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1762. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1763. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1764. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1765. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1766. do { \
  1767. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1768. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1769. } while (0)
  1770. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1771. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1772. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1773. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1774. do { \
  1775. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1776. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1777. } while (0)
  1778. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1779. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1780. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1781. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1782. do { \
  1783. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1784. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1785. } while (0)
  1786. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1787. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1788. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1789. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1790. do { \
  1791. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1792. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1793. } while (0)
  1794. /* DWORD 2 */
  1795. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1796. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1797. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1798. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1799. do { \
  1800. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1801. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1802. } while (0)
  1803. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1804. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1805. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1806. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1807. do { \
  1808. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1809. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1810. } while (0)
  1811. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1812. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1813. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1814. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1815. do { \
  1816. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1817. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1818. } while (0)
  1819. /* DWORD 5 */
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1821. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1822. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1824. do { \
  1825. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1826. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1827. } while (0)
  1828. typedef enum {
  1829. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1830. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1831. } htt_tcl_metadata_type;
  1832. /**
  1833. * @brief HTT TCL command number format
  1834. * @details
  1835. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1836. * available to firmware as tcl_exit_base->tcl_status_number.
  1837. * For regular / multicast packets host will send vdev and mac id and for
  1838. * NAWDS packets, host will send peer id.
  1839. * A_UINT32 is used to avoid endianness conversion problems.
  1840. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1841. */
  1842. typedef struct {
  1843. A_UINT32
  1844. type: 1, /* vdev_id based or peer_id based */
  1845. rsvd: 31;
  1846. } htt_tx_tcl_vdev_or_peer_t;
  1847. typedef struct {
  1848. A_UINT32
  1849. type: 1, /* vdev_id based or peer_id based */
  1850. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1851. vdev_id: 8,
  1852. pdev_id: 2,
  1853. host_inspected:1,
  1854. rsvd: 19;
  1855. } htt_tx_tcl_vdev_metadata;
  1856. typedef struct {
  1857. A_UINT32
  1858. type: 1, /* vdev_id based or peer_id based */
  1859. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1860. peer_id: 14,
  1861. rsvd: 16;
  1862. } htt_tx_tcl_peer_metadata;
  1863. PREPACK struct htt_tx_tcl_metadata {
  1864. union {
  1865. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1866. htt_tx_tcl_vdev_metadata vdev_meta;
  1867. htt_tx_tcl_peer_metadata peer_meta;
  1868. };
  1869. } POSTPACK;
  1870. /* DWORD 0 */
  1871. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1872. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1873. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1874. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1875. /* VDEV metadata */
  1876. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1877. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1878. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1879. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1880. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1881. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1882. /* PEER metadata */
  1883. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1884. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1885. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1886. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1887. HTT_TX_TCL_METADATA_TYPE_S)
  1888. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1892. } while (0)
  1893. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1894. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1895. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1896. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1900. } while (0)
  1901. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1902. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1903. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1904. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1908. } while (0)
  1909. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1910. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1911. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1912. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1916. } while (0)
  1917. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1918. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1919. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1920. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1924. } while (0)
  1925. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1926. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1927. HTT_TX_TCL_METADATA_PEER_ID_S)
  1928. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1932. } while (0)
  1933. typedef enum {
  1934. HTT_TX_FW2WBM_TX_STATUS_OK,
  1935. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1936. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1937. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1938. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1939. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1940. HTT_TX_FW2WBM_TX_STATUS_MAX
  1941. } htt_tx_fw2wbm_tx_status_t;
  1942. typedef enum {
  1943. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1944. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1945. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1946. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1947. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1948. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1949. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1950. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1951. } htt_tx_fw2wbm_reinject_reason_t;
  1952. /**
  1953. * @brief HTT TX WBM Completion from firmware to host
  1954. * @details
  1955. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1956. * DWORD 3 and 4 for software based completions (Exception frames and
  1957. * TQM bypass frames)
  1958. * For software based completions, wbm_release_ring->release_source_module will
  1959. * be set to release_source_fw
  1960. */
  1961. PREPACK struct htt_tx_wbm_completion {
  1962. A_UINT32
  1963. sch_cmd_id: 24,
  1964. exception_frame: 1, /* If set, this packet was queued via exception path */
  1965. rsvd0_31_25: 7;
  1966. A_UINT32
  1967. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1968. * reception of an ACK or BA, this field indicates
  1969. * the RSSI of the received ACK or BA frame.
  1970. * When the frame is removed as result of a direct
  1971. * remove command from the SW, this field is set
  1972. * to 0x0 (which is never a valid value when real
  1973. * RSSI is available).
  1974. * Units: dB w.r.t noise floor
  1975. */
  1976. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1977. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1978. rsvd1_31_16: 16;
  1979. } POSTPACK;
  1980. /* DWORD 0 */
  1981. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1982. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1983. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1984. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1985. /* DWORD 1 */
  1986. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1987. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1988. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1989. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1990. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1991. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1992. /* DWORD 0 */
  1993. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1994. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1995. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1996. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2000. } while (0)
  2001. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2002. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2003. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2004. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2008. } while (0)
  2009. /* DWORD 1 */
  2010. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2011. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2012. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2013. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2016. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2017. } while (0)
  2018. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2019. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2020. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2021. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2025. } while (0)
  2026. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2027. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2028. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2029. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2033. } while (0)
  2034. /**
  2035. * @brief HTT TX WBM Completion from firmware to host
  2036. * @details
  2037. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2038. * (WBM) offload HW.
  2039. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2040. * For software based completions, release_source_module will
  2041. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2042. * struct wbm_release_ring and then switch to this after looking at
  2043. * release_source_module.
  2044. */
  2045. PREPACK struct htt_tx_wbm_completion_v2 {
  2046. A_UINT32
  2047. used_by_hw0; /* Refer to struct wbm_release_ring */
  2048. A_UINT32
  2049. used_by_hw1; /* Refer to struct wbm_release_ring */
  2050. A_UINT32
  2051. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2052. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2053. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2054. exception_frame: 1,
  2055. rsvd0: 12, /* For future use */
  2056. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2057. rsvd1: 1; /* For future use */
  2058. A_UINT32
  2059. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2060. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2061. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2062. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2063. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2064. */
  2065. A_UINT32
  2066. data1: 32;
  2067. A_UINT32
  2068. data2: 32;
  2069. A_UINT32
  2070. used_by_hw3; /* Refer to struct wbm_release_ring */
  2071. } POSTPACK;
  2072. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2073. /* DWORD 3 */
  2074. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2075. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2076. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2077. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2078. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2079. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2080. /* DWORD 3 */
  2081. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2082. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2083. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2084. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2088. } while (0)
  2089. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2090. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2091. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2092. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2096. } while (0)
  2097. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2098. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2099. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2100. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2104. } while (0)
  2105. /**
  2106. * @brief HTT TX WBM transmit status from firmware to host
  2107. * @details
  2108. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2109. * (WBM) offload HW.
  2110. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2111. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2112. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2113. */
  2114. PREPACK struct htt_tx_wbm_transmit_status {
  2115. A_UINT32
  2116. sch_cmd_id: 24,
  2117. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2118. * reception of an ACK or BA, this field indicates
  2119. * the RSSI of the received ACK or BA frame.
  2120. * When the frame is removed as result of a direct
  2121. * remove command from the SW, this field is set
  2122. * to 0x0 (which is never a valid value when real
  2123. * RSSI is available).
  2124. * Units: dB w.r.t noise floor
  2125. */
  2126. A_UINT32
  2127. sw_peer_id: 16,
  2128. tid_num: 5,
  2129. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2130. * and tid_num fields contain valid data.
  2131. * If this "valid" flag is not set, the
  2132. * sw_peer_id and tid_num fields must be ignored.
  2133. */
  2134. mcast: 1,
  2135. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2136. * contains valid data.
  2137. */
  2138. reserved0: 8;
  2139. A_UINT32
  2140. reserved1: 32;
  2141. } POSTPACK;
  2142. /* DWORD 4 */
  2143. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2144. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2145. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2146. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2147. /* DWORD 5 */
  2148. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2149. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2150. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2151. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2152. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2153. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2154. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2155. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2156. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2157. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2158. /* DWORD 4 */
  2159. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2160. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2161. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2162. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2166. } while (0)
  2167. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2168. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2169. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2170. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2174. } while (0)
  2175. /* DWORD 5 */
  2176. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2177. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2178. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2179. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2183. } while (0)
  2184. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2185. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2186. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2187. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2191. } while (0)
  2192. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2193. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2194. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2195. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2196. do { \
  2197. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2198. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2199. } while (0)
  2200. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2201. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2202. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2203. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2206. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2207. } while (0)
  2208. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2209. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2210. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2211. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2212. do { \
  2213. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2214. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2215. } while (0)
  2216. /**
  2217. * @brief HTT TX WBM reinject status from firmware to host
  2218. * @details
  2219. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2220. * (WBM) offload HW.
  2221. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2222. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2223. */
  2224. PREPACK struct htt_tx_wbm_reinject_status {
  2225. A_UINT32
  2226. reserved0: 32;
  2227. A_UINT32
  2228. reserved1: 32;
  2229. A_UINT32
  2230. reserved2: 32;
  2231. } POSTPACK;
  2232. /**
  2233. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2234. * @details
  2235. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2236. * (WBM) offload HW.
  2237. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2238. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2239. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2240. * STA side.
  2241. */
  2242. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2243. A_UINT32
  2244. mec_sa_addr_31_0;
  2245. A_UINT32
  2246. mec_sa_addr_47_32: 16,
  2247. sa_ast_index: 16;
  2248. A_UINT32
  2249. vdev_id: 8,
  2250. reserved0: 24;
  2251. } POSTPACK;
  2252. /* DWORD 4 - mec_sa_addr_31_0 */
  2253. /* DWORD 5 */
  2254. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2255. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2256. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2257. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2258. /* DWORD 6 */
  2259. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2260. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2261. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2262. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2263. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2264. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2268. } while (0)
  2269. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2270. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2271. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2272. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2276. } while (0)
  2277. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2278. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2279. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2280. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2284. } while (0)
  2285. typedef enum {
  2286. TX_FLOW_PRIORITY_BE,
  2287. TX_FLOW_PRIORITY_HIGH,
  2288. TX_FLOW_PRIORITY_LOW,
  2289. } htt_tx_flow_priority_t;
  2290. typedef enum {
  2291. TX_FLOW_LATENCY_SENSITIVE,
  2292. TX_FLOW_LATENCY_INSENSITIVE,
  2293. } htt_tx_flow_latency_t;
  2294. typedef enum {
  2295. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2296. TX_FLOW_INTERACTIVE_TRAFFIC,
  2297. TX_FLOW_PERIODIC_TRAFFIC,
  2298. TX_FLOW_BURSTY_TRAFFIC,
  2299. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2300. } htt_tx_flow_traffic_pattern_t;
  2301. /**
  2302. * @brief HTT TX Flow search metadata format
  2303. * @details
  2304. * Host will set this metadata in flow table's flow search entry along with
  2305. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2306. * firmware and TQM ring if the flow search entry wins.
  2307. * This metadata is available to firmware in that first MSDU's
  2308. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2309. * to one of the available flows for specific tid and returns the tqm flow
  2310. * pointer as part of htt_tx_map_flow_info message.
  2311. */
  2312. PREPACK struct htt_tx_flow_metadata {
  2313. A_UINT32
  2314. rsvd0_1_0: 2,
  2315. tid: 4,
  2316. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2317. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2318. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2319. * Else choose final tid based on latency, priority.
  2320. */
  2321. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2322. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2323. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2324. } POSTPACK;
  2325. /* DWORD 0 */
  2326. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2327. #define HTT_TX_FLOW_METADATA_TID_S 2
  2328. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2329. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2330. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2331. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2332. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2333. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2334. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2335. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2336. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2337. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2338. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2339. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2340. /* DWORD 0 */
  2341. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2342. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2343. HTT_TX_FLOW_METADATA_TID_S)
  2344. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2345. do { \
  2346. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2347. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2348. } while (0)
  2349. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2350. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2351. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2352. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2355. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2356. } while (0)
  2357. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2358. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2359. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2360. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2361. do { \
  2362. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2363. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2364. } while (0)
  2365. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2366. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2367. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2368. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2369. do { \
  2370. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2371. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2372. } while (0)
  2373. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2374. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2375. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2376. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2377. do { \
  2378. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2379. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2380. } while (0)
  2381. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2382. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2383. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2384. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2385. do { \
  2386. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2387. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2388. } while (0)
  2389. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2390. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2391. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2392. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2395. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2396. } while (0)
  2397. /**
  2398. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2399. *
  2400. * @details
  2401. * HTT wds entry from source port learning
  2402. * Host will learn wds entries from rx and send this message to firmware
  2403. * to enable firmware to configure/delete AST entries for wds clients.
  2404. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2405. * and when SA's entry is deleted, firmware removes this AST entry
  2406. *
  2407. * The message would appear as follows:
  2408. *
  2409. * |31 30|29 |17 16|15 8|7 0|
  2410. * |----------------+----------------+----------------+----------------|
  2411. * | rsvd0 |PDVID| vdev_id | msg_type |
  2412. * |-------------------------------------------------------------------|
  2413. * | sa_addr_31_0 |
  2414. * |-------------------------------------------------------------------|
  2415. * | | ta_peer_id | sa_addr_47_32 |
  2416. * |-------------------------------------------------------------------|
  2417. * Where PDVID = pdev_id
  2418. *
  2419. * The message is interpreted as follows:
  2420. *
  2421. * dword0 - b'0:7 - msg_type: This will be set to
  2422. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2423. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2424. *
  2425. * dword0 - b'8:15 - vdev_id
  2426. *
  2427. * dword0 - b'16:17 - pdev_id
  2428. *
  2429. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2430. *
  2431. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2432. *
  2433. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2434. *
  2435. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2436. */
  2437. PREPACK struct htt_wds_entry {
  2438. A_UINT32
  2439. msg_type: 8,
  2440. vdev_id: 8,
  2441. pdev_id: 2,
  2442. rsvd0: 14;
  2443. A_UINT32 sa_addr_31_0;
  2444. A_UINT32
  2445. sa_addr_47_32: 16,
  2446. ta_peer_id: 14,
  2447. rsvd2: 2;
  2448. } POSTPACK;
  2449. /* DWORD 0 */
  2450. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2451. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2452. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2453. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2454. /* DWORD 2 */
  2455. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2456. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2457. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2458. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2459. /* DWORD 0 */
  2460. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2461. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2462. HTT_WDS_ENTRY_VDEV_ID_S)
  2463. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2466. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2467. } while (0)
  2468. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2469. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2470. HTT_WDS_ENTRY_PDEV_ID_S)
  2471. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2474. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2475. } while (0)
  2476. /* DWORD 2 */
  2477. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2478. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2479. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2480. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2481. do { \
  2482. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2483. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2484. } while (0)
  2485. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2486. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2487. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2488. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2489. do { \
  2490. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2491. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2492. } while (0)
  2493. /**
  2494. * @brief MAC DMA rx ring setup specification
  2495. * @details
  2496. * To allow for dynamic rx ring reconfiguration and to avoid race
  2497. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2498. * it uses. Instead, it sends this message to the target, indicating how
  2499. * the rx ring used by the host should be set up and maintained.
  2500. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2501. * specifications.
  2502. *
  2503. * |31 16|15 8|7 0|
  2504. * |---------------------------------------------------------------|
  2505. * header: | reserved | num rings | msg type |
  2506. * |---------------------------------------------------------------|
  2507. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2508. #if HTT_PADDR64
  2509. * | FW_IDX shadow register physical address (bits 63:32) |
  2510. #endif
  2511. * |---------------------------------------------------------------|
  2512. * | rx ring base physical address (bits 31:0) |
  2513. #if HTT_PADDR64
  2514. * | rx ring base physical address (bits 63:32) |
  2515. #endif
  2516. * |---------------------------------------------------------------|
  2517. * | rx ring buffer size | rx ring length |
  2518. * |---------------------------------------------------------------|
  2519. * | FW_IDX initial value | enabled flags |
  2520. * |---------------------------------------------------------------|
  2521. * | MSDU payload offset | 802.11 header offset |
  2522. * |---------------------------------------------------------------|
  2523. * | PPDU end offset | PPDU start offset |
  2524. * |---------------------------------------------------------------|
  2525. * | MPDU end offset | MPDU start offset |
  2526. * |---------------------------------------------------------------|
  2527. * | MSDU end offset | MSDU start offset |
  2528. * |---------------------------------------------------------------|
  2529. * | frag info offset | rx attention offset |
  2530. * |---------------------------------------------------------------|
  2531. * payload 2, if present, has the same format as payload 1
  2532. * Header fields:
  2533. * - MSG_TYPE
  2534. * Bits 7:0
  2535. * Purpose: identifies this as an rx ring configuration message
  2536. * Value: 0x2
  2537. * - NUM_RINGS
  2538. * Bits 15:8
  2539. * Purpose: indicates whether the host is setting up one rx ring or two
  2540. * Value: 1 or 2
  2541. * Payload:
  2542. * for systems using 64-bit format for bus addresses:
  2543. * - IDX_SHADOW_REG_PADDR_LO
  2544. * Bits 31:0
  2545. * Value: lower 4 bytes of physical address of the host's
  2546. * FW_IDX shadow register
  2547. * - IDX_SHADOW_REG_PADDR_HI
  2548. * Bits 31:0
  2549. * Value: upper 4 bytes of physical address of the host's
  2550. * FW_IDX shadow register
  2551. * - RING_BASE_PADDR_LO
  2552. * Bits 31:0
  2553. * Value: lower 4 bytes of physical address of the host's rx ring
  2554. * - RING_BASE_PADDR_HI
  2555. * Bits 31:0
  2556. * Value: uppper 4 bytes of physical address of the host's rx ring
  2557. * for systems using 32-bit format for bus addresses:
  2558. * - IDX_SHADOW_REG_PADDR
  2559. * Bits 31:0
  2560. * Value: physical address of the host's FW_IDX shadow register
  2561. * - RING_BASE_PADDR
  2562. * Bits 31:0
  2563. * Value: physical address of the host's rx ring
  2564. * - RING_LEN
  2565. * Bits 15:0
  2566. * Value: number of elements in the rx ring
  2567. * - RING_BUF_SZ
  2568. * Bits 31:16
  2569. * Value: size of the buffers referenced by the rx ring, in byte units
  2570. * - ENABLED_FLAGS
  2571. * Bits 15:0
  2572. * Value: 1-bit flags to show whether different rx fields are enabled
  2573. * bit 0: 802.11 header enabled (1) or disabled (0)
  2574. * bit 1: MSDU payload enabled (1) or disabled (0)
  2575. * bit 2: PPDU start enabled (1) or disabled (0)
  2576. * bit 3: PPDU end enabled (1) or disabled (0)
  2577. * bit 4: MPDU start enabled (1) or disabled (0)
  2578. * bit 5: MPDU end enabled (1) or disabled (0)
  2579. * bit 6: MSDU start enabled (1) or disabled (0)
  2580. * bit 7: MSDU end enabled (1) or disabled (0)
  2581. * bit 8: rx attention enabled (1) or disabled (0)
  2582. * bit 9: frag info enabled (1) or disabled (0)
  2583. * bit 10: unicast rx enabled (1) or disabled (0)
  2584. * bit 11: multicast rx enabled (1) or disabled (0)
  2585. * bit 12: ctrl rx enabled (1) or disabled (0)
  2586. * bit 13: mgmt rx enabled (1) or disabled (0)
  2587. * bit 14: null rx enabled (1) or disabled (0)
  2588. * bit 15: phy data rx enabled (1) or disabled (0)
  2589. * - IDX_INIT_VAL
  2590. * Bits 31:16
  2591. * Purpose: Specify the initial value for the FW_IDX.
  2592. * Value: the number of buffers initially present in the host's rx ring
  2593. * - OFFSET_802_11_HDR
  2594. * Bits 15:0
  2595. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2596. * - OFFSET_MSDU_PAYLOAD
  2597. * Bits 31:16
  2598. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2599. * - OFFSET_PPDU_START
  2600. * Bits 15:0
  2601. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2602. * - OFFSET_PPDU_END
  2603. * Bits 31:16
  2604. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2605. * - OFFSET_MPDU_START
  2606. * Bits 15:0
  2607. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2608. * - OFFSET_MPDU_END
  2609. * Bits 31:16
  2610. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2611. * - OFFSET_MSDU_START
  2612. * Bits 15:0
  2613. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2614. * - OFFSET_MSDU_END
  2615. * Bits 31:16
  2616. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2617. * - OFFSET_RX_ATTN
  2618. * Bits 15:0
  2619. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2620. * - OFFSET_FRAG_INFO
  2621. * Bits 31:16
  2622. * Value: offset in QUAD-bytes of frag info table
  2623. */
  2624. /* header fields */
  2625. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2626. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2627. /* payload fields */
  2628. /* for systems using a 64-bit format for bus addresses */
  2629. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2630. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2633. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2634. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2635. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2636. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2637. /* for systems using a 32-bit format for bus addresses */
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2640. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2642. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2643. #define HTT_RX_RING_CFG_LEN_S 0
  2644. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2645. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2646. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2647. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2648. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2649. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2650. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2651. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2652. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2653. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2654. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2655. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2656. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2657. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2658. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2659. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2660. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2661. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2662. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2663. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2664. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2665. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2666. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2667. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2668. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2669. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2670. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2671. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2672. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2673. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2674. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2675. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2676. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2677. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2678. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2679. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2680. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2681. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2682. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2683. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2684. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2685. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2686. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2687. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2688. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2689. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2690. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2691. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2692. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2693. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2694. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2695. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2696. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2697. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2698. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2699. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2700. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2701. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2702. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2703. #if HTT_PADDR64
  2704. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2705. #else
  2706. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2707. #endif
  2708. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2709. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2710. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2711. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2712. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2713. do { \
  2714. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2715. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2716. } while (0)
  2717. /* degenerate case for 32-bit fields */
  2718. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2719. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2720. ((_var) = (_val))
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2723. ((_var) = (_val))
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2726. ((_var) = (_val))
  2727. /* degenerate case for 32-bit fields */
  2728. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2729. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2730. ((_var) = (_val))
  2731. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2733. ((_var) = (_val))
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2735. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2736. ((_var) = (_val))
  2737. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2738. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2739. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2740. do { \
  2741. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2742. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2743. } while (0)
  2744. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2745. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2746. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2749. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2750. } while (0)
  2751. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2752. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2753. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2754. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2755. do { \
  2756. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2757. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2758. } while (0)
  2759. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2760. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2761. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2762. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2763. do { \
  2764. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2765. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2766. } while (0)
  2767. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2768. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2769. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2770. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2773. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2774. } while (0)
  2775. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2776. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2777. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2778. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2781. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2782. } while (0)
  2783. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2784. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2785. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2786. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2789. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2790. } while (0)
  2791. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2792. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2793. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2794. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2797. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2798. } while (0)
  2799. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2800. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2801. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2802. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2805. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2806. } while (0)
  2807. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2809. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2810. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2811. do { \
  2812. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2813. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2814. } while (0)
  2815. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2816. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2817. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2818. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2821. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2822. } while (0)
  2823. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2824. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2825. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2826. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2827. do { \
  2828. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2829. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2830. } while (0)
  2831. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2832. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2833. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2834. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2837. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2838. } while (0)
  2839. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2840. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2841. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2842. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2845. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2846. } while (0)
  2847. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2848. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2849. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2850. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2853. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2854. } while (0)
  2855. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2856. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2857. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2858. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2859. do { \
  2860. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2861. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2862. } while (0)
  2863. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2864. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2865. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2866. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2869. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2870. } while (0)
  2871. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2872. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2873. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2874. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2877. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2878. } while (0)
  2879. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2880. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2881. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2882. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2883. do { \
  2884. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2885. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2886. } while (0)
  2887. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2888. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2889. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2890. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2891. do { \
  2892. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2893. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2894. } while (0)
  2895. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2896. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2897. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2898. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2899. do { \
  2900. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2901. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2902. } while (0)
  2903. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2904. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2905. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2906. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2907. do { \
  2908. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2909. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2910. } while (0)
  2911. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2912. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2913. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2914. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2915. do { \
  2916. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2917. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2918. } while (0)
  2919. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2920. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2921. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2922. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2923. do { \
  2924. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2925. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2926. } while (0)
  2927. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2928. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2929. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2930. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2933. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2934. } while (0)
  2935. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2936. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2937. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2938. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2939. do { \
  2940. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2941. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2942. } while (0)
  2943. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2944. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2945. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2946. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2949. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2950. } while (0)
  2951. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2952. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2953. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2954. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2957. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2958. } while (0)
  2959. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2960. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2961. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2962. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2965. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2966. } while (0)
  2967. /**
  2968. * @brief host -> target FW statistics retrieve
  2969. *
  2970. * @details
  2971. * The following field definitions describe the format of the HTT host
  2972. * to target FW stats retrieve message. The message specifies the type of
  2973. * stats host wants to retrieve.
  2974. *
  2975. * |31 24|23 16|15 8|7 0|
  2976. * |-----------------------------------------------------------|
  2977. * | stats types request bitmask | msg type |
  2978. * |-----------------------------------------------------------|
  2979. * | stats types reset bitmask | reserved |
  2980. * |-----------------------------------------------------------|
  2981. * | stats type | config value |
  2982. * |-----------------------------------------------------------|
  2983. * | cookie LSBs |
  2984. * |-----------------------------------------------------------|
  2985. * | cookie MSBs |
  2986. * |-----------------------------------------------------------|
  2987. * Header fields:
  2988. * - MSG_TYPE
  2989. * Bits 7:0
  2990. * Purpose: identifies this is a stats upload request message
  2991. * Value: 0x3
  2992. * - UPLOAD_TYPES
  2993. * Bits 31:8
  2994. * Purpose: identifies which types of FW statistics to upload
  2995. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2996. * - RESET_TYPES
  2997. * Bits 31:8
  2998. * Purpose: identifies which types of FW statistics to reset
  2999. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3000. * - CFG_VAL
  3001. * Bits 23:0
  3002. * Purpose: give an opaque configuration value to the specified stats type
  3003. * Value: stats-type specific configuration value
  3004. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3005. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3006. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3007. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3008. * - CFG_STAT_TYPE
  3009. * Bits 31:24
  3010. * Purpose: specify which stats type (if any) the config value applies to
  3011. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3012. * a valid configuration specification
  3013. * - COOKIE_LSBS
  3014. * Bits 31:0
  3015. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3016. * message with its preceding host->target stats request message.
  3017. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3018. * - COOKIE_MSBS
  3019. * Bits 31:0
  3020. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3021. * message with its preceding host->target stats request message.
  3022. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3023. */
  3024. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3025. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3026. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3027. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3028. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3029. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3030. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3031. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3032. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3033. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3034. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3035. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3036. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3037. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3040. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3041. } while (0)
  3042. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3043. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3044. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3045. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3048. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3049. } while (0)
  3050. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3051. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3052. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3053. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3054. do { \
  3055. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3056. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3057. } while (0)
  3058. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3059. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3060. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3061. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3062. do { \
  3063. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3064. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3065. } while (0)
  3066. /**
  3067. * @brief host -> target HTT out-of-band sync request
  3068. *
  3069. * @details
  3070. * The HTT SYNC tells the target to suspend processing of subsequent
  3071. * HTT host-to-target messages until some other target agent locally
  3072. * informs the target HTT FW that the current sync counter is equal to
  3073. * or greater than (in a modulo sense) the sync counter specified in
  3074. * the SYNC message.
  3075. * This allows other host-target components to synchronize their operation
  3076. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3077. * security key has been downloaded to and activated by the target.
  3078. * In the absence of any explicit synchronization counter value
  3079. * specification, the target HTT FW will use zero as the default current
  3080. * sync value.
  3081. *
  3082. * |31 24|23 16|15 8|7 0|
  3083. * |-----------------------------------------------------------|
  3084. * | reserved | sync count | msg type |
  3085. * |-----------------------------------------------------------|
  3086. * Header fields:
  3087. * - MSG_TYPE
  3088. * Bits 7:0
  3089. * Purpose: identifies this as a sync message
  3090. * Value: 0x4
  3091. * - SYNC_COUNT
  3092. * Bits 15:8
  3093. * Purpose: specifies what sync value the HTT FW will wait for from
  3094. * an out-of-band specification to resume its operation
  3095. * Value: in-band sync counter value to compare against the out-of-band
  3096. * counter spec.
  3097. * The HTT target FW will suspend its host->target message processing
  3098. * as long as
  3099. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3100. */
  3101. #define HTT_H2T_SYNC_MSG_SZ 4
  3102. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3103. #define HTT_H2T_SYNC_COUNT_S 8
  3104. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3105. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3106. HTT_H2T_SYNC_COUNT_S)
  3107. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3110. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3111. } while (0)
  3112. /**
  3113. * @brief HTT aggregation configuration
  3114. */
  3115. #define HTT_AGGR_CFG_MSG_SZ 4
  3116. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3117. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3118. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3119. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3120. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3121. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3122. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3123. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3126. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3127. } while (0)
  3128. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3129. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3130. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3131. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3134. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3135. } while (0)
  3136. /**
  3137. * @brief host -> target HTT configure max amsdu info per vdev
  3138. *
  3139. * @details
  3140. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3141. *
  3142. * |31 21|20 16|15 8|7 0|
  3143. * |-----------------------------------------------------------|
  3144. * | reserved | vdev id | max amsdu | msg type |
  3145. * |-----------------------------------------------------------|
  3146. * Header fields:
  3147. * - MSG_TYPE
  3148. * Bits 7:0
  3149. * Purpose: identifies this as a aggr cfg ex message
  3150. * Value: 0xa
  3151. * - MAX_NUM_AMSDU_SUBFRM
  3152. * Bits 15:8
  3153. * Purpose: max MSDUs per A-MSDU
  3154. * - VDEV_ID
  3155. * Bits 20:16
  3156. * Purpose: ID of the vdev to which this limit is applied
  3157. */
  3158. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3159. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3160. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3161. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3162. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3163. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3164. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3165. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3166. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3167. do { \
  3168. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3169. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3170. } while (0)
  3171. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3172. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3173. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3174. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3175. do { \
  3176. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3177. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3178. } while (0)
  3179. /**
  3180. * @brief HTT WDI_IPA Config Message
  3181. *
  3182. * @details
  3183. * The HTT WDI_IPA config message is created/sent by host at driver
  3184. * init time. It contains information about data structures used on
  3185. * WDI_IPA TX and RX path.
  3186. * TX CE ring is used for pushing packet metadata from IPA uC
  3187. * to WLAN FW
  3188. * TX Completion ring is used for generating TX completions from
  3189. * WLAN FW to IPA uC
  3190. * RX Indication ring is used for indicating RX packets from FW
  3191. * to IPA uC
  3192. * RX Ring2 is used as either completion ring or as second
  3193. * indication ring. when Ring2 is used as completion ring, IPA uC
  3194. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3195. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3196. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3197. * indicated in RX Indication ring. Please see WDI_IPA specification
  3198. * for more details.
  3199. * |31 24|23 16|15 8|7 0|
  3200. * |----------------+----------------+----------------+----------------|
  3201. * | tx pkt pool size | Rsvd | msg_type |
  3202. * |-------------------------------------------------------------------|
  3203. * | tx comp ring base (bits 31:0) |
  3204. #if HTT_PADDR64
  3205. * | tx comp ring base (bits 63:32) |
  3206. #endif
  3207. * |-------------------------------------------------------------------|
  3208. * | tx comp ring size |
  3209. * |-------------------------------------------------------------------|
  3210. * | tx comp WR_IDX physical address (bits 31:0) |
  3211. #if HTT_PADDR64
  3212. * | tx comp WR_IDX physical address (bits 63:32) |
  3213. #endif
  3214. * |-------------------------------------------------------------------|
  3215. * | tx CE WR_IDX physical address (bits 31:0) |
  3216. #if HTT_PADDR64
  3217. * | tx CE WR_IDX physical address (bits 63:32) |
  3218. #endif
  3219. * |-------------------------------------------------------------------|
  3220. * | rx indication ring base (bits 31:0) |
  3221. #if HTT_PADDR64
  3222. * | rx indication ring base (bits 63:32) |
  3223. #endif
  3224. * |-------------------------------------------------------------------|
  3225. * | rx indication ring size |
  3226. * |-------------------------------------------------------------------|
  3227. * | rx ind RD_IDX physical address (bits 31:0) |
  3228. #if HTT_PADDR64
  3229. * | rx ind RD_IDX physical address (bits 63:32) |
  3230. #endif
  3231. * |-------------------------------------------------------------------|
  3232. * | rx ind WR_IDX physical address (bits 31:0) |
  3233. #if HTT_PADDR64
  3234. * | rx ind WR_IDX physical address (bits 63:32) |
  3235. #endif
  3236. * |-------------------------------------------------------------------|
  3237. * |-------------------------------------------------------------------|
  3238. * | rx ring2 base (bits 31:0) |
  3239. #if HTT_PADDR64
  3240. * | rx ring2 base (bits 63:32) |
  3241. #endif
  3242. * |-------------------------------------------------------------------|
  3243. * | rx ring2 size |
  3244. * |-------------------------------------------------------------------|
  3245. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3246. #if HTT_PADDR64
  3247. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3248. #endif
  3249. * |-------------------------------------------------------------------|
  3250. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3251. #if HTT_PADDR64
  3252. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3253. #endif
  3254. * |-------------------------------------------------------------------|
  3255. *
  3256. * Header fields:
  3257. * Header fields:
  3258. * - MSG_TYPE
  3259. * Bits 7:0
  3260. * Purpose: Identifies this as WDI_IPA config message
  3261. * value: = 0x8
  3262. * - TX_PKT_POOL_SIZE
  3263. * Bits 15:0
  3264. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3265. * WDI_IPA TX path
  3266. * For systems using 32-bit format for bus addresses:
  3267. * - TX_COMP_RING_BASE_ADDR
  3268. * Bits 31:0
  3269. * Purpose: TX Completion Ring base address in DDR
  3270. * - TX_COMP_RING_SIZE
  3271. * Bits 31:0
  3272. * Purpose: TX Completion Ring size (must be power of 2)
  3273. * - TX_COMP_WR_IDX_ADDR
  3274. * Bits 31:0
  3275. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3276. * updates the Write Index for WDI_IPA TX completion ring
  3277. * - TX_CE_WR_IDX_ADDR
  3278. * Bits 31:0
  3279. * Purpose: DDR address where IPA uC
  3280. * updates the WR Index for TX CE ring
  3281. * (needed for fusion platforms)
  3282. * - RX_IND_RING_BASE_ADDR
  3283. * Bits 31:0
  3284. * Purpose: RX Indication Ring base address in DDR
  3285. * - RX_IND_RING_SIZE
  3286. * Bits 31:0
  3287. * Purpose: RX Indication Ring size
  3288. * - RX_IND_RD_IDX_ADDR
  3289. * Bits 31:0
  3290. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3291. * RX indication ring
  3292. * - RX_IND_WR_IDX_ADDR
  3293. * Bits 31:0
  3294. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3295. * updates the Write Index for WDI_IPA RX indication ring
  3296. * - RX_RING2_BASE_ADDR
  3297. * Bits 31:0
  3298. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3299. * - RX_RING2_SIZE
  3300. * Bits 31:0
  3301. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3302. * - RX_RING2_RD_IDX_ADDR
  3303. * Bits 31:0
  3304. * Purpose: If Second RX ring is Indication ring, DDR address where
  3305. * IPA uC updates the Read Index for Ring2.
  3306. * If Second RX ring is completion ring, this is NOT used
  3307. * - RX_RING2_WR_IDX_ADDR
  3308. * Bits 31:0
  3309. * Purpose: If Second RX ring is Indication ring, DDR address where
  3310. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3311. * If second RX ring is completion ring, DDR address where
  3312. * IPA uC updates the Write Index for Ring 2.
  3313. * For systems using 64-bit format for bus addresses:
  3314. * - TX_COMP_RING_BASE_ADDR_LO
  3315. * Bits 31:0
  3316. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3317. * - TX_COMP_RING_BASE_ADDR_HI
  3318. * Bits 31:0
  3319. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3320. * - TX_COMP_RING_SIZE
  3321. * Bits 31:0
  3322. * Purpose: TX Completion Ring size (must be power of 2)
  3323. * - TX_COMP_WR_IDX_ADDR_LO
  3324. * Bits 31:0
  3325. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3326. * Lower 4 bytes of DDR address where WIFI FW
  3327. * updates the Write Index for WDI_IPA TX completion ring
  3328. * - TX_COMP_WR_IDX_ADDR_HI
  3329. * Bits 31:0
  3330. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3331. * Higher 4 bytes of DDR address where WIFI FW
  3332. * updates the Write Index for WDI_IPA TX completion ring
  3333. * - TX_CE_WR_IDX_ADDR_LO
  3334. * Bits 31:0
  3335. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3336. * updates the WR Index for TX CE ring
  3337. * (needed for fusion platforms)
  3338. * - TX_CE_WR_IDX_ADDR_HI
  3339. * Bits 31:0
  3340. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3341. * updates the WR Index for TX CE ring
  3342. * (needed for fusion platforms)
  3343. * - RX_IND_RING_BASE_ADDR_LO
  3344. * Bits 31:0
  3345. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3346. * - RX_IND_RING_BASE_ADDR_HI
  3347. * Bits 31:0
  3348. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3349. * - RX_IND_RING_SIZE
  3350. * Bits 31:0
  3351. * Purpose: RX Indication Ring size
  3352. * - RX_IND_RD_IDX_ADDR_LO
  3353. * Bits 31:0
  3354. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3355. * for WDI_IPA RX indication ring
  3356. * - RX_IND_RD_IDX_ADDR_HI
  3357. * Bits 31:0
  3358. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3359. * for WDI_IPA RX indication ring
  3360. * - RX_IND_WR_IDX_ADDR_LO
  3361. * Bits 31:0
  3362. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3363. * Lower 4 bytes of DDR address where WIFI FW
  3364. * updates the Write Index for WDI_IPA RX indication ring
  3365. * - RX_IND_WR_IDX_ADDR_HI
  3366. * Bits 31:0
  3367. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3368. * Higher 4 bytes of DDR address where WIFI FW
  3369. * updates the Write Index for WDI_IPA RX indication ring
  3370. * - RX_RING2_BASE_ADDR_LO
  3371. * Bits 31:0
  3372. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3373. * - RX_RING2_BASE_ADDR_HI
  3374. * Bits 31:0
  3375. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3376. * - RX_RING2_SIZE
  3377. * Bits 31:0
  3378. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3379. * - RX_RING2_RD_IDX_ADDR_LO
  3380. * Bits 31:0
  3381. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3382. * DDR address where IPA uC updates the Read Index for Ring2.
  3383. * If Second RX ring is completion ring, this is NOT used
  3384. * - RX_RING2_RD_IDX_ADDR_HI
  3385. * Bits 31:0
  3386. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3387. * DDR address where IPA uC updates the Read Index for Ring2.
  3388. * If Second RX ring is completion ring, this is NOT used
  3389. * - RX_RING2_WR_IDX_ADDR_LO
  3390. * Bits 31:0
  3391. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3392. * DDR address where WIFI FW updates the Write Index
  3393. * for WDI_IPA RX ring2
  3394. * If second RX ring is completion ring, lower 4 bytes of
  3395. * DDR address where IPA uC updates the Write Index for Ring 2.
  3396. * - RX_RING2_WR_IDX_ADDR_HI
  3397. * Bits 31:0
  3398. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3399. * DDR address where WIFI FW updates the Write Index
  3400. * for WDI_IPA RX ring2
  3401. * If second RX ring is completion ring, higher 4 bytes of
  3402. * DDR address where IPA uC updates the Write Index for Ring 2.
  3403. */
  3404. #if HTT_PADDR64
  3405. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3406. #else
  3407. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3408. #endif
  3409. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3410. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3411. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3412. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3413. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3416. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3418. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3425. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3427. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3429. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3431. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3433. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3435. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3437. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3445. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3446. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3447. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3448. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3449. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3450. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3451. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3452. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3453. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3454. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3455. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3457. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3458. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3471. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3472. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3473. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3476. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3477. } while (0)
  3478. /* for systems using 32-bit format for bus addr */
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3480. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3484. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3485. } while (0)
  3486. /* for systems using 64-bit format for bus addr */
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3488. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3492. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3493. } while (0)
  3494. /* for systems using 64-bit format for bus addr */
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3496. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3498. do { \
  3499. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3500. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3501. } while (0)
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3503. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3507. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3508. } while (0)
  3509. /* for systems using 32-bit format for bus addr */
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3511. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3515. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3516. } while (0)
  3517. /* for systems using 64-bit format for bus addr */
  3518. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3519. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3520. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3523. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3524. } while (0)
  3525. /* for systems using 64-bit format for bus addr */
  3526. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3527. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3528. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3531. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3532. } while (0)
  3533. /* for systems using 32-bit format for bus addr */
  3534. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3536. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3539. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3540. } while (0)
  3541. /* for systems using 64-bit format for bus addr */
  3542. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3543. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3544. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3547. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3548. } while (0)
  3549. /* for systems using 64-bit format for bus addr */
  3550. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3552. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3556. } while (0)
  3557. /* for systems using 32-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3560. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3564. } while (0)
  3565. /* for systems using 64-bit format for bus addr */
  3566. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3567. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3568. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3571. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3572. } while (0)
  3573. /* for systems using 64-bit format for bus addr */
  3574. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3575. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3576. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3579. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3580. } while (0)
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3583. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3587. } while (0)
  3588. /* for systems using 32-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3591. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3595. } while (0)
  3596. /* for systems using 64-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3599. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3603. } while (0)
  3604. /* for systems using 64-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3607. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3611. } while (0)
  3612. /* for systems using 32-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3615. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3619. } while (0)
  3620. /* for systems using 64-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3623. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3627. } while (0)
  3628. /* for systems using 64-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3631. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3635. } while (0)
  3636. /* for systems using 32-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3639. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3643. } while (0)
  3644. /* for systems using 64-bit format for bus addr */
  3645. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3646. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3647. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3650. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3651. } while (0)
  3652. /* for systems using 64-bit format for bus addr */
  3653. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3654. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3655. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3658. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3659. } while (0)
  3660. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3662. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3666. } while (0)
  3667. /* for systems using 32-bit format for bus addr */
  3668. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3670. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3674. } while (0)
  3675. /* for systems using 64-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3678. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3682. } while (0)
  3683. /* for systems using 64-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3686. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3690. } while (0)
  3691. /* for systems using 32-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3694. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3698. } while (0)
  3699. /* for systems using 64-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3706. } while (0)
  3707. /* for systems using 64-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3714. } while (0)
  3715. /*
  3716. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3717. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3718. * addresses are stored in a XXX-bit field.
  3719. * This macro is used to define both htt_wdi_ipa_config32_t and
  3720. * htt_wdi_ipa_config64_t structs.
  3721. */
  3722. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3723. _paddr__tx_comp_ring_base_addr_, \
  3724. _paddr__tx_comp_wr_idx_addr_, \
  3725. _paddr__tx_ce_wr_idx_addr_, \
  3726. _paddr__rx_ind_ring_base_addr_, \
  3727. _paddr__rx_ind_rd_idx_addr_, \
  3728. _paddr__rx_ind_wr_idx_addr_, \
  3729. _paddr__rx_ring2_base_addr_,\
  3730. _paddr__rx_ring2_rd_idx_addr_,\
  3731. _paddr__rx_ring2_wr_idx_addr_) \
  3732. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3733. { \
  3734. /* DWORD 0: flags and meta-data */ \
  3735. A_UINT32 \
  3736. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3737. reserved: 8, \
  3738. tx_pkt_pool_size: 16;\
  3739. /* DWORD 1 */\
  3740. _paddr__tx_comp_ring_base_addr_;\
  3741. /* DWORD 2 (or 3)*/\
  3742. A_UINT32 tx_comp_ring_size;\
  3743. /* DWORD 3 (or 4)*/\
  3744. _paddr__tx_comp_wr_idx_addr_;\
  3745. /* DWORD 4 (or 6)*/\
  3746. _paddr__tx_ce_wr_idx_addr_;\
  3747. /* DWORD 5 (or 8)*/\
  3748. _paddr__rx_ind_ring_base_addr_;\
  3749. /* DWORD 6 (or 10)*/\
  3750. A_UINT32 rx_ind_ring_size;\
  3751. /* DWORD 7 (or 11)*/\
  3752. _paddr__rx_ind_rd_idx_addr_;\
  3753. /* DWORD 8 (or 13)*/\
  3754. _paddr__rx_ind_wr_idx_addr_;\
  3755. /* DWORD 9 (or 15)*/\
  3756. _paddr__rx_ring2_base_addr_;\
  3757. /* DWORD 10 (or 17) */\
  3758. A_UINT32 rx_ring2_size;\
  3759. /* DWORD 11 (or 18) */\
  3760. _paddr__rx_ring2_rd_idx_addr_;\
  3761. /* DWORD 12 (or 20) */\
  3762. _paddr__rx_ring2_wr_idx_addr_;\
  3763. } POSTPACK
  3764. /* define a htt_wdi_ipa_config32_t type */
  3765. 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));
  3766. /* define a htt_wdi_ipa_config64_t type */
  3767. 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));
  3768. #if HTT_PADDR64
  3769. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3770. #else
  3771. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3772. #endif
  3773. enum htt_wdi_ipa_op_code {
  3774. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3775. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3776. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3777. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3778. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3779. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3780. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3781. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3782. /* keep this last */
  3783. HTT_WDI_IPA_OPCODE_MAX
  3784. };
  3785. /**
  3786. * @brief HTT WDI_IPA Operation Request Message
  3787. *
  3788. * @details
  3789. * HTT WDI_IPA Operation Request message is sent by host
  3790. * to either suspend or resume WDI_IPA TX or RX path.
  3791. * |31 24|23 16|15 8|7 0|
  3792. * |----------------+----------------+----------------+----------------|
  3793. * | op_code | Rsvd | msg_type |
  3794. * |-------------------------------------------------------------------|
  3795. *
  3796. * Header fields:
  3797. * - MSG_TYPE
  3798. * Bits 7:0
  3799. * Purpose: Identifies this as WDI_IPA Operation Request message
  3800. * value: = 0x9
  3801. * - OP_CODE
  3802. * Bits 31:16
  3803. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3804. * value: = enum htt_wdi_ipa_op_code
  3805. */
  3806. PREPACK struct htt_wdi_ipa_op_request_t
  3807. {
  3808. /* DWORD 0: flags and meta-data */
  3809. A_UINT32
  3810. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3811. reserved: 8,
  3812. op_code: 16;
  3813. } POSTPACK;
  3814. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3815. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3816. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3817. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3818. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3819. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3820. do { \
  3821. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3822. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3823. } while (0)
  3824. /*
  3825. * @brief host -> target HTT_SRING_SETUP message
  3826. *
  3827. * @details
  3828. * After target is booted up, Host can send SRING setup message for
  3829. * each host facing LMAC SRING. Target setups up HW registers based
  3830. * on setup message and confirms back to Host if response_required is set.
  3831. * Host should wait for confirmation message before sending new SRING
  3832. * setup message
  3833. *
  3834. * The message would appear as follows:
  3835. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3836. * |--------------- +-----------------+----------------+------------------|
  3837. * | ring_type | ring_id | pdev_id | msg_type |
  3838. * |----------------------------------------------------------------------|
  3839. * | ring_base_addr_lo |
  3840. * |----------------------------------------------------------------------|
  3841. * | ring_base_addr_hi |
  3842. * |----------------------------------------------------------------------|
  3843. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3844. * |----------------------------------------------------------------------|
  3845. * | ring_head_offset32_remote_addr_lo |
  3846. * |----------------------------------------------------------------------|
  3847. * | ring_head_offset32_remote_addr_hi |
  3848. * |----------------------------------------------------------------------|
  3849. * | ring_tail_offset32_remote_addr_lo |
  3850. * |----------------------------------------------------------------------|
  3851. * | ring_tail_offset32_remote_addr_hi |
  3852. * |----------------------------------------------------------------------|
  3853. * | ring_msi_addr_lo |
  3854. * |----------------------------------------------------------------------|
  3855. * | ring_msi_addr_hi |
  3856. * |----------------------------------------------------------------------|
  3857. * | ring_msi_data |
  3858. * |----------------------------------------------------------------------|
  3859. * | intr_timer_th |IM| intr_batch_counter_th |
  3860. * |----------------------------------------------------------------------|
  3861. * | reserved |RR|PTCF| intr_low_threshold |
  3862. * |----------------------------------------------------------------------|
  3863. * Where
  3864. * IM = sw_intr_mode
  3865. * RR = response_required
  3866. * PTCF = prefetch_timer_cfg
  3867. *
  3868. * The message is interpreted as follows:
  3869. * dword0 - b'0:7 - msg_type: This will be set to
  3870. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3871. * b'8:15 - pdev_id:
  3872. * 0 (for rings at SOC/UMAC level),
  3873. * 1/2/3 mac id (for rings at LMAC level)
  3874. * b'16:23 - ring_id: identify which ring is to setup,
  3875. * more details can be got from enum htt_srng_ring_id
  3876. * b'24:31 - ring_type: identify type of host rings,
  3877. * more details can be got from enum htt_srng_ring_type
  3878. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3879. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3880. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3881. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3882. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3883. * SW_TO_HW_RING.
  3884. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3885. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3886. * Lower 32 bits of memory address of the remote variable
  3887. * storing the 4-byte word offset that identifies the head
  3888. * element within the ring.
  3889. * (The head offset variable has type A_UINT32.)
  3890. * Valid for HW_TO_SW and SW_TO_SW rings.
  3891. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3892. * Upper 32 bits of memory address of the remote variable
  3893. * storing the 4-byte word offset that identifies the head
  3894. * element within the ring.
  3895. * (The head offset variable has type A_UINT32.)
  3896. * Valid for HW_TO_SW and SW_TO_SW rings.
  3897. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3898. * Lower 32 bits of memory address of the remote variable
  3899. * storing the 4-byte word offset that identifies the tail
  3900. * element within the ring.
  3901. * (The tail offset variable has type A_UINT32.)
  3902. * Valid for HW_TO_SW and SW_TO_SW rings.
  3903. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3904. * Upper 32 bits of memory address of the remote variable
  3905. * storing the 4-byte word offset that identifies the tail
  3906. * element within the ring.
  3907. * (The tail offset variable has type A_UINT32.)
  3908. * Valid for HW_TO_SW and SW_TO_SW rings.
  3909. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3910. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3911. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3912. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3913. * dword10 - b'0:31 - ring_msi_data: MSI data
  3914. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3915. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3916. * dword11 - b'0:14 - intr_batch_counter_th:
  3917. * batch counter threshold is in units of 4-byte words.
  3918. * HW internally maintains and increments batch count.
  3919. * (see SRING spec for detail description).
  3920. * When batch count reaches threshold value, an interrupt
  3921. * is generated by HW.
  3922. * b'15 - sw_intr_mode:
  3923. * This configuration shall be static.
  3924. * Only programmed at power up.
  3925. * 0: generate pulse style sw interrupts
  3926. * 1: generate level style sw interrupts
  3927. * b'16:31 - intr_timer_th:
  3928. * The timer init value when timer is idle or is
  3929. * initialized to start downcounting.
  3930. * In 8us units (to cover a range of 0 to 524 ms)
  3931. * dword12 - b'0:15 - intr_low_threshold:
  3932. * Used only by Consumer ring to generate ring_sw_int_p.
  3933. * Ring entries low threshold water mark, that is used
  3934. * in combination with the interrupt timer as well as
  3935. * the the clearing of the level interrupt.
  3936. * b'16:18 - prefetch_timer_cfg:
  3937. * Used only by Consumer ring to set timer mode to
  3938. * support Application prefetch handling.
  3939. * The external tail offset/pointer will be updated
  3940. * at following intervals:
  3941. * 3'b000: (Prefetch feature disabled; used only for debug)
  3942. * 3'b001: 1 usec
  3943. * 3'b010: 4 usec
  3944. * 3'b011: 8 usec (default)
  3945. * 3'b100: 16 usec
  3946. * Others: Reserverd
  3947. * b'19 - response_required:
  3948. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3949. * b'20:31 - reserved: reserved for future use
  3950. */
  3951. PREPACK struct htt_sring_setup_t {
  3952. A_UINT32 msg_type: 8,
  3953. pdev_id: 8,
  3954. ring_id: 8,
  3955. ring_type: 8;
  3956. A_UINT32 ring_base_addr_lo;
  3957. A_UINT32 ring_base_addr_hi;
  3958. A_UINT32 ring_size: 16,
  3959. ring_entry_size: 8,
  3960. ring_misc_cfg_flag: 8;
  3961. A_UINT32 ring_head_offset32_remote_addr_lo;
  3962. A_UINT32 ring_head_offset32_remote_addr_hi;
  3963. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3964. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3965. A_UINT32 ring_msi_addr_lo;
  3966. A_UINT32 ring_msi_addr_hi;
  3967. A_UINT32 ring_msi_data;
  3968. A_UINT32 intr_batch_counter_th: 15,
  3969. sw_intr_mode: 1,
  3970. intr_timer_th: 16;
  3971. A_UINT32 intr_low_threshold: 16,
  3972. prefetch_timer_cfg: 3,
  3973. response_required: 1,
  3974. reserved1: 12;
  3975. } POSTPACK;
  3976. enum htt_srng_ring_type {
  3977. HTT_HW_TO_SW_RING = 0,
  3978. HTT_SW_TO_HW_RING,
  3979. HTT_SW_TO_SW_RING,
  3980. /* Insert new ring types above this line */
  3981. };
  3982. enum htt_srng_ring_id {
  3983. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3984. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3985. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3986. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3987. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3988. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3989. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3990. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3991. /* Add Other SRING which can't be directly configured by host software above this line */
  3992. };
  3993. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3994. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3995. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3996. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3997. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3998. HTT_SRING_SETUP_PDEV_ID_S)
  3999. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4000. do { \
  4001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4002. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4003. } while (0)
  4004. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4005. #define HTT_SRING_SETUP_RING_ID_S 16
  4006. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4007. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4008. HTT_SRING_SETUP_RING_ID_S)
  4009. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4010. do { \
  4011. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4012. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4013. } while (0)
  4014. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4015. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4016. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4017. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4018. HTT_SRING_SETUP_RING_TYPE_S)
  4019. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4020. do { \
  4021. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4022. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4023. } while (0)
  4024. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4025. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4026. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4027. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4028. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4029. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4030. do { \
  4031. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4032. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4033. } while (0)
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4036. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4037. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4038. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4039. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4040. do { \
  4041. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4042. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4043. } while (0)
  4044. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4045. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4046. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4047. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4048. HTT_SRING_SETUP_RING_SIZE_S)
  4049. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4050. do { \
  4051. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4052. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4053. } while (0)
  4054. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4055. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4056. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4057. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4058. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4059. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4060. do { \
  4061. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4062. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4063. } while (0)
  4064. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4065. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4066. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4067. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4068. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4069. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4070. do { \
  4071. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4072. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4073. } while (0)
  4074. /* This control bit is applicable to only Producer, which updates Ring ID field
  4075. * of each descriptor before pushing into the ring.
  4076. * 0: updates ring_id(default)
  4077. * 1: ring_id updating disabled */
  4078. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4080. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4081. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4082. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4083. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4086. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4087. } while (0)
  4088. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4089. * of each descriptor before pushing into the ring.
  4090. * 0: updates Loopcnt(default)
  4091. * 1: Loopcnt updating disabled */
  4092. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4093. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4094. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4095. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4096. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4097. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4100. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4101. } while (0)
  4102. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4103. * into security_id port of GXI/AXI. */
  4104. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4106. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4107. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4108. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4109. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4112. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4113. } while (0)
  4114. /* During MSI write operation, SRNG drives value of this register bit into
  4115. * swap bit of GXI/AXI. */
  4116. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4118. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4119. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4120. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4121. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4124. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4125. } while (0)
  4126. /* During Pointer write operation, SRNG drives value of this register bit into
  4127. * swap bit of GXI/AXI. */
  4128. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4129. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4130. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4131. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4132. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4133. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4136. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4137. } while (0)
  4138. /* During any data or TLV write operation, SRNG drives value of this register
  4139. * bit into swap bit of GXI/AXI. */
  4140. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4143. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4144. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4145. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4148. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4149. } while (0)
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4151. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4152. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4153. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4154. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4155. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4156. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4157. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4160. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4161. } while (0)
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4164. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4165. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4166. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4167. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4170. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4171. } while (0)
  4172. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4173. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4174. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4175. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4176. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4177. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4180. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4181. } while (0)
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4184. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4185. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4186. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4187. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4190. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4191. } while (0)
  4192. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4193. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4194. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4195. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4196. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4197. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4200. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4201. } while (0)
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4204. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4205. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4206. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4207. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4210. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4211. } while (0)
  4212. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4213. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4214. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4215. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4216. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4217. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4220. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4221. } while (0)
  4222. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4223. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4224. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4225. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4226. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4227. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4230. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4231. } while (0)
  4232. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4233. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4234. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4235. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4236. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4237. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4240. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4241. } while (0)
  4242. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4243. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4244. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4245. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4246. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4247. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4248. do { \
  4249. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4250. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4251. } while (0)
  4252. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4253. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4254. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4255. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4256. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4257. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4260. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4261. } while (0)
  4262. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4263. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4264. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4265. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4266. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4267. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4270. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4271. } while (0)
  4272. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4273. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4274. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4275. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4276. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4277. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4278. do { \
  4279. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4280. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4281. } while (0)
  4282. /**
  4283. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4284. *
  4285. * @details
  4286. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4287. * configure RXDMA rings.
  4288. * The configuration is per ring based and includes both packet subtypes
  4289. * and PPDU/MPDU TLVs.
  4290. *
  4291. * The message would appear as follows:
  4292. *
  4293. * |31 26|25|24|23 16|15 8|7 0|
  4294. * |-----------------+----------------+----------------+---------------|
  4295. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4296. * |-------------------------------------------------------------------|
  4297. * | rsvd2 | ring_buffer_size |
  4298. * |-------------------------------------------------------------------|
  4299. * | packet_type_enable_flags_0 |
  4300. * |-------------------------------------------------------------------|
  4301. * | packet_type_enable_flags_1 |
  4302. * |-------------------------------------------------------------------|
  4303. * | packet_type_enable_flags_2 |
  4304. * |-------------------------------------------------------------------|
  4305. * | packet_type_enable_flags_3 |
  4306. * |-------------------------------------------------------------------|
  4307. * | tlv_filter_in_flags |
  4308. * |-------------------------------------------------------------------|
  4309. * Where:
  4310. * PS = pkt_swap
  4311. * SS = status_swap
  4312. * The message is interpreted as follows:
  4313. * dword0 - b'0:7 - msg_type: This will be set to
  4314. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4315. * b'8:15 - pdev_id:
  4316. * 0 (for rings at SOC/UMAC level),
  4317. * 1/2/3 mac id (for rings at LMAC level)
  4318. * b'16:23 - ring_id : Identify the ring to configure.
  4319. * More details can be got from enum htt_srng_ring_id
  4320. * b'24 - status_swap: 1 is to swap status TLV
  4321. * b'25 - pkt_swap: 1 is to swap packet TLV
  4322. * b'26:31 - rsvd1: reserved for future use
  4323. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4324. * in byte units.
  4325. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4326. * - b'16:31 - rsvd2: Reserved for future use
  4327. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4328. * Enable MGMT packet from 0b0000 to 0b1001
  4329. * bits from low to high: FP, MD, MO - 3 bits
  4330. * FP: Filter_Pass
  4331. * MD: Monitor_Direct
  4332. * MO: Monitor_Other
  4333. * 10 mgmt subtypes * 3 bits -> 30 bits
  4334. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4335. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4336. * Enable MGMT packet from 0b1010 to 0b1111
  4337. * bits from low to high: FP, MD, MO - 3 bits
  4338. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4339. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4340. * Enable CTRL packet from 0b0000 to 0b1001
  4341. * bits from low to high: FP, MD, MO - 3 bits
  4342. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4343. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4344. * Enable CTRL packet from 0b1010 to 0b1111,
  4345. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4346. * bits from low to high: FP, MD, MO - 3 bits
  4347. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4348. * dword6 - b'0:31 - tlv_filter_in_flags:
  4349. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4350. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4351. */
  4352. PREPACK struct htt_rx_ring_selection_cfg_t {
  4353. A_UINT32 msg_type: 8,
  4354. pdev_id: 8,
  4355. ring_id: 8,
  4356. status_swap: 1,
  4357. pkt_swap: 1,
  4358. rsvd1: 6;
  4359. A_UINT32 ring_buffer_size: 16,
  4360. rsvd2: 16;
  4361. A_UINT32 packet_type_enable_flags_0;
  4362. A_UINT32 packet_type_enable_flags_1;
  4363. A_UINT32 packet_type_enable_flags_2;
  4364. A_UINT32 packet_type_enable_flags_3;
  4365. A_UINT32 tlv_filter_in_flags;
  4366. } POSTPACK;
  4367. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4368. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4369. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4370. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4371. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4372. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4373. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4377. } while (0)
  4378. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4379. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4380. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4381. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4382. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4383. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4384. do { \
  4385. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4386. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4387. } while (0)
  4388. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4389. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4390. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4391. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4392. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4393. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4394. do { \
  4395. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4396. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4397. } while (0)
  4398. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4401. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4402. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4404. do { \
  4405. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4406. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4407. } while (0)
  4408. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4409. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4410. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4411. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4412. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4413. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4414. do { \
  4415. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4416. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4417. } while (0)
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4421. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4422. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4424. do { \
  4425. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4426. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4427. } while (0)
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4431. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4432. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4434. do { \
  4435. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4436. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4437. } while (0)
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4441. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4442. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4444. do { \
  4445. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4446. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4447. } while (0)
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4451. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4452. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4454. do { \
  4455. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4456. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4457. } while (0)
  4458. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4459. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4460. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4461. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4462. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4464. do { \
  4465. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4466. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4467. } while (0)
  4468. /*
  4469. * Subtype based MGMT frames enable bits.
  4470. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4471. */
  4472. /* association request */
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4479. /* association response */
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4486. /* Reassociation request */
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4493. /* Reassociation response */
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4500. /* Probe request */
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4507. /* Probe response */
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4514. /* Timing Advertisement */
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4521. /* Reserved */
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4528. /* Beacon */
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4535. /* ATIM */
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4542. /* Disassociation */
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4549. /* Authentication */
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4556. /* Deauthentication */
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4563. /* Action */
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4570. /* Action No Ack */
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4577. /* Reserved */
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4584. /*
  4585. * Subtype based CTRL frames enable bits.
  4586. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4587. */
  4588. /* Reserved */
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4595. /* Reserved */
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4602. /* Reserved */
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4609. /* Reserved */
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4616. /* Reserved */
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4623. /* Reserved */
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4630. /* Reserved */
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4637. /* Control Wrapper */
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4644. /* Block Ack Request */
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4651. /* Block Ack*/
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4658. /* PS-POLL */
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4665. /* RTS */
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4672. /* CTS */
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4679. /* ACK */
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4686. /* CF-END */
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4693. /* CF-END + CF-ACK */
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4700. /* Multicast data */
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4707. /* Unicast data */
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4714. /* NULL data */
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4722. do { \
  4723. HTT_CHECK_SET_VAL(httsym, value); \
  4724. (word) |= (value) << httsym##_S; \
  4725. } while (0)
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4727. (((word) & httsym##_M) >> httsym##_S)
  4728. #define htt_rx_ring_pkt_enable_subtype_set( \
  4729. word, flag, mode, type, subtype, val) \
  4730. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4731. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4732. #define htt_rx_ring_pkt_enable_subtype_get( \
  4733. word, flag, mode, type, subtype) \
  4734. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4735. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4736. /* Definition to filter in TLVs */
  4737. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4738. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4747. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4748. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4749. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4750. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4751. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4752. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4753. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4754. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4755. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4756. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4757. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4758. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4759. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4760. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4761. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4762. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4763. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4764. do { \
  4765. HTT_CHECK_SET_VAL(httsym, enable); \
  4766. (word) |= (enable) << httsym##_S; \
  4767. } while (0)
  4768. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4769. (((word) & httsym##_M) >> httsym##_S)
  4770. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4771. HTT_RX_RING_TLV_ENABLE_SET( \
  4772. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4773. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4774. HTT_RX_RING_TLV_ENABLE_GET( \
  4775. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4776. /**
  4777. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4778. * host --> target Receive Flow Steering configuration message definition.
  4779. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4780. * The reason for this is we want RFS to be configured and ready before MAC
  4781. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4782. *
  4783. * |31 24|23 16|15 9|8|7 0|
  4784. * |----------------+----------------+----------------+----------------|
  4785. * | reserved |E| msg type |
  4786. * |-------------------------------------------------------------------|
  4787. * Where E = RFS enable flag
  4788. *
  4789. * The RFS_CONFIG message consists of a single 4-byte word.
  4790. *
  4791. * Header fields:
  4792. * - MSG_TYPE
  4793. * Bits 7:0
  4794. * Purpose: identifies this as a RFS config msg
  4795. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4796. * - RFS_CONFIG
  4797. * Bit 8
  4798. * Purpose: Tells target whether to enable (1) or disable (0)
  4799. * flow steering feature when sending rx indication messages to host
  4800. */
  4801. #define HTT_H2T_RFS_CONFIG_M 0x100
  4802. #define HTT_H2T_RFS_CONFIG_S 8
  4803. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4804. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4805. HTT_H2T_RFS_CONFIG_S)
  4806. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4809. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4810. } while (0)
  4811. #define HTT_RFS_CFG_REQ_BYTES 4
  4812. /**
  4813. * @brief host -> target FW extended statistics retrieve
  4814. *
  4815. * @details
  4816. * The following field definitions describe the format of the HTT host
  4817. * to target FW extended stats retrieve message.
  4818. * The message specifies the type of stats the host wants to retrieve.
  4819. *
  4820. * |31 24|23 16|15 8|7 0|
  4821. * |-----------------------------------------------------------|
  4822. * | reserved | stats type | pdev_mask | msg type |
  4823. * |-----------------------------------------------------------|
  4824. * | config param [0] |
  4825. * |-----------------------------------------------------------|
  4826. * | config param [1] |
  4827. * |-----------------------------------------------------------|
  4828. * | config param [2] |
  4829. * |-----------------------------------------------------------|
  4830. * | config param [3] |
  4831. * |-----------------------------------------------------------|
  4832. * | reserved |
  4833. * |-----------------------------------------------------------|
  4834. * | cookie LSBs |
  4835. * |-----------------------------------------------------------|
  4836. * | cookie MSBs |
  4837. * |-----------------------------------------------------------|
  4838. * Header fields:
  4839. * - MSG_TYPE
  4840. * Bits 7:0
  4841. * Purpose: identifies this is a extended stats upload request message
  4842. * Value: 0x10
  4843. * - PDEV_MASK
  4844. * Bits 8:15
  4845. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4846. * Value: This is a overloaded field, refer to usage and interpretation of
  4847. * PDEV in interface document.
  4848. * Bit 8 : Reserved for SOC stats
  4849. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4850. * Indicates MACID_MASK in DBS
  4851. * - STATS_TYPE
  4852. * Bits 23:16
  4853. * Purpose: identifies which FW statistics to upload
  4854. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4855. * - Reserved
  4856. * Bits 31:24
  4857. * - CONFIG_PARAM [0]
  4858. * Bits 31:0
  4859. * Purpose: give an opaque configuration value to the specified stats type
  4860. * Value: stats-type specific configuration value
  4861. * Refer to htt_stats.h for interpretation for each stats sub_type
  4862. * - CONFIG_PARAM [1]
  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 [2]
  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 [3]
  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. * - Reserved [31:0] for future use.
  4878. * - COOKIE_LSBS
  4879. * Bits 31:0
  4880. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4881. * message with its preceding host->target stats request message.
  4882. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4883. * - COOKIE_MSBS
  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: MSBs of the opaque cookie specified by the host-side requestor
  4888. */
  4889. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4890. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4891. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4892. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4893. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4894. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4895. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4896. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4897. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4898. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4899. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4902. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4903. } while (0)
  4904. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4905. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4906. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4907. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4908. do { \
  4909. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4910. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4911. } while (0)
  4912. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4913. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4914. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4915. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4916. do { \
  4917. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4918. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4919. } while (0)
  4920. /**
  4921. * @brief host -> target FW PPDU_STATS request message
  4922. *
  4923. * @details
  4924. * The following field definitions describe the format of the HTT host
  4925. * to target FW for PPDU_STATS_CFG msg.
  4926. * The message allows the host to configure the PPDU_STATS_IND messages
  4927. * produced by the target.
  4928. *
  4929. * |31 24|23 16|15 8|7 0|
  4930. * |-----------------------------------------------------------|
  4931. * | REQ bit mask | pdev_mask | msg type |
  4932. * |-----------------------------------------------------------|
  4933. * Header fields:
  4934. * - MSG_TYPE
  4935. * Bits 7:0
  4936. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4937. * Value: 0x11
  4938. * - PDEV_MASK
  4939. * Bits 8:15
  4940. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4941. * Value: This is a overloaded field, refer to usage and interpretation of
  4942. * PDEV in interface document.
  4943. * Bit 8 : Reserved for SOC stats
  4944. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4945. * Indicates MACID_MASK in DBS
  4946. * - REQ_TLV_BIT_MASK
  4947. * Bits 16:31
  4948. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4949. * needs to be included in the target's PPDU_STATS_IND messages.
  4950. * Value: refer htt_ppdu_stats_tlv_tag_t
  4951. *
  4952. */
  4953. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4954. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4955. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4956. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4957. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4958. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4959. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4960. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4961. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4962. do { \
  4963. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4964. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4965. } while (0)
  4966. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4967. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4968. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4969. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4972. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4973. } while (0)
  4974. /*=== target -> host messages ===============================================*/
  4975. enum htt_t2h_msg_type {
  4976. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4977. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4978. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4979. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4980. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4981. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4982. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4983. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4984. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4985. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4986. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4987. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4988. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4989. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4990. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4991. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4992. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4993. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4994. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4995. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4996. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4997. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4998. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4999. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5000. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5001. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5002. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5003. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5004. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5005. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5006. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5007. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5008. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5009. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5010. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5011. HTT_T2H_MSG_TYPE_TEST,
  5012. /* keep this last */
  5013. HTT_T2H_NUM_MSGS
  5014. };
  5015. /*
  5016. * HTT target to host message type -
  5017. * stored in bits 7:0 of the first word of the message
  5018. */
  5019. #define HTT_T2H_MSG_TYPE_M 0xff
  5020. #define HTT_T2H_MSG_TYPE_S 0
  5021. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5022. do { \
  5023. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5024. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5025. } while (0)
  5026. #define HTT_T2H_MSG_TYPE_GET(word) \
  5027. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5028. /**
  5029. * @brief target -> host version number confirmation message definition
  5030. *
  5031. * |31 24|23 16|15 8|7 0|
  5032. * |----------------+----------------+----------------+----------------|
  5033. * | reserved | major number | minor number | msg type |
  5034. * |-------------------------------------------------------------------|
  5035. * : option request TLV (optional) |
  5036. * :...................................................................:
  5037. *
  5038. * The VER_CONF message may consist of a single 4-byte word, or may be
  5039. * extended with TLVs that specify HTT options selected by the target.
  5040. * The following option TLVs may be appended to the VER_CONF message:
  5041. * - LL_BUS_ADDR_SIZE
  5042. * - HL_SUPPRESS_TX_COMPL_IND
  5043. * - MAX_TX_QUEUE_GROUPS
  5044. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5045. * may be appended to the VER_CONF message (but only one TLV of each type).
  5046. *
  5047. * Header fields:
  5048. * - MSG_TYPE
  5049. * Bits 7:0
  5050. * Purpose: identifies this as a version number confirmation message
  5051. * Value: 0x0
  5052. * - VER_MINOR
  5053. * Bits 15:8
  5054. * Purpose: Specify the minor number of the HTT message library version
  5055. * in use by the target firmware.
  5056. * The minor number specifies the specific revision within a range
  5057. * of fundamentally compatible HTT message definition revisions.
  5058. * Compatible revisions involve adding new messages or perhaps
  5059. * adding new fields to existing messages, in a backwards-compatible
  5060. * manner.
  5061. * Incompatible revisions involve changing the message type values,
  5062. * or redefining existing messages.
  5063. * Value: minor number
  5064. * - VER_MAJOR
  5065. * Bits 15:8
  5066. * Purpose: Specify the major number of the HTT message library version
  5067. * in use by the target firmware.
  5068. * The major number specifies the family of minor revisions that are
  5069. * fundamentally compatible with each other, but not with prior or
  5070. * later families.
  5071. * Value: major number
  5072. */
  5073. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5074. #define HTT_VER_CONF_MINOR_S 8
  5075. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5076. #define HTT_VER_CONF_MAJOR_S 16
  5077. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5078. do { \
  5079. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5080. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5081. } while (0)
  5082. #define HTT_VER_CONF_MINOR_GET(word) \
  5083. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5084. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5085. do { \
  5086. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5087. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5088. } while (0)
  5089. #define HTT_VER_CONF_MAJOR_GET(word) \
  5090. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5091. #define HTT_VER_CONF_BYTES 4
  5092. /**
  5093. * @brief - target -> host HTT Rx In order indication message
  5094. *
  5095. * @details
  5096. *
  5097. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5098. * |----------------+-------------------+---------------------+---------------|
  5099. * | peer ID | P| F| O| ext TID | msg type |
  5100. * |--------------------------------------------------------------------------|
  5101. * | MSDU count | Reserved | vdev id |
  5102. * |--------------------------------------------------------------------------|
  5103. * | MSDU 0 bus address (bits 31:0) |
  5104. #if HTT_PADDR64
  5105. * | MSDU 0 bus address (bits 63:32) |
  5106. #endif
  5107. * |--------------------------------------------------------------------------|
  5108. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5109. * |--------------------------------------------------------------------------|
  5110. * | MSDU 1 bus address (bits 31:0) |
  5111. #if HTT_PADDR64
  5112. * | MSDU 1 bus address (bits 63:32) |
  5113. #endif
  5114. * |--------------------------------------------------------------------------|
  5115. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5116. * |--------------------------------------------------------------------------|
  5117. */
  5118. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5119. *
  5120. * @details
  5121. * bits
  5122. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5123. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5124. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5125. * | | frag | | | | fail |chksum fail|
  5126. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5127. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5128. */
  5129. struct htt_rx_in_ord_paddr_ind_hdr_t
  5130. {
  5131. A_UINT32 /* word 0 */
  5132. msg_type: 8,
  5133. ext_tid: 5,
  5134. offload: 1,
  5135. frag: 1,
  5136. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5137. peer_id: 16;
  5138. A_UINT32 /* word 1 */
  5139. vap_id: 8,
  5140. reserved_1: 8,
  5141. msdu_cnt: 16;
  5142. };
  5143. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5144. {
  5145. A_UINT32 dma_addr;
  5146. A_UINT32
  5147. length: 16,
  5148. fw_desc: 8,
  5149. msdu_info:8;
  5150. };
  5151. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5152. {
  5153. A_UINT32 dma_addr_lo;
  5154. A_UINT32 dma_addr_hi;
  5155. A_UINT32
  5156. length: 16,
  5157. fw_desc: 8,
  5158. msdu_info:8;
  5159. };
  5160. #if HTT_PADDR64
  5161. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5162. #else
  5163. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5164. #endif
  5165. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5166. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5168. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5175. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5176. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5177. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5178. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5179. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5180. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5181. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5182. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5183. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5184. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5185. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5186. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5187. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5188. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5189. /* for systems using 64-bit format for bus addresses */
  5190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5194. /* for systems using 32-bit format for bus addresses */
  5195. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5196. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5199. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5200. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5202. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5203. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5204. do { \
  5205. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5206. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5207. } while (0)
  5208. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5209. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5210. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5211. do { \
  5212. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5213. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5214. } while (0)
  5215. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5216. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5217. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5218. do { \
  5219. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5220. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5221. } while (0)
  5222. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5223. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5224. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5225. do { \
  5226. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5227. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5228. } while (0)
  5229. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5230. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5231. /* for systems using 64-bit format for bus addresses */
  5232. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5235. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5236. } while (0)
  5237. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5238. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5239. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5240. do { \
  5241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5243. } while (0)
  5244. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5245. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5246. /* for systems using 32-bit format for bus addresses */
  5247. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5248. do { \
  5249. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5250. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5251. } while (0)
  5252. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5253. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5254. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5255. do { \
  5256. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5257. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5258. } while (0)
  5259. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5260. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5261. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5262. do { \
  5263. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5264. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5265. } while (0)
  5266. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5267. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5268. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5269. do { \
  5270. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5271. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5272. } while (0)
  5273. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5274. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5275. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5276. do { \
  5277. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5278. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5279. } while (0)
  5280. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5281. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5282. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5283. do { \
  5284. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5285. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5286. } while (0)
  5287. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5288. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5289. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5290. do { \
  5291. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5292. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5293. } while (0)
  5294. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5295. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5296. /* definitions used within target -> host rx indication message */
  5297. PREPACK struct htt_rx_ind_hdr_prefix_t
  5298. {
  5299. A_UINT32 /* word 0 */
  5300. msg_type: 8,
  5301. ext_tid: 5,
  5302. release_valid: 1,
  5303. flush_valid: 1,
  5304. reserved0: 1,
  5305. peer_id: 16;
  5306. A_UINT32 /* word 1 */
  5307. flush_start_seq_num: 6,
  5308. flush_end_seq_num: 6,
  5309. release_start_seq_num: 6,
  5310. release_end_seq_num: 6,
  5311. num_mpdu_ranges: 8;
  5312. } POSTPACK;
  5313. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5314. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5315. #define HTT_TGT_RSSI_INVALID 0x80
  5316. PREPACK struct htt_rx_ppdu_desc_t
  5317. {
  5318. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5319. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5320. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5321. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5322. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5323. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5325. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5326. A_UINT32 /* word 0 */
  5327. rssi_cmb: 8,
  5328. timestamp_submicrosec: 8,
  5329. phy_err_code: 8,
  5330. phy_err: 1,
  5331. legacy_rate: 4,
  5332. legacy_rate_sel: 1,
  5333. end_valid: 1,
  5334. start_valid: 1;
  5335. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5336. union {
  5337. A_UINT32 /* word 1 */
  5338. rssi0_pri20: 8,
  5339. rssi0_ext20: 8,
  5340. rssi0_ext40: 8,
  5341. rssi0_ext80: 8;
  5342. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5343. } u0;
  5344. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5345. union {
  5346. A_UINT32 /* word 2 */
  5347. rssi1_pri20: 8,
  5348. rssi1_ext20: 8,
  5349. rssi1_ext40: 8,
  5350. rssi1_ext80: 8;
  5351. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5352. } u1;
  5353. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5354. union {
  5355. A_UINT32 /* word 3 */
  5356. rssi2_pri20: 8,
  5357. rssi2_ext20: 8,
  5358. rssi2_ext40: 8,
  5359. rssi2_ext80: 8;
  5360. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5361. } u2;
  5362. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5363. union {
  5364. A_UINT32 /* word 4 */
  5365. rssi3_pri20: 8,
  5366. rssi3_ext20: 8,
  5367. rssi3_ext40: 8,
  5368. rssi3_ext80: 8;
  5369. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5370. } u3;
  5371. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5372. A_UINT32 tsf32; /* word 5 */
  5373. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5374. A_UINT32 timestamp_microsec; /* word 6 */
  5375. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5376. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5377. A_UINT32 /* word 7 */
  5378. vht_sig_a1: 24,
  5379. preamble_type: 8;
  5380. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5381. A_UINT32 /* word 8 */
  5382. vht_sig_a2: 24,
  5383. reserved0: 8;
  5384. } POSTPACK;
  5385. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5386. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5387. PREPACK struct htt_rx_ind_hdr_suffix_t
  5388. {
  5389. A_UINT32 /* word 0 */
  5390. fw_rx_desc_bytes: 16,
  5391. reserved0: 16;
  5392. } POSTPACK;
  5393. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5394. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5395. PREPACK struct htt_rx_ind_hdr_t
  5396. {
  5397. struct htt_rx_ind_hdr_prefix_t prefix;
  5398. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5399. struct htt_rx_ind_hdr_suffix_t suffix;
  5400. } POSTPACK;
  5401. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5402. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5403. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5404. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5405. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5406. /*
  5407. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5408. * the offset into the HTT rx indication message at which the
  5409. * FW rx PPDU descriptor resides
  5410. */
  5411. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5412. /*
  5413. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5414. * the offset into the HTT rx indication message at which the
  5415. * header suffix (FW rx MSDU byte count) resides
  5416. */
  5417. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5418. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5419. /*
  5420. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5421. * the offset into the HTT rx indication message at which the per-MSDU
  5422. * information starts
  5423. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5424. * per-MSDU information portion of the message. The per-MSDU info itself
  5425. * starts at byte 12.
  5426. */
  5427. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5428. /**
  5429. * @brief target -> host rx indication message definition
  5430. *
  5431. * @details
  5432. * The following field definitions describe the format of the rx indication
  5433. * message sent from the target to the host.
  5434. * The message consists of three major sections:
  5435. * 1. a fixed-length header
  5436. * 2. a variable-length list of firmware rx MSDU descriptors
  5437. * 3. one or more 4-octet MPDU range information elements
  5438. * The fixed length header itself has two sub-sections
  5439. * 1. the message meta-information, including identification of the
  5440. * sender and type of the received data, and a 4-octet flush/release IE
  5441. * 2. the firmware rx PPDU descriptor
  5442. *
  5443. * The format of the message is depicted below.
  5444. * in this depiction, the following abbreviations are used for information
  5445. * elements within the message:
  5446. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5447. * elements associated with the PPDU start are valid.
  5448. * Specifically, the following fields are valid only if SV is set:
  5449. * RSSI (all variants), L, legacy rate, preamble type, service,
  5450. * VHT-SIG-A
  5451. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5452. * elements associated with the PPDU end are valid.
  5453. * Specifically, the following fields are valid only if EV is set:
  5454. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5455. * - L - Legacy rate selector - if legacy rates are used, this flag
  5456. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5457. * (L == 0) PHY.
  5458. * - P - PHY error flag - boolean indication of whether the rx frame had
  5459. * a PHY error
  5460. *
  5461. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5462. * |----------------+-------------------+---------------------+---------------|
  5463. * | peer ID | |RV|FV| ext TID | msg type |
  5464. * |--------------------------------------------------------------------------|
  5465. * | num | release | release | flush | flush |
  5466. * | MPDU | end | start | end | start |
  5467. * | ranges | seq num | seq num | seq num | seq num |
  5468. * |==========================================================================|
  5469. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5470. * |V|V| | rate | | | timestamp | RSSI |
  5471. * |--------------------------------------------------------------------------|
  5472. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5473. * |--------------------------------------------------------------------------|
  5474. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5475. * |--------------------------------------------------------------------------|
  5476. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5477. * |--------------------------------------------------------------------------|
  5478. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5479. * |--------------------------------------------------------------------------|
  5480. * | TSF LSBs |
  5481. * |--------------------------------------------------------------------------|
  5482. * | microsec timestamp |
  5483. * |--------------------------------------------------------------------------|
  5484. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5485. * |--------------------------------------------------------------------------|
  5486. * | service | HT-SIG / VHT-SIG-A2 |
  5487. * |==========================================================================|
  5488. * | reserved | FW rx desc bytes |
  5489. * |--------------------------------------------------------------------------|
  5490. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5491. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5492. * |--------------------------------------------------------------------------|
  5493. * : : :
  5494. * |--------------------------------------------------------------------------|
  5495. * | alignment | MSDU Rx |
  5496. * | padding | desc Bn |
  5497. * |--------------------------------------------------------------------------|
  5498. * | reserved | MPDU range status | MPDU count |
  5499. * |--------------------------------------------------------------------------|
  5500. * : reserved : MPDU range status : MPDU count :
  5501. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5502. *
  5503. * Header fields:
  5504. * - MSG_TYPE
  5505. * Bits 7:0
  5506. * Purpose: identifies this as an rx indication message
  5507. * Value: 0x1
  5508. * - EXT_TID
  5509. * Bits 12:8
  5510. * Purpose: identify the traffic ID of the rx data, including
  5511. * special "extended" TID values for multicast, broadcast, and
  5512. * non-QoS data frames
  5513. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5514. * - FLUSH_VALID (FV)
  5515. * Bit 13
  5516. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5517. * is valid
  5518. * Value:
  5519. * 1 -> flush IE is valid and needs to be processed
  5520. * 0 -> flush IE is not valid and should be ignored
  5521. * - REL_VALID (RV)
  5522. * Bit 13
  5523. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5524. * is valid
  5525. * Value:
  5526. * 1 -> release IE is valid and needs to be processed
  5527. * 0 -> release IE is not valid and should be ignored
  5528. * - PEER_ID
  5529. * Bits 31:16
  5530. * Purpose: Identify, by ID, which peer sent the rx data
  5531. * Value: ID of the peer who sent the rx data
  5532. * - FLUSH_SEQ_NUM_START
  5533. * Bits 5:0
  5534. * Purpose: Indicate the start of a series of MPDUs to flush
  5535. * Not all MPDUs within this series are necessarily valid - the host
  5536. * must check each sequence number within this range to see if the
  5537. * corresponding MPDU is actually present.
  5538. * This field is only valid if the FV bit is set.
  5539. * Value:
  5540. * The sequence number for the first MPDUs to check to flush.
  5541. * The sequence number is masked by 0x3f.
  5542. * - FLUSH_SEQ_NUM_END
  5543. * Bits 11:6
  5544. * Purpose: Indicate the end of a series of MPDUs to flush
  5545. * Value:
  5546. * The sequence number one larger than the sequence number of the
  5547. * last MPDU to check to flush.
  5548. * The sequence number is masked by 0x3f.
  5549. * Not all MPDUs within this series are necessarily valid - the host
  5550. * must check each sequence number within this range to see if the
  5551. * corresponding MPDU is actually present.
  5552. * This field is only valid if the FV bit is set.
  5553. * - REL_SEQ_NUM_START
  5554. * Bits 17:12
  5555. * Purpose: Indicate the start of a series of MPDUs to release.
  5556. * All MPDUs within this series are present and valid - the host
  5557. * need not check each sequence number within this range to see if
  5558. * the corresponding MPDU is actually present.
  5559. * This field is only valid if the RV bit is set.
  5560. * Value:
  5561. * The sequence number for the first MPDUs to check to release.
  5562. * The sequence number is masked by 0x3f.
  5563. * - REL_SEQ_NUM_END
  5564. * Bits 23:18
  5565. * Purpose: Indicate the end of a series of MPDUs to release.
  5566. * Value:
  5567. * The sequence number one larger than the sequence number of the
  5568. * last MPDU to check to release.
  5569. * The sequence number is masked by 0x3f.
  5570. * All MPDUs within this series are present and valid - the host
  5571. * need not check each sequence number within this range to see if
  5572. * the corresponding MPDU is actually present.
  5573. * This field is only valid if the RV bit is set.
  5574. * - NUM_MPDU_RANGES
  5575. * Bits 31:24
  5576. * Purpose: Indicate how many ranges of MPDUs are present.
  5577. * Each MPDU range consists of a series of contiguous MPDUs within the
  5578. * rx frame sequence which all have the same MPDU status.
  5579. * Value: 1-63 (typically a small number, like 1-3)
  5580. *
  5581. * Rx PPDU descriptor fields:
  5582. * - RSSI_CMB
  5583. * Bits 7:0
  5584. * Purpose: Combined RSSI from all active rx chains, across the active
  5585. * bandwidth.
  5586. * Value: RSSI dB units w.r.t. noise floor
  5587. * - TIMESTAMP_SUBMICROSEC
  5588. * Bits 15:8
  5589. * Purpose: high-resolution timestamp
  5590. * Value:
  5591. * Sub-microsecond time of PPDU reception.
  5592. * This timestamp ranges from [0,MAC clock MHz).
  5593. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5594. * to form a high-resolution, large range rx timestamp.
  5595. * - PHY_ERR_CODE
  5596. * Bits 23:16
  5597. * Purpose:
  5598. * If the rx frame processing resulted in a PHY error, indicate what
  5599. * type of rx PHY error occurred.
  5600. * Value:
  5601. * This field is valid if the "P" (PHY_ERR) flag is set.
  5602. * TBD: document/specify the values for this field
  5603. * - PHY_ERR
  5604. * Bit 24
  5605. * Purpose: indicate whether the rx PPDU had a PHY error
  5606. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5607. * - LEGACY_RATE
  5608. * Bits 28:25
  5609. * Purpose:
  5610. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5611. * specify which rate was used.
  5612. * Value:
  5613. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5614. * flag.
  5615. * If LEGACY_RATE_SEL is 0:
  5616. * 0x8: OFDM 48 Mbps
  5617. * 0x9: OFDM 24 Mbps
  5618. * 0xA: OFDM 12 Mbps
  5619. * 0xB: OFDM 6 Mbps
  5620. * 0xC: OFDM 54 Mbps
  5621. * 0xD: OFDM 36 Mbps
  5622. * 0xE: OFDM 18 Mbps
  5623. * 0xF: OFDM 9 Mbps
  5624. * If LEGACY_RATE_SEL is 1:
  5625. * 0x8: CCK 11 Mbps long preamble
  5626. * 0x9: CCK 5.5 Mbps long preamble
  5627. * 0xA: CCK 2 Mbps long preamble
  5628. * 0xB: CCK 1 Mbps long preamble
  5629. * 0xC: CCK 11 Mbps short preamble
  5630. * 0xD: CCK 5.5 Mbps short preamble
  5631. * 0xE: CCK 2 Mbps short preamble
  5632. * - LEGACY_RATE_SEL
  5633. * Bit 29
  5634. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5635. * Value:
  5636. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5637. * used a legacy rate.
  5638. * 0 -> OFDM, 1 -> CCK
  5639. * - END_VALID
  5640. * Bit 30
  5641. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5642. * the start of the PPDU are valid. Specifically, the following
  5643. * fields are only valid if END_VALID is set:
  5644. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5645. * TIMESTAMP_SUBMICROSEC
  5646. * Value:
  5647. * 0 -> rx PPDU desc end fields are not valid
  5648. * 1 -> rx PPDU desc end fields are valid
  5649. * - START_VALID
  5650. * Bit 31
  5651. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5652. * the end of the PPDU are valid. Specifically, the following
  5653. * fields are only valid if START_VALID is set:
  5654. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5655. * VHT-SIG-A
  5656. * Value:
  5657. * 0 -> rx PPDU desc start fields are not valid
  5658. * 1 -> rx PPDU desc start fields are valid
  5659. * - RSSI0_PRI20
  5660. * Bits 7:0
  5661. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5662. * Value: RSSI dB units w.r.t. noise floor
  5663. *
  5664. * - RSSI0_EXT20
  5665. * Bits 7:0
  5666. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5667. * (if the rx bandwidth was >= 40 MHz)
  5668. * Value: RSSI dB units w.r.t. noise floor
  5669. * - RSSI0_EXT40
  5670. * Bits 7:0
  5671. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5672. * (if the rx bandwidth was >= 80 MHz)
  5673. * Value: RSSI dB units w.r.t. noise floor
  5674. * - RSSI0_EXT80
  5675. * Bits 7:0
  5676. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5677. * (if the rx bandwidth was >= 160 MHz)
  5678. * Value: RSSI dB units w.r.t. noise floor
  5679. *
  5680. * - RSSI1_PRI20
  5681. * Bits 7:0
  5682. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5683. * Value: RSSI dB units w.r.t. noise floor
  5684. * - RSSI1_EXT20
  5685. * Bits 7:0
  5686. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5687. * (if the rx bandwidth was >= 40 MHz)
  5688. * Value: RSSI dB units w.r.t. noise floor
  5689. * - RSSI1_EXT40
  5690. * Bits 7:0
  5691. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5692. * (if the rx bandwidth was >= 80 MHz)
  5693. * Value: RSSI dB units w.r.t. noise floor
  5694. * - RSSI1_EXT80
  5695. * Bits 7:0
  5696. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5697. * (if the rx bandwidth was >= 160 MHz)
  5698. * Value: RSSI dB units w.r.t. noise floor
  5699. *
  5700. * - RSSI2_PRI20
  5701. * Bits 7:0
  5702. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5703. * Value: RSSI dB units w.r.t. noise floor
  5704. * - RSSI2_EXT20
  5705. * Bits 7:0
  5706. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5707. * (if the rx bandwidth was >= 40 MHz)
  5708. * Value: RSSI dB units w.r.t. noise floor
  5709. * - RSSI2_EXT40
  5710. * Bits 7:0
  5711. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5712. * (if the rx bandwidth was >= 80 MHz)
  5713. * Value: RSSI dB units w.r.t. noise floor
  5714. * - RSSI2_EXT80
  5715. * Bits 7:0
  5716. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5717. * (if the rx bandwidth was >= 160 MHz)
  5718. * Value: RSSI dB units w.r.t. noise floor
  5719. *
  5720. * - RSSI3_PRI20
  5721. * Bits 7:0
  5722. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5723. * Value: RSSI dB units w.r.t. noise floor
  5724. * - RSSI3_EXT20
  5725. * Bits 7:0
  5726. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5727. * (if the rx bandwidth was >= 40 MHz)
  5728. * Value: RSSI dB units w.r.t. noise floor
  5729. * - RSSI3_EXT40
  5730. * Bits 7:0
  5731. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5732. * (if the rx bandwidth was >= 80 MHz)
  5733. * Value: RSSI dB units w.r.t. noise floor
  5734. * - RSSI3_EXT80
  5735. * Bits 7:0
  5736. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5737. * (if the rx bandwidth was >= 160 MHz)
  5738. * Value: RSSI dB units w.r.t. noise floor
  5739. *
  5740. * - TSF32
  5741. * Bits 31:0
  5742. * Purpose: specify the time the rx PPDU was received, in TSF units
  5743. * Value: 32 LSBs of the TSF
  5744. * - TIMESTAMP_MICROSEC
  5745. * Bits 31:0
  5746. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5747. * Value: PPDU rx time, in microseconds
  5748. * - VHT_SIG_A1
  5749. * Bits 23:0
  5750. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5751. * from the rx PPDU
  5752. * Value:
  5753. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5754. * VHT-SIG-A1 data.
  5755. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5756. * first 24 bits of the HT-SIG data.
  5757. * Otherwise, this field is invalid.
  5758. * Refer to the the 802.11 protocol for the definition of the
  5759. * HT-SIG and VHT-SIG-A1 fields
  5760. * - VHT_SIG_A2
  5761. * Bits 23:0
  5762. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5763. * from the rx PPDU
  5764. * Value:
  5765. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5766. * VHT-SIG-A2 data.
  5767. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5768. * last 24 bits of the HT-SIG data.
  5769. * Otherwise, this field is invalid.
  5770. * Refer to the the 802.11 protocol for the definition of the
  5771. * HT-SIG and VHT-SIG-A2 fields
  5772. * - PREAMBLE_TYPE
  5773. * Bits 31:24
  5774. * Purpose: indicate the PHY format of the received burst
  5775. * Value:
  5776. * 0x4: Legacy (OFDM/CCK)
  5777. * 0x8: HT
  5778. * 0x9: HT with TxBF
  5779. * 0xC: VHT
  5780. * 0xD: VHT with TxBF
  5781. * - SERVICE
  5782. * Bits 31:24
  5783. * Purpose: TBD
  5784. * Value: TBD
  5785. *
  5786. * Rx MSDU descriptor fields:
  5787. * - FW_RX_DESC_BYTES
  5788. * Bits 15:0
  5789. * Purpose: Indicate how many bytes in the Rx indication are used for
  5790. * FW Rx descriptors
  5791. *
  5792. * Payload fields:
  5793. * - MPDU_COUNT
  5794. * Bits 7:0
  5795. * Purpose: Indicate how many sequential MPDUs share the same status.
  5796. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5797. * - MPDU_STATUS
  5798. * Bits 15:8
  5799. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5800. * received successfully.
  5801. * Value:
  5802. * 0x1: success
  5803. * 0x2: FCS error
  5804. * 0x3: duplicate error
  5805. * 0x4: replay error
  5806. * 0x5: invalid peer
  5807. */
  5808. /* header fields */
  5809. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5810. #define HTT_RX_IND_EXT_TID_S 8
  5811. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5812. #define HTT_RX_IND_FLUSH_VALID_S 13
  5813. #define HTT_RX_IND_REL_VALID_M 0x4000
  5814. #define HTT_RX_IND_REL_VALID_S 14
  5815. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5816. #define HTT_RX_IND_PEER_ID_S 16
  5817. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5818. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5819. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5820. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5821. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5822. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5823. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5824. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5825. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5826. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5827. /* rx PPDU descriptor fields */
  5828. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5829. #define HTT_RX_IND_RSSI_CMB_S 0
  5830. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5831. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5832. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5833. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5834. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5835. #define HTT_RX_IND_PHY_ERR_S 24
  5836. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5837. #define HTT_RX_IND_LEGACY_RATE_S 25
  5838. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5839. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5840. #define HTT_RX_IND_END_VALID_M 0x40000000
  5841. #define HTT_RX_IND_END_VALID_S 30
  5842. #define HTT_RX_IND_START_VALID_M 0x80000000
  5843. #define HTT_RX_IND_START_VALID_S 31
  5844. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5845. #define HTT_RX_IND_RSSI_PRI20_S 0
  5846. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5847. #define HTT_RX_IND_RSSI_EXT20_S 8
  5848. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5849. #define HTT_RX_IND_RSSI_EXT40_S 16
  5850. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5851. #define HTT_RX_IND_RSSI_EXT80_S 24
  5852. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5853. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5854. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5855. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5856. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5857. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5858. #define HTT_RX_IND_SERVICE_M 0xff000000
  5859. #define HTT_RX_IND_SERVICE_S 24
  5860. /* rx MSDU descriptor fields */
  5861. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5862. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5863. /* payload fields */
  5864. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5865. #define HTT_RX_IND_MPDU_COUNT_S 0
  5866. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5867. #define HTT_RX_IND_MPDU_STATUS_S 8
  5868. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5869. do { \
  5870. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5871. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5872. } while (0)
  5873. #define HTT_RX_IND_EXT_TID_GET(word) \
  5874. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5875. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5876. do { \
  5877. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5878. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5879. } while (0)
  5880. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5881. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5882. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5883. do { \
  5884. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5885. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5886. } while (0)
  5887. #define HTT_RX_IND_REL_VALID_GET(word) \
  5888. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5889. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5890. do { \
  5891. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5892. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5893. } while (0)
  5894. #define HTT_RX_IND_PEER_ID_GET(word) \
  5895. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5896. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5897. do { \
  5898. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5899. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5900. } while (0)
  5901. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5902. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5903. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5904. do { \
  5905. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5906. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5907. } while (0)
  5908. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5909. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5910. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5911. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5912. do { \
  5913. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5914. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5915. } while (0)
  5916. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5917. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5918. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5919. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5920. do { \
  5921. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5922. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5923. } while (0)
  5924. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5925. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5926. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5927. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5928. do { \
  5929. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5930. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5931. } while (0)
  5932. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5933. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5934. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5935. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5936. do { \
  5937. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5938. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5939. } while (0)
  5940. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5941. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5942. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5943. /* FW rx PPDU descriptor fields */
  5944. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5945. do { \
  5946. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5947. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5948. } while (0)
  5949. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5950. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5951. HTT_RX_IND_RSSI_CMB_S)
  5952. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5953. do { \
  5954. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5955. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5956. } while (0)
  5957. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5958. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5959. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5960. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5961. do { \
  5962. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5963. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5964. } while (0)
  5965. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5966. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5967. HTT_RX_IND_PHY_ERR_CODE_S)
  5968. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5969. do { \
  5970. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5971. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5972. } while (0)
  5973. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5974. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5975. HTT_RX_IND_PHY_ERR_S)
  5976. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5979. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5980. } while (0)
  5981. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5982. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5983. HTT_RX_IND_LEGACY_RATE_S)
  5984. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5987. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5988. } while (0)
  5989. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5990. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5991. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5992. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5993. do { \
  5994. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5995. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5996. } while (0)
  5997. #define HTT_RX_IND_END_VALID_GET(word) \
  5998. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5999. HTT_RX_IND_END_VALID_S)
  6000. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6001. do { \
  6002. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6003. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6004. } while (0)
  6005. #define HTT_RX_IND_START_VALID_GET(word) \
  6006. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6007. HTT_RX_IND_START_VALID_S)
  6008. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6009. do { \
  6010. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6011. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6012. } while (0)
  6013. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6014. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6015. HTT_RX_IND_RSSI_PRI20_S)
  6016. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6017. do { \
  6018. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6019. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6020. } while (0)
  6021. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6022. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6023. HTT_RX_IND_RSSI_EXT20_S)
  6024. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6025. do { \
  6026. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6027. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6028. } while (0)
  6029. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6030. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6031. HTT_RX_IND_RSSI_EXT40_S)
  6032. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6035. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6036. } while (0)
  6037. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6038. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6039. HTT_RX_IND_RSSI_EXT80_S)
  6040. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6041. do { \
  6042. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6043. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6044. } while (0)
  6045. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6046. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6047. HTT_RX_IND_VHT_SIG_A1_S)
  6048. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6049. do { \
  6050. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6051. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6052. } while (0)
  6053. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6054. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6055. HTT_RX_IND_VHT_SIG_A2_S)
  6056. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6057. do { \
  6058. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6059. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6060. } while (0)
  6061. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6062. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6063. HTT_RX_IND_PREAMBLE_TYPE_S)
  6064. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6065. do { \
  6066. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6067. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6068. } while (0)
  6069. #define HTT_RX_IND_SERVICE_GET(word) \
  6070. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6071. HTT_RX_IND_SERVICE_S)
  6072. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6073. do { \
  6074. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6075. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6076. } while (0)
  6077. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6078. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6079. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6080. do { \
  6081. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6082. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6083. } while (0)
  6084. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6085. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6086. #define HTT_RX_IND_HL_BYTES \
  6087. (HTT_RX_IND_HDR_BYTES + \
  6088. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6089. 4 /* single MPDU range information element */)
  6090. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6091. /* Could we use one macro entry? */
  6092. #define HTT_WORD_SET(word, field, value) \
  6093. do { \
  6094. HTT_CHECK_SET_VAL(field, value); \
  6095. (word) |= ((value) << field ## _S); \
  6096. } while (0)
  6097. #define HTT_WORD_GET(word, field) \
  6098. (((word) & field ## _M) >> field ## _S)
  6099. PREPACK struct hl_htt_rx_ind_base {
  6100. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6101. } POSTPACK;
  6102. /*
  6103. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6104. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6105. * HL host needed info. The field is just after the msdu fw rx desc.
  6106. */
  6107. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6108. struct htt_rx_ind_hl_rx_desc_t {
  6109. A_UINT8 ver;
  6110. A_UINT8 len;
  6111. struct {
  6112. A_UINT8
  6113. first_msdu: 1,
  6114. last_msdu: 1,
  6115. c3_failed: 1,
  6116. c4_failed: 1,
  6117. ipv6: 1,
  6118. tcp: 1,
  6119. udp: 1,
  6120. reserved: 1;
  6121. } flags;
  6122. };
  6123. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6124. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6125. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6126. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6127. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6128. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6129. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6130. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6131. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6132. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6133. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6134. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6135. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6136. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6137. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6138. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6139. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6140. /* This structure is used in HL, the basic descriptor information
  6141. * used by host. the structure is translated by FW from HW desc
  6142. * or generated by FW. But in HL monitor mode, the host would use
  6143. * the same structure with LL.
  6144. */
  6145. PREPACK struct hl_htt_rx_desc_base {
  6146. A_UINT32
  6147. seq_num:12,
  6148. encrypted:1,
  6149. chan_info_present:1,
  6150. resv0:2,
  6151. mcast_bcast:1,
  6152. fragment:1,
  6153. key_id_oct:8,
  6154. resv1:6;
  6155. A_UINT32
  6156. pn_31_0;
  6157. union {
  6158. struct {
  6159. A_UINT16 pn_47_32;
  6160. A_UINT16 pn_63_48;
  6161. } pn16;
  6162. A_UINT32 pn_63_32;
  6163. } u0;
  6164. A_UINT32
  6165. pn_95_64;
  6166. A_UINT32
  6167. pn_127_96;
  6168. } POSTPACK;
  6169. /*
  6170. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6171. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6172. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6173. * Please see htt_chan_change_t for description of the fields.
  6174. */
  6175. PREPACK struct htt_chan_info_t
  6176. {
  6177. A_UINT32 primary_chan_center_freq_mhz: 16,
  6178. contig_chan1_center_freq_mhz: 16;
  6179. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6180. phy_mode: 8,
  6181. reserved: 8;
  6182. } POSTPACK;
  6183. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6184. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6185. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6186. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6187. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6188. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6189. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6190. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6191. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6192. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6193. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6194. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6195. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6196. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6197. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6198. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6199. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6200. /* Channel information */
  6201. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6202. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6203. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6204. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6205. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6206. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6207. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6208. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6209. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6210. do { \
  6211. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6212. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6213. } while (0)
  6214. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6215. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6216. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6217. do { \
  6218. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6219. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6220. } while (0)
  6221. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6222. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6223. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6224. do { \
  6225. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6226. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6227. } while (0)
  6228. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6229. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6230. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6233. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6234. } while (0)
  6235. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6236. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6237. /*
  6238. * @brief target -> host rx reorder flush message definition
  6239. *
  6240. * @details
  6241. * The following field definitions describe the format of the rx flush
  6242. * message sent from the target to the host.
  6243. * The message consists of a 4-octet header, followed by one or more
  6244. * 4-octet payload information elements.
  6245. *
  6246. * |31 24|23 8|7 0|
  6247. * |--------------------------------------------------------------|
  6248. * | TID | peer ID | msg type |
  6249. * |--------------------------------------------------------------|
  6250. * | seq num end | seq num start | MPDU status | reserved |
  6251. * |--------------------------------------------------------------|
  6252. * First DWORD:
  6253. * - MSG_TYPE
  6254. * Bits 7:0
  6255. * Purpose: identifies this as an rx flush message
  6256. * Value: 0x2
  6257. * - PEER_ID
  6258. * Bits 23:8 (only bits 18:8 actually used)
  6259. * Purpose: identify which peer's rx data is being flushed
  6260. * Value: (rx) peer ID
  6261. * - TID
  6262. * Bits 31:24 (only bits 27:24 actually used)
  6263. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6264. * Value: traffic identifier
  6265. * Second DWORD:
  6266. * - MPDU_STATUS
  6267. * Bits 15:8
  6268. * Purpose:
  6269. * Indicate whether the flushed MPDUs should be discarded or processed.
  6270. * Value:
  6271. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6272. * stages of rx processing
  6273. * other: discard the MPDUs
  6274. * It is anticipated that flush messages will always have
  6275. * MPDU status == 1, but the status flag is included for
  6276. * flexibility.
  6277. * - SEQ_NUM_START
  6278. * Bits 23:16
  6279. * Purpose:
  6280. * Indicate the start of a series of consecutive MPDUs being flushed.
  6281. * Not all MPDUs within this range are necessarily valid - the host
  6282. * must check each sequence number within this range to see if the
  6283. * corresponding MPDU is actually present.
  6284. * Value:
  6285. * The sequence number for the first MPDU in the sequence.
  6286. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6287. * - SEQ_NUM_END
  6288. * Bits 30:24
  6289. * Purpose:
  6290. * Indicate the end of a series of consecutive MPDUs being flushed.
  6291. * Value:
  6292. * The sequence number one larger than the sequence number of the
  6293. * last MPDU being flushed.
  6294. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6295. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6296. * are to be released for further rx processing.
  6297. * Not all MPDUs within this range are necessarily valid - the host
  6298. * must check each sequence number within this range to see if the
  6299. * corresponding MPDU is actually present.
  6300. */
  6301. /* first DWORD */
  6302. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6303. #define HTT_RX_FLUSH_PEER_ID_S 8
  6304. #define HTT_RX_FLUSH_TID_M 0xff000000
  6305. #define HTT_RX_FLUSH_TID_S 24
  6306. /* second DWORD */
  6307. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6308. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6309. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6310. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6311. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6312. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6313. #define HTT_RX_FLUSH_BYTES 8
  6314. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6317. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6318. } while (0)
  6319. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6320. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6321. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6324. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6325. } while (0)
  6326. #define HTT_RX_FLUSH_TID_GET(word) \
  6327. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6328. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6329. do { \
  6330. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6331. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6332. } while (0)
  6333. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6334. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6335. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6336. do { \
  6337. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6338. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6339. } while (0)
  6340. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6341. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6342. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6345. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6346. } while (0)
  6347. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6348. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6349. /*
  6350. * @brief target -> host rx pn check indication message
  6351. *
  6352. * @details
  6353. * The following field definitions describe the format of the Rx PN check
  6354. * indication message sent from the target to the host.
  6355. * The message consists of a 4-octet header, followed by the start and
  6356. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6357. * IE is one octet containing the sequence number that failed the PN
  6358. * check.
  6359. *
  6360. * |31 24|23 8|7 0|
  6361. * |--------------------------------------------------------------|
  6362. * | TID | peer ID | msg type |
  6363. * |--------------------------------------------------------------|
  6364. * | Reserved | PN IE count | seq num end | seq num start|
  6365. * |--------------------------------------------------------------|
  6366. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6367. * |--------------------------------------------------------------|
  6368. * First DWORD:
  6369. * - MSG_TYPE
  6370. * Bits 7:0
  6371. * Purpose: Identifies this as an rx pn check indication message
  6372. * Value: 0x2
  6373. * - PEER_ID
  6374. * Bits 23:8 (only bits 18:8 actually used)
  6375. * Purpose: identify which peer
  6376. * Value: (rx) peer ID
  6377. * - TID
  6378. * Bits 31:24 (only bits 27:24 actually used)
  6379. * Purpose: identify traffic identifier
  6380. * Value: traffic identifier
  6381. * Second DWORD:
  6382. * - SEQ_NUM_START
  6383. * Bits 7:0
  6384. * Purpose:
  6385. * Indicates the starting sequence number of the MPDU in this
  6386. * series of MPDUs that went though PN check.
  6387. * Value:
  6388. * The sequence number for the first MPDU in the sequence.
  6389. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6390. * - SEQ_NUM_END
  6391. * Bits 15:8
  6392. * Purpose:
  6393. * Indicates the ending sequence number of the MPDU in this
  6394. * series of MPDUs that went though PN check.
  6395. * Value:
  6396. * The sequence number one larger then the sequence number of the last
  6397. * MPDU being flushed.
  6398. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6399. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6400. * for invalid PN numbers and are ready to be released for further processing.
  6401. * Not all MPDUs within this range are necessarily valid - the host
  6402. * must check each sequence number within this range to see if the
  6403. * corresponding MPDU is actually present.
  6404. * - PN_IE_COUNT
  6405. * Bits 23:16
  6406. * Purpose:
  6407. * Used to determine the variable number of PN information elements in this
  6408. * message
  6409. *
  6410. * PN information elements:
  6411. * - PN_IE_x-
  6412. * Purpose:
  6413. * Each PN information element contains the sequence number of the MPDU that
  6414. * has failed the target PN check.
  6415. * Value:
  6416. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6417. * that failed the PN check.
  6418. */
  6419. /* first DWORD */
  6420. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6421. #define HTT_RX_PN_IND_PEER_ID_S 8
  6422. #define HTT_RX_PN_IND_TID_M 0xff000000
  6423. #define HTT_RX_PN_IND_TID_S 24
  6424. /* second DWORD */
  6425. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6426. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6427. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6428. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6429. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6430. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6431. #define HTT_RX_PN_IND_BYTES 8
  6432. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6433. do { \
  6434. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6435. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6436. } while (0)
  6437. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6438. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6439. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6440. do { \
  6441. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6442. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6443. } while (0)
  6444. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6445. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6446. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6447. do { \
  6448. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6449. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6450. } while (0)
  6451. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6452. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6453. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6454. do { \
  6455. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6456. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6457. } while (0)
  6458. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6459. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6460. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6463. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6464. } while (0)
  6465. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6466. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6467. /*
  6468. * @brief target -> host rx offload deliver message for LL system
  6469. *
  6470. * @details
  6471. * In a low latency system this message is sent whenever the offload
  6472. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6473. * The DMA of the actual packets into host memory is done before sending out
  6474. * this message. This message indicates only how many MSDUs to reap. The
  6475. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6476. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6477. * DMA'd by the MAC directly into host memory these packets do not contain
  6478. * the MAC descriptors in the header portion of the packet. Instead they contain
  6479. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6480. * message, the packets are delivered directly to the NW stack without going
  6481. * through the regular reorder buffering and PN checking path since it has
  6482. * already been done in target.
  6483. *
  6484. * |31 24|23 16|15 8|7 0|
  6485. * |-----------------------------------------------------------------------|
  6486. * | Total MSDU count | reserved | msg type |
  6487. * |-----------------------------------------------------------------------|
  6488. *
  6489. * @brief target -> host rx offload deliver message for HL system
  6490. *
  6491. * @details
  6492. * In a high latency system this message is sent whenever the offload manager
  6493. * flushes out the packets it has coalesced in its coalescing buffer. The
  6494. * actual packets are also carried along with this message. When the host
  6495. * receives this message, it is expected to deliver these packets to the NW
  6496. * stack directly instead of routing them through the reorder buffering and
  6497. * PN checking path since it has already been done in target.
  6498. *
  6499. * |31 24|23 16|15 8|7 0|
  6500. * |-----------------------------------------------------------------------|
  6501. * | Total MSDU count | reserved | msg type |
  6502. * |-----------------------------------------------------------------------|
  6503. * | peer ID | MSDU length |
  6504. * |-----------------------------------------------------------------------|
  6505. * | MSDU payload | FW Desc | tid | vdev ID |
  6506. * |-----------------------------------------------------------------------|
  6507. * | MSDU payload contd. |
  6508. * |-----------------------------------------------------------------------|
  6509. * | peer ID | MSDU length |
  6510. * |-----------------------------------------------------------------------|
  6511. * | MSDU payload | FW Desc | tid | vdev ID |
  6512. * |-----------------------------------------------------------------------|
  6513. * | MSDU payload contd. |
  6514. * |-----------------------------------------------------------------------|
  6515. *
  6516. */
  6517. /* first DWORD */
  6518. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6519. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6520. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6521. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6523. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6525. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6530. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6532. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6533. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6535. do { \
  6536. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6537. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6538. } while (0)
  6539. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6540. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6541. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6544. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6545. } while (0)
  6546. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6547. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6548. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6551. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6552. } while (0)
  6553. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6554. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6556. do { \
  6557. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6558. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6559. } while (0)
  6560. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6561. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6563. do { \
  6564. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6565. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6566. } while (0)
  6567. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6568. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6570. do { \
  6571. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6572. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6573. } while (0)
  6574. /**
  6575. * @brief target -> host rx peer map/unmap message definition
  6576. *
  6577. * @details
  6578. * The following diagram shows the format of the rx peer map message sent
  6579. * from the target to the host. This layout assumes the target operates
  6580. * as little-endian.
  6581. *
  6582. * This message always contains a SW peer ID. The main purpose of the
  6583. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6584. * with, so that the host can use that peer ID to determine which peer
  6585. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6586. * other purposes, such as identifying during tx completions which peer
  6587. * the tx frames in question were transmitted to.
  6588. *
  6589. * In certain generations of chips, the peer map message also contains
  6590. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6591. * to identify which peer the frame needs to be forwarded to (i.e. the
  6592. * peer assocated with the Destination MAC Address within the packet),
  6593. * and particularly which vdev needs to transmit the frame (for cases
  6594. * of inter-vdev rx --> tx forwarding).
  6595. * This DA-based peer ID that is provided for certain rx frames
  6596. * (the rx frames that need to be re-transmitted as tx frames)
  6597. * is the ID that the HW uses for referring to the peer in question,
  6598. * rather than the peer ID that the SW+FW use to refer to the peer.
  6599. *
  6600. *
  6601. * |31 24|23 16|15 8|7 0|
  6602. * |-----------------------------------------------------------------------|
  6603. * | SW peer ID | VDEV ID | msg type |
  6604. * |-----------------------------------------------------------------------|
  6605. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6606. * |-----------------------------------------------------------------------|
  6607. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6608. * |-----------------------------------------------------------------------|
  6609. *
  6610. *
  6611. * The following diagram shows the format of the rx peer unmap message sent
  6612. * from the target to the host.
  6613. *
  6614. * |31 24|23 16|15 8|7 0|
  6615. * |-----------------------------------------------------------------------|
  6616. * | SW peer ID | VDEV ID | msg type |
  6617. * |-----------------------------------------------------------------------|
  6618. *
  6619. * The following field definitions describe the format of the rx peer map
  6620. * and peer unmap messages sent from the target to the host.
  6621. * - MSG_TYPE
  6622. * Bits 7:0
  6623. * Purpose: identifies this as an rx peer map or peer unmap message
  6624. * Value: peer map -> 0x3, peer unmap -> 0x4
  6625. * - VDEV_ID
  6626. * Bits 15:8
  6627. * Purpose: Indicates which virtual device the peer is associated
  6628. * with.
  6629. * Value: vdev ID (used in the host to look up the vdev object)
  6630. * - PEER_ID (a.k.a. SW_PEER_ID)
  6631. * Bits 31:16
  6632. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6633. * freeing (unmap)
  6634. * Value: (rx) peer ID
  6635. * - MAC_ADDR_L32 (peer map only)
  6636. * Bits 31:0
  6637. * Purpose: Identifies which peer node the peer ID is for.
  6638. * Value: lower 4 bytes of peer node's MAC address
  6639. * - MAC_ADDR_U16 (peer map only)
  6640. * Bits 15:0
  6641. * Purpose: Identifies which peer node the peer ID is for.
  6642. * Value: upper 2 bytes of peer node's MAC address
  6643. * - HW_PEER_ID
  6644. * Bits 31:16
  6645. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6646. * address, so for rx frames marked for rx --> tx forwarding, the
  6647. * host can determine from the HW peer ID provided as meta-data with
  6648. * the rx frame which peer the frame is supposed to be forwarded to.
  6649. * Value: ID used by the MAC HW to identify the peer
  6650. */
  6651. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6652. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6653. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6654. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6655. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6656. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6657. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6658. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6659. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6660. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6661. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6662. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6663. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6664. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6665. do { \
  6666. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6667. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6668. } while (0)
  6669. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6670. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6671. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6672. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6675. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6676. } while (0)
  6677. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6678. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6679. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6680. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6681. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6682. do { \
  6683. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6684. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6685. } while (0)
  6686. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6687. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6688. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6689. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6690. #define HTT_RX_PEER_MAP_BYTES 12
  6691. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6692. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6693. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6694. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6695. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6696. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6697. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6698. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6699. #define HTT_RX_PEER_UNMAP_BYTES 4
  6700. /**
  6701. * @brief target -> host rx peer map V2 message definition
  6702. *
  6703. * @details
  6704. * The following diagram shows the format of the rx peer map v2 message sent
  6705. * from the target to the host. This layout assumes the target operates
  6706. * as little-endian.
  6707. *
  6708. * This message always contains a SW peer ID. The main purpose of the
  6709. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6710. * with, so that the host can use that peer ID to determine which peer
  6711. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6712. * other purposes, such as identifying during tx completions which peer
  6713. * the tx frames in question were transmitted to.
  6714. *
  6715. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6716. * is used during rx --> tx frame forwarding to identify which peer the
  6717. * frame needs to be forwarded to (i.e. the peer assocated with the
  6718. * Destination MAC Address within the packet), and particularly which vdev
  6719. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6720. * This DA-based peer ID that is provided for certain rx frames
  6721. * (the rx frames that need to be re-transmitted as tx frames)
  6722. * is the ID that the HW uses for referring to the peer in question,
  6723. * rather than the peer ID that the SW+FW use to refer to the peer.
  6724. *
  6725. *
  6726. * |31 24|23 16|15 8|7 0|
  6727. * |-----------------------------------------------------------------------|
  6728. * | SW peer ID | VDEV ID | msg type |
  6729. * |-----------------------------------------------------------------------|
  6730. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6731. * |-----------------------------------------------------------------------|
  6732. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6733. * |-----------------------------------------------------------------------|
  6734. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6735. * |-----------------------------------------------------------------------|
  6736. * | Reserved_0 |
  6737. * |-----------------------------------------------------------------------|
  6738. * | Reserved_1 |
  6739. * |-----------------------------------------------------------------------|
  6740. * | Reserved_2 |
  6741. * |-----------------------------------------------------------------------|
  6742. * | Reserved_3 |
  6743. * |-----------------------------------------------------------------------|
  6744. *
  6745. *
  6746. * The following field definitions describe the format of the rx peer map v2
  6747. * messages sent from the target to the host.
  6748. * - MSG_TYPE
  6749. * Bits 7:0
  6750. * Purpose: identifies this as an rx peer map v2 message
  6751. * Value: peer map v2 -> 0x1e
  6752. * - VDEV_ID
  6753. * Bits 15:8
  6754. * Purpose: Indicates which virtual device the peer is associated with.
  6755. * Value: vdev ID (used in the host to look up the vdev object)
  6756. * - SW_PEER_ID
  6757. * Bits 31:16
  6758. * Purpose: The peer ID (index) that WAL is allocating
  6759. * Value: (rx) peer ID
  6760. * - MAC_ADDR_L32
  6761. * Bits 31:0
  6762. * Purpose: Identifies which peer node the peer ID is for.
  6763. * Value: lower 4 bytes of peer node's MAC address
  6764. * - MAC_ADDR_U16
  6765. * Bits 15:0
  6766. * Purpose: Identifies which peer node the peer ID is for.
  6767. * Value: upper 2 bytes of peer node's MAC address
  6768. * - HW_PEER_ID
  6769. * Bits 31:16
  6770. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6771. * address, so for rx frames marked for rx --> tx forwarding, the
  6772. * host can determine from the HW peer ID provided as meta-data with
  6773. * the rx frame which peer the frame is supposed to be forwarded to.
  6774. * Value: ID used by the MAC HW to identify the peer
  6775. * - AST_HASH_VALUE
  6776. * Bits 15:0
  6777. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6778. * override feature.
  6779. * - NEXT_HOP
  6780. * Bit 16
  6781. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6782. * (Wireless Distribution System).
  6783. */
  6784. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6785. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6786. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6787. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6788. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6789. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6790. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6791. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6792. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6793. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6794. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6795. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6796. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6797. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6798. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6799. do { \
  6800. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6801. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6802. } while (0)
  6803. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6804. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6805. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6806. do { \
  6807. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6808. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6809. } while (0)
  6810. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6811. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6812. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6813. do { \
  6814. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6815. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6816. } while (0)
  6817. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6818. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6819. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6820. do { \
  6821. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6822. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6823. } while (0)
  6824. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6825. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6826. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6827. do { \
  6828. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6829. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6830. } while (0)
  6831. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6832. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6833. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6834. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6835. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6836. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6837. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6838. /**
  6839. * @brief target -> host rx peer unmap V2 message definition
  6840. *
  6841. *
  6842. * The following diagram shows the format of the rx peer unmap message sent
  6843. * from the target to the host.
  6844. *
  6845. * |31 24|23 16|15 8|7 0|
  6846. * |-----------------------------------------------------------------------|
  6847. * | SW peer ID | VDEV ID | msg type |
  6848. * |-----------------------------------------------------------------------|
  6849. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6850. * |-----------------------------------------------------------------------|
  6851. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6852. * |-----------------------------------------------------------------------|
  6853. * | Peer Delete Duration |
  6854. * |-----------------------------------------------------------------------|
  6855. * | Reserved_0 |
  6856. * |-----------------------------------------------------------------------|
  6857. * | Reserved_1 |
  6858. * |-----------------------------------------------------------------------|
  6859. * | Reserved_2 |
  6860. * |-----------------------------------------------------------------------|
  6861. *
  6862. *
  6863. * The following field definitions describe the format of the rx peer unmap
  6864. * messages sent from the target to the host.
  6865. * - MSG_TYPE
  6866. * Bits 7:0
  6867. * Purpose: identifies this as an rx peer unmap v2 message
  6868. * Value: peer unmap v2 -> 0x1f
  6869. * - VDEV_ID
  6870. * Bits 15:8
  6871. * Purpose: Indicates which virtual device the peer is associated
  6872. * with.
  6873. * Value: vdev ID (used in the host to look up the vdev object)
  6874. * - SW_PEER_ID
  6875. * Bits 31:16
  6876. * Purpose: The peer ID (index) that WAL is freeing
  6877. * Value: (rx) peer ID
  6878. * - MAC_ADDR_L32
  6879. * Bits 31:0
  6880. * Purpose: Identifies which peer node the peer ID is for.
  6881. * Value: lower 4 bytes of peer node's MAC address
  6882. * - MAC_ADDR_U16
  6883. * Bits 15:0
  6884. * Purpose: Identifies which peer node the peer ID is for.
  6885. * Value: upper 2 bytes of peer node's MAC address
  6886. * - NEXT_HOP
  6887. * Bits 16
  6888. * Purpose: Bit indicates next_hop AST entry used for WDS
  6889. * (Wireless Distribution System).
  6890. * - PEER_DELETE_DURATION
  6891. * Bits 31:0
  6892. * Purpose: Time taken to delete peer, in msec,
  6893. * Used for monitoring / debugging PEER delete response delay
  6894. */
  6895. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6896. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6897. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6898. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6899. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6900. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6901. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6902. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6903. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6904. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6905. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6906. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6907. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6908. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6909. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6910. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6911. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6912. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6913. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6914. do { \
  6915. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6916. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6917. } while (0)
  6918. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6919. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6920. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6921. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6922. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6923. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6924. /**
  6925. * @brief target -> host message specifying security parameters
  6926. *
  6927. * @details
  6928. * The following diagram shows the format of the security specification
  6929. * message sent from the target to the host.
  6930. * This security specification message tells the host whether a PN check is
  6931. * necessary on rx data frames, and if so, how large the PN counter is.
  6932. * This message also tells the host about the security processing to apply
  6933. * to defragmented rx frames - specifically, whether a Message Integrity
  6934. * Check is required, and the Michael key to use.
  6935. *
  6936. * |31 24|23 16|15|14 8|7 0|
  6937. * |-----------------------------------------------------------------------|
  6938. * | peer ID | U| security type | msg type |
  6939. * |-----------------------------------------------------------------------|
  6940. * | Michael Key K0 |
  6941. * |-----------------------------------------------------------------------|
  6942. * | Michael Key K1 |
  6943. * |-----------------------------------------------------------------------|
  6944. * | WAPI RSC Low0 |
  6945. * |-----------------------------------------------------------------------|
  6946. * | WAPI RSC Low1 |
  6947. * |-----------------------------------------------------------------------|
  6948. * | WAPI RSC Hi0 |
  6949. * |-----------------------------------------------------------------------|
  6950. * | WAPI RSC Hi1 |
  6951. * |-----------------------------------------------------------------------|
  6952. *
  6953. * The following field definitions describe the format of the security
  6954. * indication message sent from the target to the host.
  6955. * - MSG_TYPE
  6956. * Bits 7:0
  6957. * Purpose: identifies this as a security specification message
  6958. * Value: 0xb
  6959. * - SEC_TYPE
  6960. * Bits 14:8
  6961. * Purpose: specifies which type of security applies to the peer
  6962. * Value: htt_sec_type enum value
  6963. * - UNICAST
  6964. * Bit 15
  6965. * Purpose: whether this security is applied to unicast or multicast data
  6966. * Value: 1 -> unicast, 0 -> multicast
  6967. * - PEER_ID
  6968. * Bits 31:16
  6969. * Purpose: The ID number for the peer the security specification is for
  6970. * Value: peer ID
  6971. * - MICHAEL_KEY_K0
  6972. * Bits 31:0
  6973. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6974. * Value: Michael Key K0 (if security type is TKIP)
  6975. * - MICHAEL_KEY_K1
  6976. * Bits 31:0
  6977. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6978. * Value: Michael Key K1 (if security type is TKIP)
  6979. * - WAPI_RSC_LOW0
  6980. * Bits 31:0
  6981. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6982. * Value: WAPI RSC Low0 (if security type is WAPI)
  6983. * - WAPI_RSC_LOW1
  6984. * Bits 31:0
  6985. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6986. * Value: WAPI RSC Low1 (if security type is WAPI)
  6987. * - WAPI_RSC_HI0
  6988. * Bits 31:0
  6989. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6990. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6991. * - WAPI_RSC_HI1
  6992. * Bits 31:0
  6993. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6994. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6995. */
  6996. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6997. #define HTT_SEC_IND_SEC_TYPE_S 8
  6998. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6999. #define HTT_SEC_IND_UNICAST_S 15
  7000. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7001. #define HTT_SEC_IND_PEER_ID_S 16
  7002. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7003. do { \
  7004. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7005. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7006. } while (0)
  7007. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7008. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7009. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7010. do { \
  7011. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7012. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7013. } while (0)
  7014. #define HTT_SEC_IND_UNICAST_GET(word) \
  7015. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7016. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7017. do { \
  7018. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7019. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7020. } while (0)
  7021. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7022. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7023. #define HTT_SEC_IND_BYTES 28
  7024. /**
  7025. * @brief target -> host rx ADDBA / DELBA message definitions
  7026. *
  7027. * @details
  7028. * The following diagram shows the format of the rx ADDBA message sent
  7029. * from the target to the host:
  7030. *
  7031. * |31 20|19 16|15 8|7 0|
  7032. * |---------------------------------------------------------------------|
  7033. * | peer ID | TID | window size | msg type |
  7034. * |---------------------------------------------------------------------|
  7035. *
  7036. * The following diagram shows the format of the rx DELBA message sent
  7037. * from the target to the host:
  7038. *
  7039. * |31 20|19 16|15 10|9 8|7 0|
  7040. * |---------------------------------------------------------------------|
  7041. * | peer ID | TID | reserved | IR| msg type |
  7042. * |---------------------------------------------------------------------|
  7043. *
  7044. * The following field definitions describe the format of the rx ADDBA
  7045. * and DELBA messages sent from the target to the host.
  7046. * - MSG_TYPE
  7047. * Bits 7:0
  7048. * Purpose: identifies this as an rx ADDBA or DELBA message
  7049. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7050. * - IR (initiator / recipient)
  7051. * Bits 9:8 (DELBA only)
  7052. * Purpose: specify whether the DELBA handshake was initiated by the
  7053. * local STA/AP, or by the peer STA/AP
  7054. * Value:
  7055. * 0 - unspecified
  7056. * 1 - initiator (a.k.a. originator)
  7057. * 2 - recipient (a.k.a. responder)
  7058. * 3 - unused / reserved
  7059. * - WIN_SIZE
  7060. * Bits 15:8 (ADDBA only)
  7061. * Purpose: Specifies the length of the block ack window (max = 64).
  7062. * Value:
  7063. * block ack window length specified by the received ADDBA
  7064. * management message.
  7065. * - TID
  7066. * Bits 19:16
  7067. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7068. * Value:
  7069. * TID specified by the received ADDBA or DELBA management message.
  7070. * - PEER_ID
  7071. * Bits 31:20
  7072. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7073. * Value:
  7074. * ID (hash value) used by the host for fast, direct lookup of
  7075. * host SW peer info, including rx reorder states.
  7076. */
  7077. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7078. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7079. #define HTT_RX_ADDBA_TID_M 0xf0000
  7080. #define HTT_RX_ADDBA_TID_S 16
  7081. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7082. #define HTT_RX_ADDBA_PEER_ID_S 20
  7083. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7084. do { \
  7085. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7086. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7087. } while (0)
  7088. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7089. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7090. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7091. do { \
  7092. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7093. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7094. } while (0)
  7095. #define HTT_RX_ADDBA_TID_GET(word) \
  7096. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7097. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7098. do { \
  7099. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7100. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7101. } while (0)
  7102. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7103. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7104. #define HTT_RX_ADDBA_BYTES 4
  7105. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7106. #define HTT_RX_DELBA_INITIATOR_S 8
  7107. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7108. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7109. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7110. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7111. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7112. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7113. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7114. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7115. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7116. do { \
  7117. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7118. (word) |= (value) << HTT_RX_DELBA_INITIATOR; \
  7119. } while (0)
  7120. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7121. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7122. #define HTT_RX_DELBA_BYTES 4
  7123. /**
  7124. * @brief tx queue group information element definition
  7125. *
  7126. * @details
  7127. * The following diagram shows the format of the tx queue group
  7128. * information element, which can be included in target --> host
  7129. * messages to specify the number of tx "credits" (tx descriptors
  7130. * for LL, or tx buffers for HL) available to a particular group
  7131. * of host-side tx queues, and which host-side tx queues belong to
  7132. * the group.
  7133. *
  7134. * |31|30 24|23 16|15|14|13 0|
  7135. * |------------------------------------------------------------------------|
  7136. * | X| reserved | tx queue grp ID | A| S| credit count |
  7137. * |------------------------------------------------------------------------|
  7138. * | vdev ID mask | AC mask |
  7139. * |------------------------------------------------------------------------|
  7140. *
  7141. * The following definitions describe the fields within the tx queue group
  7142. * information element:
  7143. * - credit_count
  7144. * Bits 13:1
  7145. * Purpose: specify how many tx credits are available to the tx queue group
  7146. * Value: An absolute or relative, positive or negative credit value
  7147. * The 'A' bit specifies whether the value is absolute or relative.
  7148. * The 'S' bit specifies whether the value is positive or negative.
  7149. * A negative value can only be relative, not absolute.
  7150. * An absolute value replaces any prior credit value the host has for
  7151. * the tx queue group in question.
  7152. * A relative value is added to the prior credit value the host has for
  7153. * the tx queue group in question.
  7154. * - sign
  7155. * Bit 14
  7156. * Purpose: specify whether the credit count is positive or negative
  7157. * Value: 0 -> positive, 1 -> negative
  7158. * - absolute
  7159. * Bit 15
  7160. * Purpose: specify whether the credit count is absolute or relative
  7161. * Value: 0 -> relative, 1 -> absolute
  7162. * - txq_group_id
  7163. * Bits 23:16
  7164. * Purpose: indicate which tx queue group's credit and/or membership are
  7165. * being specified
  7166. * Value: 0 to max_tx_queue_groups-1
  7167. * - reserved
  7168. * Bits 30:16
  7169. * Value: 0x0
  7170. * - eXtension
  7171. * Bit 31
  7172. * Purpose: specify whether another tx queue group info element follows
  7173. * Value: 0 -> no more tx queue group information elements
  7174. * 1 -> another tx queue group information element immediately follows
  7175. * - ac_mask
  7176. * Bits 15:0
  7177. * Purpose: specify which Access Categories belong to the tx queue group
  7178. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7179. * the tx queue group.
  7180. * The AC bit-mask values are obtained by left-shifting by the
  7181. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7182. * - vdev_id_mask
  7183. * Bits 31:16
  7184. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7185. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7186. * belong to the tx queue group.
  7187. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7188. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7189. */
  7190. PREPACK struct htt_txq_group {
  7191. A_UINT32
  7192. credit_count: 14,
  7193. sign: 1,
  7194. absolute: 1,
  7195. tx_queue_group_id: 8,
  7196. reserved0: 7,
  7197. extension: 1;
  7198. A_UINT32
  7199. ac_mask: 16,
  7200. vdev_id_mask: 16;
  7201. } POSTPACK;
  7202. /* first word */
  7203. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7204. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7205. #define HTT_TXQ_GROUP_SIGN_S 14
  7206. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7207. #define HTT_TXQ_GROUP_ABS_S 15
  7208. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7209. #define HTT_TXQ_GROUP_ID_S 16
  7210. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7211. #define HTT_TXQ_GROUP_EXT_S 31
  7212. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7213. /* second word */
  7214. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7215. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7216. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7217. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7218. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7219. do { \
  7220. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7221. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7222. } while (0)
  7223. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7224. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7225. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7226. do { \
  7227. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7228. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7229. } while (0)
  7230. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7231. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7232. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7235. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7236. } while (0)
  7237. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7238. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7239. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7240. do { \
  7241. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7242. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7243. } while (0)
  7244. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7245. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7246. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7247. do { \
  7248. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7249. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7250. } while (0)
  7251. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7252. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7253. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7254. do { \
  7255. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7256. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7257. } while (0)
  7258. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7259. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7260. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7261. do { \
  7262. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7263. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7264. } while (0)
  7265. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7266. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7267. /**
  7268. * @brief target -> host TX completion indication message definition
  7269. *
  7270. * @details
  7271. * The following diagram shows the format of the TX completion indication sent
  7272. * from the target to the host
  7273. *
  7274. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7275. * |------------------------------------------------------------|
  7276. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7277. * |------------------------------------------------------------|
  7278. * payload: | MSDU1 ID | MSDU0 ID |
  7279. * |------------------------------------------------------------|
  7280. * : MSDU3 ID : MSDU2 ID :
  7281. * |------------------------------------------------------------|
  7282. * | struct htt_tx_compl_ind_append_retries |
  7283. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7284. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7285. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7286. * Where:
  7287. * A0 = append (a.k.a. append0)
  7288. * A1 = append1
  7289. * TP = MSDU tx power presence
  7290. *
  7291. * The following field definitions describe the format of the TX completion
  7292. * indication sent from the target to the host
  7293. * Header fields:
  7294. * - msg_type
  7295. * Bits 7:0
  7296. * Purpose: identifies this as HTT TX completion indication
  7297. * Value: 0x7
  7298. * - status
  7299. * Bits 10:8
  7300. * Purpose: the TX completion status of payload fragmentations descriptors
  7301. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7302. * - tid
  7303. * Bits 14:11
  7304. * Purpose: the tid associated with those fragmentation descriptors. It is
  7305. * valid or not, depending on the tid_invalid bit.
  7306. * Value: 0 to 15
  7307. * - tid_invalid
  7308. * Bits 15:15
  7309. * Purpose: this bit indicates whether the tid field is valid or not
  7310. * Value: 0 indicates valid; 1 indicates invalid
  7311. * - num
  7312. * Bits 23:16
  7313. * Purpose: the number of payload in this indication
  7314. * Value: 1 to 255
  7315. * - append (a.k.a. append0)
  7316. * Bits 24:24
  7317. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7318. * the number of tx retries for one MSDU at the end of this message
  7319. * Value: 0 indicates no appending; 1 indicates appending
  7320. * - append1
  7321. * Bits 25:25
  7322. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7323. * contains the timestamp info for each TX msdu id in payload.
  7324. * The order of the timestamps matches the order of the MSDU IDs.
  7325. * Note that a big-endian host needs to account for the reordering
  7326. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7327. * conversion) when determining which tx timestamp corresponds to
  7328. * which MSDU ID.
  7329. * Value: 0 indicates no appending; 1 indicates appending
  7330. * - msdu_tx_power_presence
  7331. * Bits 26:26
  7332. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7333. * for each MSDU referenced by the TX_COMPL_IND message.
  7334. * The tx power is reported in 0.5 dBm units.
  7335. * The order of the per-MSDU tx power reports matches the order
  7336. * of the MSDU IDs.
  7337. * Note that a big-endian host needs to account for the reordering
  7338. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7339. * conversion) when determining which Tx Power corresponds to
  7340. * which MSDU ID.
  7341. * Value: 0 indicates MSDU tx power reports are not appended,
  7342. * 1 indicates MSDU tx power reports are appended
  7343. * Payload fields:
  7344. * - hmsdu_id
  7345. * Bits 15:0
  7346. * Purpose: this ID is used to track the Tx buffer in host
  7347. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7348. */
  7349. #define HTT_TX_COMPL_IND_STATUS_S 8
  7350. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7351. #define HTT_TX_COMPL_IND_TID_S 11
  7352. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7353. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7354. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7355. #define HTT_TX_COMPL_IND_NUM_S 16
  7356. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7357. #define HTT_TX_COMPL_IND_APPEND_S 24
  7358. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7359. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7360. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7361. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7362. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7363. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7364. do { \
  7365. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7366. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7367. } while (0)
  7368. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7369. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7370. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7371. do { \
  7372. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7373. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7374. } while (0)
  7375. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7376. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7377. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7378. do { \
  7379. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7380. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7381. } while (0)
  7382. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7383. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7384. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7385. do { \
  7386. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7387. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7388. } while (0)
  7389. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7390. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7391. HTT_TX_COMPL_IND_TID_INV_S)
  7392. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7393. do { \
  7394. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7395. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7396. } while (0)
  7397. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7398. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7399. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7400. do { \
  7401. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7402. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7403. } while (0)
  7404. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7405. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7406. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7407. do { \
  7408. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7409. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7410. } while (0)
  7411. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7412. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7413. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7414. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7415. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7416. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7417. #define HTT_TX_COMPL_IND_STAT_OK 0
  7418. /* DISCARD:
  7419. * current meaning:
  7420. * MSDUs were queued for transmission but filtered by HW or SW
  7421. * without any over the air attempts
  7422. * legacy meaning (HL Rome):
  7423. * MSDUs were discarded by the target FW without any over the air
  7424. * attempts due to lack of space
  7425. */
  7426. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7427. /* NO_ACK:
  7428. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7429. */
  7430. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7431. /* POSTPONE:
  7432. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7433. * be downloaded again later (in the appropriate order), when they are
  7434. * deliverable.
  7435. */
  7436. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7437. /*
  7438. * The PEER_DEL tx completion status is used for HL cases
  7439. * where the peer the frame is for has been deleted.
  7440. * The host has already discarded its copy of the frame, but
  7441. * it still needs the tx completion to restore its credit.
  7442. */
  7443. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7444. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7445. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7446. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7447. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7448. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7449. PREPACK struct htt_tx_compl_ind_base {
  7450. A_UINT32 hdr;
  7451. A_UINT16 payload[1/*or more*/];
  7452. } POSTPACK;
  7453. PREPACK struct htt_tx_compl_ind_append_retries {
  7454. A_UINT16 msdu_id;
  7455. A_UINT8 tx_retries;
  7456. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7457. 0: this is the last append_retries struct */
  7458. } POSTPACK;
  7459. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7460. A_UINT32 timestamp[1/*or more*/];
  7461. } POSTPACK;
  7462. /**
  7463. * @brief target -> host rate-control update indication message
  7464. *
  7465. * @details
  7466. * The following diagram shows the format of the RC Update message
  7467. * sent from the target to the host, while processing the tx-completion
  7468. * of a transmitted PPDU.
  7469. *
  7470. * |31 24|23 16|15 8|7 0|
  7471. * |-------------------------------------------------------------|
  7472. * | peer ID | vdev ID | msg_type |
  7473. * |-------------------------------------------------------------|
  7474. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7475. * |-------------------------------------------------------------|
  7476. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7477. * |-------------------------------------------------------------|
  7478. * | : |
  7479. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7480. * | : |
  7481. * |-------------------------------------------------------------|
  7482. * | : |
  7483. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7484. * | : |
  7485. * |-------------------------------------------------------------|
  7486. * : :
  7487. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7488. *
  7489. */
  7490. typedef struct {
  7491. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7492. A_UINT32 rate_code_flags;
  7493. A_UINT32 flags; /* Encodes information such as excessive
  7494. retransmission, aggregate, some info
  7495. from .11 frame control,
  7496. STBC, LDPC, (SGI and Tx Chain Mask
  7497. are encoded in ptx_rc->flags field),
  7498. AMPDU truncation (BT/time based etc.),
  7499. RTS/CTS attempt */
  7500. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7501. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7502. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7503. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7504. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7505. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7506. } HTT_RC_TX_DONE_PARAMS;
  7507. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7508. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7509. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7510. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7511. #define HTT_RC_UPDATE_VDEVID_S 8
  7512. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7513. #define HTT_RC_UPDATE_PEERID_S 16
  7514. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7515. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7516. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7517. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7518. do { \
  7519. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7520. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7521. } while (0)
  7522. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7523. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7524. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7525. do { \
  7526. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7527. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7528. } while (0)
  7529. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7530. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7531. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7534. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7535. } while (0)
  7536. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7537. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7538. /**
  7539. * @brief target -> host rx fragment indication message definition
  7540. *
  7541. * @details
  7542. * The following field definitions describe the format of the rx fragment
  7543. * indication message sent from the target to the host.
  7544. * The rx fragment indication message shares the format of the
  7545. * rx indication message, but not all fields from the rx indication message
  7546. * are relevant to the rx fragment indication message.
  7547. *
  7548. *
  7549. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7550. * |-----------+-------------------+---------------------+-------------|
  7551. * | peer ID | |FV| ext TID | msg type |
  7552. * |-------------------------------------------------------------------|
  7553. * | | flush | flush |
  7554. * | | end | start |
  7555. * | | seq num | seq num |
  7556. * |-------------------------------------------------------------------|
  7557. * | reserved | FW rx desc bytes |
  7558. * |-------------------------------------------------------------------|
  7559. * | | FW MSDU Rx |
  7560. * | | desc B0 |
  7561. * |-------------------------------------------------------------------|
  7562. * Header fields:
  7563. * - MSG_TYPE
  7564. * Bits 7:0
  7565. * Purpose: identifies this as an rx fragment indication message
  7566. * Value: 0xa
  7567. * - EXT_TID
  7568. * Bits 12:8
  7569. * Purpose: identify the traffic ID of the rx data, including
  7570. * special "extended" TID values for multicast, broadcast, and
  7571. * non-QoS data frames
  7572. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7573. * - FLUSH_VALID (FV)
  7574. * Bit 13
  7575. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7576. * is valid
  7577. * Value:
  7578. * 1 -> flush IE is valid and needs to be processed
  7579. * 0 -> flush IE is not valid and should be ignored
  7580. * - PEER_ID
  7581. * Bits 31:16
  7582. * Purpose: Identify, by ID, which peer sent the rx data
  7583. * Value: ID of the peer who sent the rx data
  7584. * - FLUSH_SEQ_NUM_START
  7585. * Bits 5:0
  7586. * Purpose: Indicate the start of a series of MPDUs to flush
  7587. * Not all MPDUs within this series are necessarily valid - the host
  7588. * must check each sequence number within this range to see if the
  7589. * corresponding MPDU is actually present.
  7590. * This field is only valid if the FV bit is set.
  7591. * Value:
  7592. * The sequence number for the first MPDUs to check to flush.
  7593. * The sequence number is masked by 0x3f.
  7594. * - FLUSH_SEQ_NUM_END
  7595. * Bits 11:6
  7596. * Purpose: Indicate the end of a series of MPDUs to flush
  7597. * Value:
  7598. * The sequence number one larger than the sequence number of the
  7599. * last MPDU to check to flush.
  7600. * The sequence number is masked by 0x3f.
  7601. * Not all MPDUs within this series are necessarily valid - the host
  7602. * must check each sequence number within this range to see if the
  7603. * corresponding MPDU is actually present.
  7604. * This field is only valid if the FV bit is set.
  7605. * Rx descriptor fields:
  7606. * - FW_RX_DESC_BYTES
  7607. * Bits 15:0
  7608. * Purpose: Indicate how many bytes in the Rx indication are used for
  7609. * FW Rx descriptors
  7610. * Value: 1
  7611. */
  7612. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7613. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7614. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7615. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7616. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7617. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7618. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7619. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7620. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7621. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7622. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7623. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7624. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7625. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7626. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7627. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7628. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7629. #define HTT_RX_FRAG_IND_BYTES \
  7630. (4 /* msg hdr */ + \
  7631. 4 /* flush spec */ + \
  7632. 4 /* (unused) FW rx desc bytes spec */ + \
  7633. 4 /* FW rx desc */)
  7634. /**
  7635. * @brief target -> host test message definition
  7636. *
  7637. * @details
  7638. * The following field definitions describe the format of the test
  7639. * message sent from the target to the host.
  7640. * The message consists of a 4-octet header, followed by a variable
  7641. * number of 32-bit integer values, followed by a variable number
  7642. * of 8-bit character values.
  7643. *
  7644. * |31 16|15 8|7 0|
  7645. * |-----------------------------------------------------------|
  7646. * | num chars | num ints | msg type |
  7647. * |-----------------------------------------------------------|
  7648. * | int 0 |
  7649. * |-----------------------------------------------------------|
  7650. * | int 1 |
  7651. * |-----------------------------------------------------------|
  7652. * | ... |
  7653. * |-----------------------------------------------------------|
  7654. * | char 3 | char 2 | char 1 | char 0 |
  7655. * |-----------------------------------------------------------|
  7656. * | | | ... | char 4 |
  7657. * |-----------------------------------------------------------|
  7658. * - MSG_TYPE
  7659. * Bits 7:0
  7660. * Purpose: identifies this as a test message
  7661. * Value: HTT_MSG_TYPE_TEST
  7662. * - NUM_INTS
  7663. * Bits 15:8
  7664. * Purpose: indicate how many 32-bit integers follow the message header
  7665. * - NUM_CHARS
  7666. * Bits 31:16
  7667. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7668. */
  7669. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7670. #define HTT_RX_TEST_NUM_INTS_S 8
  7671. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7672. #define HTT_RX_TEST_NUM_CHARS_S 16
  7673. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7674. do { \
  7675. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7676. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7677. } while (0)
  7678. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7679. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7680. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7681. do { \
  7682. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7683. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7684. } while (0)
  7685. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7686. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7687. /**
  7688. * @brief target -> host packet log message
  7689. *
  7690. * @details
  7691. * The following field definitions describe the format of the packet log
  7692. * message sent from the target to the host.
  7693. * The message consists of a 4-octet header,followed by a variable number
  7694. * of 32-bit character values.
  7695. *
  7696. * |31 16|15 12|11 10|9 8|7 0|
  7697. * |------------------------------------------------------------------|
  7698. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7699. * |------------------------------------------------------------------|
  7700. * | payload |
  7701. * |------------------------------------------------------------------|
  7702. * - MSG_TYPE
  7703. * Bits 7:0
  7704. * Purpose: identifies this as a pktlog message
  7705. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7706. * - mac_id
  7707. * Bits 9:8
  7708. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7709. * Value: 0-3
  7710. * - pdev_id
  7711. * Bits 11:10
  7712. * Purpose: pdev_id
  7713. * Value: 0-3
  7714. * 0 (for rings at SOC level),
  7715. * 1/2/3 PDEV -> 0/1/2
  7716. * - payload_size
  7717. * Bits 31:16
  7718. * Purpose: explicitly specify the payload size
  7719. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7720. */
  7721. PREPACK struct htt_pktlog_msg {
  7722. A_UINT32 header;
  7723. A_UINT32 payload[1/* or more */];
  7724. } POSTPACK;
  7725. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7726. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7727. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7728. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7729. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7730. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7731. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7734. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7735. } while (0)
  7736. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7737. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7738. HTT_T2H_PKTLOG_MAC_ID_S)
  7739. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7742. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7743. } while (0)
  7744. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7745. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7746. HTT_T2H_PKTLOG_PDEV_ID_S)
  7747. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7750. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7751. } while (0)
  7752. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7753. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7754. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7755. /*
  7756. * Rx reorder statistics
  7757. * NB: all the fields must be defined in 4 octets size.
  7758. */
  7759. struct rx_reorder_stats {
  7760. /* Non QoS MPDUs received */
  7761. A_UINT32 deliver_non_qos;
  7762. /* MPDUs received in-order */
  7763. A_UINT32 deliver_in_order;
  7764. /* Flush due to reorder timer expired */
  7765. A_UINT32 deliver_flush_timeout;
  7766. /* Flush due to move out of window */
  7767. A_UINT32 deliver_flush_oow;
  7768. /* Flush due to DELBA */
  7769. A_UINT32 deliver_flush_delba;
  7770. /* MPDUs dropped due to FCS error */
  7771. A_UINT32 fcs_error;
  7772. /* MPDUs dropped due to monitor mode non-data packet */
  7773. A_UINT32 mgmt_ctrl;
  7774. /* Unicast-data MPDUs dropped due to invalid peer */
  7775. A_UINT32 invalid_peer;
  7776. /* MPDUs dropped due to duplication (non aggregation) */
  7777. A_UINT32 dup_non_aggr;
  7778. /* MPDUs dropped due to processed before */
  7779. A_UINT32 dup_past;
  7780. /* MPDUs dropped due to duplicate in reorder queue */
  7781. A_UINT32 dup_in_reorder;
  7782. /* Reorder timeout happened */
  7783. A_UINT32 reorder_timeout;
  7784. /* invalid bar ssn */
  7785. A_UINT32 invalid_bar_ssn;
  7786. /* reorder reset due to bar ssn */
  7787. A_UINT32 ssn_reset;
  7788. /* Flush due to delete peer */
  7789. A_UINT32 deliver_flush_delpeer;
  7790. /* Flush due to offload*/
  7791. A_UINT32 deliver_flush_offload;
  7792. /* Flush due to out of buffer*/
  7793. A_UINT32 deliver_flush_oob;
  7794. /* MPDUs dropped due to PN check fail */
  7795. A_UINT32 pn_fail;
  7796. /* MPDUs dropped due to unable to allocate memory */
  7797. A_UINT32 store_fail;
  7798. /* Number of times the tid pool alloc succeeded */
  7799. A_UINT32 tid_pool_alloc_succ;
  7800. /* Number of times the MPDU pool alloc succeeded */
  7801. A_UINT32 mpdu_pool_alloc_succ;
  7802. /* Number of times the MSDU pool alloc succeeded */
  7803. A_UINT32 msdu_pool_alloc_succ;
  7804. /* Number of times the tid pool alloc failed */
  7805. A_UINT32 tid_pool_alloc_fail;
  7806. /* Number of times the MPDU pool alloc failed */
  7807. A_UINT32 mpdu_pool_alloc_fail;
  7808. /* Number of times the MSDU pool alloc failed */
  7809. A_UINT32 msdu_pool_alloc_fail;
  7810. /* Number of times the tid pool freed */
  7811. A_UINT32 tid_pool_free;
  7812. /* Number of times the MPDU pool freed */
  7813. A_UINT32 mpdu_pool_free;
  7814. /* Number of times the MSDU pool freed */
  7815. A_UINT32 msdu_pool_free;
  7816. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7817. A_UINT32 msdu_queued;
  7818. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7819. A_UINT32 msdu_recycled;
  7820. /* Number of MPDUs with invalid peer but A2 found in AST */
  7821. A_UINT32 invalid_peer_a2_in_ast;
  7822. /* Number of MPDUs with invalid peer but A3 found in AST */
  7823. A_UINT32 invalid_peer_a3_in_ast;
  7824. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7825. A_UINT32 invalid_peer_bmc_mpdus;
  7826. /* Number of MSDUs with err attention word */
  7827. A_UINT32 rxdesc_err_att;
  7828. /* Number of MSDUs with flag of peer_idx_invalid */
  7829. A_UINT32 rxdesc_err_peer_idx_inv;
  7830. /* Number of MSDUs with flag of peer_idx_timeout */
  7831. A_UINT32 rxdesc_err_peer_idx_to;
  7832. /* Number of MSDUs with flag of overflow */
  7833. A_UINT32 rxdesc_err_ov;
  7834. /* Number of MSDUs with flag of msdu_length_err */
  7835. A_UINT32 rxdesc_err_msdu_len;
  7836. /* Number of MSDUs with flag of mpdu_length_err */
  7837. A_UINT32 rxdesc_err_mpdu_len;
  7838. /* Number of MSDUs with flag of tkip_mic_err */
  7839. A_UINT32 rxdesc_err_tkip_mic;
  7840. /* Number of MSDUs with flag of decrypt_err */
  7841. A_UINT32 rxdesc_err_decrypt;
  7842. /* Number of MSDUs with flag of fcs_err */
  7843. A_UINT32 rxdesc_err_fcs;
  7844. /* Number of Unicast (bc_mc bit is not set in attention word)
  7845. * frames with invalid peer handler
  7846. */
  7847. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7848. /* Number of unicast frame directly (direct bit is set in attention word)
  7849. * to DUT with invalid peer handler
  7850. */
  7851. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7852. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7853. * frames with invalid peer handler
  7854. */
  7855. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7856. /* Number of MSDUs dropped due to no first MSDU flag */
  7857. A_UINT32 rxdesc_no_1st_msdu;
  7858. /* Number of MSDUs droped due to ring overflow */
  7859. A_UINT32 msdu_drop_ring_ov;
  7860. /* Number of MSDUs dropped due to FC mismatch */
  7861. A_UINT32 msdu_drop_fc_mismatch;
  7862. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7863. A_UINT32 msdu_drop_mgmt_remote_ring;
  7864. /* Number of MSDUs dropped due to errors not reported in attention word */
  7865. A_UINT32 msdu_drop_misc;
  7866. /* Number of MSDUs go to offload before reorder */
  7867. A_UINT32 offload_msdu_wal;
  7868. /* Number of data frame dropped by offload after reorder */
  7869. A_UINT32 offload_msdu_reorder;
  7870. /* Number of MPDUs with sequence number in the past and within the BA window */
  7871. A_UINT32 dup_past_within_window;
  7872. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7873. A_UINT32 dup_past_outside_window;
  7874. /* Number of MSDUs with decrypt/MIC error */
  7875. A_UINT32 rxdesc_err_decrypt_mic;
  7876. /* Number of data MSDUs received on both local and remote rings */
  7877. A_UINT32 data_msdus_on_both_rings;
  7878. /* MPDUs never filled */
  7879. A_UINT32 holes_not_filled;
  7880. };
  7881. /*
  7882. * Rx Remote buffer statistics
  7883. * NB: all the fields must be defined in 4 octets size.
  7884. */
  7885. struct rx_remote_buffer_mgmt_stats {
  7886. /* Total number of MSDUs reaped for Rx processing */
  7887. A_UINT32 remote_reaped;
  7888. /* MSDUs recycled within firmware */
  7889. A_UINT32 remote_recycled;
  7890. /* MSDUs stored by Data Rx */
  7891. A_UINT32 data_rx_msdus_stored;
  7892. /* Number of HTT indications from WAL Rx MSDU */
  7893. A_UINT32 wal_rx_ind;
  7894. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7895. A_UINT32 wal_rx_ind_unconsumed;
  7896. /* Number of HTT indications from Data Rx MSDU */
  7897. A_UINT32 data_rx_ind;
  7898. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7899. A_UINT32 data_rx_ind_unconsumed;
  7900. /* Number of HTT indications from ATHBUF */
  7901. A_UINT32 athbuf_rx_ind;
  7902. /* Number of remote buffers requested for refill */
  7903. A_UINT32 refill_buf_req;
  7904. /* Number of remote buffers filled by the host */
  7905. A_UINT32 refill_buf_rsp;
  7906. /* Number of times MAC hw_index = f/w write_index */
  7907. A_INT32 mac_no_bufs;
  7908. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7909. A_INT32 fw_indices_equal;
  7910. /* Number of times f/w finds no buffers to post */
  7911. A_INT32 host_no_bufs;
  7912. };
  7913. /*
  7914. * TXBF MU/SU packets and NDPA statistics
  7915. * NB: all the fields must be defined in 4 octets size.
  7916. */
  7917. struct rx_txbf_musu_ndpa_pkts_stats {
  7918. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7919. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7920. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7921. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7922. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7923. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7924. };
  7925. /*
  7926. * htt_dbg_stats_status -
  7927. * present - The requested stats have been delivered in full.
  7928. * This indicates that either the stats information was contained
  7929. * in its entirety within this message, or else this message
  7930. * completes the delivery of the requested stats info that was
  7931. * partially delivered through earlier STATS_CONF messages.
  7932. * partial - The requested stats have been delivered in part.
  7933. * One or more subsequent STATS_CONF messages with the same
  7934. * cookie value will be sent to deliver the remainder of the
  7935. * information.
  7936. * error - The requested stats could not be delivered, for example due
  7937. * to a shortage of memory to construct a message holding the
  7938. * requested stats.
  7939. * invalid - The requested stat type is either not recognized, or the
  7940. * target is configured to not gather the stats type in question.
  7941. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7942. * series_done - This special value indicates that no further stats info
  7943. * elements are present within a series of stats info elems
  7944. * (within a stats upload confirmation message).
  7945. */
  7946. enum htt_dbg_stats_status {
  7947. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7948. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7949. HTT_DBG_STATS_STATUS_ERROR = 2,
  7950. HTT_DBG_STATS_STATUS_INVALID = 3,
  7951. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7952. };
  7953. /**
  7954. * @brief target -> host statistics upload
  7955. *
  7956. * @details
  7957. * The following field definitions describe the format of the HTT target
  7958. * to host stats upload confirmation message.
  7959. * The message contains a cookie echoed from the HTT host->target stats
  7960. * upload request, which identifies which request the confirmation is
  7961. * for, and a series of tag-length-value stats information elements.
  7962. * The tag-length header for each stats info element also includes a
  7963. * status field, to indicate whether the request for the stat type in
  7964. * question was fully met, partially met, unable to be met, or invalid
  7965. * (if the stat type in question is disabled in the target).
  7966. * A special value of all 1's in this status field is used to indicate
  7967. * the end of the series of stats info elements.
  7968. *
  7969. *
  7970. * |31 16|15 8|7 5|4 0|
  7971. * |------------------------------------------------------------|
  7972. * | reserved | msg type |
  7973. * |------------------------------------------------------------|
  7974. * | cookie LSBs |
  7975. * |------------------------------------------------------------|
  7976. * | cookie MSBs |
  7977. * |------------------------------------------------------------|
  7978. * | stats entry length | reserved | S |stat type|
  7979. * |------------------------------------------------------------|
  7980. * | |
  7981. * | type-specific stats info |
  7982. * | |
  7983. * |------------------------------------------------------------|
  7984. * | stats entry length | reserved | S |stat type|
  7985. * |------------------------------------------------------------|
  7986. * | |
  7987. * | type-specific stats info |
  7988. * | |
  7989. * |------------------------------------------------------------|
  7990. * | n/a | reserved | 111 | n/a |
  7991. * |------------------------------------------------------------|
  7992. * Header fields:
  7993. * - MSG_TYPE
  7994. * Bits 7:0
  7995. * Purpose: identifies this is a statistics upload confirmation message
  7996. * Value: 0x9
  7997. * - COOKIE_LSBS
  7998. * Bits 31:0
  7999. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8000. * message with its preceding host->target stats request message.
  8001. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8002. * - COOKIE_MSBS
  8003. * Bits 31:0
  8004. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8005. * message with its preceding host->target stats request message.
  8006. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8007. *
  8008. * Stats Information Element tag-length header fields:
  8009. * - STAT_TYPE
  8010. * Bits 4:0
  8011. * Purpose: identifies the type of statistics info held in the
  8012. * following information element
  8013. * Value: htt_dbg_stats_type
  8014. * - STATUS
  8015. * Bits 7:5
  8016. * Purpose: indicate whether the requested stats are present
  8017. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8018. * the completion of the stats entry series
  8019. * - LENGTH
  8020. * Bits 31:16
  8021. * Purpose: indicate the stats information size
  8022. * Value: This field specifies the number of bytes of stats information
  8023. * that follows the element tag-length header.
  8024. * It is expected but not required that this length is a multiple of
  8025. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8026. * subsequent stats entry header will begin on a 4-byte aligned
  8027. * boundary.
  8028. */
  8029. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8030. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8031. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8032. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8033. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8034. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8035. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8036. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8037. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8038. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8039. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8040. do { \
  8041. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8042. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8043. } while (0)
  8044. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8045. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8046. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8047. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8048. do { \
  8049. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8050. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8051. } while (0)
  8052. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8053. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8054. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8055. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8056. do { \
  8057. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8058. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8059. } while (0)
  8060. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8061. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8062. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8063. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8064. #define HTT_MAX_AGGR 64
  8065. #define HTT_HL_MAX_AGGR 18
  8066. /**
  8067. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8068. *
  8069. * @details
  8070. * The following field definitions describe the format of the HTT host
  8071. * to target frag_desc/msdu_ext bank configuration message.
  8072. * The message contains the based address and the min and max id of the
  8073. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8074. * MSDU_EXT/FRAG_DESC.
  8075. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8076. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8077. * the hardware does the mapping/translation.
  8078. *
  8079. * Total banks that can be configured is configured to 16.
  8080. *
  8081. * This should be called before any TX has be initiated by the HTT
  8082. *
  8083. * |31 16|15 8|7 5|4 0|
  8084. * |------------------------------------------------------------|
  8085. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8086. * |------------------------------------------------------------|
  8087. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8088. #if HTT_PADDR64
  8089. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8090. #endif
  8091. * |------------------------------------------------------------|
  8092. * | ... |
  8093. * |------------------------------------------------------------|
  8094. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8095. #if HTT_PADDR64
  8096. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8097. #endif
  8098. * |------------------------------------------------------------|
  8099. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8100. * |------------------------------------------------------------|
  8101. * | ... |
  8102. * |------------------------------------------------------------|
  8103. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8104. * |------------------------------------------------------------|
  8105. * Header fields:
  8106. * - MSG_TYPE
  8107. * Bits 7:0
  8108. * Value: 0x6
  8109. * for systems with 64-bit format for bus addresses:
  8110. * - BANKx_BASE_ADDRESS_LO
  8111. * Bits 31:0
  8112. * Purpose: Provide a mechanism to specify the base address of the
  8113. * MSDU_EXT bank physical/bus address.
  8114. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8115. * - BANKx_BASE_ADDRESS_HI
  8116. * Bits 31:0
  8117. * Purpose: Provide a mechanism to specify the base address of the
  8118. * MSDU_EXT bank physical/bus address.
  8119. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8120. * for systems with 32-bit format for bus addresses:
  8121. * - BANKx_BASE_ADDRESS
  8122. * Bits 31:0
  8123. * Purpose: Provide a mechanism to specify the base address of the
  8124. * MSDU_EXT bank physical/bus address.
  8125. * Value: MSDU_EXT bank physical / bus address
  8126. * - BANKx_MIN_ID
  8127. * Bits 15:0
  8128. * Purpose: Provide a mechanism to specify the min index that needs to
  8129. * mapped.
  8130. * - BANKx_MAX_ID
  8131. * Bits 31:16
  8132. * Purpose: Provide a mechanism to specify the max index that needs to
  8133. * mapped.
  8134. *
  8135. */
  8136. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8137. * safe value.
  8138. * @note MAX supported banks is 16.
  8139. */
  8140. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8141. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8142. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8143. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8144. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8145. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8146. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8147. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8148. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8149. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8150. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8151. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8152. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8153. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8154. do { \
  8155. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8156. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8157. } while (0)
  8158. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8159. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8160. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8161. do { \
  8162. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8163. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8164. } while (0)
  8165. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8166. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8167. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8168. do { \
  8169. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8170. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8171. } while (0)
  8172. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8173. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8174. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8175. do { \
  8176. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8177. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8178. } while (0)
  8179. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8180. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8181. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8182. do { \
  8183. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8184. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8185. } while (0)
  8186. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8187. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8188. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8189. do { \
  8190. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8191. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8192. } while (0)
  8193. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8194. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8195. /*
  8196. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8197. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8198. * addresses are stored in a XXX-bit field.
  8199. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8200. * htt_tx_frag_desc64_bank_cfg_t structs.
  8201. */
  8202. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8203. _paddr_bits_, \
  8204. _paddr__bank_base_address_) \
  8205. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8206. /** word 0 \
  8207. * msg_type: 8, \
  8208. * pdev_id: 2, \
  8209. * swap: 1, \
  8210. * reserved0: 5, \
  8211. * num_banks: 8, \
  8212. * desc_size: 8; \
  8213. */ \
  8214. A_UINT32 word0; \
  8215. /* \
  8216. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8217. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8218. * the second A_UINT32). \
  8219. */ \
  8220. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8221. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8222. } POSTPACK
  8223. /* define htt_tx_frag_desc32_bank_cfg_t */
  8224. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8225. /* define htt_tx_frag_desc64_bank_cfg_t */
  8226. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8227. /*
  8228. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8229. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8230. */
  8231. #if HTT_PADDR64
  8232. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8233. #else
  8234. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8235. #endif
  8236. /**
  8237. * @brief target -> host HTT TX Credit total count update message definition
  8238. *
  8239. *|31 16|15|14 9| 8 |7 0 |
  8240. *|---------------------+--+----------+-------+----------|
  8241. *|cur htt credit delta | Q| reserved | sign | msg type |
  8242. *|------------------------------------------------------|
  8243. *
  8244. * Header fields:
  8245. * - MSG_TYPE
  8246. * Bits 7:0
  8247. * Purpose: identifies this as a htt tx credit delta update message
  8248. * Value: 0xe
  8249. * - SIGN
  8250. * Bits 8
  8251. * identifies whether credit delta is positive or negative
  8252. * Value:
  8253. * - 0x0: credit delta is positive, rebalance in some buffers
  8254. * - 0x1: credit delta is negative, rebalance out some buffers
  8255. * - reserved
  8256. * Bits 14:9
  8257. * Value: 0x0
  8258. * - TXQ_GRP
  8259. * Bit 15
  8260. * Purpose: indicates whether any tx queue group information elements
  8261. * are appended to the tx credit update message
  8262. * Value: 0 -> no tx queue group information element is present
  8263. * 1 -> a tx queue group information element immediately follows
  8264. * - DELTA_COUNT
  8265. * Bits 31:16
  8266. * Purpose: Specify current htt credit delta absolute count
  8267. */
  8268. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8269. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8270. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8271. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8272. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8273. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8274. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8275. do { \
  8276. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8277. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8278. } while (0)
  8279. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8280. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8281. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8282. do { \
  8283. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8284. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8285. } while (0)
  8286. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8287. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8288. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8289. do { \
  8290. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8291. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8292. } while (0)
  8293. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8294. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8295. #define HTT_TX_CREDIT_MSG_BYTES 4
  8296. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8297. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8298. /**
  8299. * @brief HTT WDI_IPA Operation Response Message
  8300. *
  8301. * @details
  8302. * HTT WDI_IPA Operation Response message is sent by target
  8303. * to host confirming suspend or resume operation.
  8304. * |31 24|23 16|15 8|7 0|
  8305. * |----------------+----------------+----------------+----------------|
  8306. * | op_code | Rsvd | msg_type |
  8307. * |-------------------------------------------------------------------|
  8308. * | Rsvd | Response len |
  8309. * |-------------------------------------------------------------------|
  8310. * | |
  8311. * | Response-type specific info |
  8312. * | |
  8313. * | |
  8314. * |-------------------------------------------------------------------|
  8315. * Header fields:
  8316. * - MSG_TYPE
  8317. * Bits 7:0
  8318. * Purpose: Identifies this as WDI_IPA Operation Response message
  8319. * value: = 0x13
  8320. * - OP_CODE
  8321. * Bits 31:16
  8322. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8323. * value: = enum htt_wdi_ipa_op_code
  8324. * - RSP_LEN
  8325. * Bits 16:0
  8326. * Purpose: length for the response-type specific info
  8327. * value: = length in bytes for response-type specific info
  8328. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8329. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8330. */
  8331. PREPACK struct htt_wdi_ipa_op_response_t
  8332. {
  8333. /* DWORD 0: flags and meta-data */
  8334. A_UINT32
  8335. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8336. reserved1: 8,
  8337. op_code: 16;
  8338. A_UINT32
  8339. rsp_len: 16,
  8340. reserved2: 16;
  8341. } POSTPACK;
  8342. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8343. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8344. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8345. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8346. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8347. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8348. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8349. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8352. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8353. } while (0)
  8354. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8355. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8356. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8357. do { \
  8358. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8359. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8360. } while (0)
  8361. enum htt_phy_mode {
  8362. htt_phy_mode_11a = 0,
  8363. htt_phy_mode_11g = 1,
  8364. htt_phy_mode_11b = 2,
  8365. htt_phy_mode_11g_only = 3,
  8366. htt_phy_mode_11na_ht20 = 4,
  8367. htt_phy_mode_11ng_ht20 = 5,
  8368. htt_phy_mode_11na_ht40 = 6,
  8369. htt_phy_mode_11ng_ht40 = 7,
  8370. htt_phy_mode_11ac_vht20 = 8,
  8371. htt_phy_mode_11ac_vht40 = 9,
  8372. htt_phy_mode_11ac_vht80 = 10,
  8373. htt_phy_mode_11ac_vht20_2g = 11,
  8374. htt_phy_mode_11ac_vht40_2g = 12,
  8375. htt_phy_mode_11ac_vht80_2g = 13,
  8376. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8377. htt_phy_mode_11ac_vht160 = 15,
  8378. htt_phy_mode_max,
  8379. };
  8380. /**
  8381. * @brief target -> host HTT channel change indication
  8382. * @details
  8383. * Specify when a channel change occurs.
  8384. * This allows the host to precisely determine which rx frames arrived
  8385. * on the old channel and which rx frames arrived on the new channel.
  8386. *
  8387. *|31 |7 0 |
  8388. *|-------------------------------------------+----------|
  8389. *| reserved | msg type |
  8390. *|------------------------------------------------------|
  8391. *| primary_chan_center_freq_mhz |
  8392. *|------------------------------------------------------|
  8393. *| contiguous_chan1_center_freq_mhz |
  8394. *|------------------------------------------------------|
  8395. *| contiguous_chan2_center_freq_mhz |
  8396. *|------------------------------------------------------|
  8397. *| phy_mode |
  8398. *|------------------------------------------------------|
  8399. *
  8400. * Header fields:
  8401. * - MSG_TYPE
  8402. * Bits 7:0
  8403. * Purpose: identifies this as a htt channel change indication message
  8404. * Value: 0x15
  8405. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8406. * Bits 31:0
  8407. * Purpose: identify the (center of the) new 20 MHz primary channel
  8408. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8409. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8410. * Bits 31:0
  8411. * Purpose: identify the (center of the) contiguous frequency range
  8412. * comprising the new channel.
  8413. * For example, if the new channel is a 80 MHz channel extending
  8414. * 60 MHz beyond the primary channel, this field would be 30 larger
  8415. * than the primary channel center frequency field.
  8416. * Value: center frequency of the contiguous frequency range comprising
  8417. * the full channel in MHz units
  8418. * (80+80 channels also use the CONTIG_CHAN2 field)
  8419. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8420. * Bits 31:0
  8421. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8422. * within a VHT 80+80 channel.
  8423. * This field is only relevant for VHT 80+80 channels.
  8424. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8425. * channel (arbitrary value for cases besides VHT 80+80)
  8426. * - PHY_MODE
  8427. * Bits 31:0
  8428. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8429. * and band
  8430. * Value: htt_phy_mode enum value
  8431. */
  8432. PREPACK struct htt_chan_change_t
  8433. {
  8434. /* DWORD 0: flags and meta-data */
  8435. A_UINT32
  8436. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8437. reserved1: 24;
  8438. A_UINT32 primary_chan_center_freq_mhz;
  8439. A_UINT32 contig_chan1_center_freq_mhz;
  8440. A_UINT32 contig_chan2_center_freq_mhz;
  8441. A_UINT32 phy_mode;
  8442. } POSTPACK;
  8443. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8444. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8445. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8446. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8447. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8448. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8449. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8450. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8451. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8454. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8455. } while (0)
  8456. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8457. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8458. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8459. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8462. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8463. } while (0)
  8464. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8465. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8466. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8467. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8470. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8471. } while (0)
  8472. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8473. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8474. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8475. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8476. do { \
  8477. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8478. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8479. } while (0)
  8480. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8481. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8482. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8483. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8484. /**
  8485. * @brief rx offload packet error message
  8486. *
  8487. * @details
  8488. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8489. * of target payload like mic err.
  8490. *
  8491. * |31 24|23 16|15 8|7 0|
  8492. * |----------------+----------------+----------------+----------------|
  8493. * | tid | vdev_id | msg_sub_type | msg_type |
  8494. * |-------------------------------------------------------------------|
  8495. * : (sub-type dependent content) :
  8496. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8497. * Header fields:
  8498. * - msg_type
  8499. * Bits 7:0
  8500. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8501. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8502. * - msg_sub_type
  8503. * Bits 15:8
  8504. * Purpose: Identifies which type of rx error is reported by this message
  8505. * value: htt_rx_ofld_pkt_err_type
  8506. * - vdev_id
  8507. * Bits 23:16
  8508. * Purpose: Identifies which vdev received the erroneous rx frame
  8509. * value:
  8510. * - tid
  8511. * Bits 31:24
  8512. * Purpose: Identifies the traffic type of the rx frame
  8513. * value:
  8514. *
  8515. * - The payload fields used if the sub-type == MIC error are shown below.
  8516. * Note - MIC err is per MSDU, while PN is per MPDU.
  8517. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8518. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8519. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8520. * instead of sending separate HTT messages for each wrong MSDU within
  8521. * the MPDU.
  8522. *
  8523. * |31 24|23 16|15 8|7 0|
  8524. * |----------------+----------------+----------------+----------------|
  8525. * | Rsvd | key_id | peer_id |
  8526. * |-------------------------------------------------------------------|
  8527. * | receiver MAC addr 31:0 |
  8528. * |-------------------------------------------------------------------|
  8529. * | Rsvd | receiver MAC addr 47:32 |
  8530. * |-------------------------------------------------------------------|
  8531. * | transmitter MAC addr 31:0 |
  8532. * |-------------------------------------------------------------------|
  8533. * | Rsvd | transmitter MAC addr 47:32 |
  8534. * |-------------------------------------------------------------------|
  8535. * | PN 31:0 |
  8536. * |-------------------------------------------------------------------|
  8537. * | Rsvd | PN 47:32 |
  8538. * |-------------------------------------------------------------------|
  8539. * - peer_id
  8540. * Bits 15:0
  8541. * Purpose: identifies which peer is frame is from
  8542. * value:
  8543. * - key_id
  8544. * Bits 23:16
  8545. * Purpose: identifies key_id of rx frame
  8546. * value:
  8547. * - RA_31_0 (receiver MAC addr 31:0)
  8548. * Bits 31:0
  8549. * Purpose: identifies by MAC address which vdev received the frame
  8550. * value: MAC address lower 4 bytes
  8551. * - RA_47_32 (receiver MAC addr 47:32)
  8552. * Bits 15:0
  8553. * Purpose: identifies by MAC address which vdev received the frame
  8554. * value: MAC address upper 2 bytes
  8555. * - TA_31_0 (transmitter MAC addr 31:0)
  8556. * Bits 31:0
  8557. * Purpose: identifies by MAC address which peer transmitted the frame
  8558. * value: MAC address lower 4 bytes
  8559. * - TA_47_32 (transmitter MAC addr 47:32)
  8560. * Bits 15:0
  8561. * Purpose: identifies by MAC address which peer transmitted the frame
  8562. * value: MAC address upper 2 bytes
  8563. * - PN_31_0
  8564. * Bits 31:0
  8565. * Purpose: Identifies pn of rx frame
  8566. * value: PN lower 4 bytes
  8567. * - PN_47_32
  8568. * Bits 15:0
  8569. * Purpose: Identifies pn of rx frame
  8570. * value:
  8571. * TKIP or CCMP: PN upper 2 bytes
  8572. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8573. */
  8574. enum htt_rx_ofld_pkt_err_type {
  8575. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8576. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8577. };
  8578. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8579. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8580. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8581. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8582. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8583. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8584. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8585. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8586. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8587. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8588. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8589. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8592. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8593. } while (0)
  8594. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8595. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8596. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8597. do { \
  8598. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8599. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8600. } while (0)
  8601. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8602. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8603. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8604. do { \
  8605. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8606. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8607. } while (0)
  8608. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8609. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8610. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8620. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8627. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8628. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8629. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8630. do { \
  8631. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8632. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8633. } while (0)
  8634. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8635. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8636. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8637. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8638. do { \
  8639. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8640. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8641. } while (0)
  8642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8643. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8644. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8648. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8649. } while (0)
  8650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8651. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8652. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8654. do { \
  8655. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8656. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8657. } while (0)
  8658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8659. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8660. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8662. do { \
  8663. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8664. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8665. } while (0)
  8666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8667. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8668. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8670. do { \
  8671. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8672. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8673. } while (0)
  8674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8675. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8676. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8678. do { \
  8679. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8680. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8681. } while (0)
  8682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8683. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8684. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8686. do { \
  8687. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8688. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8689. } while (0)
  8690. /**
  8691. * @brief peer rate report message
  8692. *
  8693. * @details
  8694. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8695. * justified rate of all the peers.
  8696. *
  8697. * |31 24|23 16|15 8|7 0|
  8698. * |----------------+----------------+----------------+----------------|
  8699. * | peer_count | | msg_type |
  8700. * |-------------------------------------------------------------------|
  8701. * : Payload (variant number of peer rate report) :
  8702. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8703. * Header fields:
  8704. * - msg_type
  8705. * Bits 7:0
  8706. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8707. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8708. * - reserved
  8709. * Bits 15:8
  8710. * Purpose:
  8711. * value:
  8712. * - peer_count
  8713. * Bits 31:16
  8714. * Purpose: Specify how many peer rate report elements are present in the payload.
  8715. * value:
  8716. *
  8717. * Payload:
  8718. * There are variant number of peer rate report follow the first 32 bits.
  8719. * The peer rate report is defined as follows.
  8720. *
  8721. * |31 20|19 16|15 0|
  8722. * |-----------------------+---------+---------------------------------|-
  8723. * | reserved | phy | peer_id | \
  8724. * |-------------------------------------------------------------------| -> report #0
  8725. * | rate | /
  8726. * |-----------------------+---------+---------------------------------|-
  8727. * | reserved | phy | peer_id | \
  8728. * |-------------------------------------------------------------------| -> report #1
  8729. * | rate | /
  8730. * |-----------------------+---------+---------------------------------|-
  8731. * | reserved | phy | peer_id | \
  8732. * |-------------------------------------------------------------------| -> report #2
  8733. * | rate | /
  8734. * |-------------------------------------------------------------------|-
  8735. * : :
  8736. * : :
  8737. * : :
  8738. * :-------------------------------------------------------------------:
  8739. *
  8740. * - peer_id
  8741. * Bits 15:0
  8742. * Purpose: identify the peer
  8743. * value:
  8744. * - phy
  8745. * Bits 19:16
  8746. * Purpose: identify which phy is in use
  8747. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8748. * Please see enum htt_peer_report_phy_type for detail.
  8749. * - reserved
  8750. * Bits 31:20
  8751. * Purpose:
  8752. * value:
  8753. * - rate
  8754. * Bits 31:0
  8755. * Purpose: represent the justified rate of the peer specified by peer_id
  8756. * value:
  8757. */
  8758. enum htt_peer_rate_report_phy_type {
  8759. HTT_PEER_RATE_REPORT_11B = 0,
  8760. HTT_PEER_RATE_REPORT_11A_G,
  8761. HTT_PEER_RATE_REPORT_11N,
  8762. HTT_PEER_RATE_REPORT_11AC,
  8763. };
  8764. #define HTT_PEER_RATE_REPORT_SIZE 8
  8765. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8766. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8767. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8768. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8769. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8770. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8771. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8772. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8773. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8774. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8775. do { \
  8776. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8777. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8778. } while (0)
  8779. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8780. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8781. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8782. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8783. do { \
  8784. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8785. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8786. } while (0)
  8787. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8788. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8789. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8790. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8791. do { \
  8792. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8793. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8794. } while (0)
  8795. /**
  8796. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8797. *
  8798. * @details
  8799. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8800. * a flow of descriptors.
  8801. *
  8802. * This message is in TLV format and indicates the parameters to be setup a
  8803. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8804. * receive descriptors from a specified pool.
  8805. *
  8806. * The message would appear as follows:
  8807. *
  8808. * |31 24|23 16|15 8|7 0|
  8809. * |----------------+----------------+----------------+----------------|
  8810. * header | reserved | num_flows | msg_type |
  8811. * |-------------------------------------------------------------------|
  8812. * | |
  8813. * : payload :
  8814. * | |
  8815. * |-------------------------------------------------------------------|
  8816. *
  8817. * The header field is one DWORD long and is interpreted as follows:
  8818. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8819. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8820. * this message
  8821. * b'16-31 - reserved: These bits are reserved for future use
  8822. *
  8823. * Payload:
  8824. * The payload would contain multiple objects of the following structure. Each
  8825. * object represents a flow.
  8826. *
  8827. * |31 24|23 16|15 8|7 0|
  8828. * |----------------+----------------+----------------+----------------|
  8829. * header | reserved | num_flows | msg_type |
  8830. * |-------------------------------------------------------------------|
  8831. * payload0| flow_type |
  8832. * |-------------------------------------------------------------------|
  8833. * | flow_id |
  8834. * |-------------------------------------------------------------------|
  8835. * | reserved0 | flow_pool_id |
  8836. * |-------------------------------------------------------------------|
  8837. * | reserved1 | flow_pool_size |
  8838. * |-------------------------------------------------------------------|
  8839. * | reserved2 |
  8840. * |-------------------------------------------------------------------|
  8841. * payload1| flow_type |
  8842. * |-------------------------------------------------------------------|
  8843. * | flow_id |
  8844. * |-------------------------------------------------------------------|
  8845. * | reserved0 | flow_pool_id |
  8846. * |-------------------------------------------------------------------|
  8847. * | reserved1 | flow_pool_size |
  8848. * |-------------------------------------------------------------------|
  8849. * | reserved2 |
  8850. * |-------------------------------------------------------------------|
  8851. * | . |
  8852. * | . |
  8853. * | . |
  8854. * |-------------------------------------------------------------------|
  8855. *
  8856. * Each payload is 5 DWORDS long and is interpreted as follows:
  8857. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8858. * this flow is associated. It can be VDEV, peer,
  8859. * or tid (AC). Based on enum htt_flow_type.
  8860. *
  8861. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8862. * object. For flow_type vdev it is set to the
  8863. * vdevid, for peer it is peerid and for tid, it is
  8864. * tid_num.
  8865. *
  8866. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8867. * in the host for this flow
  8868. * b'16:31 - reserved0: This field in reserved for the future. In case
  8869. * we have a hierarchical implementation (HCM) of
  8870. * pools, it can be used to indicate the ID of the
  8871. * parent-pool.
  8872. *
  8873. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8874. * Descriptors for this flow will be
  8875. * allocated from this pool in the host.
  8876. * b'16:31 - reserved1: This field in reserved for the future. In case
  8877. * we have a hierarchical implementation of pools,
  8878. * it can be used to indicate the max number of
  8879. * descriptors in the pool. The b'0:15 can be used
  8880. * to indicate min number of descriptors in the
  8881. * HCM scheme.
  8882. *
  8883. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8884. * we have a hierarchical implementation of pools,
  8885. * b'0:15 can be used to indicate the
  8886. * priority-based borrowing (PBB) threshold of
  8887. * the flow's pool. The b'16:31 are still left
  8888. * reserved.
  8889. */
  8890. enum htt_flow_type {
  8891. FLOW_TYPE_VDEV = 0,
  8892. /* Insert new flow types above this line */
  8893. };
  8894. PREPACK struct htt_flow_pool_map_payload_t {
  8895. A_UINT32 flow_type;
  8896. A_UINT32 flow_id;
  8897. A_UINT32 flow_pool_id:16,
  8898. reserved0:16;
  8899. A_UINT32 flow_pool_size:16,
  8900. reserved1:16;
  8901. A_UINT32 reserved2;
  8902. } POSTPACK;
  8903. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8904. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8905. (sizeof(struct htt_flow_pool_map_payload_t))
  8906. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8907. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8908. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8909. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8910. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8911. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8912. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8913. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8914. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8916. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8917. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8918. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8919. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8920. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8921. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8922. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8923. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8924. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8925. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8926. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8927. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8928. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8929. do { \
  8930. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8931. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8932. } while (0)
  8933. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8934. do { \
  8935. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8936. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8937. } while (0)
  8938. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8941. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8942. } while (0)
  8943. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8944. do { \
  8945. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8946. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8947. } while (0)
  8948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8949. do { \
  8950. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8951. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8952. } while (0)
  8953. /**
  8954. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8955. *
  8956. * @details
  8957. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8958. * down a flow of descriptors.
  8959. * This message indicates that for the flow (whose ID is provided) is wanting
  8960. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8961. * pool of descriptors from where descriptors are being allocated for this
  8962. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8963. * be unmapped by the host.
  8964. *
  8965. * The message would appear as follows:
  8966. *
  8967. * |31 24|23 16|15 8|7 0|
  8968. * |----------------+----------------+----------------+----------------|
  8969. * | reserved0 | msg_type |
  8970. * |-------------------------------------------------------------------|
  8971. * | flow_type |
  8972. * |-------------------------------------------------------------------|
  8973. * | flow_id |
  8974. * |-------------------------------------------------------------------|
  8975. * | reserved1 | flow_pool_id |
  8976. * |-------------------------------------------------------------------|
  8977. *
  8978. * The message is interpreted as follows:
  8979. * dword0 - b'0:7 - msg_type: This will be set to
  8980. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8981. * b'8:31 - reserved0: Reserved for future use
  8982. *
  8983. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8984. * this flow is associated. It can be VDEV, peer,
  8985. * or tid (AC). Based on enum htt_flow_type.
  8986. *
  8987. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8988. * object. For flow_type vdev it is set to the
  8989. * vdevid, for peer it is peerid and for tid, it is
  8990. * tid_num.
  8991. *
  8992. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8993. * used in the host for this flow
  8994. * b'16:31 - reserved0: This field in reserved for the future.
  8995. *
  8996. */
  8997. PREPACK struct htt_flow_pool_unmap_t {
  8998. A_UINT32 msg_type:8,
  8999. reserved0:24;
  9000. A_UINT32 flow_type;
  9001. A_UINT32 flow_id;
  9002. A_UINT32 flow_pool_id:16,
  9003. reserved1:16;
  9004. } POSTPACK;
  9005. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9006. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9007. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9008. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9009. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9010. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9011. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9012. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9013. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9014. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9015. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9016. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9017. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9018. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9019. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9020. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9023. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9024. } while (0)
  9025. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9026. do { \
  9027. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9028. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9029. } while (0)
  9030. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9031. do { \
  9032. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9033. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9034. } while (0)
  9035. /**
  9036. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9037. *
  9038. * @details
  9039. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9040. * SRNG ring setup is done
  9041. *
  9042. * This message indicates whether the last setup operation is successful.
  9043. * It will be sent to host when host set respose_required bit in
  9044. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9045. * The message would appear as follows:
  9046. *
  9047. * |31 24|23 16|15 8|7 0|
  9048. * |--------------- +----------------+----------------+----------------|
  9049. * | setup_status | ring_id | pdev_id | msg_type |
  9050. * |-------------------------------------------------------------------|
  9051. *
  9052. * The message is interpreted as follows:
  9053. * dword0 - b'0:7 - msg_type: This will be set to
  9054. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9055. * b'8:15 - pdev_id:
  9056. * 0 (for rings at SOC/UMAC level),
  9057. * 1/2/3 mac id (for rings at LMAC level)
  9058. * b'16:23 - ring_id: Identify the ring which is set up
  9059. * More details can be got from enum htt_srng_ring_id
  9060. * b'24:31 - setup_status: Indicate status of setup operation
  9061. * Refer to htt_ring_setup_status
  9062. */
  9063. PREPACK struct htt_sring_setup_done_t {
  9064. A_UINT32 msg_type: 8,
  9065. pdev_id: 8,
  9066. ring_id: 8,
  9067. setup_status: 8;
  9068. } POSTPACK;
  9069. enum htt_ring_setup_status {
  9070. htt_ring_setup_status_ok = 0,
  9071. htt_ring_setup_status_error,
  9072. };
  9073. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9074. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9075. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9076. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9077. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9078. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9079. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9080. do { \
  9081. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9082. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9083. } while (0)
  9084. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9085. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9086. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9087. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9088. HTT_SRING_SETUP_DONE_RING_ID_S)
  9089. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9090. do { \
  9091. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9092. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9093. } while (0)
  9094. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9095. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9096. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9097. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9098. HTT_SRING_SETUP_DONE_STATUS_S)
  9099. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9100. do { \
  9101. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9102. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9103. } while (0)
  9104. /**
  9105. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9106. *
  9107. * @details
  9108. * HTT TX map flow entry with tqm flow pointer
  9109. * Sent from firmware to host to add tqm flow pointer in corresponding
  9110. * flow search entry. Flow metadata is replayed back to host as part of this
  9111. * struct to enable host to find the specific flow search entry
  9112. *
  9113. * The message would appear as follows:
  9114. *
  9115. * |31 28|27 18|17 14|13 8|7 0|
  9116. * |-------+------------------------------------------+----------------|
  9117. * | rsvd0 | fse_hsh_idx | msg_type |
  9118. * |-------------------------------------------------------------------|
  9119. * | rsvd1 | tid | peer_id |
  9120. * |-------------------------------------------------------------------|
  9121. * | tqm_flow_pntr_lo |
  9122. * |-------------------------------------------------------------------|
  9123. * | tqm_flow_pntr_hi |
  9124. * |-------------------------------------------------------------------|
  9125. * | fse_meta_data |
  9126. * |-------------------------------------------------------------------|
  9127. *
  9128. * The message is interpreted as follows:
  9129. *
  9130. * dword0 - b'0:7 - msg_type: This will be set to
  9131. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9132. *
  9133. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9134. * for this flow entry
  9135. *
  9136. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9137. *
  9138. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9139. *
  9140. * dword1 - b'14:17 - tid
  9141. *
  9142. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9143. *
  9144. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9145. *
  9146. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9147. *
  9148. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9149. * given by host
  9150. */
  9151. PREPACK struct htt_tx_map_flow_info {
  9152. A_UINT32
  9153. msg_type: 8,
  9154. fse_hsh_idx: 20,
  9155. rsvd0: 4;
  9156. A_UINT32
  9157. peer_id: 14,
  9158. tid: 4,
  9159. rsvd1: 14;
  9160. A_UINT32 tqm_flow_pntr_lo;
  9161. A_UINT32 tqm_flow_pntr_hi;
  9162. struct htt_tx_flow_metadata fse_meta_data;
  9163. } POSTPACK;
  9164. /* DWORD 0 */
  9165. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9166. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9167. /* DWORD 1 */
  9168. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9169. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9170. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9171. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9172. /* DWORD 0 */
  9173. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9174. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9175. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9176. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9177. do { \
  9178. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9179. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9180. } while (0)
  9181. /* DWORD 1 */
  9182. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9183. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9184. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9185. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9188. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9189. } while (0)
  9190. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9191. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9192. HTT_TX_MAP_FLOW_INFO_TID_S)
  9193. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9196. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9197. } while (0)
  9198. /*
  9199. * htt_dbg_ext_stats_status -
  9200. * present - The requested stats have been delivered in full.
  9201. * This indicates that either the stats information was contained
  9202. * in its entirety within this message, or else this message
  9203. * completes the delivery of the requested stats info that was
  9204. * partially delivered through earlier STATS_CONF messages.
  9205. * partial - The requested stats have been delivered in part.
  9206. * One or more subsequent STATS_CONF messages with the same
  9207. * cookie value will be sent to deliver the remainder of the
  9208. * information.
  9209. * error - The requested stats could not be delivered, for example due
  9210. * to a shortage of memory to construct a message holding the
  9211. * requested stats.
  9212. * invalid - The requested stat type is either not recognized, or the
  9213. * target is configured to not gather the stats type in question.
  9214. */
  9215. enum htt_dbg_ext_stats_status {
  9216. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9217. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9218. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9219. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9220. };
  9221. /**
  9222. * @brief target -> host ppdu stats upload
  9223. *
  9224. * @details
  9225. * The following field definitions describe the format of the HTT target
  9226. * to host ppdu stats indication message.
  9227. *
  9228. *
  9229. * |31 16|15 12|11 10|9 8|7 0 |
  9230. * |----------------------------------------------------------------------|
  9231. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9232. * |----------------------------------------------------------------------|
  9233. * | ppdu_id |
  9234. * |----------------------------------------------------------------------|
  9235. * | Timestamp in us |
  9236. * |----------------------------------------------------------------------|
  9237. * | reserved |
  9238. * |----------------------------------------------------------------------|
  9239. * | type-specific stats info |
  9240. * | (see htt_ppdu_stats.h) |
  9241. * |----------------------------------------------------------------------|
  9242. * Header fields:
  9243. * - MSG_TYPE
  9244. * Bits 7:0
  9245. * Purpose: Identifies this is a PPDU STATS indication
  9246. * message.
  9247. * Value: 0x1d
  9248. * - mac_id
  9249. * Bits 9:8
  9250. * Purpose: mac_id of this ppdu_id
  9251. * Value: 0-3
  9252. * - pdev_id
  9253. * Bits 11:10
  9254. * Purpose: pdev_id of this ppdu_id
  9255. * Value: 0-3
  9256. * 0 (for rings at SOC level),
  9257. * 1/2/3 PDEV -> 0/1/2
  9258. * - payload_size
  9259. * Bits 31:16
  9260. * Purpose: total tlv size
  9261. * Value: payload_size in bytes
  9262. */
  9263. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9264. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9265. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9266. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9267. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9268. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9269. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9270. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9271. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9272. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9273. do { \
  9274. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9275. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9276. } while (0)
  9277. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9278. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9279. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9280. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9281. do { \
  9282. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9283. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9284. } while (0)
  9285. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9286. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9287. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9288. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9289. do { \
  9290. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9291. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9292. } while (0)
  9293. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9294. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9295. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9296. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9297. do { \
  9298. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9299. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9300. } while (0)
  9301. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9302. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9303. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9304. /**
  9305. * @brief target -> host extended statistics upload
  9306. *
  9307. * @details
  9308. * The following field definitions describe the format of the HTT target
  9309. * to host stats upload confirmation message.
  9310. * The message contains a cookie echoed from the HTT host->target stats
  9311. * upload request, which identifies which request the confirmation is
  9312. * for, and a single stats can span over multiple HTT stats indication
  9313. * due to the HTT message size limitation so every HTT ext stats indication
  9314. * will have tag-length-value stats information elements.
  9315. * The tag-length header for each HTT stats IND message also includes a
  9316. * status field, to indicate whether the request for the stat type in
  9317. * question was fully met, partially met, unable to be met, or invalid
  9318. * (if the stat type in question is disabled in the target).
  9319. * A Done bit 1's indicate the end of the of stats info elements.
  9320. *
  9321. *
  9322. * |31 16|15 12|11|10 8|7 5|4 0|
  9323. * |--------------------------------------------------------------|
  9324. * | reserved | msg type |
  9325. * |--------------------------------------------------------------|
  9326. * | cookie LSBs |
  9327. * |--------------------------------------------------------------|
  9328. * | cookie MSBs |
  9329. * |--------------------------------------------------------------|
  9330. * | stats entry length | rsvd | D| S | stat type |
  9331. * |--------------------------------------------------------------|
  9332. * | type-specific stats info |
  9333. * | (see htt_stats.h) |
  9334. * |--------------------------------------------------------------|
  9335. * Header fields:
  9336. * - MSG_TYPE
  9337. * Bits 7:0
  9338. * Purpose: Identifies this is a extended statistics upload confirmation
  9339. * message.
  9340. * Value: 0x1c
  9341. * - COOKIE_LSBS
  9342. * Bits 31:0
  9343. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9344. * message with its preceding host->target stats request message.
  9345. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9346. * - COOKIE_MSBS
  9347. * Bits 31:0
  9348. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9349. * message with its preceding host->target stats request message.
  9350. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9351. *
  9352. * Stats Information Element tag-length header fields:
  9353. * - STAT_TYPE
  9354. * Bits 7:0
  9355. * Purpose: identifies the type of statistics info held in the
  9356. * following information element
  9357. * Value: htt_dbg_ext_stats_type
  9358. * - STATUS
  9359. * Bits 10:8
  9360. * Purpose: indicate whether the requested stats are present
  9361. * Value: htt_dbg_ext_stats_status
  9362. * - DONE
  9363. * Bits 11
  9364. * Purpose:
  9365. * Indicates the completion of the stats entry, this will be the last
  9366. * stats conf HTT segment for the requested stats type.
  9367. * Value:
  9368. * 0 -> the stats retrieval is ongoing
  9369. * 1 -> the stats retrieval is complete
  9370. * - LENGTH
  9371. * Bits 31:16
  9372. * Purpose: indicate the stats information size
  9373. * Value: This field specifies the number of bytes of stats information
  9374. * that follows the element tag-length header.
  9375. * It is expected but not required that this length is a multiple of
  9376. * 4 bytes.
  9377. */
  9378. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9379. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9380. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9381. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9382. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9383. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9384. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9385. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9386. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9387. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9388. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9389. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9390. do { \
  9391. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9392. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9393. } while (0)
  9394. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9395. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9396. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9397. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9398. do { \
  9399. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9400. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9401. } while (0)
  9402. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9403. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9404. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9405. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9406. do { \
  9407. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9408. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9409. } while (0)
  9410. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9411. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9412. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9413. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9414. do { \
  9415. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9416. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9417. } while (0)
  9418. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9419. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9420. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9421. typedef enum {
  9422. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9423. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9424. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9425. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9426. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9427. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9428. /* Reserved from 128 - 255 for target internal use.*/
  9429. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9430. } HTT_PEER_TYPE;
  9431. /** 2 word representation of MAC addr */
  9432. typedef struct {
  9433. /** upper 4 bytes of MAC address */
  9434. A_UINT32 mac_addr31to0;
  9435. /** lower 2 bytes of MAC address */
  9436. A_UINT32 mac_addr47to32;
  9437. } htt_mac_addr;
  9438. /** macro to convert MAC address from char array to HTT word format */
  9439. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9440. (phtt_mac_addr)->mac_addr31to0 = \
  9441. (((c_macaddr)[0] << 0) | \
  9442. ((c_macaddr)[1] << 8) | \
  9443. ((c_macaddr)[2] << 16) | \
  9444. ((c_macaddr)[3] << 24)); \
  9445. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9446. } while (0)
  9447. /**
  9448. * @brief target -> host monitor mac header indication message
  9449. *
  9450. * @details
  9451. * The following diagram shows the format of the monitor mac header message
  9452. * sent from the target to the host.
  9453. * This message is primarily sent when promiscuous rx mode is enabled.
  9454. * One message is sent per rx PPDU.
  9455. *
  9456. * |31 24|23 16|15 8|7 0|
  9457. * |-------------------------------------------------------------|
  9458. * | peer_id | reserved0 | msg_type |
  9459. * |-------------------------------------------------------------|
  9460. * | reserved1 | num_mpdu |
  9461. * |-------------------------------------------------------------|
  9462. * | struct hw_rx_desc |
  9463. * | (see wal_rx_desc.h) |
  9464. * |-------------------------------------------------------------|
  9465. * | struct ieee80211_frame_addr4 |
  9466. * | (see ieee80211_defs.h) |
  9467. * |-------------------------------------------------------------|
  9468. * | struct ieee80211_frame_addr4 |
  9469. * | (see ieee80211_defs.h) |
  9470. * |-------------------------------------------------------------|
  9471. * | ...... |
  9472. * |-------------------------------------------------------------|
  9473. *
  9474. * Header fields:
  9475. * - msg_type
  9476. * Bits 7:0
  9477. * Purpose: Identifies this is a monitor mac header indication message.
  9478. * Value: 0x20
  9479. * - peer_id
  9480. * Bits 31:16
  9481. * Purpose: Software peer id given by host during association,
  9482. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9483. * for rx PPDUs received from unassociated peers.
  9484. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9485. * - num_mpdu
  9486. * Bits 15:0
  9487. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9488. * delivered within the message.
  9489. * Value: 1 to 32
  9490. * num_mpdu is limited to a maximum value of 32, due to buffer
  9491. * size limits. For PPDUs with more than 32 MPDUs, only the
  9492. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9493. * the PPDU will be provided.
  9494. */
  9495. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9496. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9497. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9498. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9499. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9500. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9501. do { \
  9502. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9503. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9504. } while (0)
  9505. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9506. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9507. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9508. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9509. do { \
  9510. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9511. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9512. } while (0)
  9513. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9514. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9515. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9516. /**
  9517. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9518. *
  9519. * @details
  9520. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9521. * the flow pool associated with the specified ID is resized
  9522. *
  9523. * The message would appear as follows:
  9524. *
  9525. * |31 16|15 8|7 0|
  9526. * |---------------------------------+----------------+----------------|
  9527. * | reserved0 | Msg type |
  9528. * |-------------------------------------------------------------------|
  9529. * | flow pool new size | flow pool ID |
  9530. * |-------------------------------------------------------------------|
  9531. *
  9532. * The message is interpreted as follows:
  9533. * b'0:7 - msg_type: This will be set to
  9534. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9535. *
  9536. * b'0:15 - flow pool ID: Existing flow pool ID
  9537. *
  9538. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9539. *
  9540. */
  9541. PREPACK struct htt_flow_pool_resize_t {
  9542. A_UINT32 msg_type:8,
  9543. reserved0:24;
  9544. A_UINT32 flow_pool_id:16,
  9545. flow_pool_new_size:16;
  9546. } POSTPACK;
  9547. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9548. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9549. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9550. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9551. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9552. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9553. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9554. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9555. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9556. do { \
  9557. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9558. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9559. } while (0)
  9560. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9561. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9562. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9563. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9564. do { \
  9565. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9566. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9567. } while (0)
  9568. #endif