htt.h 474 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478
  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. */
  163. #define HTT_CURRENT_VERSION_MAJOR 3
  164. #define HTT_CURRENT_VERSION_MINOR 51
  165. #define HTT_NUM_TX_FRAG_DESC 1024
  166. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  167. #define HTT_CHECK_SET_VAL(field, val) \
  168. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  169. /* macros to assist in sign-extending fields from HTT messages */
  170. #define HTT_SIGN_BIT_MASK(field) \
  171. ((field ## _M + (1 << field ## _S)) >> 1)
  172. #define HTT_SIGN_BIT(_val, field) \
  173. (_val & HTT_SIGN_BIT_MASK(field))
  174. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  175. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  176. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  177. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  178. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  179. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  180. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  181. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  182. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  183. /*
  184. * TEMPORARY:
  185. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  186. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  187. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  188. * updated.
  189. */
  190. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  191. /*
  192. * TEMPORARY:
  193. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  194. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  195. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  196. * updated.
  197. */
  198. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  199. /* HTT Access Category values */
  200. enum HTT_AC_WMM {
  201. /* WMM Access Categories */
  202. HTT_AC_WMM_BE = 0x0,
  203. HTT_AC_WMM_BK = 0x1,
  204. HTT_AC_WMM_VI = 0x2,
  205. HTT_AC_WMM_VO = 0x3,
  206. /* extension Access Categories */
  207. HTT_AC_EXT_NON_QOS = 0x4,
  208. HTT_AC_EXT_UCAST_MGMT = 0x5,
  209. HTT_AC_EXT_MCAST_DATA = 0x6,
  210. HTT_AC_EXT_MCAST_MGMT = 0x7,
  211. };
  212. enum HTT_AC_WMM_MASK {
  213. /* WMM Access Categories */
  214. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  215. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  216. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  217. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  218. /* extension Access Categories */
  219. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  220. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  221. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  222. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  223. };
  224. #define HTT_AC_MASK_WMM \
  225. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  226. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  227. #define HTT_AC_MASK_EXT \
  228. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  229. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  230. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  231. /*
  232. * htt_dbg_stats_type -
  233. * bit positions for each stats type within a stats type bitmask
  234. * The bitmask contains 24 bits.
  235. */
  236. enum htt_dbg_stats_type {
  237. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  238. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  239. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  240. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  241. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  242. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  243. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  244. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  245. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  246. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  247. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  248. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  249. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  250. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  251. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  252. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  253. /* bits 16-23 currently reserved */
  254. /* keep this last */
  255. HTT_DBG_NUM_STATS
  256. };
  257. /*=== HTT option selection TLVs ===
  258. * Certain HTT messages have alternatives or options.
  259. * For such cases, the host and target need to agree on which option to use.
  260. * Option specification TLVs can be appended to the VERSION_REQ and
  261. * VERSION_CONF messages to select options other than the default.
  262. * These TLVs are entirely optional - if they are not provided, there is a
  263. * well-defined default for each option. If they are provided, they can be
  264. * provided in any order. Each TLV can be present or absent independent of
  265. * the presence / absence of other TLVs.
  266. *
  267. * The HTT option selection TLVs use the following format:
  268. * |31 16|15 8|7 0|
  269. * |---------------------------------+----------------+----------------|
  270. * | value (payload) | length | tag |
  271. * |-------------------------------------------------------------------|
  272. * The value portion need not be only 2 bytes; it can be extended by any
  273. * integer number of 4-byte units. The total length of the TLV, including
  274. * the tag and length fields, must be a multiple of 4 bytes. The length
  275. * field specifies the total TLV size in 4-byte units. Thus, the typical
  276. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  277. * field, would store 0x1 in its length field, to show that the TLV occupies
  278. * a single 4-byte unit.
  279. */
  280. /*--- TLV header format - applies to all HTT option TLVs ---*/
  281. enum HTT_OPTION_TLV_TAGS {
  282. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  283. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  284. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  285. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  286. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  287. };
  288. PREPACK struct htt_option_tlv_header_t {
  289. A_UINT8 tag;
  290. A_UINT8 length;
  291. } POSTPACK;
  292. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  293. #define HTT_OPTION_TLV_TAG_S 0
  294. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  295. #define HTT_OPTION_TLV_LENGTH_S 8
  296. /*
  297. * value0 - 16 bit value field stored in word0
  298. * The TLV's value field may be longer than 2 bytes, in which case
  299. * the remainder of the value is stored in word1, word2, etc.
  300. */
  301. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  302. #define HTT_OPTION_TLV_VALUE0_S 16
  303. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  304. do { \
  305. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  306. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  307. } while (0)
  308. #define HTT_OPTION_TLV_TAG_GET(word) \
  309. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  310. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  311. do { \
  312. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  313. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  314. } while (0)
  315. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  316. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  317. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  318. do { \
  319. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  320. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  321. } while (0)
  322. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  323. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  324. /*--- format of specific HTT option TLVs ---*/
  325. /*
  326. * HTT option TLV for specifying LL bus address size
  327. * Some chips require bus addresses used by the target to access buffers
  328. * within the host's memory to be 32 bits; others require bus addresses
  329. * used by the target to access buffers within the host's memory to be
  330. * 64 bits.
  331. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  332. * a suffix to the VERSION_CONF message to specify which bus address format
  333. * the target requires.
  334. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  335. * default to providing bus addresses to the target in 32-bit format.
  336. */
  337. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  338. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  339. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  340. };
  341. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  342. struct htt_option_tlv_header_t hdr;
  343. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  344. } POSTPACK;
  345. /*
  346. * HTT option TLV for specifying whether HL systems should indicate
  347. * over-the-air tx completion for individual frames, or should instead
  348. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  349. * requests an OTA tx completion for a particular tx frame.
  350. * This option does not apply to LL systems, where the TX_COMPL_IND
  351. * is mandatory.
  352. * This option is primarily intended for HL systems in which the tx frame
  353. * downloads over the host --> target bus are as slow as or slower than
  354. * the transmissions over the WLAN PHY. For cases where the bus is faster
  355. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  356. * and consquently will send one TX_COMPL_IND message that covers several
  357. * tx frames. For cases where the WLAN PHY is faster than the bus,
  358. * the target will end up transmitting very short A-MPDUs, and consequently
  359. * sending many TX_COMPL_IND messages, which each cover a very small number
  360. * of tx frames.
  361. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  362. * a suffix to the VERSION_REQ message to request whether the host desires to
  363. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  364. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  365. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  366. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  367. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  368. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  369. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  370. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  371. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  372. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  373. * TLV.
  374. */
  375. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  376. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  377. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  378. };
  379. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  380. struct htt_option_tlv_header_t hdr;
  381. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  382. } POSTPACK;
  383. /*
  384. * HTT option TLV for specifying how many tx queue groups the target
  385. * may establish.
  386. * This TLV specifies the maximum value the target may send in the
  387. * txq_group_id field of any TXQ_GROUP information elements sent by
  388. * the target to the host. This allows the host to pre-allocate an
  389. * appropriate number of tx queue group structs.
  390. *
  391. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  392. * a suffix to the VERSION_REQ message to specify whether the host supports
  393. * tx queue groups at all, and if so if there is any limit on the number of
  394. * tx queue groups that the host supports.
  395. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  396. * a suffix to the VERSION_CONF message. If the host has specified in the
  397. * VER_REQ message a limit on the number of tx queue groups the host can
  398. * supprt, the target shall limit its specification of the maximum tx groups
  399. * to be no larger than this host-specified limit.
  400. *
  401. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  402. * shall preallocate 4 tx queue group structs, and the target shall not
  403. * specify a txq_group_id larger than 3.
  404. */
  405. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  406. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  407. /*
  408. * values 1 through N specify the max number of tx queue groups
  409. * the sender supports
  410. */
  411. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  412. };
  413. /* TEMPORARY backwards-compatibility alias for a typo fix -
  414. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  415. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  416. * to support the old name (with the typo) until all references to the
  417. * old name are replaced with the new name.
  418. */
  419. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  420. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  421. struct htt_option_tlv_header_t hdr;
  422. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  423. } POSTPACK;
  424. /*
  425. * HTT option TLV for specifying whether the target supports an extended
  426. * version of the HTT tx descriptor. If the target provides this TLV
  427. * and specifies in the TLV that the target supports an extended version
  428. * of the HTT tx descriptor, the target must check the "extension" bit in
  429. * the HTT tx descriptor, and if the extension bit is set, to expect a
  430. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  431. * descriptor. Furthermore, the target must provide room for the HTT
  432. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  433. * This option is intended for systems where the host needs to explicitly
  434. * control the transmission parameters such as tx power for individual
  435. * tx frames.
  436. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  437. * as a suffix to the VERSION_CONF message to explicitly specify whether
  438. * the target supports the HTT tx MSDU extension descriptor.
  439. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  440. * by the host as lack of target support for the HTT tx MSDU extension
  441. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  442. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  443. * the HTT tx MSDU extension descriptor.
  444. * The host is not required to provide the HTT tx MSDU extension descriptor
  445. * just because the target supports it; the target must check the
  446. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  447. * extension descriptor is present.
  448. */
  449. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  450. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  451. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  452. };
  453. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  454. struct htt_option_tlv_header_t hdr;
  455. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  456. } POSTPACK;
  457. /*=== host -> target messages ===============================================*/
  458. enum htt_h2t_msg_type {
  459. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  460. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  461. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  462. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  463. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  464. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  465. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  466. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  467. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  468. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  469. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  470. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  471. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  472. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  473. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  474. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  475. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  476. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  477. /* keep this last */
  478. HTT_H2T_NUM_MSGS
  479. };
  480. /*
  481. * HTT host to target message type -
  482. * stored in bits 7:0 of the first word of the message
  483. */
  484. #define HTT_H2T_MSG_TYPE_M 0xff
  485. #define HTT_H2T_MSG_TYPE_S 0
  486. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  487. do { \
  488. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  489. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  490. } while (0)
  491. #define HTT_H2T_MSG_TYPE_GET(word) \
  492. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  493. /**
  494. * @brief host -> target version number request message definition
  495. *
  496. * |31 24|23 16|15 8|7 0|
  497. * |----------------+----------------+----------------+----------------|
  498. * | reserved | msg type |
  499. * |-------------------------------------------------------------------|
  500. * : option request TLV (optional) |
  501. * :...................................................................:
  502. *
  503. * The VER_REQ message may consist of a single 4-byte word, or may be
  504. * extended with TLVs that specify which HTT options the host is requesting
  505. * from the target.
  506. * The following option TLVs may be appended to the VER_REQ message:
  507. * - HL_SUPPRESS_TX_COMPL_IND
  508. * - HL_MAX_TX_QUEUE_GROUPS
  509. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  510. * may be appended to the VER_REQ message (but only one TLV of each type).
  511. *
  512. * Header fields:
  513. * - MSG_TYPE
  514. * Bits 7:0
  515. * Purpose: identifies this as a version number request message
  516. * Value: 0x0
  517. */
  518. #define HTT_VER_REQ_BYTES 4
  519. /* TBDXXX: figure out a reasonable number */
  520. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  521. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  522. /**
  523. * @brief HTT tx MSDU descriptor
  524. *
  525. * @details
  526. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  527. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  528. * the target firmware needs for the FW's tx processing, particularly
  529. * for creating the HW msdu descriptor.
  530. * The same HTT tx descriptor is used for HL and LL systems, though
  531. * a few fields within the tx descriptor are used only by LL or
  532. * only by HL.
  533. * The HTT tx descriptor is defined in two manners: by a struct with
  534. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  535. * definitions.
  536. * The target should use the struct def, for simplicitly and clarity,
  537. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  538. * neutral. Specifically, the host shall use the get/set macros built
  539. * around the mask + shift defs.
  540. */
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  549. #define HTT_TX_VDEV_ID_WORD 0
  550. #define HTT_TX_VDEV_ID_MASK 0x3f
  551. #define HTT_TX_VDEV_ID_SHIFT 16
  552. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  553. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  554. #define HTT_TX_MSDU_LEN_DWORD 1
  555. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  556. /*
  557. * HTT_VAR_PADDR macros
  558. * Allow physical / bus addresses to be either a single 32-bit value,
  559. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  560. */
  561. #define HTT_VAR_PADDR32(var_name) \
  562. A_UINT32 var_name
  563. #define HTT_VAR_PADDR64_LE(var_name) \
  564. struct { \
  565. /* little-endian: lo precedes hi */ \
  566. A_UINT32 lo; \
  567. A_UINT32 hi; \
  568. } var_name
  569. /*
  570. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  571. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  572. * addresses are stored in a XXX-bit field.
  573. * This macro is used to define both htt_tx_msdu_desc32_t and
  574. * htt_tx_msdu_desc64_t structs.
  575. */
  576. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  577. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  578. { \
  579. /* DWORD 0: flags and meta-data */ \
  580. A_UINT32 \
  581. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  582. \
  583. /* pkt_subtype - \
  584. * Detailed specification of the tx frame contents, extending the \
  585. * general specification provided by pkt_type. \
  586. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  587. * pkt_type | pkt_subtype \
  588. * ============================================================== \
  589. * 802.3 | bit 0:3 - Reserved \
  590. * | bit 4: 0x0 - Copy-Engine Classification Results \
  591. * | not appended to the HTT message \
  592. * | 0x1 - Copy-Engine Classification Results \
  593. * | appended to the HTT message in the \
  594. * | format: \
  595. * | [HTT tx desc, frame header, \
  596. * | CE classification results] \
  597. * | The CE classification results begin \
  598. * | at the next 4-byte boundary after \
  599. * | the frame header. \
  600. * ------------+------------------------------------------------- \
  601. * Eth2 | bit 0:3 - Reserved \
  602. * | bit 4: 0x0 - Copy-Engine Classification Results \
  603. * | not appended to the HTT message \
  604. * | 0x1 - Copy-Engine Classification Results \
  605. * | appended to the HTT message. \
  606. * | See the above specification of the \
  607. * | CE classification results location. \
  608. * ------------+------------------------------------------------- \
  609. * native WiFi | bit 0:3 - Reserved \
  610. * | bit 4: 0x0 - Copy-Engine Classification Results \
  611. * | not appended to the HTT message \
  612. * | 0x1 - Copy-Engine Classification Results \
  613. * | appended to the HTT message. \
  614. * | See the above specification of the \
  615. * | CE classification results location. \
  616. * ------------+------------------------------------------------- \
  617. * mgmt | 0x0 - 802.11 MAC header absent \
  618. * | 0x1 - 802.11 MAC header present \
  619. * ------------+------------------------------------------------- \
  620. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  621. * | 0x1 - 802.11 MAC header present \
  622. * | bit 1: 0x0 - allow aggregation \
  623. * | 0x1 - don't allow aggregation \
  624. * | bit 2: 0x0 - perform encryption \
  625. * | 0x1 - don't perform encryption \
  626. * | bit 3: 0x0 - perform tx classification / queuing \
  627. * | 0x1 - don't perform tx classification; \
  628. * | insert the frame into the "misc" \
  629. * | tx queue \
  630. * | bit 4: 0x0 - Copy-Engine Classification Results \
  631. * | not appended to the HTT message \
  632. * | 0x1 - Copy-Engine Classification Results \
  633. * | appended to the HTT message. \
  634. * | See the above specification of the \
  635. * | CE classification results location. \
  636. */ \
  637. pkt_subtype: 5, \
  638. \
  639. /* pkt_type - \
  640. * General specification of the tx frame contents. \
  641. * The htt_pkt_type enum should be used to specify and check the \
  642. * value of this field. \
  643. */ \
  644. pkt_type: 3, \
  645. \
  646. /* vdev_id - \
  647. * ID for the vdev that is sending this tx frame. \
  648. * For certain non-standard packet types, e.g. pkt_type == raw \
  649. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  650. * This field is used primarily for determining where to queue \
  651. * broadcast and multicast frames. \
  652. */ \
  653. vdev_id: 6, \
  654. /* ext_tid - \
  655. * The extended traffic ID. \
  656. * If the TID is unknown, the extended TID is set to \
  657. * HTT_TX_EXT_TID_INVALID. \
  658. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  659. * value of the QoS TID. \
  660. * If the tx frame is non-QoS data, then the extended TID is set to \
  661. * HTT_TX_EXT_TID_NON_QOS. \
  662. * If the tx frame is multicast or broadcast, then the extended TID \
  663. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  664. */ \
  665. ext_tid: 5, \
  666. \
  667. /* postponed - \
  668. * This flag indicates whether the tx frame has been downloaded to \
  669. * the target before but discarded by the target, and now is being \
  670. * downloaded again; or if this is a new frame that is being \
  671. * downloaded for the first time. \
  672. * This flag allows the target to determine the correct order for \
  673. * transmitting new vs. old frames. \
  674. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  675. * This flag only applies to HL systems, since in LL systems, \
  676. * the tx flow control is handled entirely within the target. \
  677. */ \
  678. postponed: 1, \
  679. \
  680. /* extension - \
  681. * This flag indicates whether a HTT tx MSDU extension descriptor \
  682. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  683. * \
  684. * 0x0 - no extension MSDU descriptor is present \
  685. * 0x1 - an extension MSDU descriptor immediately follows the \
  686. * regular MSDU descriptor \
  687. */ \
  688. extension: 1, \
  689. \
  690. /* cksum_offload - \
  691. * This flag indicates whether checksum offload is enabled or not \
  692. * for this frame. Target FW use this flag to turn on HW checksumming \
  693. * 0x0 - No checksum offload \
  694. * 0x1 - L3 header checksum only \
  695. * 0x2 - L4 checksum only \
  696. * 0x3 - L3 header checksum + L4 checksum \
  697. */ \
  698. cksum_offload: 2, \
  699. \
  700. /* tx_comp_req - \
  701. * This flag indicates whether Tx Completion \
  702. * from fw is required or not. \
  703. * This flag is only relevant if tx completion is not \
  704. * universally enabled. \
  705. * For all LL systems, tx completion is mandatory, \
  706. * so this flag will be irrelevant. \
  707. * For HL systems tx completion is optional, but HL systems in which \
  708. * the bus throughput exceeds the WLAN throughput will \
  709. * probably want to always use tx completion, and thus \
  710. * would not check this flag. \
  711. * This flag is required when tx completions are not used universally, \
  712. * but are still required for certain tx frames for which \
  713. * an OTA delivery acknowledgment is needed by the host. \
  714. * In practice, this would be for HL systems in which the \
  715. * bus throughput is less than the WLAN throughput. \
  716. * \
  717. * 0x0 - Tx Completion Indication from Fw not required \
  718. * 0x1 - Tx Completion Indication from Fw is required \
  719. */ \
  720. tx_compl_req: 1; \
  721. \
  722. \
  723. /* DWORD 1: MSDU length and ID */ \
  724. A_UINT32 \
  725. len: 16, /* MSDU length, in bytes */ \
  726. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  727. * and this id is used to calculate fragmentation \
  728. * descriptor pointer inside the target based on \
  729. * the base address, configured inside the target. \
  730. */ \
  731. \
  732. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  733. /* frags_desc_ptr - \
  734. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  735. * where the tx frame's fragments reside in memory. \
  736. * This field only applies to LL systems, since in HL systems the \
  737. * (degenerate single-fragment) fragmentation descriptor is created \
  738. * within the target. \
  739. */ \
  740. _paddr__frags_desc_ptr_; \
  741. \
  742. /* DWORD 3 (or 4): peerid, chanfreq */ \
  743. /* \
  744. * Peer ID : Target can use this value to know which peer-id packet \
  745. * destined to. \
  746. * It's intended to be specified by host in case of NAWDS. \
  747. */ \
  748. A_UINT16 peerid; \
  749. \
  750. /* \
  751. * Channel frequency: This identifies the desired channel \
  752. * frequency (in mhz) for tx frames. This is used by FW to help \
  753. * determine when it is safe to transmit or drop frames for \
  754. * off-channel operation. \
  755. * The default value of zero indicates to FW that the corresponding \
  756. * VDEV's home channel (if there is one) is the desired channel \
  757. * frequency. \
  758. */ \
  759. A_UINT16 chanfreq; \
  760. \
  761. /* Reason reserved is commented is increasing the htt structure size \
  762. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  763. * A_UINT32 reserved_dword3_bits0_31; \
  764. */ \
  765. } POSTPACK
  766. /* define a htt_tx_msdu_desc32_t type */
  767. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  768. /* define a htt_tx_msdu_desc64_t type */
  769. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  770. /*
  771. * Make htt_tx_msdu_desc_t be an alias for either
  772. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  773. */
  774. #if HTT_PADDR64
  775. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  776. #else
  777. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  778. #endif
  779. /* decriptor information for Management frame*/
  780. /*
  781. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  782. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  783. */
  784. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  785. extern A_UINT32 mgmt_hdr_len;
  786. PREPACK struct htt_mgmt_tx_desc_t {
  787. A_UINT32 msg_type;
  788. #if HTT_PADDR64
  789. A_UINT64 frag_paddr; /* DMAble address of the data */
  790. #else
  791. A_UINT32 frag_paddr; /* DMAble address of the data */
  792. #endif
  793. A_UINT32 desc_id; /* returned to host during completion
  794. * to free the meory*/
  795. A_UINT32 len; /* Fragment length */
  796. A_UINT32 vdev_id; /* virtual device ID*/
  797. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  798. } POSTPACK;
  799. PREPACK struct htt_mgmt_tx_compl_ind {
  800. A_UINT32 desc_id;
  801. A_UINT32 status;
  802. } POSTPACK;
  803. /*
  804. * This SDU header size comes from the summation of the following:
  805. * 1. Max of:
  806. * a. Native WiFi header, for native WiFi frames: 24 bytes
  807. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  808. * b. 802.11 header, for raw frames: 36 bytes
  809. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  810. * QoS header, HT header)
  811. * c. 802.3 header, for ethernet frames: 14 bytes
  812. * (destination address, source address, ethertype / length)
  813. * 2. Max of:
  814. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  815. * b. IPv6 header, up through the Traffic Class: 2 bytes
  816. * 3. 802.1Q VLAN header: 4 bytes
  817. * 4. LLC/SNAP header: 8 bytes
  818. */
  819. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  820. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  821. #define HTT_TX_HDR_SIZE_ETHERNET 14
  822. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  823. A_COMPILE_TIME_ASSERT(
  824. htt_encap_hdr_size_max_check_nwifi,
  825. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  826. A_COMPILE_TIME_ASSERT(
  827. htt_encap_hdr_size_max_check_enet,
  828. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  829. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  830. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  831. #define HTT_TX_HDR_SIZE_802_1Q 4
  832. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  833. #define HTT_COMMON_TX_FRM_HDR_LEN \
  834. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  835. HTT_TX_HDR_SIZE_802_1Q + \
  836. HTT_TX_HDR_SIZE_LLC_SNAP)
  837. #define HTT_HL_TX_FRM_HDR_LEN \
  838. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  839. #define HTT_LL_TX_FRM_HDR_LEN \
  840. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  841. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  842. /* dword 0 */
  843. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  844. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  845. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  846. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  847. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  848. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  849. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  850. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  851. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  852. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  853. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  854. #define HTT_TX_DESC_PKT_TYPE_S 13
  855. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  858. #define HTT_TX_DESC_VDEV_ID_S 16
  859. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  862. #define HTT_TX_DESC_EXT_TID_S 22
  863. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  866. #define HTT_TX_DESC_POSTPONED_S 27
  867. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  868. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  870. #define HTT_TX_DESC_EXTENSION_S 28
  871. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  872. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  874. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  875. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  876. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  878. #define HTT_TX_DESC_TX_COMP_S 31
  879. /* dword 1 */
  880. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  881. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  882. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  883. #define HTT_TX_DESC_FRM_LEN_S 0
  884. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  885. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  886. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  887. #define HTT_TX_DESC_FRM_ID_S 16
  888. /* dword 2 */
  889. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  891. /* for systems using 64-bit format for bus addresses */
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  896. /* for systems using 32-bit format for bus addresses */
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  899. /* dword 3 */
  900. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  901. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  903. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  905. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  906. #if HTT_PADDR64
  907. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  909. #else
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  912. #endif
  913. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  914. #define HTT_TX_DESC_PEER_ID_S 0
  915. /*
  916. * TEMPORARY:
  917. * The original definitions for the PEER_ID fields contained typos
  918. * (with _DESC_PADDR appended to this PEER_ID field name).
  919. * Retain deprecated original names for PEER_ID fields until all code that
  920. * refers to them has been updated.
  921. */
  922. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  923. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  924. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  925. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  926. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  927. HTT_TX_DESC_PEER_ID_M
  928. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  929. HTT_TX_DESC_PEER_ID_S
  930. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  931. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  933. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  935. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  936. #if HTT_PADDR64
  937. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  939. #else
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  942. #endif
  943. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  944. #define HTT_TX_DESC_CHAN_FREQ_S 16
  945. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  946. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  947. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  948. do { \
  949. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  950. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  951. } while (0)
  952. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  953. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  954. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  955. do { \
  956. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  957. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  958. } while (0)
  959. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  960. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  961. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  962. do { \
  963. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  964. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  965. } while (0)
  966. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  967. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  968. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  969. do { \
  970. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  971. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  972. } while (0)
  973. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  974. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  975. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  976. do { \
  977. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  978. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  979. } while (0)
  980. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  981. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  982. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  983. do { \
  984. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  985. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  986. } while (0)
  987. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  988. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  989. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  990. do { \
  991. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  992. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  993. } while (0)
  994. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  995. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  996. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  997. do { \
  998. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  999. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1000. } while (0)
  1001. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1002. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1003. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1004. do { \
  1005. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1006. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1007. } while (0)
  1008. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1009. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1010. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1011. do { \
  1012. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1013. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1014. } while (0)
  1015. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1016. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1017. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1018. do { \
  1019. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1020. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1021. } while (0)
  1022. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1023. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1024. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1025. do { \
  1026. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1027. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1028. } while (0)
  1029. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1030. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1031. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1032. do { \
  1033. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1034. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1035. } while (0)
  1036. /* enums used in the HTT tx MSDU extension descriptor */
  1037. enum {
  1038. htt_tx_guard_interval_regular = 0,
  1039. htt_tx_guard_interval_short = 1,
  1040. };
  1041. enum {
  1042. htt_tx_preamble_type_ofdm = 0,
  1043. htt_tx_preamble_type_cck = 1,
  1044. htt_tx_preamble_type_ht = 2,
  1045. htt_tx_preamble_type_vht = 3,
  1046. };
  1047. enum {
  1048. htt_tx_bandwidth_5MHz = 0,
  1049. htt_tx_bandwidth_10MHz = 1,
  1050. htt_tx_bandwidth_20MHz = 2,
  1051. htt_tx_bandwidth_40MHz = 3,
  1052. htt_tx_bandwidth_80MHz = 4,
  1053. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1054. };
  1055. /**
  1056. * @brief HTT tx MSDU extension descriptor
  1057. * @details
  1058. * If the target supports HTT tx MSDU extension descriptors, the host has
  1059. * the option of appending the following struct following the regular
  1060. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1061. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1062. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1063. * tx specs for each frame.
  1064. */
  1065. PREPACK struct htt_tx_msdu_desc_ext_t {
  1066. /* DWORD 0: flags */
  1067. A_UINT32
  1068. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1069. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1070. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1071. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1072. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1073. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1074. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1075. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1076. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1077. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1078. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1079. /* DWORD 1: tx power, tx rate, tx BW */
  1080. A_UINT32
  1081. /* pwr -
  1082. * Specify what power the tx frame needs to be transmitted at.
  1083. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1084. * The value needs to be appropriately sign-extended when extracting
  1085. * the value from the message and storing it in a variable that is
  1086. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1087. * automatically handles this sign-extension.)
  1088. * If the transmission uses multiple tx chains, this power spec is
  1089. * the total transmit power, assuming incoherent combination of
  1090. * per-chain power to produce the total power.
  1091. */
  1092. pwr: 8,
  1093. /* mcs_mask -
  1094. * Specify the allowable values for MCS index (modulation and coding)
  1095. * to use for transmitting the frame.
  1096. *
  1097. * For HT / VHT preamble types, this mask directly corresponds to
  1098. * the HT or VHT MCS indices that are allowed. For each bit N set
  1099. * within the mask, MCS index N is allowed for transmitting the frame.
  1100. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1101. * rates versus OFDM rates, so the host has the option of specifying
  1102. * that the target must transmit the frame with CCK or OFDM rates
  1103. * (not HT or VHT), but leaving the decision to the target whether
  1104. * to use CCK or OFDM.
  1105. *
  1106. * For CCK and OFDM, the bits within this mask are interpreted as
  1107. * follows:
  1108. * bit 0 -> CCK 1 Mbps rate is allowed
  1109. * bit 1 -> CCK 2 Mbps rate is allowed
  1110. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1111. * bit 3 -> CCK 11 Mbps rate is allowed
  1112. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1113. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1114. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1115. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1116. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1117. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1118. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1119. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1120. *
  1121. * The MCS index specification needs to be compatible with the
  1122. * bandwidth mask specification. For example, a MCS index == 9
  1123. * specification is inconsistent with a preamble type == VHT,
  1124. * Nss == 1, and channel bandwidth == 20 MHz.
  1125. *
  1126. * Furthermore, the host has only a limited ability to specify to
  1127. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1128. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1129. */
  1130. mcs_mask: 12,
  1131. /* nss_mask -
  1132. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1133. * Each bit in this mask corresponds to a Nss value:
  1134. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1135. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1136. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1137. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1138. * The values in the Nss mask must be suitable for the recipient, e.g.
  1139. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1140. * recipient which only supports 2x2 MIMO.
  1141. */
  1142. nss_mask: 4,
  1143. /* guard_interval -
  1144. * Specify a htt_tx_guard_interval enum value to indicate whether
  1145. * the transmission should use a regular guard interval or a
  1146. * short guard interval.
  1147. */
  1148. guard_interval: 1,
  1149. /* preamble_type_mask -
  1150. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1151. * may choose from for transmitting this frame.
  1152. * The bits in this mask correspond to the values in the
  1153. * htt_tx_preamble_type enum. For example, to allow the target
  1154. * to transmit the frame as either CCK or OFDM, this field would
  1155. * be set to
  1156. * (1 << htt_tx_preamble_type_ofdm) |
  1157. * (1 << htt_tx_preamble_type_cck)
  1158. */
  1159. preamble_type_mask: 4,
  1160. reserved1_31_29: 3; /* unused, set to 0x0 */
  1161. /* DWORD 2: tx chain mask, tx retries */
  1162. A_UINT32
  1163. /* chain_mask - specify which chains to transmit from */
  1164. chain_mask: 4,
  1165. /* retry_limit -
  1166. * Specify the maximum number of transmissions, including the
  1167. * initial transmission, to attempt before giving up if no ack
  1168. * is received.
  1169. * If the tx rate is specified, then all retries shall use the
  1170. * same rate as the initial transmission.
  1171. * If no tx rate is specified, the target can choose whether to
  1172. * retain the original rate during the retransmissions, or to
  1173. * fall back to a more robust rate.
  1174. */
  1175. retry_limit: 4,
  1176. /* bandwidth_mask -
  1177. * Specify what channel widths may be used for the transmission.
  1178. * A value of zero indicates "don't care" - the target may choose
  1179. * the transmission bandwidth.
  1180. * The bits within this mask correspond to the htt_tx_bandwidth
  1181. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1182. * The bandwidth_mask must be consistent with the preamble_type_mask
  1183. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1184. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1185. */
  1186. bandwidth_mask: 6,
  1187. reserved2_31_14: 18; /* unused, set to 0x0 */
  1188. /* DWORD 3: tx expiry time (TSF) LSBs */
  1189. A_UINT32 expire_tsf_lo;
  1190. /* DWORD 4: tx expiry time (TSF) MSBs */
  1191. A_UINT32 expire_tsf_hi;
  1192. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1193. } POSTPACK;
  1194. /* DWORD 0 */
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1215. /* DWORD 1 */
  1216. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1217. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1218. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1219. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1220. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1221. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1222. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1223. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1224. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1225. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1226. /* DWORD 2 */
  1227. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1228. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1229. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1230. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1231. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1232. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1233. /* DWORD 0 */
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1235. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1236. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1238. do { \
  1239. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1240. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1241. } while (0)
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1243. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1244. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1246. do { \
  1247. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1248. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1249. } while (0)
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1251. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1252. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1254. do { \
  1255. HTT_CHECK_SET_VAL( \
  1256. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1257. ((_var) |= ((_val) \
  1258. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1259. } while (0)
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1261. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1262. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1263. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1264. do { \
  1265. HTT_CHECK_SET_VAL( \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1267. ((_var) |= ((_val) \
  1268. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1269. } while (0)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1271. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1272. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1274. do { \
  1275. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1276. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1277. } while (0)
  1278. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1279. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1280. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1285. } while (0)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1287. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1288. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1293. } while (0)
  1294. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1295. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1296. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1298. do { \
  1299. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1300. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1301. } while (0)
  1302. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1303. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1304. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1309. } while (0)
  1310. /* DWORD 1 */
  1311. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1312. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1313. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1314. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1315. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1316. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1317. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1318. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1319. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1320. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1321. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1322. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1323. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1327. } while (0)
  1328. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1335. } while (0)
  1336. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1337. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1338. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1339. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1342. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1343. } while (0)
  1344. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1345. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1346. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1347. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1348. do { \
  1349. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1350. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1351. } while (0)
  1352. /* DWORD 2 */
  1353. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1354. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1355. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1356. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1360. } while (0)
  1361. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1362. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1363. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1364. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1368. } while (0)
  1369. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1370. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1371. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1372. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1373. do { \
  1374. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1375. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1376. } while (0)
  1377. typedef enum {
  1378. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1379. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1380. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1381. } htt_11ax_ltf_subtype_t;
  1382. typedef enum {
  1383. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1389. } htt_tx_ext2_preamble_type_t;
  1390. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1402. /**
  1403. * @brief HTT tx MSDU extension descriptor v2
  1404. * @details
  1405. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1406. * is received as tcl_exit_base->host_meta_info in firmware.
  1407. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1408. * are already part of tcl_exit_base.
  1409. */
  1410. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1411. /* DWORD 0: flags */
  1412. A_UINT32
  1413. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1414. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1415. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1416. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1417. valid_retries : 1, /* if set, tx retries spec is valid */
  1418. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1419. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1420. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1421. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1422. valid_key_flags : 1, /* if set, key flags is valid */
  1423. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1424. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1425. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1426. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1427. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1428. 1 = ENCRYPT,
  1429. 2 ~ 3 - Reserved */
  1430. /* retry_limit -
  1431. * Specify the maximum number of transmissions, including the
  1432. * initial transmission, to attempt before giving up if no ack
  1433. * is received.
  1434. * If the tx rate is specified, then all retries shall use the
  1435. * same rate as the initial transmission.
  1436. * If no tx rate is specified, the target can choose whether to
  1437. * retain the original rate during the retransmissions, or to
  1438. * fall back to a more robust rate.
  1439. */
  1440. retry_limit : 4,
  1441. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1442. * Valid only for 11ax preamble types HE_SU
  1443. * and HE_EXT_SU
  1444. */
  1445. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1446. * Valid only for 11ax preamble types HE_SU
  1447. * and HE_EXT_SU
  1448. */
  1449. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1450. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1451. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1452. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1453. */
  1454. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1455. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1456. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1457. * Use cases:
  1458. * Any time firmware uses TQM-BYPASS for Data
  1459. * TID, firmware expect host to set this bit.
  1460. */
  1461. /* DWORD 1: tx power, tx rate */
  1462. A_UINT32
  1463. power : 8, /* unit of the power field is 0.5 dbm
  1464. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1465. * signed value ranging from -64dbm to 63.5 dbm
  1466. */
  1467. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1468. * Setting more than one MCS isn't currently
  1469. * supported by the target (but is supported
  1470. * in the interface in case in the future
  1471. * the target supports specifications of
  1472. * a limited set of MCS values.
  1473. */
  1474. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1475. * Setting more than one Nss isn't currently
  1476. * supported by the target (but is supported
  1477. * in the interface in case in the future
  1478. * the target supports specifications of
  1479. * a limited set of Nss values.
  1480. */
  1481. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1482. update_peer_cache : 1; /* When set these custom values will be
  1483. * used for all packets, until the next
  1484. * update via this ext header.
  1485. * This is to make sure not all packets
  1486. * need to include this header.
  1487. */
  1488. /* DWORD 2: tx chain mask, tx retries */
  1489. A_UINT32
  1490. /* chain_mask - specify which chains to transmit from */
  1491. chain_mask : 8,
  1492. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1493. * TODO: Update Enum values for key_flags
  1494. */
  1495. /*
  1496. * Channel frequency: This identifies the desired channel
  1497. * frequency (in MHz) for tx frames. This is used by FW to help
  1498. * determine when it is safe to transmit or drop frames for
  1499. * off-channel operation.
  1500. * The default value of zero indicates to FW that the corresponding
  1501. * VDEV's home channel (if there is one) is the desired channel
  1502. * frequency.
  1503. */
  1504. chanfreq : 16;
  1505. /* DWORD 3: tx expiry time (TSF) LSBs */
  1506. A_UINT32 expire_tsf_lo;
  1507. /* DWORD 4: tx expiry time (TSF) MSBs */
  1508. A_UINT32 expire_tsf_hi;
  1509. /* DWORD 5: reserved
  1510. * This structure can be expanded further up to 60 bytes
  1511. * by adding further DWORDs as needed.
  1512. */
  1513. A_UINT32
  1514. /* learning_frame
  1515. * When this flag is set, this frame will be dropped by FW
  1516. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1517. */
  1518. learning_frame : 1,
  1519. rsvd0 : 31;
  1520. } POSTPACK;
  1521. /* DWORD 0 */
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1548. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1549. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1550. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1551. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1552. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1553. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1554. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1555. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1556. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1557. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1558. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1559. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1560. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1561. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1562. /* DWORD 1 */
  1563. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1564. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1565. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1566. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1567. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1568. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1569. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1570. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1571. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1572. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1573. /* DWORD 2 */
  1574. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1575. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1576. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1577. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1578. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1579. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1580. /* DWORD 5 */
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1583. /* DWORD 0 */
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1586. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1591. } while (0)
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1593. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1594. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1596. do { \
  1597. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1598. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1599. } while (0)
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1601. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1602. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1604. do { \
  1605. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1606. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1607. } while (0)
  1608. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1610. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1612. do { \
  1613. HTT_CHECK_SET_VAL( \
  1614. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1615. ((_var) |= ((_val) \
  1616. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1617. } while (0)
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1619. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1620. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1622. do { \
  1623. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1624. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1625. } while (0)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1633. } while (0)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1635. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1636. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1638. do { \
  1639. HTT_CHECK_SET_VAL( \
  1640. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1641. ((_var) |= ((_val) \
  1642. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1682. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1683. } while (0)
  1684. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1685. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1686. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1688. do { \
  1689. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1690. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1691. } while (0)
  1692. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1693. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1694. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1695. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1696. do { \
  1697. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1698. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1699. } while (0)
  1700. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1704. do { \
  1705. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1706. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1707. } while (0)
  1708. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1710. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1711. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1718. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1719. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1726. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1727. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1730. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1731. } while (0)
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1733. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1734. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1736. do { \
  1737. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1738. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1739. } while (0)
  1740. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1741. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1742. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1743. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1744. do { \
  1745. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1746. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1747. } while (0)
  1748. /* DWORD 1 */
  1749. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1753. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1754. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1755. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1756. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1757. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1758. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1759. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1760. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1761. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1762. do { \
  1763. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1764. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1765. } while (0)
  1766. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1767. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1768. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1769. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1770. do { \
  1771. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1772. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1773. } while (0)
  1774. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1775. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1776. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1777. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1778. do { \
  1779. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1780. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1781. } while (0)
  1782. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1783. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1784. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1785. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1786. do { \
  1787. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1788. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1789. } while (0)
  1790. /* DWORD 2 */
  1791. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1797. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1798. } while (0)
  1799. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1806. } while (0)
  1807. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1814. } while (0)
  1815. /* DWORD 5 */
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1820. do { \
  1821. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1822. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1823. } while (0)
  1824. typedef enum {
  1825. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1826. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1827. } htt_tcl_metadata_type;
  1828. /**
  1829. * @brief HTT TCL command number format
  1830. * @details
  1831. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1832. * available to firmware as tcl_exit_base->tcl_status_number.
  1833. * For regular / multicast packets host will send vdev and mac id and for
  1834. * NAWDS packets, host will send peer id.
  1835. * A_UINT32 is used to avoid endianness conversion problems.
  1836. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1837. */
  1838. typedef struct {
  1839. A_UINT32
  1840. type: 1, /* vdev_id based or peer_id based */
  1841. rsvd: 31;
  1842. } htt_tx_tcl_vdev_or_peer_t;
  1843. typedef struct {
  1844. A_UINT32
  1845. type: 1, /* vdev_id based or peer_id based */
  1846. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1847. vdev_id: 8,
  1848. pdev_id: 2,
  1849. host_inspected:1,
  1850. rsvd: 19;
  1851. } htt_tx_tcl_vdev_metadata;
  1852. typedef struct {
  1853. A_UINT32
  1854. type: 1, /* vdev_id based or peer_id based */
  1855. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1856. peer_id: 14,
  1857. rsvd: 16;
  1858. } htt_tx_tcl_peer_metadata;
  1859. PREPACK struct htt_tx_tcl_metadata {
  1860. union {
  1861. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1862. htt_tx_tcl_vdev_metadata vdev_meta;
  1863. htt_tx_tcl_peer_metadata peer_meta;
  1864. };
  1865. } POSTPACK;
  1866. /* DWORD 0 */
  1867. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1868. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1869. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1870. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1871. /* VDEV metadata */
  1872. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1873. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1874. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1875. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1876. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1877. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1878. /* PEER metadata */
  1879. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1880. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1881. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1882. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1883. HTT_TX_TCL_METADATA_TYPE_S)
  1884. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1888. } while (0)
  1889. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1890. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1891. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1892. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1896. } while (0)
  1897. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1898. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1899. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1900. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1904. } while (0)
  1905. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1906. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1907. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1908. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1911. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1912. } while (0)
  1913. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1914. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1915. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1916. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1917. do { \
  1918. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1919. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1920. } while (0)
  1921. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1922. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1923. HTT_TX_TCL_METADATA_PEER_ID_S)
  1924. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1925. do { \
  1926. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1927. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1928. } while (0)
  1929. typedef enum {
  1930. HTT_TX_FW2WBM_TX_STATUS_OK,
  1931. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1932. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1933. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1934. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1935. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1936. HTT_TX_FW2WBM_TX_STATUS_MAX
  1937. } htt_tx_fw2wbm_tx_status_t;
  1938. typedef enum {
  1939. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1940. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1941. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1942. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1943. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1944. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1945. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1946. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1947. } htt_tx_fw2wbm_reinject_reason_t;
  1948. /**
  1949. * @brief HTT TX WBM Completion from firmware to host
  1950. * @details
  1951. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1952. * DWORD 3 and 4 for software based completions (Exception frames and
  1953. * TQM bypass frames)
  1954. * For software based completions, wbm_release_ring->release_source_module will
  1955. * be set to release_source_fw
  1956. */
  1957. PREPACK struct htt_tx_wbm_completion {
  1958. A_UINT32
  1959. sch_cmd_id: 24,
  1960. exception_frame: 1, /* If set, this packet was queued via exception path */
  1961. rsvd0_31_25: 7;
  1962. A_UINT32
  1963. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1964. * reception of an ACK or BA, this field indicates
  1965. * the RSSI of the received ACK or BA frame.
  1966. * When the frame is removed as result of a direct
  1967. * remove command from the SW, this field is set
  1968. * to 0x0 (which is never a valid value when real
  1969. * RSSI is available).
  1970. * Units: dB w.r.t noise floor
  1971. */
  1972. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1973. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1974. rsvd1_31_16: 16;
  1975. } POSTPACK;
  1976. /* DWORD 0 */
  1977. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1978. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1979. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1980. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1981. /* DWORD 1 */
  1982. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1983. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1984. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1985. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1986. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1987. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1988. /* DWORD 0 */
  1989. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1990. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1991. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1992. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1996. } while (0)
  1997. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1998. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1999. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2000. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2004. } while (0)
  2005. /* DWORD 1 */
  2006. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2007. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2008. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2009. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2013. } while (0)
  2014. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2015. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2016. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2017. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2021. } while (0)
  2022. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2023. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2024. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2025. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2029. } while (0)
  2030. /**
  2031. * @brief HTT TX WBM Completion from firmware to host
  2032. * @details
  2033. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2034. * (WBM) offload HW.
  2035. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2036. * For software based completions, release_source_module will
  2037. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2038. * struct wbm_release_ring and then switch to this after looking at
  2039. * release_source_module.
  2040. */
  2041. PREPACK struct htt_tx_wbm_completion_v2 {
  2042. A_UINT32
  2043. used_by_hw0; /* Refer to struct wbm_release_ring */
  2044. A_UINT32
  2045. used_by_hw1; /* Refer to struct wbm_release_ring */
  2046. A_UINT32
  2047. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2048. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2049. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2050. exception_frame: 1,
  2051. rsvd0: 12, /* For future use */
  2052. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2053. rsvd1: 1; /* For future use */
  2054. A_UINT32
  2055. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2056. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2057. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2058. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2059. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2060. */
  2061. A_UINT32
  2062. data1: 32;
  2063. A_UINT32
  2064. data2: 32;
  2065. A_UINT32
  2066. used_by_hw3; /* Refer to struct wbm_release_ring */
  2067. } POSTPACK;
  2068. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2069. /* DWORD 3 */
  2070. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2071. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2072. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2073. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2074. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2075. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2076. /* DWORD 3 */
  2077. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2078. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2079. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2080. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2081. do { \
  2082. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2083. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2084. } while (0)
  2085. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2086. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2087. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2088. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2092. } while (0)
  2093. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2094. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2095. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2096. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2100. } while (0)
  2101. /**
  2102. * @brief HTT TX WBM transmit status from firmware to host
  2103. * @details
  2104. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2105. * (WBM) offload HW.
  2106. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2107. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2108. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2109. */
  2110. PREPACK struct htt_tx_wbm_transmit_status {
  2111. A_UINT32
  2112. sch_cmd_id: 24,
  2113. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2114. * reception of an ACK or BA, this field indicates
  2115. * the RSSI of the received ACK or BA frame.
  2116. * When the frame is removed as result of a direct
  2117. * remove command from the SW, this field is set
  2118. * to 0x0 (which is never a valid value when real
  2119. * RSSI is available).
  2120. * Units: dB w.r.t noise floor
  2121. */
  2122. A_UINT32
  2123. sw_peer_id: 16,
  2124. tid_num: 5,
  2125. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2126. * and tid_num fields contain valid data.
  2127. * If this "valid" flag is not set, the
  2128. * sw_peer_id and tid_num fields must be ignored.
  2129. */
  2130. reserved0: 10;
  2131. A_UINT32
  2132. reserved1: 32;
  2133. } POSTPACK;
  2134. /* DWORD 4 */
  2135. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2136. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2137. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2138. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2139. /* DWORD 5 */
  2140. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2141. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2142. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2143. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2144. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2145. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2146. /* DWORD 4 */
  2147. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2148. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2149. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2150. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2154. } while (0)
  2155. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2156. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2157. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2158. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2162. } while (0)
  2163. /* DWORD 5 */
  2164. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2165. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2166. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2167. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2171. } while (0)
  2172. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2173. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2174. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2175. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2179. } while (0)
  2180. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2181. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2182. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2183. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2187. } while (0)
  2188. /**
  2189. * @brief HTT TX WBM reinject status from firmware to host
  2190. * @details
  2191. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2192. * (WBM) offload HW.
  2193. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2194. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2195. */
  2196. PREPACK struct htt_tx_wbm_reinject_status {
  2197. A_UINT32
  2198. reserved0: 32;
  2199. A_UINT32
  2200. reserved1: 32;
  2201. A_UINT32
  2202. reserved2: 32;
  2203. } POSTPACK;
  2204. /**
  2205. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2206. * @details
  2207. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2208. * (WBM) offload HW.
  2209. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2210. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2211. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2212. * STA side.
  2213. */
  2214. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2215. A_UINT32
  2216. mec_sa_addr_31_0;
  2217. A_UINT32
  2218. mec_sa_addr_47_32: 16,
  2219. sa_ast_index: 16;
  2220. A_UINT32
  2221. vdev_id: 8,
  2222. reserved0: 24;
  2223. } POSTPACK;
  2224. /* DWORD 4 - mec_sa_addr_31_0 */
  2225. /* DWORD 5 */
  2226. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2227. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2228. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2229. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2230. /* DWORD 6 */
  2231. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2232. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2233. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2234. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2235. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2236. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2239. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2240. } while (0)
  2241. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2242. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2243. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2244. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2247. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2248. } while (0)
  2249. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2250. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2251. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2252. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2256. } while (0)
  2257. typedef enum {
  2258. TX_FLOW_PRIORITY_BE,
  2259. TX_FLOW_PRIORITY_HIGH,
  2260. TX_FLOW_PRIORITY_LOW,
  2261. } htt_tx_flow_priority_t;
  2262. typedef enum {
  2263. TX_FLOW_LATENCY_SENSITIVE,
  2264. TX_FLOW_LATENCY_INSENSITIVE,
  2265. } htt_tx_flow_latency_t;
  2266. typedef enum {
  2267. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2268. TX_FLOW_INTERACTIVE_TRAFFIC,
  2269. TX_FLOW_PERIODIC_TRAFFIC,
  2270. TX_FLOW_BURSTY_TRAFFIC,
  2271. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2272. } htt_tx_flow_traffic_pattern_t;
  2273. /**
  2274. * @brief HTT TX Flow search metadata format
  2275. * @details
  2276. * Host will set this metadata in flow table's flow search entry along with
  2277. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2278. * firmware and TQM ring if the flow search entry wins.
  2279. * This metadata is available to firmware in that first MSDU's
  2280. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2281. * to one of the available flows for specific tid and returns the tqm flow
  2282. * pointer as part of htt_tx_map_flow_info message.
  2283. */
  2284. PREPACK struct htt_tx_flow_metadata {
  2285. A_UINT32
  2286. rsvd0_1_0: 2,
  2287. tid: 4,
  2288. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2289. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2290. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2291. * Else choose final tid based on latency, priority.
  2292. */
  2293. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2294. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2295. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2296. } POSTPACK;
  2297. /* DWORD 0 */
  2298. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2299. #define HTT_TX_FLOW_METADATA_TID_S 2
  2300. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2301. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2302. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2303. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2304. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2305. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2306. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2307. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2308. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2309. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2310. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2311. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2312. /* DWORD 0 */
  2313. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2314. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2315. HTT_TX_FLOW_METADATA_TID_S)
  2316. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2317. do { \
  2318. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2319. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2320. } while (0)
  2321. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2322. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2323. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2324. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2325. do { \
  2326. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2327. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2328. } while (0)
  2329. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2330. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2331. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2332. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2333. do { \
  2334. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2335. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2336. } while (0)
  2337. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2338. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2339. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2340. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2343. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2344. } while (0)
  2345. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2346. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2347. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2348. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2352. } while (0)
  2353. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2354. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2355. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2356. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2360. } while (0)
  2361. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2362. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2363. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2364. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2368. } while (0)
  2369. /**
  2370. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2371. *
  2372. * @details
  2373. * HTT wds entry from source port learning
  2374. * Host will learn wds entries from rx and send this message to firmware
  2375. * to enable firmware to configure/delete AST entries for wds clients.
  2376. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2377. * and when SA's entry is deleted, firmware removes this AST entry
  2378. *
  2379. * The message would appear as follows:
  2380. *
  2381. * |31 30|29 |17 16|15 8|7 0|
  2382. * |----------------+----------------+----------------+----------------|
  2383. * | rsvd0 |PDVID| vdev_id | msg_type |
  2384. * |-------------------------------------------------------------------|
  2385. * | sa_addr_31_0 |
  2386. * |-------------------------------------------------------------------|
  2387. * | | ta_peer_id | sa_addr_47_32 |
  2388. * |-------------------------------------------------------------------|
  2389. * Where PDVID = pdev_id
  2390. *
  2391. * The message is interpreted as follows:
  2392. *
  2393. * dword0 - b'0:7 - msg_type: This will be set to
  2394. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2395. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2396. *
  2397. * dword0 - b'8:15 - vdev_id
  2398. *
  2399. * dword0 - b'16:17 - pdev_id
  2400. *
  2401. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2402. *
  2403. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2404. *
  2405. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2406. *
  2407. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2408. */
  2409. PREPACK struct htt_wds_entry {
  2410. A_UINT32
  2411. msg_type: 8,
  2412. vdev_id: 8,
  2413. pdev_id: 2,
  2414. rsvd0: 14;
  2415. A_UINT32 sa_addr_31_0;
  2416. A_UINT32
  2417. sa_addr_47_32: 16,
  2418. ta_peer_id: 14,
  2419. rsvd2: 2;
  2420. } POSTPACK;
  2421. /* DWORD 0 */
  2422. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2423. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2424. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2425. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2426. /* DWORD 2 */
  2427. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2428. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2429. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2430. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2431. /* DWORD 0 */
  2432. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2433. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2434. HTT_WDS_ENTRY_VDEV_ID_S)
  2435. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2438. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2439. } while (0)
  2440. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2441. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2442. HTT_WDS_ENTRY_PDEV_ID_S)
  2443. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2446. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2447. } while (0)
  2448. /* DWORD 2 */
  2449. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2450. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2451. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2452. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2455. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2456. } while (0)
  2457. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2458. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2459. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2460. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2463. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2464. } while (0)
  2465. /**
  2466. * @brief MAC DMA rx ring setup specification
  2467. * @details
  2468. * To allow for dynamic rx ring reconfiguration and to avoid race
  2469. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2470. * it uses. Instead, it sends this message to the target, indicating how
  2471. * the rx ring used by the host should be set up and maintained.
  2472. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2473. * specifications.
  2474. *
  2475. * |31 16|15 8|7 0|
  2476. * |---------------------------------------------------------------|
  2477. * header: | reserved | num rings | msg type |
  2478. * |---------------------------------------------------------------|
  2479. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2480. #if HTT_PADDR64
  2481. * | FW_IDX shadow register physical address (bits 63:32) |
  2482. #endif
  2483. * |---------------------------------------------------------------|
  2484. * | rx ring base physical address (bits 31:0) |
  2485. #if HTT_PADDR64
  2486. * | rx ring base physical address (bits 63:32) |
  2487. #endif
  2488. * |---------------------------------------------------------------|
  2489. * | rx ring buffer size | rx ring length |
  2490. * |---------------------------------------------------------------|
  2491. * | FW_IDX initial value | enabled flags |
  2492. * |---------------------------------------------------------------|
  2493. * | MSDU payload offset | 802.11 header offset |
  2494. * |---------------------------------------------------------------|
  2495. * | PPDU end offset | PPDU start offset |
  2496. * |---------------------------------------------------------------|
  2497. * | MPDU end offset | MPDU start offset |
  2498. * |---------------------------------------------------------------|
  2499. * | MSDU end offset | MSDU start offset |
  2500. * |---------------------------------------------------------------|
  2501. * | frag info offset | rx attention offset |
  2502. * |---------------------------------------------------------------|
  2503. * payload 2, if present, has the same format as payload 1
  2504. * Header fields:
  2505. * - MSG_TYPE
  2506. * Bits 7:0
  2507. * Purpose: identifies this as an rx ring configuration message
  2508. * Value: 0x2
  2509. * - NUM_RINGS
  2510. * Bits 15:8
  2511. * Purpose: indicates whether the host is setting up one rx ring or two
  2512. * Value: 1 or 2
  2513. * Payload:
  2514. * for systems using 64-bit format for bus addresses:
  2515. * - IDX_SHADOW_REG_PADDR_LO
  2516. * Bits 31:0
  2517. * Value: lower 4 bytes of physical address of the host's
  2518. * FW_IDX shadow register
  2519. * - IDX_SHADOW_REG_PADDR_HI
  2520. * Bits 31:0
  2521. * Value: upper 4 bytes of physical address of the host's
  2522. * FW_IDX shadow register
  2523. * - RING_BASE_PADDR_LO
  2524. * Bits 31:0
  2525. * Value: lower 4 bytes of physical address of the host's rx ring
  2526. * - RING_BASE_PADDR_HI
  2527. * Bits 31:0
  2528. * Value: uppper 4 bytes of physical address of the host's rx ring
  2529. * for systems using 32-bit format for bus addresses:
  2530. * - IDX_SHADOW_REG_PADDR
  2531. * Bits 31:0
  2532. * Value: physical address of the host's FW_IDX shadow register
  2533. * - RING_BASE_PADDR
  2534. * Bits 31:0
  2535. * Value: physical address of the host's rx ring
  2536. * - RING_LEN
  2537. * Bits 15:0
  2538. * Value: number of elements in the rx ring
  2539. * - RING_BUF_SZ
  2540. * Bits 31:16
  2541. * Value: size of the buffers referenced by the rx ring, in byte units
  2542. * - ENABLED_FLAGS
  2543. * Bits 15:0
  2544. * Value: 1-bit flags to show whether different rx fields are enabled
  2545. * bit 0: 802.11 header enabled (1) or disabled (0)
  2546. * bit 1: MSDU payload enabled (1) or disabled (0)
  2547. * bit 2: PPDU start enabled (1) or disabled (0)
  2548. * bit 3: PPDU end enabled (1) or disabled (0)
  2549. * bit 4: MPDU start enabled (1) or disabled (0)
  2550. * bit 5: MPDU end enabled (1) or disabled (0)
  2551. * bit 6: MSDU start enabled (1) or disabled (0)
  2552. * bit 7: MSDU end enabled (1) or disabled (0)
  2553. * bit 8: rx attention enabled (1) or disabled (0)
  2554. * bit 9: frag info enabled (1) or disabled (0)
  2555. * bit 10: unicast rx enabled (1) or disabled (0)
  2556. * bit 11: multicast rx enabled (1) or disabled (0)
  2557. * bit 12: ctrl rx enabled (1) or disabled (0)
  2558. * bit 13: mgmt rx enabled (1) or disabled (0)
  2559. * bit 14: null rx enabled (1) or disabled (0)
  2560. * bit 15: phy data rx enabled (1) or disabled (0)
  2561. * - IDX_INIT_VAL
  2562. * Bits 31:16
  2563. * Purpose: Specify the initial value for the FW_IDX.
  2564. * Value: the number of buffers initially present in the host's rx ring
  2565. * - OFFSET_802_11_HDR
  2566. * Bits 15:0
  2567. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2568. * - OFFSET_MSDU_PAYLOAD
  2569. * Bits 31:16
  2570. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2571. * - OFFSET_PPDU_START
  2572. * Bits 15:0
  2573. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2574. * - OFFSET_PPDU_END
  2575. * Bits 31:16
  2576. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2577. * - OFFSET_MPDU_START
  2578. * Bits 15:0
  2579. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2580. * - OFFSET_MPDU_END
  2581. * Bits 31:16
  2582. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2583. * - OFFSET_MSDU_START
  2584. * Bits 15:0
  2585. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2586. * - OFFSET_MSDU_END
  2587. * Bits 31:16
  2588. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2589. * - OFFSET_RX_ATTN
  2590. * Bits 15:0
  2591. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2592. * - OFFSET_FRAG_INFO
  2593. * Bits 31:16
  2594. * Value: offset in QUAD-bytes of frag info table
  2595. */
  2596. /* header fields */
  2597. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2598. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2599. /* payload fields */
  2600. /* for systems using a 64-bit format for bus addresses */
  2601. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2602. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2603. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2604. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2605. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2606. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2607. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2608. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2609. /* for systems using a 32-bit format for bus addresses */
  2610. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2611. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2612. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2613. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2614. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2615. #define HTT_RX_RING_CFG_LEN_S 0
  2616. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2617. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2618. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2619. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2620. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2621. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2622. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2623. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2624. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2625. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2626. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2627. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2628. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2629. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2630. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2631. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2632. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2633. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2634. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2635. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2636. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2637. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2638. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2639. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2640. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2641. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2642. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2643. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2644. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2645. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2646. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2647. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2648. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2649. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2650. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2651. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2652. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2653. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2654. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2655. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2656. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2657. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2658. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2659. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2660. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2661. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2662. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2663. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2664. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2665. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2666. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2667. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2668. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2669. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2670. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2671. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2672. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2673. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2674. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2675. #if HTT_PADDR64
  2676. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2677. #else
  2678. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2679. #endif
  2680. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2681. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2682. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2683. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2684. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2685. do { \
  2686. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2687. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2688. } while (0)
  2689. /* degenerate case for 32-bit fields */
  2690. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2691. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2692. ((_var) = (_val))
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2695. ((_var) = (_val))
  2696. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2697. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2698. ((_var) = (_val))
  2699. /* degenerate case for 32-bit fields */
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2702. ((_var) = (_val))
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2704. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2705. ((_var) = (_val))
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2707. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2708. ((_var) = (_val))
  2709. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2710. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2711. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2712. do { \
  2713. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2714. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2715. } while (0)
  2716. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2717. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2718. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2719. do { \
  2720. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2721. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2722. } while (0)
  2723. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2724. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2725. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2726. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2727. do { \
  2728. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2729. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2730. } while (0)
  2731. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2732. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2733. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2734. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2735. do { \
  2736. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2737. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2738. } while (0)
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2740. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2741. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2745. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2746. } while (0)
  2747. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2748. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2749. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2750. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2753. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2754. } while (0)
  2755. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2756. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2757. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2758. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2761. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2762. } while (0)
  2763. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2764. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2765. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2766. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2769. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2770. } while (0)
  2771. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2772. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2773. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2774. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2777. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2778. } while (0)
  2779. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2780. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2781. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2782. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2785. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2786. } while (0)
  2787. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2788. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2789. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2790. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2793. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2794. } while (0)
  2795. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2796. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2797. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2798. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2801. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2802. } while (0)
  2803. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2805. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2806. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2809. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2810. } while (0)
  2811. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2812. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2813. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2814. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2817. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2818. } while (0)
  2819. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2820. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2821. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2822. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2825. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2826. } while (0)
  2827. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2828. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2829. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2830. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2837. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2838. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2845. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2846. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2853. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2854. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2861. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2862. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2869. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2870. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2877. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2878. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2885. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2886. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2893. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2894. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2898. } while (0)
  2899. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2900. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2901. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2902. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2905. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2906. } while (0)
  2907. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2908. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2909. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2910. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2911. do { \
  2912. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2913. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2914. } while (0)
  2915. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2916. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2917. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2918. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2919. do { \
  2920. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2921. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2922. } while (0)
  2923. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2924. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2925. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2926. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2927. do { \
  2928. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2929. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2930. } while (0)
  2931. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2932. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2933. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2934. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2935. do { \
  2936. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2937. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2938. } while (0)
  2939. /**
  2940. * @brief host -> target FW statistics retrieve
  2941. *
  2942. * @details
  2943. * The following field definitions describe the format of the HTT host
  2944. * to target FW stats retrieve message. The message specifies the type of
  2945. * stats host wants to retrieve.
  2946. *
  2947. * |31 24|23 16|15 8|7 0|
  2948. * |-----------------------------------------------------------|
  2949. * | stats types request bitmask | msg type |
  2950. * |-----------------------------------------------------------|
  2951. * | stats types reset bitmask | reserved |
  2952. * |-----------------------------------------------------------|
  2953. * | stats type | config value |
  2954. * |-----------------------------------------------------------|
  2955. * | cookie LSBs |
  2956. * |-----------------------------------------------------------|
  2957. * | cookie MSBs |
  2958. * |-----------------------------------------------------------|
  2959. * Header fields:
  2960. * - MSG_TYPE
  2961. * Bits 7:0
  2962. * Purpose: identifies this is a stats upload request message
  2963. * Value: 0x3
  2964. * - UPLOAD_TYPES
  2965. * Bits 31:8
  2966. * Purpose: identifies which types of FW statistics to upload
  2967. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2968. * - RESET_TYPES
  2969. * Bits 31:8
  2970. * Purpose: identifies which types of FW statistics to reset
  2971. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2972. * - CFG_VAL
  2973. * Bits 23:0
  2974. * Purpose: give an opaque configuration value to the specified stats type
  2975. * Value: stats-type specific configuration value
  2976. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2977. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2978. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2979. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2980. * - CFG_STAT_TYPE
  2981. * Bits 31:24
  2982. * Purpose: specify which stats type (if any) the config value applies to
  2983. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2984. * a valid configuration specification
  2985. * - COOKIE_LSBS
  2986. * Bits 31:0
  2987. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2988. * message with its preceding host->target stats request message.
  2989. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2990. * - COOKIE_MSBS
  2991. * Bits 31:0
  2992. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2993. * message with its preceding host->target stats request message.
  2994. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2995. */
  2996. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2997. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2998. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2999. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3000. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3001. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3002. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3003. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3004. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3005. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3006. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3007. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3008. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3009. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3012. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3013. } while (0)
  3014. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3015. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3016. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3017. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3020. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3021. } while (0)
  3022. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3023. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3024. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3025. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3028. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3029. } while (0)
  3030. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3031. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3032. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3033. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3036. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3037. } while (0)
  3038. /**
  3039. * @brief host -> target HTT out-of-band sync request
  3040. *
  3041. * @details
  3042. * The HTT SYNC tells the target to suspend processing of subsequent
  3043. * HTT host-to-target messages until some other target agent locally
  3044. * informs the target HTT FW that the current sync counter is equal to
  3045. * or greater than (in a modulo sense) the sync counter specified in
  3046. * the SYNC message.
  3047. * This allows other host-target components to synchronize their operation
  3048. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3049. * security key has been downloaded to and activated by the target.
  3050. * In the absence of any explicit synchronization counter value
  3051. * specification, the target HTT FW will use zero as the default current
  3052. * sync value.
  3053. *
  3054. * |31 24|23 16|15 8|7 0|
  3055. * |-----------------------------------------------------------|
  3056. * | reserved | sync count | msg type |
  3057. * |-----------------------------------------------------------|
  3058. * Header fields:
  3059. * - MSG_TYPE
  3060. * Bits 7:0
  3061. * Purpose: identifies this as a sync message
  3062. * Value: 0x4
  3063. * - SYNC_COUNT
  3064. * Bits 15:8
  3065. * Purpose: specifies what sync value the HTT FW will wait for from
  3066. * an out-of-band specification to resume its operation
  3067. * Value: in-band sync counter value to compare against the out-of-band
  3068. * counter spec.
  3069. * The HTT target FW will suspend its host->target message processing
  3070. * as long as
  3071. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3072. */
  3073. #define HTT_H2T_SYNC_MSG_SZ 4
  3074. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3075. #define HTT_H2T_SYNC_COUNT_S 8
  3076. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3077. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3078. HTT_H2T_SYNC_COUNT_S)
  3079. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3082. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3083. } while (0)
  3084. /**
  3085. * @brief HTT aggregation configuration
  3086. */
  3087. #define HTT_AGGR_CFG_MSG_SZ 4
  3088. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3089. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3090. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3091. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3092. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3093. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3094. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3095. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3096. do { \
  3097. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3098. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3099. } while (0)
  3100. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3101. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3102. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3103. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3106. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3107. } while (0)
  3108. /**
  3109. * @brief host -> target HTT configure max amsdu info per vdev
  3110. *
  3111. * @details
  3112. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3113. *
  3114. * |31 21|20 16|15 8|7 0|
  3115. * |-----------------------------------------------------------|
  3116. * | reserved | vdev id | max amsdu | msg type |
  3117. * |-----------------------------------------------------------|
  3118. * Header fields:
  3119. * - MSG_TYPE
  3120. * Bits 7:0
  3121. * Purpose: identifies this as a aggr cfg ex message
  3122. * Value: 0xa
  3123. * - MAX_NUM_AMSDU_SUBFRM
  3124. * Bits 15:8
  3125. * Purpose: max MSDUs per A-MSDU
  3126. * - VDEV_ID
  3127. * Bits 20:16
  3128. * Purpose: ID of the vdev to which this limit is applied
  3129. */
  3130. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3131. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3132. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3133. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3134. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3135. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3136. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3137. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3138. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3141. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3142. } while (0)
  3143. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3144. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3145. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3146. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3147. do { \
  3148. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3149. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3150. } while (0)
  3151. /**
  3152. * @brief HTT WDI_IPA Config Message
  3153. *
  3154. * @details
  3155. * The HTT WDI_IPA config message is created/sent by host at driver
  3156. * init time. It contains information about data structures used on
  3157. * WDI_IPA TX and RX path.
  3158. * TX CE ring is used for pushing packet metadata from IPA uC
  3159. * to WLAN FW
  3160. * TX Completion ring is used for generating TX completions from
  3161. * WLAN FW to IPA uC
  3162. * RX Indication ring is used for indicating RX packets from FW
  3163. * to IPA uC
  3164. * RX Ring2 is used as either completion ring or as second
  3165. * indication ring. when Ring2 is used as completion ring, IPA uC
  3166. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3167. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3168. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3169. * indicated in RX Indication ring. Please see WDI_IPA specification
  3170. * for more details.
  3171. * |31 24|23 16|15 8|7 0|
  3172. * |----------------+----------------+----------------+----------------|
  3173. * | tx pkt pool size | Rsvd | msg_type |
  3174. * |-------------------------------------------------------------------|
  3175. * | tx comp ring base (bits 31:0) |
  3176. #if HTT_PADDR64
  3177. * | tx comp ring base (bits 63:32) |
  3178. #endif
  3179. * |-------------------------------------------------------------------|
  3180. * | tx comp ring size |
  3181. * |-------------------------------------------------------------------|
  3182. * | tx comp WR_IDX physical address (bits 31:0) |
  3183. #if HTT_PADDR64
  3184. * | tx comp WR_IDX physical address (bits 63:32) |
  3185. #endif
  3186. * |-------------------------------------------------------------------|
  3187. * | tx CE WR_IDX physical address (bits 31:0) |
  3188. #if HTT_PADDR64
  3189. * | tx CE WR_IDX physical address (bits 63:32) |
  3190. #endif
  3191. * |-------------------------------------------------------------------|
  3192. * | rx indication ring base (bits 31:0) |
  3193. #if HTT_PADDR64
  3194. * | rx indication ring base (bits 63:32) |
  3195. #endif
  3196. * |-------------------------------------------------------------------|
  3197. * | rx indication ring size |
  3198. * |-------------------------------------------------------------------|
  3199. * | rx ind RD_IDX physical address (bits 31:0) |
  3200. #if HTT_PADDR64
  3201. * | rx ind RD_IDX physical address (bits 63:32) |
  3202. #endif
  3203. * |-------------------------------------------------------------------|
  3204. * | rx ind WR_IDX physical address (bits 31:0) |
  3205. #if HTT_PADDR64
  3206. * | rx ind WR_IDX physical address (bits 63:32) |
  3207. #endif
  3208. * |-------------------------------------------------------------------|
  3209. * |-------------------------------------------------------------------|
  3210. * | rx ring2 base (bits 31:0) |
  3211. #if HTT_PADDR64
  3212. * | rx ring2 base (bits 63:32) |
  3213. #endif
  3214. * |-------------------------------------------------------------------|
  3215. * | rx ring2 size |
  3216. * |-------------------------------------------------------------------|
  3217. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3218. #if HTT_PADDR64
  3219. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3220. #endif
  3221. * |-------------------------------------------------------------------|
  3222. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3223. #if HTT_PADDR64
  3224. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3225. #endif
  3226. * |-------------------------------------------------------------------|
  3227. *
  3228. * Header fields:
  3229. * Header fields:
  3230. * - MSG_TYPE
  3231. * Bits 7:0
  3232. * Purpose: Identifies this as WDI_IPA config message
  3233. * value: = 0x8
  3234. * - TX_PKT_POOL_SIZE
  3235. * Bits 15:0
  3236. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3237. * WDI_IPA TX path
  3238. * For systems using 32-bit format for bus addresses:
  3239. * - TX_COMP_RING_BASE_ADDR
  3240. * Bits 31:0
  3241. * Purpose: TX Completion Ring base address in DDR
  3242. * - TX_COMP_RING_SIZE
  3243. * Bits 31:0
  3244. * Purpose: TX Completion Ring size (must be power of 2)
  3245. * - TX_COMP_WR_IDX_ADDR
  3246. * Bits 31:0
  3247. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3248. * updates the Write Index for WDI_IPA TX completion ring
  3249. * - TX_CE_WR_IDX_ADDR
  3250. * Bits 31:0
  3251. * Purpose: DDR address where IPA uC
  3252. * updates the WR Index for TX CE ring
  3253. * (needed for fusion platforms)
  3254. * - RX_IND_RING_BASE_ADDR
  3255. * Bits 31:0
  3256. * Purpose: RX Indication Ring base address in DDR
  3257. * - RX_IND_RING_SIZE
  3258. * Bits 31:0
  3259. * Purpose: RX Indication Ring size
  3260. * - RX_IND_RD_IDX_ADDR
  3261. * Bits 31:0
  3262. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3263. * RX indication ring
  3264. * - RX_IND_WR_IDX_ADDR
  3265. * Bits 31:0
  3266. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3267. * updates the Write Index for WDI_IPA RX indication ring
  3268. * - RX_RING2_BASE_ADDR
  3269. * Bits 31:0
  3270. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3271. * - RX_RING2_SIZE
  3272. * Bits 31:0
  3273. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3274. * - RX_RING2_RD_IDX_ADDR
  3275. * Bits 31:0
  3276. * Purpose: If Second RX ring is Indication ring, DDR address where
  3277. * IPA uC updates the Read Index for Ring2.
  3278. * If Second RX ring is completion ring, this is NOT used
  3279. * - RX_RING2_WR_IDX_ADDR
  3280. * Bits 31:0
  3281. * Purpose: If Second RX ring is Indication ring, DDR address where
  3282. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3283. * If second RX ring is completion ring, DDR address where
  3284. * IPA uC updates the Write Index for Ring 2.
  3285. * For systems using 64-bit format for bus addresses:
  3286. * - TX_COMP_RING_BASE_ADDR_LO
  3287. * Bits 31:0
  3288. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3289. * - TX_COMP_RING_BASE_ADDR_HI
  3290. * Bits 31:0
  3291. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3292. * - TX_COMP_RING_SIZE
  3293. * Bits 31:0
  3294. * Purpose: TX Completion Ring size (must be power of 2)
  3295. * - TX_COMP_WR_IDX_ADDR_LO
  3296. * Bits 31:0
  3297. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3298. * Lower 4 bytes of DDR address where WIFI FW
  3299. * updates the Write Index for WDI_IPA TX completion ring
  3300. * - TX_COMP_WR_IDX_ADDR_HI
  3301. * Bits 31:0
  3302. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3303. * Higher 4 bytes of DDR address where WIFI FW
  3304. * updates the Write Index for WDI_IPA TX completion ring
  3305. * - TX_CE_WR_IDX_ADDR_LO
  3306. * Bits 31:0
  3307. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3308. * updates the WR Index for TX CE ring
  3309. * (needed for fusion platforms)
  3310. * - TX_CE_WR_IDX_ADDR_HI
  3311. * Bits 31:0
  3312. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3313. * updates the WR Index for TX CE ring
  3314. * (needed for fusion platforms)
  3315. * - RX_IND_RING_BASE_ADDR_LO
  3316. * Bits 31:0
  3317. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3318. * - RX_IND_RING_BASE_ADDR_HI
  3319. * Bits 31:0
  3320. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3321. * - RX_IND_RING_SIZE
  3322. * Bits 31:0
  3323. * Purpose: RX Indication Ring size
  3324. * - RX_IND_RD_IDX_ADDR_LO
  3325. * Bits 31:0
  3326. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3327. * for WDI_IPA RX indication ring
  3328. * - RX_IND_RD_IDX_ADDR_HI
  3329. * Bits 31:0
  3330. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3331. * for WDI_IPA RX indication ring
  3332. * - RX_IND_WR_IDX_ADDR_LO
  3333. * Bits 31:0
  3334. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3335. * Lower 4 bytes of DDR address where WIFI FW
  3336. * updates the Write Index for WDI_IPA RX indication ring
  3337. * - RX_IND_WR_IDX_ADDR_HI
  3338. * Bits 31:0
  3339. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3340. * Higher 4 bytes of DDR address where WIFI FW
  3341. * updates the Write Index for WDI_IPA RX indication ring
  3342. * - RX_RING2_BASE_ADDR_LO
  3343. * Bits 31:0
  3344. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3345. * - RX_RING2_BASE_ADDR_HI
  3346. * Bits 31:0
  3347. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3348. * - RX_RING2_SIZE
  3349. * Bits 31:0
  3350. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3351. * - RX_RING2_RD_IDX_ADDR_LO
  3352. * Bits 31:0
  3353. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3354. * DDR address where IPA uC updates the Read Index for Ring2.
  3355. * If Second RX ring is completion ring, this is NOT used
  3356. * - RX_RING2_RD_IDX_ADDR_HI
  3357. * Bits 31:0
  3358. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3359. * DDR address where IPA uC updates the Read Index for Ring2.
  3360. * If Second RX ring is completion ring, this is NOT used
  3361. * - RX_RING2_WR_IDX_ADDR_LO
  3362. * Bits 31:0
  3363. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3364. * DDR address where WIFI FW updates the Write Index
  3365. * for WDI_IPA RX ring2
  3366. * If second RX ring is completion ring, lower 4 bytes of
  3367. * DDR address where IPA uC updates the Write Index for Ring 2.
  3368. * - RX_RING2_WR_IDX_ADDR_HI
  3369. * Bits 31:0
  3370. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3371. * DDR address where WIFI FW updates the Write Index
  3372. * for WDI_IPA RX ring2
  3373. * If second RX ring is completion ring, higher 4 bytes of
  3374. * DDR address where IPA uC updates the Write Index for Ring 2.
  3375. */
  3376. #if HTT_PADDR64
  3377. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3378. #else
  3379. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3380. #endif
  3381. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3382. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3383. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3384. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3385. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3386. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3387. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3388. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3389. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3390. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3392. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3393. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3394. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3395. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3396. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3397. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3398. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3399. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3400. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3401. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3402. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3403. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3404. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3405. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3406. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3407. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3408. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3409. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3410. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3411. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3412. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3413. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3414. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3415. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3416. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3417. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3418. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3419. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3421. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3423. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3425. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3427. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3431. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3433. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3435. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3437. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3443. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3444. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3445. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3448. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3449. } while (0)
  3450. /* for systems using 32-bit format for bus addr */
  3451. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3452. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3453. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3456. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3457. } while (0)
  3458. /* for systems using 64-bit format for bus addr */
  3459. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3460. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3461. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3464. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3465. } while (0)
  3466. /* for systems using 64-bit format for bus addr */
  3467. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3468. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3469. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3472. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3473. } while (0)
  3474. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3475. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3479. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3480. } while (0)
  3481. /* for systems using 32-bit format for bus addr */
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3483. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3487. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3488. } while (0)
  3489. /* for systems using 64-bit format for bus addr */
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3491. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3495. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3496. } while (0)
  3497. /* for systems using 64-bit format for bus addr */
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3499. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3503. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3504. } while (0)
  3505. /* for systems using 32-bit format for bus addr */
  3506. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3507. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3511. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3512. } while (0)
  3513. /* for systems using 64-bit format for bus addr */
  3514. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3515. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3519. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3520. } while (0)
  3521. /* for systems using 64-bit format for bus addr */
  3522. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3523. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3524. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3527. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3528. } while (0)
  3529. /* for systems using 32-bit format for bus addr */
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3531. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3535. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3536. } while (0)
  3537. /* for systems using 64-bit format for bus addr */
  3538. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3539. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3540. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3543. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3544. } while (0)
  3545. /* for systems using 64-bit format for bus addr */
  3546. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3547. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3548. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3551. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3552. } while (0)
  3553. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3554. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3555. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3559. } while (0)
  3560. /* for systems using 32-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3563. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3567. } while (0)
  3568. /* for systems using 64-bit format for bus addr */
  3569. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3570. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3571. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3574. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3575. } while (0)
  3576. /* for systems using 64-bit format for bus addr */
  3577. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3578. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3579. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3582. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3583. } while (0)
  3584. /* for systems using 32-bit format for bus addr */
  3585. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3586. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3587. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3590. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3591. } while (0)
  3592. /* for systems using 64-bit format for bus addr */
  3593. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3594. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3595. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3598. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3599. } while (0)
  3600. /* for systems using 64-bit format for bus addr */
  3601. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3602. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3603. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3604. do { \
  3605. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3606. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3607. } while (0)
  3608. /* for systems using 32-bit format for bus addr */
  3609. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3610. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3611. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3614. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3615. } while (0)
  3616. /* for systems using 64-bit format for bus addr */
  3617. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3618. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3619. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3622. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3623. } while (0)
  3624. /* for systems using 64-bit format for bus addr */
  3625. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3626. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3627. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3630. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3631. } while (0)
  3632. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3634. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3638. } while (0)
  3639. /* for systems using 32-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3642. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3646. } while (0)
  3647. /* for systems using 64-bit format for bus addr */
  3648. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3649. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3650. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3651. do { \
  3652. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3653. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3654. } while (0)
  3655. /* for systems using 64-bit format for bus addr */
  3656. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3657. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3658. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3661. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3662. } while (0)
  3663. /* for systems using 32-bit format for bus addr */
  3664. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3665. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3666. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3669. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3670. } while (0)
  3671. /* for systems using 64-bit format for bus addr */
  3672. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3673. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3674. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3677. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3678. } while (0)
  3679. /* for systems using 64-bit format for bus addr */
  3680. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3681. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3682. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3685. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3686. } while (0)
  3687. /*
  3688. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3689. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3690. * addresses are stored in a XXX-bit field.
  3691. * This macro is used to define both htt_wdi_ipa_config32_t and
  3692. * htt_wdi_ipa_config64_t structs.
  3693. */
  3694. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3695. _paddr__tx_comp_ring_base_addr_, \
  3696. _paddr__tx_comp_wr_idx_addr_, \
  3697. _paddr__tx_ce_wr_idx_addr_, \
  3698. _paddr__rx_ind_ring_base_addr_, \
  3699. _paddr__rx_ind_rd_idx_addr_, \
  3700. _paddr__rx_ind_wr_idx_addr_, \
  3701. _paddr__rx_ring2_base_addr_,\
  3702. _paddr__rx_ring2_rd_idx_addr_,\
  3703. _paddr__rx_ring2_wr_idx_addr_) \
  3704. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3705. { \
  3706. /* DWORD 0: flags and meta-data */ \
  3707. A_UINT32 \
  3708. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3709. reserved: 8, \
  3710. tx_pkt_pool_size: 16;\
  3711. /* DWORD 1 */\
  3712. _paddr__tx_comp_ring_base_addr_;\
  3713. /* DWORD 2 (or 3)*/\
  3714. A_UINT32 tx_comp_ring_size;\
  3715. /* DWORD 3 (or 4)*/\
  3716. _paddr__tx_comp_wr_idx_addr_;\
  3717. /* DWORD 4 (or 6)*/\
  3718. _paddr__tx_ce_wr_idx_addr_;\
  3719. /* DWORD 5 (or 8)*/\
  3720. _paddr__rx_ind_ring_base_addr_;\
  3721. /* DWORD 6 (or 10)*/\
  3722. A_UINT32 rx_ind_ring_size;\
  3723. /* DWORD 7 (or 11)*/\
  3724. _paddr__rx_ind_rd_idx_addr_;\
  3725. /* DWORD 8 (or 13)*/\
  3726. _paddr__rx_ind_wr_idx_addr_;\
  3727. /* DWORD 9 (or 15)*/\
  3728. _paddr__rx_ring2_base_addr_;\
  3729. /* DWORD 10 (or 17) */\
  3730. A_UINT32 rx_ring2_size;\
  3731. /* DWORD 11 (or 18) */\
  3732. _paddr__rx_ring2_rd_idx_addr_;\
  3733. /* DWORD 12 (or 20) */\
  3734. _paddr__rx_ring2_wr_idx_addr_;\
  3735. } POSTPACK
  3736. /* define a htt_wdi_ipa_config32_t type */
  3737. 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));
  3738. /* define a htt_wdi_ipa_config64_t type */
  3739. 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));
  3740. #if HTT_PADDR64
  3741. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3742. #else
  3743. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3744. #endif
  3745. enum htt_wdi_ipa_op_code {
  3746. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3747. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3748. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3749. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3750. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3751. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3752. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3753. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3754. /* keep this last */
  3755. HTT_WDI_IPA_OPCODE_MAX
  3756. };
  3757. /**
  3758. * @brief HTT WDI_IPA Operation Request Message
  3759. *
  3760. * @details
  3761. * HTT WDI_IPA Operation Request message is sent by host
  3762. * to either suspend or resume WDI_IPA TX or RX path.
  3763. * |31 24|23 16|15 8|7 0|
  3764. * |----------------+----------------+----------------+----------------|
  3765. * | op_code | Rsvd | msg_type |
  3766. * |-------------------------------------------------------------------|
  3767. *
  3768. * Header fields:
  3769. * - MSG_TYPE
  3770. * Bits 7:0
  3771. * Purpose: Identifies this as WDI_IPA Operation Request message
  3772. * value: = 0x9
  3773. * - OP_CODE
  3774. * Bits 31:16
  3775. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3776. * value: = enum htt_wdi_ipa_op_code
  3777. */
  3778. PREPACK struct htt_wdi_ipa_op_request_t
  3779. {
  3780. /* DWORD 0: flags and meta-data */
  3781. A_UINT32
  3782. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3783. reserved: 8,
  3784. op_code: 16;
  3785. } POSTPACK;
  3786. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3787. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3788. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3789. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3790. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3791. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3792. do { \
  3793. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3794. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3795. } while (0)
  3796. /*
  3797. * @brief host -> target HTT_SRING_SETUP message
  3798. *
  3799. * @details
  3800. * After target is booted up, Host can send SRING setup message for
  3801. * each host facing LMAC SRING. Target setups up HW registers based
  3802. * on setup message and confirms back to Host if response_required is set.
  3803. * Host should wait for confirmation message before sending new SRING
  3804. * setup message
  3805. *
  3806. * The message would appear as follows:
  3807. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3808. * |--------------- +-----------------+----------------+------------------|
  3809. * | ring_type | ring_id | pdev_id | msg_type |
  3810. * |----------------------------------------------------------------------|
  3811. * | ring_base_addr_lo |
  3812. * |----------------------------------------------------------------------|
  3813. * | ring_base_addr_hi |
  3814. * |----------------------------------------------------------------------|
  3815. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3816. * |----------------------------------------------------------------------|
  3817. * | ring_head_offset32_remote_addr_lo |
  3818. * |----------------------------------------------------------------------|
  3819. * | ring_head_offset32_remote_addr_hi |
  3820. * |----------------------------------------------------------------------|
  3821. * | ring_tail_offset32_remote_addr_lo |
  3822. * |----------------------------------------------------------------------|
  3823. * | ring_tail_offset32_remote_addr_hi |
  3824. * |----------------------------------------------------------------------|
  3825. * | ring_msi_addr_lo |
  3826. * |----------------------------------------------------------------------|
  3827. * | ring_msi_addr_hi |
  3828. * |----------------------------------------------------------------------|
  3829. * | ring_msi_data |
  3830. * |----------------------------------------------------------------------|
  3831. * | intr_timer_th |IM| intr_batch_counter_th |
  3832. * |----------------------------------------------------------------------|
  3833. * | reserved |RR|PTCF| intr_low_threshold |
  3834. * |----------------------------------------------------------------------|
  3835. * Where
  3836. * IM = sw_intr_mode
  3837. * RR = response_required
  3838. * PTCF = prefetch_timer_cfg
  3839. *
  3840. * The message is interpreted as follows:
  3841. * dword0 - b'0:7 - msg_type: This will be set to
  3842. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3843. * b'8:15 - pdev_id:
  3844. * 0 (for rings at SOC/UMAC level),
  3845. * 1/2/3 mac id (for rings at LMAC level)
  3846. * b'16:23 - ring_id: identify which ring is to setup,
  3847. * more details can be got from enum htt_srng_ring_id
  3848. * b'24:31 - ring_type: identify type of host rings,
  3849. * more details can be got from enum htt_srng_ring_type
  3850. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3851. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3852. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3853. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3854. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3855. * SW_TO_HW_RING.
  3856. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3857. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3858. * Lower 32 bits of memory address of the remote variable
  3859. * storing the 4-byte word offset that identifies the head
  3860. * element within the ring.
  3861. * (The head offset variable has type A_UINT32.)
  3862. * Valid for HW_TO_SW and SW_TO_SW rings.
  3863. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3864. * Upper 32 bits of memory address of the remote variable
  3865. * storing the 4-byte word offset that identifies the head
  3866. * element within the ring.
  3867. * (The head offset variable has type A_UINT32.)
  3868. * Valid for HW_TO_SW and SW_TO_SW rings.
  3869. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3870. * Lower 32 bits of memory address of the remote variable
  3871. * storing the 4-byte word offset that identifies the tail
  3872. * element within the ring.
  3873. * (The tail offset variable has type A_UINT32.)
  3874. * Valid for HW_TO_SW and SW_TO_SW rings.
  3875. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3876. * Upper 32 bits of memory address of the remote variable
  3877. * storing the 4-byte word offset that identifies the tail
  3878. * element within the ring.
  3879. * (The tail offset variable has type A_UINT32.)
  3880. * Valid for HW_TO_SW and SW_TO_SW rings.
  3881. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3882. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3883. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3884. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3885. * dword10 - b'0:31 - ring_msi_data: MSI data
  3886. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3887. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3888. * dword11 - b'0:14 - intr_batch_counter_th:
  3889. * batch counter threshold is in units of 4-byte words.
  3890. * HW internally maintains and increments batch count.
  3891. * (see SRING spec for detail description).
  3892. * When batch count reaches threshold value, an interrupt
  3893. * is generated by HW.
  3894. * b'15 - sw_intr_mode:
  3895. * This configuration shall be static.
  3896. * Only programmed at power up.
  3897. * 0: generate pulse style sw interrupts
  3898. * 1: generate level style sw interrupts
  3899. * b'16:31 - intr_timer_th:
  3900. * The timer init value when timer is idle or is
  3901. * initialized to start downcounting.
  3902. * In 8us units (to cover a range of 0 to 524 ms)
  3903. * dword12 - b'0:15 - intr_low_threshold:
  3904. * Used only by Consumer ring to generate ring_sw_int_p.
  3905. * Ring entries low threshold water mark, that is used
  3906. * in combination with the interrupt timer as well as
  3907. * the the clearing of the level interrupt.
  3908. * b'16:18 - prefetch_timer_cfg:
  3909. * Used only by Consumer ring to set timer mode to
  3910. * support Application prefetch handling.
  3911. * The external tail offset/pointer will be updated
  3912. * at following intervals:
  3913. * 3'b000: (Prefetch feature disabled; used only for debug)
  3914. * 3'b001: 1 usec
  3915. * 3'b010: 4 usec
  3916. * 3'b011: 8 usec (default)
  3917. * 3'b100: 16 usec
  3918. * Others: Reserverd
  3919. * b'19 - response_required:
  3920. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3921. * b'20:31 - reserved: reserved for future use
  3922. */
  3923. PREPACK struct htt_sring_setup_t {
  3924. A_UINT32 msg_type: 8,
  3925. pdev_id: 8,
  3926. ring_id: 8,
  3927. ring_type: 8;
  3928. A_UINT32 ring_base_addr_lo;
  3929. A_UINT32 ring_base_addr_hi;
  3930. A_UINT32 ring_size: 16,
  3931. ring_entry_size: 8,
  3932. ring_misc_cfg_flag: 8;
  3933. A_UINT32 ring_head_offset32_remote_addr_lo;
  3934. A_UINT32 ring_head_offset32_remote_addr_hi;
  3935. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3936. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3937. A_UINT32 ring_msi_addr_lo;
  3938. A_UINT32 ring_msi_addr_hi;
  3939. A_UINT32 ring_msi_data;
  3940. A_UINT32 intr_batch_counter_th: 15,
  3941. sw_intr_mode: 1,
  3942. intr_timer_th: 16;
  3943. A_UINT32 intr_low_threshold: 16,
  3944. prefetch_timer_cfg: 3,
  3945. response_required: 1,
  3946. reserved1: 12;
  3947. } POSTPACK;
  3948. enum htt_srng_ring_type {
  3949. HTT_HW_TO_SW_RING = 0,
  3950. HTT_SW_TO_HW_RING,
  3951. HTT_SW_TO_SW_RING,
  3952. /* Insert new ring types above this line */
  3953. };
  3954. enum htt_srng_ring_id {
  3955. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3956. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3957. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3958. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3959. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3960. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3961. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3962. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3963. /* Add Other SRING which can't be directly configured by host software above this line */
  3964. };
  3965. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3966. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3967. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3968. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3969. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3970. HTT_SRING_SETUP_PDEV_ID_S)
  3971. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3972. do { \
  3973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3974. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3975. } while (0)
  3976. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3977. #define HTT_SRING_SETUP_RING_ID_S 16
  3978. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3979. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3980. HTT_SRING_SETUP_RING_ID_S)
  3981. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3982. do { \
  3983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3984. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3985. } while (0)
  3986. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3987. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3988. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3989. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3990. HTT_SRING_SETUP_RING_TYPE_S)
  3991. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3992. do { \
  3993. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3994. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3995. } while (0)
  3996. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3997. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3998. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3999. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4000. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4001. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4002. do { \
  4003. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4004. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4005. } while (0)
  4006. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4007. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4008. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4009. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4010. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4011. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4012. do { \
  4013. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4014. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4015. } while (0)
  4016. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4017. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4018. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4019. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4020. HTT_SRING_SETUP_RING_SIZE_S)
  4021. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4022. do { \
  4023. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4024. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4025. } while (0)
  4026. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4027. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4028. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4029. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4030. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4031. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4032. do { \
  4033. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4034. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4035. } while (0)
  4036. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4037. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4038. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4039. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4040. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4041. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4042. do { \
  4043. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4044. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4045. } while (0)
  4046. /* This control bit is applicable to only Producer, which updates Ring ID field
  4047. * of each descriptor before pushing into the ring.
  4048. * 0: updates ring_id(default)
  4049. * 1: ring_id updating disabled */
  4050. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4051. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4053. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4054. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4055. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4056. do { \
  4057. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4058. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4059. } while (0)
  4060. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4061. * of each descriptor before pushing into the ring.
  4062. * 0: updates Loopcnt(default)
  4063. * 1: Loopcnt updating disabled */
  4064. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4065. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4066. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4067. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4068. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4069. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4070. do { \
  4071. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4072. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4073. } while (0)
  4074. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4075. * into security_id port of GXI/AXI. */
  4076. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4077. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4078. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4079. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4080. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4081. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4082. do { \
  4083. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4084. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4085. } while (0)
  4086. /* During MSI write operation, SRNG drives value of this register bit into
  4087. * swap bit of GXI/AXI. */
  4088. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4089. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4090. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4091. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4092. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4093. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4096. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4097. } while (0)
  4098. /* During Pointer write operation, SRNG drives value of this register bit into
  4099. * swap bit of GXI/AXI. */
  4100. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4101. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4104. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4105. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4109. } while (0)
  4110. /* During any data or TLV write operation, SRNG drives value of this register
  4111. * bit into swap bit of GXI/AXI. */
  4112. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4113. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4116. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4117. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4121. } while (0)
  4122. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4123. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4124. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4125. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4126. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4127. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4128. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4129. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4132. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4133. } while (0)
  4134. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4135. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4136. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4137. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4138. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4139. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4142. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4143. } while (0)
  4144. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4145. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4146. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4147. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4148. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4149. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4152. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4153. } while (0)
  4154. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4155. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4156. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4157. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4158. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4159. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4162. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4163. } while (0)
  4164. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4165. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4166. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4167. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4168. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4169. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4172. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4173. } while (0)
  4174. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4175. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4176. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4177. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4178. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4179. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4182. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4183. } while (0)
  4184. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4185. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4186. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4188. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4189. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4193. } while (0)
  4194. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4195. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4196. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4197. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4198. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4199. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4202. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4203. } while (0)
  4204. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4205. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4206. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4208. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4209. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4213. } while (0)
  4214. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4215. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4216. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4217. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4218. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4219. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4222. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4223. } while (0)
  4224. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4225. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4226. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4227. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4228. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4229. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4232. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4233. } while (0)
  4234. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4235. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4236. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4237. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4238. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4239. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4242. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4243. } while (0)
  4244. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4245. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4246. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4247. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4248. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4249. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4252. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4253. } while (0)
  4254. /**
  4255. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4256. *
  4257. * @details
  4258. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4259. * configure RXDMA rings.
  4260. * The configuration is per ring based and includes both packet subtypes
  4261. * and PPDU/MPDU TLVs.
  4262. *
  4263. * The message would appear as follows:
  4264. *
  4265. * |31 26|25|24|23 16|15 8|7 0|
  4266. * |-----------------+----------------+----------------+---------------|
  4267. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4268. * |-------------------------------------------------------------------|
  4269. * | rsvd2 | ring_buffer_size |
  4270. * |-------------------------------------------------------------------|
  4271. * | packet_type_enable_flags_0 |
  4272. * |-------------------------------------------------------------------|
  4273. * | packet_type_enable_flags_1 |
  4274. * |-------------------------------------------------------------------|
  4275. * | packet_type_enable_flags_2 |
  4276. * |-------------------------------------------------------------------|
  4277. * | packet_type_enable_flags_3 |
  4278. * |-------------------------------------------------------------------|
  4279. * | tlv_filter_in_flags |
  4280. * |-------------------------------------------------------------------|
  4281. * Where:
  4282. * PS = pkt_swap
  4283. * SS = status_swap
  4284. * The message is interpreted as follows:
  4285. * dword0 - b'0:7 - msg_type: This will be set to
  4286. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4287. * b'8:15 - pdev_id:
  4288. * 0 (for rings at SOC/UMAC level),
  4289. * 1/2/3 mac id (for rings at LMAC level)
  4290. * b'16:23 - ring_id : Identify the ring to configure.
  4291. * More details can be got from enum htt_srng_ring_id
  4292. * b'24 - status_swap: 1 is to swap status TLV
  4293. * b'25 - pkt_swap: 1 is to swap packet TLV
  4294. * b'26:31 - rsvd1: reserved for future use
  4295. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4296. * in byte units.
  4297. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4298. * - b'16:31 - rsvd2: Reserved for future use
  4299. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4300. * Enable MGMT packet from 0b0000 to 0b1001
  4301. * bits from low to high: FP, MD, MO - 3 bits
  4302. * FP: Filter_Pass
  4303. * MD: Monitor_Direct
  4304. * MO: Monitor_Other
  4305. * 10 mgmt subtypes * 3 bits -> 30 bits
  4306. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4307. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4308. * Enable MGMT packet from 0b1010 to 0b1111
  4309. * bits from low to high: FP, MD, MO - 3 bits
  4310. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4311. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4312. * Enable CTRL packet from 0b0000 to 0b1001
  4313. * bits from low to high: FP, MD, MO - 3 bits
  4314. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4315. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4316. * Enable CTRL packet from 0b1010 to 0b1111,
  4317. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4318. * bits from low to high: FP, MD, MO - 3 bits
  4319. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4320. * dword6 - b'0:31 - tlv_filter_in_flags:
  4321. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4322. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4323. */
  4324. PREPACK struct htt_rx_ring_selection_cfg_t {
  4325. A_UINT32 msg_type: 8,
  4326. pdev_id: 8,
  4327. ring_id: 8,
  4328. status_swap: 1,
  4329. pkt_swap: 1,
  4330. rsvd1: 6;
  4331. A_UINT32 ring_buffer_size: 16,
  4332. rsvd2: 16;
  4333. A_UINT32 packet_type_enable_flags_0;
  4334. A_UINT32 packet_type_enable_flags_1;
  4335. A_UINT32 packet_type_enable_flags_2;
  4336. A_UINT32 packet_type_enable_flags_3;
  4337. A_UINT32 tlv_filter_in_flags;
  4338. } POSTPACK;
  4339. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4340. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4341. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4342. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4343. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4344. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4345. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4348. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4349. } while (0)
  4350. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4351. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4352. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4353. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4354. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4355. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4358. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4359. } while (0)
  4360. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4361. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4362. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4363. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4364. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4365. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4366. do { \
  4367. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4368. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4369. } while (0)
  4370. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4373. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4374. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4375. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4376. do { \
  4377. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4378. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4379. } while (0)
  4380. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4381. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4383. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4384. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4385. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4386. do { \
  4387. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4388. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4389. } while (0)
  4390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4393. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4394. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4398. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4399. } while (0)
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4403. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4404. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4408. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4409. } while (0)
  4410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4413. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4414. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4416. do { \
  4417. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4418. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4419. } while (0)
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4423. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4424. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4426. do { \
  4427. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4428. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4429. } while (0)
  4430. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4431. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4432. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4433. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4434. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4435. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4436. do { \
  4437. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4438. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4439. } while (0)
  4440. /*
  4441. * Subtype based MGMT frames enable bits.
  4442. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4443. */
  4444. /* association request */
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4451. /* association response */
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4458. /* Reassociation request */
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4465. /* Reassociation response */
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4472. /* Probe request */
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4479. /* Probe response */
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4486. /* Timing Advertisement */
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4493. /* Reserved */
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4500. /* Beacon */
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4507. /* ATIM */
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4514. /* Disassociation */
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4521. /* Authentication */
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4528. /* Deauthentication */
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4535. /* Action */
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4542. /* Action No Ack */
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4549. /* Reserved */
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4556. /*
  4557. * Subtype based CTRL frames enable bits.
  4558. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4559. */
  4560. /* Reserved */
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4567. /* Reserved */
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4574. /* Reserved */
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4581. /* Reserved */
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4588. /* Reserved */
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4595. /* Reserved */
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4602. /* Reserved */
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4609. /* Control Wrapper */
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4616. /* Block Ack Request */
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4623. /* Block Ack*/
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4630. /* PS-POLL */
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4637. /* RTS */
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4644. /* CTS */
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4651. /* ACK */
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4658. /* CF-END */
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4665. /* CF-END + CF-ACK */
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4672. /* Multicast data */
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4679. /* Unicast data */
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4686. /* NULL data */
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4694. do { \
  4695. HTT_CHECK_SET_VAL(httsym, value); \
  4696. (word) |= (value) << httsym##_S; \
  4697. } while (0)
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4699. (((word) & httsym##_M) >> httsym##_S)
  4700. #define htt_rx_ring_pkt_enable_subtype_set( \
  4701. word, flag, mode, type, subtype, val) \
  4702. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4703. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4704. #define htt_rx_ring_pkt_enable_subtype_get( \
  4705. word, flag, mode, type, subtype) \
  4706. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4707. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4708. /* Definition to filter in TLVs */
  4709. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4710. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4711. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4712. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4713. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4714. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4715. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4716. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4717. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4718. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4719. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4720. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4721. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4722. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4723. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4724. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4725. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4726. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4727. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4728. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4729. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4730. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4731. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4732. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4733. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4734. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4735. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4736. do { \
  4737. HTT_CHECK_SET_VAL(httsym, enable); \
  4738. (word) |= (enable) << httsym##_S; \
  4739. } while (0)
  4740. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4741. (((word) & httsym##_M) >> httsym##_S)
  4742. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4743. HTT_RX_RING_TLV_ENABLE_SET( \
  4744. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4745. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4746. HTT_RX_RING_TLV_ENABLE_GET( \
  4747. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4748. /**
  4749. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4750. * host --> target Receive Flow Steering configuration message definition.
  4751. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4752. * The reason for this is we want RFS to be configured and ready before MAC
  4753. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4754. *
  4755. * |31 24|23 16|15 9|8|7 0|
  4756. * |----------------+----------------+----------------+----------------|
  4757. * | reserved |E| msg type |
  4758. * |-------------------------------------------------------------------|
  4759. * Where E = RFS enable flag
  4760. *
  4761. * The RFS_CONFIG message consists of a single 4-byte word.
  4762. *
  4763. * Header fields:
  4764. * - MSG_TYPE
  4765. * Bits 7:0
  4766. * Purpose: identifies this as a RFS config msg
  4767. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4768. * - RFS_CONFIG
  4769. * Bit 8
  4770. * Purpose: Tells target whether to enable (1) or disable (0)
  4771. * flow steering feature when sending rx indication messages to host
  4772. */
  4773. #define HTT_H2T_RFS_CONFIG_M 0x100
  4774. #define HTT_H2T_RFS_CONFIG_S 8
  4775. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4776. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4777. HTT_H2T_RFS_CONFIG_S)
  4778. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4781. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4782. } while (0)
  4783. #define HTT_RFS_CFG_REQ_BYTES 4
  4784. /**
  4785. * @brief host -> target FW extended statistics retrieve
  4786. *
  4787. * @details
  4788. * The following field definitions describe the format of the HTT host
  4789. * to target FW extended stats retrieve message.
  4790. * The message specifies the type of stats the host wants to retrieve.
  4791. *
  4792. * |31 24|23 16|15 8|7 0|
  4793. * |-----------------------------------------------------------|
  4794. * | reserved | stats type | pdev_mask | msg type |
  4795. * |-----------------------------------------------------------|
  4796. * | config param [0] |
  4797. * |-----------------------------------------------------------|
  4798. * | config param [1] |
  4799. * |-----------------------------------------------------------|
  4800. * | config param [2] |
  4801. * |-----------------------------------------------------------|
  4802. * | config param [3] |
  4803. * |-----------------------------------------------------------|
  4804. * | reserved |
  4805. * |-----------------------------------------------------------|
  4806. * | cookie LSBs |
  4807. * |-----------------------------------------------------------|
  4808. * | cookie MSBs |
  4809. * |-----------------------------------------------------------|
  4810. * Header fields:
  4811. * - MSG_TYPE
  4812. * Bits 7:0
  4813. * Purpose: identifies this is a extended stats upload request message
  4814. * Value: 0x10
  4815. * - PDEV_MASK
  4816. * Bits 8:15
  4817. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4818. * Value: This is a overloaded field, refer to usage and interpretation of
  4819. * PDEV in interface document.
  4820. * Bit 8 : Reserved for SOC stats
  4821. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4822. * Indicates MACID_MASK in DBS
  4823. * - STATS_TYPE
  4824. * Bits 23:16
  4825. * Purpose: identifies which FW statistics to upload
  4826. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4827. * - Reserved
  4828. * Bits 31:24
  4829. * - CONFIG_PARAM [0]
  4830. * Bits 31:0
  4831. * Purpose: give an opaque configuration value to the specified stats type
  4832. * Value: stats-type specific configuration value
  4833. * Refer to htt_stats.h for interpretation for each stats sub_type
  4834. * - CONFIG_PARAM [1]
  4835. * Bits 31:0
  4836. * Purpose: give an opaque configuration value to the specified stats type
  4837. * Value: stats-type specific configuration value
  4838. * Refer to htt_stats.h for interpretation for each stats sub_type
  4839. * - CONFIG_PARAM [2]
  4840. * Bits 31:0
  4841. * Purpose: give an opaque configuration value to the specified stats type
  4842. * Value: stats-type specific configuration value
  4843. * Refer to htt_stats.h for interpretation for each stats sub_type
  4844. * - CONFIG_PARAM [3]
  4845. * Bits 31:0
  4846. * Purpose: give an opaque configuration value to the specified stats type
  4847. * Value: stats-type specific configuration value
  4848. * Refer to htt_stats.h for interpretation for each stats sub_type
  4849. * - Reserved [31:0] for future use.
  4850. * - COOKIE_LSBS
  4851. * Bits 31:0
  4852. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4853. * message with its preceding host->target stats request message.
  4854. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4855. * - COOKIE_MSBS
  4856. * Bits 31:0
  4857. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4858. * message with its preceding host->target stats request message.
  4859. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4860. */
  4861. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4862. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4863. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4864. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4865. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4866. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4867. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4868. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4869. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4870. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4871. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4874. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4875. } while (0)
  4876. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4877. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4878. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4879. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4880. do { \
  4881. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4882. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4883. } while (0)
  4884. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4885. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4886. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4887. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4888. do { \
  4889. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4890. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4891. } while (0)
  4892. /**
  4893. * @brief host -> target FW PPDU_STATS request message
  4894. *
  4895. * @details
  4896. * The following field definitions describe the format of the HTT host
  4897. * to target FW for PPDU_STATS_CFG msg.
  4898. * The message allows the host to configure the PPDU_STATS_IND messages
  4899. * produced by the target.
  4900. *
  4901. * |31 24|23 16|15 8|7 0|
  4902. * |-----------------------------------------------------------|
  4903. * | REQ bit mask | pdev_mask | msg type |
  4904. * |-----------------------------------------------------------|
  4905. * Header fields:
  4906. * - MSG_TYPE
  4907. * Bits 7:0
  4908. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4909. * Value: 0x11
  4910. * - PDEV_MASK
  4911. * Bits 8:15
  4912. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4913. * Value: This is a overloaded field, refer to usage and interpretation of
  4914. * PDEV in interface document.
  4915. * Bit 8 : Reserved for SOC stats
  4916. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4917. * Indicates MACID_MASK in DBS
  4918. * - REQ_TLV_BIT_MASK
  4919. * Bits 16:31
  4920. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4921. * needs to be included in the target's PPDU_STATS_IND messages.
  4922. * Value: refer htt_ppdu_stats_tlv_tag_t
  4923. *
  4924. */
  4925. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4926. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4927. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4928. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4929. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4930. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4931. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4932. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4933. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4936. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4937. } while (0)
  4938. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4939. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4940. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4941. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4942. do { \
  4943. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4944. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4945. } while (0)
  4946. /*=== target -> host messages ===============================================*/
  4947. enum htt_t2h_msg_type {
  4948. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4949. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4950. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4951. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4952. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4953. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4954. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4955. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4956. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4957. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4958. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4959. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4960. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4961. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4962. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4963. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4964. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4965. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4966. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4967. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4968. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4969. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4970. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4971. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4972. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4973. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4974. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4975. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4976. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4977. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4978. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4979. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4980. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4981. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  4982. HTT_T2H_MSG_TYPE_TEST,
  4983. /* keep this last */
  4984. HTT_T2H_NUM_MSGS
  4985. };
  4986. /*
  4987. * HTT target to host message type -
  4988. * stored in bits 7:0 of the first word of the message
  4989. */
  4990. #define HTT_T2H_MSG_TYPE_M 0xff
  4991. #define HTT_T2H_MSG_TYPE_S 0
  4992. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4995. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4996. } while (0)
  4997. #define HTT_T2H_MSG_TYPE_GET(word) \
  4998. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4999. /**
  5000. * @brief target -> host version number confirmation message definition
  5001. *
  5002. * |31 24|23 16|15 8|7 0|
  5003. * |----------------+----------------+----------------+----------------|
  5004. * | reserved | major number | minor number | msg type |
  5005. * |-------------------------------------------------------------------|
  5006. * : option request TLV (optional) |
  5007. * :...................................................................:
  5008. *
  5009. * The VER_CONF message may consist of a single 4-byte word, or may be
  5010. * extended with TLVs that specify HTT options selected by the target.
  5011. * The following option TLVs may be appended to the VER_CONF message:
  5012. * - LL_BUS_ADDR_SIZE
  5013. * - HL_SUPPRESS_TX_COMPL_IND
  5014. * - MAX_TX_QUEUE_GROUPS
  5015. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5016. * may be appended to the VER_CONF message (but only one TLV of each type).
  5017. *
  5018. * Header fields:
  5019. * - MSG_TYPE
  5020. * Bits 7:0
  5021. * Purpose: identifies this as a version number confirmation message
  5022. * Value: 0x0
  5023. * - VER_MINOR
  5024. * Bits 15:8
  5025. * Purpose: Specify the minor number of the HTT message library version
  5026. * in use by the target firmware.
  5027. * The minor number specifies the specific revision within a range
  5028. * of fundamentally compatible HTT message definition revisions.
  5029. * Compatible revisions involve adding new messages or perhaps
  5030. * adding new fields to existing messages, in a backwards-compatible
  5031. * manner.
  5032. * Incompatible revisions involve changing the message type values,
  5033. * or redefining existing messages.
  5034. * Value: minor number
  5035. * - VER_MAJOR
  5036. * Bits 15:8
  5037. * Purpose: Specify the major number of the HTT message library version
  5038. * in use by the target firmware.
  5039. * The major number specifies the family of minor revisions that are
  5040. * fundamentally compatible with each other, but not with prior or
  5041. * later families.
  5042. * Value: major number
  5043. */
  5044. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5045. #define HTT_VER_CONF_MINOR_S 8
  5046. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5047. #define HTT_VER_CONF_MAJOR_S 16
  5048. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5049. do { \
  5050. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5051. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5052. } while (0)
  5053. #define HTT_VER_CONF_MINOR_GET(word) \
  5054. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5055. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5056. do { \
  5057. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5058. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5059. } while (0)
  5060. #define HTT_VER_CONF_MAJOR_GET(word) \
  5061. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5062. #define HTT_VER_CONF_BYTES 4
  5063. /**
  5064. * @brief - target -> host HTT Rx In order indication message
  5065. *
  5066. * @details
  5067. *
  5068. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5069. * |----------------+-------------------+---------------------+---------------|
  5070. * | peer ID | P| F| O| ext TID | msg type |
  5071. * |--------------------------------------------------------------------------|
  5072. * | MSDU count | Reserved | vdev id |
  5073. * |--------------------------------------------------------------------------|
  5074. * | MSDU 0 bus address (bits 31:0) |
  5075. #if HTT_PADDR64
  5076. * | MSDU 0 bus address (bits 63:32) |
  5077. #endif
  5078. * |--------------------------------------------------------------------------|
  5079. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5080. * |--------------------------------------------------------------------------|
  5081. * | MSDU 1 bus address (bits 31:0) |
  5082. #if HTT_PADDR64
  5083. * | MSDU 1 bus address (bits 63:32) |
  5084. #endif
  5085. * |--------------------------------------------------------------------------|
  5086. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5087. * |--------------------------------------------------------------------------|
  5088. */
  5089. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5090. *
  5091. * @details
  5092. * bits
  5093. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5094. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5095. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5096. * | | frag | | | | fail |chksum fail|
  5097. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5098. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5099. */
  5100. struct htt_rx_in_ord_paddr_ind_hdr_t
  5101. {
  5102. A_UINT32 /* word 0 */
  5103. msg_type: 8,
  5104. ext_tid: 5,
  5105. offload: 1,
  5106. frag: 1,
  5107. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5108. peer_id: 16;
  5109. A_UINT32 /* word 1 */
  5110. vap_id: 8,
  5111. reserved_1: 8,
  5112. msdu_cnt: 16;
  5113. };
  5114. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5115. {
  5116. A_UINT32 dma_addr;
  5117. A_UINT32
  5118. length: 16,
  5119. fw_desc: 8,
  5120. msdu_info:8;
  5121. };
  5122. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5123. {
  5124. A_UINT32 dma_addr_lo;
  5125. A_UINT32 dma_addr_hi;
  5126. A_UINT32
  5127. length: 16,
  5128. fw_desc: 8,
  5129. msdu_info:8;
  5130. };
  5131. #if HTT_PADDR64
  5132. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5133. #else
  5134. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5135. #endif
  5136. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5137. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5138. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5139. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5140. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5141. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5142. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5143. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5144. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5145. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5146. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5147. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5148. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5149. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5150. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5151. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5152. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5153. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5154. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5155. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5156. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5157. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5158. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5159. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5160. /* for systems using 64-bit format for bus addresses */
  5161. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5162. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5163. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5164. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5165. /* for systems using 32-bit format for bus addresses */
  5166. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5167. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5168. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5170. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5171. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5173. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5174. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5175. do { \
  5176. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5177. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5178. } while (0)
  5179. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5180. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5182. do { \
  5183. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5184. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5185. } while (0)
  5186. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5187. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5188. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5189. do { \
  5190. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5191. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5192. } while (0)
  5193. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5194. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5196. do { \
  5197. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5198. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5199. } while (0)
  5200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5201. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5202. /* for systems using 64-bit format for bus addresses */
  5203. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5204. do { \
  5205. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5206. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5207. } while (0)
  5208. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5209. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5210. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5211. do { \
  5212. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5213. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5214. } while (0)
  5215. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5216. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5217. /* for systems using 32-bit format for bus addresses */
  5218. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5219. do { \
  5220. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5221. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5222. } while (0)
  5223. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5224. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5225. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5228. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5229. } while (0)
  5230. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5231. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5232. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5235. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5236. } while (0)
  5237. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5238. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5239. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5240. do { \
  5241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5243. } while (0)
  5244. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5245. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5246. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5247. do { \
  5248. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5249. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5250. } while (0)
  5251. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5252. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5253. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5254. do { \
  5255. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5256. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5257. } while (0)
  5258. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5259. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5260. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5261. do { \
  5262. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5263. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5264. } while (0)
  5265. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5266. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5267. /* definitions used within target -> host rx indication message */
  5268. PREPACK struct htt_rx_ind_hdr_prefix_t
  5269. {
  5270. A_UINT32 /* word 0 */
  5271. msg_type: 8,
  5272. ext_tid: 5,
  5273. release_valid: 1,
  5274. flush_valid: 1,
  5275. reserved0: 1,
  5276. peer_id: 16;
  5277. A_UINT32 /* word 1 */
  5278. flush_start_seq_num: 6,
  5279. flush_end_seq_num: 6,
  5280. release_start_seq_num: 6,
  5281. release_end_seq_num: 6,
  5282. num_mpdu_ranges: 8;
  5283. } POSTPACK;
  5284. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5285. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5286. #define HTT_TGT_RSSI_INVALID 0x80
  5287. PREPACK struct htt_rx_ppdu_desc_t
  5288. {
  5289. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5290. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5291. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5292. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5293. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5294. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5295. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5296. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5297. A_UINT32 /* word 0 */
  5298. rssi_cmb: 8,
  5299. timestamp_submicrosec: 8,
  5300. phy_err_code: 8,
  5301. phy_err: 1,
  5302. legacy_rate: 4,
  5303. legacy_rate_sel: 1,
  5304. end_valid: 1,
  5305. start_valid: 1;
  5306. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5307. union {
  5308. A_UINT32 /* word 1 */
  5309. rssi0_pri20: 8,
  5310. rssi0_ext20: 8,
  5311. rssi0_ext40: 8,
  5312. rssi0_ext80: 8;
  5313. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5314. } u0;
  5315. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5316. union {
  5317. A_UINT32 /* word 2 */
  5318. rssi1_pri20: 8,
  5319. rssi1_ext20: 8,
  5320. rssi1_ext40: 8,
  5321. rssi1_ext80: 8;
  5322. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5323. } u1;
  5324. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5325. union {
  5326. A_UINT32 /* word 3 */
  5327. rssi2_pri20: 8,
  5328. rssi2_ext20: 8,
  5329. rssi2_ext40: 8,
  5330. rssi2_ext80: 8;
  5331. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5332. } u2;
  5333. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5334. union {
  5335. A_UINT32 /* word 4 */
  5336. rssi3_pri20: 8,
  5337. rssi3_ext20: 8,
  5338. rssi3_ext40: 8,
  5339. rssi3_ext80: 8;
  5340. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5341. } u3;
  5342. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5343. A_UINT32 tsf32; /* word 5 */
  5344. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5345. A_UINT32 timestamp_microsec; /* word 6 */
  5346. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5347. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5348. A_UINT32 /* word 7 */
  5349. vht_sig_a1: 24,
  5350. preamble_type: 8;
  5351. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5352. A_UINT32 /* word 8 */
  5353. vht_sig_a2: 24,
  5354. reserved0: 8;
  5355. } POSTPACK;
  5356. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5357. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5358. PREPACK struct htt_rx_ind_hdr_suffix_t
  5359. {
  5360. A_UINT32 /* word 0 */
  5361. fw_rx_desc_bytes: 16,
  5362. reserved0: 16;
  5363. } POSTPACK;
  5364. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5365. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5366. PREPACK struct htt_rx_ind_hdr_t
  5367. {
  5368. struct htt_rx_ind_hdr_prefix_t prefix;
  5369. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5370. struct htt_rx_ind_hdr_suffix_t suffix;
  5371. } POSTPACK;
  5372. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5373. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5374. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5375. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5376. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5377. /*
  5378. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5379. * the offset into the HTT rx indication message at which the
  5380. * FW rx PPDU descriptor resides
  5381. */
  5382. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5383. /*
  5384. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5385. * the offset into the HTT rx indication message at which the
  5386. * header suffix (FW rx MSDU byte count) resides
  5387. */
  5388. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5389. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5390. /*
  5391. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5392. * the offset into the HTT rx indication message at which the per-MSDU
  5393. * information starts
  5394. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5395. * per-MSDU information portion of the message. The per-MSDU info itself
  5396. * starts at byte 12.
  5397. */
  5398. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5399. /**
  5400. * @brief target -> host rx indication message definition
  5401. *
  5402. * @details
  5403. * The following field definitions describe the format of the rx indication
  5404. * message sent from the target to the host.
  5405. * The message consists of three major sections:
  5406. * 1. a fixed-length header
  5407. * 2. a variable-length list of firmware rx MSDU descriptors
  5408. * 3. one or more 4-octet MPDU range information elements
  5409. * The fixed length header itself has two sub-sections
  5410. * 1. the message meta-information, including identification of the
  5411. * sender and type of the received data, and a 4-octet flush/release IE
  5412. * 2. the firmware rx PPDU descriptor
  5413. *
  5414. * The format of the message is depicted below.
  5415. * in this depiction, the following abbreviations are used for information
  5416. * elements within the message:
  5417. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5418. * elements associated with the PPDU start are valid.
  5419. * Specifically, the following fields are valid only if SV is set:
  5420. * RSSI (all variants), L, legacy rate, preamble type, service,
  5421. * VHT-SIG-A
  5422. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5423. * elements associated with the PPDU end are valid.
  5424. * Specifically, the following fields are valid only if EV is set:
  5425. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5426. * - L - Legacy rate selector - if legacy rates are used, this flag
  5427. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5428. * (L == 0) PHY.
  5429. * - P - PHY error flag - boolean indication of whether the rx frame had
  5430. * a PHY error
  5431. *
  5432. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5433. * |----------------+-------------------+---------------------+---------------|
  5434. * | peer ID | |RV|FV| ext TID | msg type |
  5435. * |--------------------------------------------------------------------------|
  5436. * | num | release | release | flush | flush |
  5437. * | MPDU | end | start | end | start |
  5438. * | ranges | seq num | seq num | seq num | seq num |
  5439. * |==========================================================================|
  5440. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5441. * |V|V| | rate | | | timestamp | RSSI |
  5442. * |--------------------------------------------------------------------------|
  5443. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5444. * |--------------------------------------------------------------------------|
  5445. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5446. * |--------------------------------------------------------------------------|
  5447. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5448. * |--------------------------------------------------------------------------|
  5449. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5450. * |--------------------------------------------------------------------------|
  5451. * | TSF LSBs |
  5452. * |--------------------------------------------------------------------------|
  5453. * | microsec timestamp |
  5454. * |--------------------------------------------------------------------------|
  5455. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5456. * |--------------------------------------------------------------------------|
  5457. * | service | HT-SIG / VHT-SIG-A2 |
  5458. * |==========================================================================|
  5459. * | reserved | FW rx desc bytes |
  5460. * |--------------------------------------------------------------------------|
  5461. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5462. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5463. * |--------------------------------------------------------------------------|
  5464. * : : :
  5465. * |--------------------------------------------------------------------------|
  5466. * | alignment | MSDU Rx |
  5467. * | padding | desc Bn |
  5468. * |--------------------------------------------------------------------------|
  5469. * | reserved | MPDU range status | MPDU count |
  5470. * |--------------------------------------------------------------------------|
  5471. * : reserved : MPDU range status : MPDU count :
  5472. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5473. *
  5474. * Header fields:
  5475. * - MSG_TYPE
  5476. * Bits 7:0
  5477. * Purpose: identifies this as an rx indication message
  5478. * Value: 0x1
  5479. * - EXT_TID
  5480. * Bits 12:8
  5481. * Purpose: identify the traffic ID of the rx data, including
  5482. * special "extended" TID values for multicast, broadcast, and
  5483. * non-QoS data frames
  5484. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5485. * - FLUSH_VALID (FV)
  5486. * Bit 13
  5487. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5488. * is valid
  5489. * Value:
  5490. * 1 -> flush IE is valid and needs to be processed
  5491. * 0 -> flush IE is not valid and should be ignored
  5492. * - REL_VALID (RV)
  5493. * Bit 13
  5494. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5495. * is valid
  5496. * Value:
  5497. * 1 -> release IE is valid and needs to be processed
  5498. * 0 -> release IE is not valid and should be ignored
  5499. * - PEER_ID
  5500. * Bits 31:16
  5501. * Purpose: Identify, by ID, which peer sent the rx data
  5502. * Value: ID of the peer who sent the rx data
  5503. * - FLUSH_SEQ_NUM_START
  5504. * Bits 5:0
  5505. * Purpose: Indicate the start of a series of MPDUs to flush
  5506. * Not all MPDUs within this series are necessarily valid - the host
  5507. * must check each sequence number within this range to see if the
  5508. * corresponding MPDU is actually present.
  5509. * This field is only valid if the FV bit is set.
  5510. * Value:
  5511. * The sequence number for the first MPDUs to check to flush.
  5512. * The sequence number is masked by 0x3f.
  5513. * - FLUSH_SEQ_NUM_END
  5514. * Bits 11:6
  5515. * Purpose: Indicate the end of a series of MPDUs to flush
  5516. * Value:
  5517. * The sequence number one larger than the sequence number of the
  5518. * last MPDU to check to flush.
  5519. * The sequence number is masked by 0x3f.
  5520. * Not all MPDUs within this series are necessarily valid - the host
  5521. * must check each sequence number within this range to see if the
  5522. * corresponding MPDU is actually present.
  5523. * This field is only valid if the FV bit is set.
  5524. * - REL_SEQ_NUM_START
  5525. * Bits 17:12
  5526. * Purpose: Indicate the start of a series of MPDUs to release.
  5527. * All MPDUs within this series are present and valid - the host
  5528. * need not check each sequence number within this range to see if
  5529. * the corresponding MPDU is actually present.
  5530. * This field is only valid if the RV bit is set.
  5531. * Value:
  5532. * The sequence number for the first MPDUs to check to release.
  5533. * The sequence number is masked by 0x3f.
  5534. * - REL_SEQ_NUM_END
  5535. * Bits 23:18
  5536. * Purpose: Indicate the end of a series of MPDUs to release.
  5537. * Value:
  5538. * The sequence number one larger than the sequence number of the
  5539. * last MPDU to check to release.
  5540. * The sequence number is masked by 0x3f.
  5541. * All MPDUs within this series are present and valid - the host
  5542. * need not check each sequence number within this range to see if
  5543. * the corresponding MPDU is actually present.
  5544. * This field is only valid if the RV bit is set.
  5545. * - NUM_MPDU_RANGES
  5546. * Bits 31:24
  5547. * Purpose: Indicate how many ranges of MPDUs are present.
  5548. * Each MPDU range consists of a series of contiguous MPDUs within the
  5549. * rx frame sequence which all have the same MPDU status.
  5550. * Value: 1-63 (typically a small number, like 1-3)
  5551. *
  5552. * Rx PPDU descriptor fields:
  5553. * - RSSI_CMB
  5554. * Bits 7:0
  5555. * Purpose: Combined RSSI from all active rx chains, across the active
  5556. * bandwidth.
  5557. * Value: RSSI dB units w.r.t. noise floor
  5558. * - TIMESTAMP_SUBMICROSEC
  5559. * Bits 15:8
  5560. * Purpose: high-resolution timestamp
  5561. * Value:
  5562. * Sub-microsecond time of PPDU reception.
  5563. * This timestamp ranges from [0,MAC clock MHz).
  5564. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5565. * to form a high-resolution, large range rx timestamp.
  5566. * - PHY_ERR_CODE
  5567. * Bits 23:16
  5568. * Purpose:
  5569. * If the rx frame processing resulted in a PHY error, indicate what
  5570. * type of rx PHY error occurred.
  5571. * Value:
  5572. * This field is valid if the "P" (PHY_ERR) flag is set.
  5573. * TBD: document/specify the values for this field
  5574. * - PHY_ERR
  5575. * Bit 24
  5576. * Purpose: indicate whether the rx PPDU had a PHY error
  5577. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5578. * - LEGACY_RATE
  5579. * Bits 28:25
  5580. * Purpose:
  5581. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5582. * specify which rate was used.
  5583. * Value:
  5584. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5585. * flag.
  5586. * If LEGACY_RATE_SEL is 0:
  5587. * 0x8: OFDM 48 Mbps
  5588. * 0x9: OFDM 24 Mbps
  5589. * 0xA: OFDM 12 Mbps
  5590. * 0xB: OFDM 6 Mbps
  5591. * 0xC: OFDM 54 Mbps
  5592. * 0xD: OFDM 36 Mbps
  5593. * 0xE: OFDM 18 Mbps
  5594. * 0xF: OFDM 9 Mbps
  5595. * If LEGACY_RATE_SEL is 1:
  5596. * 0x8: CCK 11 Mbps long preamble
  5597. * 0x9: CCK 5.5 Mbps long preamble
  5598. * 0xA: CCK 2 Mbps long preamble
  5599. * 0xB: CCK 1 Mbps long preamble
  5600. * 0xC: CCK 11 Mbps short preamble
  5601. * 0xD: CCK 5.5 Mbps short preamble
  5602. * 0xE: CCK 2 Mbps short preamble
  5603. * - LEGACY_RATE_SEL
  5604. * Bit 29
  5605. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5606. * Value:
  5607. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5608. * used a legacy rate.
  5609. * 0 -> OFDM, 1 -> CCK
  5610. * - END_VALID
  5611. * Bit 30
  5612. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5613. * the start of the PPDU are valid. Specifically, the following
  5614. * fields are only valid if END_VALID is set:
  5615. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5616. * TIMESTAMP_SUBMICROSEC
  5617. * Value:
  5618. * 0 -> rx PPDU desc end fields are not valid
  5619. * 1 -> rx PPDU desc end fields are valid
  5620. * - START_VALID
  5621. * Bit 31
  5622. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5623. * the end of the PPDU are valid. Specifically, the following
  5624. * fields are only valid if START_VALID is set:
  5625. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5626. * VHT-SIG-A
  5627. * Value:
  5628. * 0 -> rx PPDU desc start fields are not valid
  5629. * 1 -> rx PPDU desc start fields are valid
  5630. * - RSSI0_PRI20
  5631. * Bits 7:0
  5632. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5633. * Value: RSSI dB units w.r.t. noise floor
  5634. *
  5635. * - RSSI0_EXT20
  5636. * Bits 7:0
  5637. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5638. * (if the rx bandwidth was >= 40 MHz)
  5639. * Value: RSSI dB units w.r.t. noise floor
  5640. * - RSSI0_EXT40
  5641. * Bits 7:0
  5642. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5643. * (if the rx bandwidth was >= 80 MHz)
  5644. * Value: RSSI dB units w.r.t. noise floor
  5645. * - RSSI0_EXT80
  5646. * Bits 7:0
  5647. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5648. * (if the rx bandwidth was >= 160 MHz)
  5649. * Value: RSSI dB units w.r.t. noise floor
  5650. *
  5651. * - RSSI1_PRI20
  5652. * Bits 7:0
  5653. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5654. * Value: RSSI dB units w.r.t. noise floor
  5655. * - RSSI1_EXT20
  5656. * Bits 7:0
  5657. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5658. * (if the rx bandwidth was >= 40 MHz)
  5659. * Value: RSSI dB units w.r.t. noise floor
  5660. * - RSSI1_EXT40
  5661. * Bits 7:0
  5662. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5663. * (if the rx bandwidth was >= 80 MHz)
  5664. * Value: RSSI dB units w.r.t. noise floor
  5665. * - RSSI1_EXT80
  5666. * Bits 7:0
  5667. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5668. * (if the rx bandwidth was >= 160 MHz)
  5669. * Value: RSSI dB units w.r.t. noise floor
  5670. *
  5671. * - RSSI2_PRI20
  5672. * Bits 7:0
  5673. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5674. * Value: RSSI dB units w.r.t. noise floor
  5675. * - RSSI2_EXT20
  5676. * Bits 7:0
  5677. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5678. * (if the rx bandwidth was >= 40 MHz)
  5679. * Value: RSSI dB units w.r.t. noise floor
  5680. * - RSSI2_EXT40
  5681. * Bits 7:0
  5682. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5683. * (if the rx bandwidth was >= 80 MHz)
  5684. * Value: RSSI dB units w.r.t. noise floor
  5685. * - RSSI2_EXT80
  5686. * Bits 7:0
  5687. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5688. * (if the rx bandwidth was >= 160 MHz)
  5689. * Value: RSSI dB units w.r.t. noise floor
  5690. *
  5691. * - RSSI3_PRI20
  5692. * Bits 7:0
  5693. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5694. * Value: RSSI dB units w.r.t. noise floor
  5695. * - RSSI3_EXT20
  5696. * Bits 7:0
  5697. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5698. * (if the rx bandwidth was >= 40 MHz)
  5699. * Value: RSSI dB units w.r.t. noise floor
  5700. * - RSSI3_EXT40
  5701. * Bits 7:0
  5702. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5703. * (if the rx bandwidth was >= 80 MHz)
  5704. * Value: RSSI dB units w.r.t. noise floor
  5705. * - RSSI3_EXT80
  5706. * Bits 7:0
  5707. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5708. * (if the rx bandwidth was >= 160 MHz)
  5709. * Value: RSSI dB units w.r.t. noise floor
  5710. *
  5711. * - TSF32
  5712. * Bits 31:0
  5713. * Purpose: specify the time the rx PPDU was received, in TSF units
  5714. * Value: 32 LSBs of the TSF
  5715. * - TIMESTAMP_MICROSEC
  5716. * Bits 31:0
  5717. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5718. * Value: PPDU rx time, in microseconds
  5719. * - VHT_SIG_A1
  5720. * Bits 23:0
  5721. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5722. * from the rx PPDU
  5723. * Value:
  5724. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5725. * VHT-SIG-A1 data.
  5726. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5727. * first 24 bits of the HT-SIG data.
  5728. * Otherwise, this field is invalid.
  5729. * Refer to the the 802.11 protocol for the definition of the
  5730. * HT-SIG and VHT-SIG-A1 fields
  5731. * - VHT_SIG_A2
  5732. * Bits 23:0
  5733. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5734. * from the rx PPDU
  5735. * Value:
  5736. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5737. * VHT-SIG-A2 data.
  5738. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5739. * last 24 bits of the HT-SIG data.
  5740. * Otherwise, this field is invalid.
  5741. * Refer to the the 802.11 protocol for the definition of the
  5742. * HT-SIG and VHT-SIG-A2 fields
  5743. * - PREAMBLE_TYPE
  5744. * Bits 31:24
  5745. * Purpose: indicate the PHY format of the received burst
  5746. * Value:
  5747. * 0x4: Legacy (OFDM/CCK)
  5748. * 0x8: HT
  5749. * 0x9: HT with TxBF
  5750. * 0xC: VHT
  5751. * 0xD: VHT with TxBF
  5752. * - SERVICE
  5753. * Bits 31:24
  5754. * Purpose: TBD
  5755. * Value: TBD
  5756. *
  5757. * Rx MSDU descriptor fields:
  5758. * - FW_RX_DESC_BYTES
  5759. * Bits 15:0
  5760. * Purpose: Indicate how many bytes in the Rx indication are used for
  5761. * FW Rx descriptors
  5762. *
  5763. * Payload fields:
  5764. * - MPDU_COUNT
  5765. * Bits 7:0
  5766. * Purpose: Indicate how many sequential MPDUs share the same status.
  5767. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5768. * - MPDU_STATUS
  5769. * Bits 15:8
  5770. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5771. * received successfully.
  5772. * Value:
  5773. * 0x1: success
  5774. * 0x2: FCS error
  5775. * 0x3: duplicate error
  5776. * 0x4: replay error
  5777. * 0x5: invalid peer
  5778. */
  5779. /* header fields */
  5780. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5781. #define HTT_RX_IND_EXT_TID_S 8
  5782. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5783. #define HTT_RX_IND_FLUSH_VALID_S 13
  5784. #define HTT_RX_IND_REL_VALID_M 0x4000
  5785. #define HTT_RX_IND_REL_VALID_S 14
  5786. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5787. #define HTT_RX_IND_PEER_ID_S 16
  5788. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5789. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5790. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5791. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5792. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5793. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5794. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5795. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5796. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5797. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5798. /* rx PPDU descriptor fields */
  5799. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5800. #define HTT_RX_IND_RSSI_CMB_S 0
  5801. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5802. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5803. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5804. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5805. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5806. #define HTT_RX_IND_PHY_ERR_S 24
  5807. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5808. #define HTT_RX_IND_LEGACY_RATE_S 25
  5809. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5810. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5811. #define HTT_RX_IND_END_VALID_M 0x40000000
  5812. #define HTT_RX_IND_END_VALID_S 30
  5813. #define HTT_RX_IND_START_VALID_M 0x80000000
  5814. #define HTT_RX_IND_START_VALID_S 31
  5815. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5816. #define HTT_RX_IND_RSSI_PRI20_S 0
  5817. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5818. #define HTT_RX_IND_RSSI_EXT20_S 8
  5819. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5820. #define HTT_RX_IND_RSSI_EXT40_S 16
  5821. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5822. #define HTT_RX_IND_RSSI_EXT80_S 24
  5823. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5824. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5825. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5826. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5827. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5828. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5829. #define HTT_RX_IND_SERVICE_M 0xff000000
  5830. #define HTT_RX_IND_SERVICE_S 24
  5831. /* rx MSDU descriptor fields */
  5832. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5833. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5834. /* payload fields */
  5835. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5836. #define HTT_RX_IND_MPDU_COUNT_S 0
  5837. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5838. #define HTT_RX_IND_MPDU_STATUS_S 8
  5839. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5840. do { \
  5841. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5842. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5843. } while (0)
  5844. #define HTT_RX_IND_EXT_TID_GET(word) \
  5845. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5846. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5847. do { \
  5848. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5849. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5850. } while (0)
  5851. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5852. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5853. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5854. do { \
  5855. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5856. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5857. } while (0)
  5858. #define HTT_RX_IND_REL_VALID_GET(word) \
  5859. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5860. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5861. do { \
  5862. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5863. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5864. } while (0)
  5865. #define HTT_RX_IND_PEER_ID_GET(word) \
  5866. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5867. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5868. do { \
  5869. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5870. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5871. } while (0)
  5872. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5873. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5874. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5875. do { \
  5876. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5877. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5878. } while (0)
  5879. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5880. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5881. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5882. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5883. do { \
  5884. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5885. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5886. } while (0)
  5887. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5888. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5889. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5890. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5891. do { \
  5892. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5893. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5894. } while (0)
  5895. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5896. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5897. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5898. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5899. do { \
  5900. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5901. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5902. } while (0)
  5903. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5904. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5905. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5906. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5907. do { \
  5908. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5909. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5910. } while (0)
  5911. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5912. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5913. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5914. /* FW rx PPDU descriptor fields */
  5915. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5916. do { \
  5917. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5918. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5919. } while (0)
  5920. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5921. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5922. HTT_RX_IND_RSSI_CMB_S)
  5923. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5924. do { \
  5925. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5926. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5927. } while (0)
  5928. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5929. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5930. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5931. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5932. do { \
  5933. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5934. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5935. } while (0)
  5936. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5937. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5938. HTT_RX_IND_PHY_ERR_CODE_S)
  5939. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5942. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5943. } while (0)
  5944. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5945. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5946. HTT_RX_IND_PHY_ERR_S)
  5947. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5948. do { \
  5949. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5950. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5951. } while (0)
  5952. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5953. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5954. HTT_RX_IND_LEGACY_RATE_S)
  5955. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5956. do { \
  5957. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5958. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5959. } while (0)
  5960. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5961. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5962. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5963. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5966. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5967. } while (0)
  5968. #define HTT_RX_IND_END_VALID_GET(word) \
  5969. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5970. HTT_RX_IND_END_VALID_S)
  5971. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5972. do { \
  5973. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5974. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5975. } while (0)
  5976. #define HTT_RX_IND_START_VALID_GET(word) \
  5977. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5978. HTT_RX_IND_START_VALID_S)
  5979. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5982. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5983. } while (0)
  5984. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5985. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5986. HTT_RX_IND_RSSI_PRI20_S)
  5987. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5990. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5991. } while (0)
  5992. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5993. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5994. HTT_RX_IND_RSSI_EXT20_S)
  5995. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5996. do { \
  5997. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5998. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5999. } while (0)
  6000. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6001. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6002. HTT_RX_IND_RSSI_EXT40_S)
  6003. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6004. do { \
  6005. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6006. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6007. } while (0)
  6008. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6009. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6010. HTT_RX_IND_RSSI_EXT80_S)
  6011. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6012. do { \
  6013. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6014. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6015. } while (0)
  6016. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6017. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6018. HTT_RX_IND_VHT_SIG_A1_S)
  6019. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6020. do { \
  6021. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6022. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6023. } while (0)
  6024. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6025. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6026. HTT_RX_IND_VHT_SIG_A2_S)
  6027. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6028. do { \
  6029. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6030. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6031. } while (0)
  6032. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6033. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6034. HTT_RX_IND_PREAMBLE_TYPE_S)
  6035. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6038. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6039. } while (0)
  6040. #define HTT_RX_IND_SERVICE_GET(word) \
  6041. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6042. HTT_RX_IND_SERVICE_S)
  6043. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6044. do { \
  6045. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6046. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6047. } while (0)
  6048. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6049. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6050. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6051. do { \
  6052. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6053. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6054. } while (0)
  6055. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6056. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6057. #define HTT_RX_IND_HL_BYTES \
  6058. (HTT_RX_IND_HDR_BYTES + \
  6059. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6060. 4 /* single MPDU range information element */)
  6061. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6062. /* Could we use one macro entry? */
  6063. #define HTT_WORD_SET(word, field, value) \
  6064. do { \
  6065. HTT_CHECK_SET_VAL(field, value); \
  6066. (word) |= ((value) << field ## _S); \
  6067. } while (0)
  6068. #define HTT_WORD_GET(word, field) \
  6069. (((word) & field ## _M) >> field ## _S)
  6070. PREPACK struct hl_htt_rx_ind_base {
  6071. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6072. } POSTPACK;
  6073. /*
  6074. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6075. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6076. * HL host needed info. The field is just after the msdu fw rx desc.
  6077. */
  6078. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6079. struct htt_rx_ind_hl_rx_desc_t {
  6080. A_UINT8 ver;
  6081. A_UINT8 len;
  6082. struct {
  6083. A_UINT8
  6084. first_msdu: 1,
  6085. last_msdu: 1,
  6086. c3_failed: 1,
  6087. c4_failed: 1,
  6088. ipv6: 1,
  6089. tcp: 1,
  6090. udp: 1,
  6091. reserved: 1;
  6092. } flags;
  6093. };
  6094. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6095. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6096. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6097. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6098. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6099. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6100. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6101. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6102. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6103. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6104. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6105. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6106. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6107. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6108. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6109. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6110. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6111. /* This structure is used in HL, the basic descriptor information
  6112. * used by host. the structure is translated by FW from HW desc
  6113. * or generated by FW. But in HL monitor mode, the host would use
  6114. * the same structure with LL.
  6115. */
  6116. PREPACK struct hl_htt_rx_desc_base {
  6117. A_UINT32
  6118. seq_num:12,
  6119. encrypted:1,
  6120. chan_info_present:1,
  6121. resv0:2,
  6122. mcast_bcast:1,
  6123. fragment:1,
  6124. key_id_oct:8,
  6125. resv1:6;
  6126. A_UINT32
  6127. pn_31_0;
  6128. union {
  6129. struct {
  6130. A_UINT16 pn_47_32;
  6131. A_UINT16 pn_63_48;
  6132. } pn16;
  6133. A_UINT32 pn_63_32;
  6134. } u0;
  6135. A_UINT32
  6136. pn_95_64;
  6137. A_UINT32
  6138. pn_127_96;
  6139. } POSTPACK;
  6140. /*
  6141. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6142. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6143. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6144. * Please see htt_chan_change_t for description of the fields.
  6145. */
  6146. PREPACK struct htt_chan_info_t
  6147. {
  6148. A_UINT32 primary_chan_center_freq_mhz: 16,
  6149. contig_chan1_center_freq_mhz: 16;
  6150. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6151. phy_mode: 8,
  6152. reserved: 8;
  6153. } POSTPACK;
  6154. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6155. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6156. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6157. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6158. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6159. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6160. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6161. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6162. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6163. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6164. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6165. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6166. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6167. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6168. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6169. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6170. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6171. /* Channel information */
  6172. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6173. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6174. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6175. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6176. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6177. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6178. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6179. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6180. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6181. do { \
  6182. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6183. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6184. } while (0)
  6185. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6186. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6187. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6188. do { \
  6189. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6190. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6191. } while (0)
  6192. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6193. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6194. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6195. do { \
  6196. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6197. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6198. } while (0)
  6199. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6200. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6201. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6202. do { \
  6203. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6204. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6205. } while (0)
  6206. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6207. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6208. /*
  6209. * @brief target -> host rx reorder flush message definition
  6210. *
  6211. * @details
  6212. * The following field definitions describe the format of the rx flush
  6213. * message sent from the target to the host.
  6214. * The message consists of a 4-octet header, followed by one or more
  6215. * 4-octet payload information elements.
  6216. *
  6217. * |31 24|23 8|7 0|
  6218. * |--------------------------------------------------------------|
  6219. * | TID | peer ID | msg type |
  6220. * |--------------------------------------------------------------|
  6221. * | seq num end | seq num start | MPDU status | reserved |
  6222. * |--------------------------------------------------------------|
  6223. * First DWORD:
  6224. * - MSG_TYPE
  6225. * Bits 7:0
  6226. * Purpose: identifies this as an rx flush message
  6227. * Value: 0x2
  6228. * - PEER_ID
  6229. * Bits 23:8 (only bits 18:8 actually used)
  6230. * Purpose: identify which peer's rx data is being flushed
  6231. * Value: (rx) peer ID
  6232. * - TID
  6233. * Bits 31:24 (only bits 27:24 actually used)
  6234. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6235. * Value: traffic identifier
  6236. * Second DWORD:
  6237. * - MPDU_STATUS
  6238. * Bits 15:8
  6239. * Purpose:
  6240. * Indicate whether the flushed MPDUs should be discarded or processed.
  6241. * Value:
  6242. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6243. * stages of rx processing
  6244. * other: discard the MPDUs
  6245. * It is anticipated that flush messages will always have
  6246. * MPDU status == 1, but the status flag is included for
  6247. * flexibility.
  6248. * - SEQ_NUM_START
  6249. * Bits 23:16
  6250. * Purpose:
  6251. * Indicate the start of a series of consecutive MPDUs being flushed.
  6252. * Not all MPDUs within this range are necessarily valid - the host
  6253. * must check each sequence number within this range to see if the
  6254. * corresponding MPDU is actually present.
  6255. * Value:
  6256. * The sequence number for the first MPDU in the sequence.
  6257. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6258. * - SEQ_NUM_END
  6259. * Bits 30:24
  6260. * Purpose:
  6261. * Indicate the end of a series of consecutive MPDUs being flushed.
  6262. * Value:
  6263. * The sequence number one larger than the sequence number of the
  6264. * last MPDU being flushed.
  6265. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6266. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6267. * are to be released for further rx processing.
  6268. * Not all MPDUs within this range are necessarily valid - the host
  6269. * must check each sequence number within this range to see if the
  6270. * corresponding MPDU is actually present.
  6271. */
  6272. /* first DWORD */
  6273. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6274. #define HTT_RX_FLUSH_PEER_ID_S 8
  6275. #define HTT_RX_FLUSH_TID_M 0xff000000
  6276. #define HTT_RX_FLUSH_TID_S 24
  6277. /* second DWORD */
  6278. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6279. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6280. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6281. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6282. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6283. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6284. #define HTT_RX_FLUSH_BYTES 8
  6285. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6286. do { \
  6287. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6288. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6289. } while (0)
  6290. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6291. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6292. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6293. do { \
  6294. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6295. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6296. } while (0)
  6297. #define HTT_RX_FLUSH_TID_GET(word) \
  6298. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6299. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6300. do { \
  6301. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6302. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6303. } while (0)
  6304. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6305. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6306. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6307. do { \
  6308. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6309. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6310. } while (0)
  6311. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6312. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6313. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6316. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6317. } while (0)
  6318. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6319. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6320. /*
  6321. * @brief target -> host rx pn check indication message
  6322. *
  6323. * @details
  6324. * The following field definitions describe the format of the Rx PN check
  6325. * indication message sent from the target to the host.
  6326. * The message consists of a 4-octet header, followed by the start and
  6327. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6328. * IE is one octet containing the sequence number that failed the PN
  6329. * check.
  6330. *
  6331. * |31 24|23 8|7 0|
  6332. * |--------------------------------------------------------------|
  6333. * | TID | peer ID | msg type |
  6334. * |--------------------------------------------------------------|
  6335. * | Reserved | PN IE count | seq num end | seq num start|
  6336. * |--------------------------------------------------------------|
  6337. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6338. * |--------------------------------------------------------------|
  6339. * First DWORD:
  6340. * - MSG_TYPE
  6341. * Bits 7:0
  6342. * Purpose: Identifies this as an rx pn check indication message
  6343. * Value: 0x2
  6344. * - PEER_ID
  6345. * Bits 23:8 (only bits 18:8 actually used)
  6346. * Purpose: identify which peer
  6347. * Value: (rx) peer ID
  6348. * - TID
  6349. * Bits 31:24 (only bits 27:24 actually used)
  6350. * Purpose: identify traffic identifier
  6351. * Value: traffic identifier
  6352. * Second DWORD:
  6353. * - SEQ_NUM_START
  6354. * Bits 7:0
  6355. * Purpose:
  6356. * Indicates the starting sequence number of the MPDU in this
  6357. * series of MPDUs that went though PN check.
  6358. * Value:
  6359. * The sequence number for the first MPDU in the sequence.
  6360. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6361. * - SEQ_NUM_END
  6362. * Bits 15:8
  6363. * Purpose:
  6364. * Indicates the ending sequence number of the MPDU in this
  6365. * series of MPDUs that went though PN check.
  6366. * Value:
  6367. * The sequence number one larger then the sequence number of the last
  6368. * MPDU being flushed.
  6369. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6370. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6371. * for invalid PN numbers and are ready to be released for further processing.
  6372. * Not all MPDUs within this range are necessarily valid - the host
  6373. * must check each sequence number within this range to see if the
  6374. * corresponding MPDU is actually present.
  6375. * - PN_IE_COUNT
  6376. * Bits 23:16
  6377. * Purpose:
  6378. * Used to determine the variable number of PN information elements in this
  6379. * message
  6380. *
  6381. * PN information elements:
  6382. * - PN_IE_x-
  6383. * Purpose:
  6384. * Each PN information element contains the sequence number of the MPDU that
  6385. * has failed the target PN check.
  6386. * Value:
  6387. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6388. * that failed the PN check.
  6389. */
  6390. /* first DWORD */
  6391. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6392. #define HTT_RX_PN_IND_PEER_ID_S 8
  6393. #define HTT_RX_PN_IND_TID_M 0xff000000
  6394. #define HTT_RX_PN_IND_TID_S 24
  6395. /* second DWORD */
  6396. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6397. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6398. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6399. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6400. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6401. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6402. #define HTT_RX_PN_IND_BYTES 8
  6403. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6406. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6407. } while (0)
  6408. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6409. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6410. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6413. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6414. } while (0)
  6415. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6416. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6417. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6418. do { \
  6419. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6420. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6421. } while (0)
  6422. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6423. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6424. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6427. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6428. } while (0)
  6429. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6430. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6431. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6434. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6435. } while (0)
  6436. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6437. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6438. /*
  6439. * @brief target -> host rx offload deliver message for LL system
  6440. *
  6441. * @details
  6442. * In a low latency system this message is sent whenever the offload
  6443. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6444. * The DMA of the actual packets into host memory is done before sending out
  6445. * this message. This message indicates only how many MSDUs to reap. The
  6446. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6447. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6448. * DMA'd by the MAC directly into host memory these packets do not contain
  6449. * the MAC descriptors in the header portion of the packet. Instead they contain
  6450. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6451. * message, the packets are delivered directly to the NW stack without going
  6452. * through the regular reorder buffering and PN checking path since it has
  6453. * already been done in target.
  6454. *
  6455. * |31 24|23 16|15 8|7 0|
  6456. * |-----------------------------------------------------------------------|
  6457. * | Total MSDU count | reserved | msg type |
  6458. * |-----------------------------------------------------------------------|
  6459. *
  6460. * @brief target -> host rx offload deliver message for HL system
  6461. *
  6462. * @details
  6463. * In a high latency system this message is sent whenever the offload manager
  6464. * flushes out the packets it has coalesced in its coalescing buffer. The
  6465. * actual packets are also carried along with this message. When the host
  6466. * receives this message, it is expected to deliver these packets to the NW
  6467. * stack directly instead of routing them through the reorder buffering and
  6468. * PN checking path since it has already been done in target.
  6469. *
  6470. * |31 24|23 16|15 8|7 0|
  6471. * |-----------------------------------------------------------------------|
  6472. * | Total MSDU count | reserved | msg type |
  6473. * |-----------------------------------------------------------------------|
  6474. * | peer ID | MSDU length |
  6475. * |-----------------------------------------------------------------------|
  6476. * | MSDU payload | FW Desc | tid | vdev ID |
  6477. * |-----------------------------------------------------------------------|
  6478. * | MSDU payload contd. |
  6479. * |-----------------------------------------------------------------------|
  6480. * | peer ID | MSDU length |
  6481. * |-----------------------------------------------------------------------|
  6482. * | MSDU payload | FW Desc | tid | vdev ID |
  6483. * |-----------------------------------------------------------------------|
  6484. * | MSDU payload contd. |
  6485. * |-----------------------------------------------------------------------|
  6486. *
  6487. */
  6488. /* first DWORD */
  6489. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6490. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6491. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6492. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6493. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6494. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6495. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6496. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6497. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6498. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6499. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6500. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6501. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6502. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6503. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6504. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6505. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6506. do { \
  6507. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6508. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6509. } while (0)
  6510. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6511. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6512. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6515. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6516. } while (0)
  6517. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6518. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6519. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6520. do { \
  6521. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6522. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6523. } while (0)
  6524. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6525. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6529. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6530. } while (0)
  6531. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6532. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6536. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6537. } while (0)
  6538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6539. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6543. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6544. } while (0)
  6545. /**
  6546. * @brief target -> host rx peer map/unmap message definition
  6547. *
  6548. * @details
  6549. * The following diagram shows the format of the rx peer map message sent
  6550. * from the target to the host. This layout assumes the target operates
  6551. * as little-endian.
  6552. *
  6553. * This message always contains a SW peer ID. The main purpose of the
  6554. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6555. * with, so that the host can use that peer ID to determine which peer
  6556. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6557. * other purposes, such as identifying during tx completions which peer
  6558. * the tx frames in question were transmitted to.
  6559. *
  6560. * In certain generations of chips, the peer map message also contains
  6561. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6562. * to identify which peer the frame needs to be forwarded to (i.e. the
  6563. * peer assocated with the Destination MAC Address within the packet),
  6564. * and particularly which vdev needs to transmit the frame (for cases
  6565. * of inter-vdev rx --> tx forwarding).
  6566. * This DA-based peer ID that is provided for certain rx frames
  6567. * (the rx frames that need to be re-transmitted as tx frames)
  6568. * is the ID that the HW uses for referring to the peer in question,
  6569. * rather than the peer ID that the SW+FW use to refer to the peer.
  6570. *
  6571. *
  6572. * |31 24|23 16|15 8|7 0|
  6573. * |-----------------------------------------------------------------------|
  6574. * | SW peer ID | VDEV ID | msg type |
  6575. * |-----------------------------------------------------------------------|
  6576. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6577. * |-----------------------------------------------------------------------|
  6578. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6579. * |-----------------------------------------------------------------------|
  6580. *
  6581. *
  6582. * The following diagram shows the format of the rx peer unmap message sent
  6583. * from the target to the host.
  6584. *
  6585. * |31 24|23 16|15 8|7 0|
  6586. * |-----------------------------------------------------------------------|
  6587. * | SW peer ID | VDEV ID | msg type |
  6588. * |-----------------------------------------------------------------------|
  6589. *
  6590. * The following field definitions describe the format of the rx peer map
  6591. * and peer unmap messages sent from the target to the host.
  6592. * - MSG_TYPE
  6593. * Bits 7:0
  6594. * Purpose: identifies this as an rx peer map or peer unmap message
  6595. * Value: peer map -> 0x3, peer unmap -> 0x4
  6596. * - VDEV_ID
  6597. * Bits 15:8
  6598. * Purpose: Indicates which virtual device the peer is associated
  6599. * with.
  6600. * Value: vdev ID (used in the host to look up the vdev object)
  6601. * - PEER_ID (a.k.a. SW_PEER_ID)
  6602. * Bits 31:16
  6603. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6604. * freeing (unmap)
  6605. * Value: (rx) peer ID
  6606. * - MAC_ADDR_L32 (peer map only)
  6607. * Bits 31:0
  6608. * Purpose: Identifies which peer node the peer ID is for.
  6609. * Value: lower 4 bytes of peer node's MAC address
  6610. * - MAC_ADDR_U16 (peer map only)
  6611. * Bits 15:0
  6612. * Purpose: Identifies which peer node the peer ID is for.
  6613. * Value: upper 2 bytes of peer node's MAC address
  6614. * - HW_PEER_ID
  6615. * Bits 31:16
  6616. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6617. * address, so for rx frames marked for rx --> tx forwarding, the
  6618. * host can determine from the HW peer ID provided as meta-data with
  6619. * the rx frame which peer the frame is supposed to be forwarded to.
  6620. * Value: ID used by the MAC HW to identify the peer
  6621. */
  6622. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6623. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6624. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6625. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6626. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6627. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6628. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6629. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6630. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6631. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6632. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6633. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6634. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6635. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6636. do { \
  6637. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6638. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6639. } while (0)
  6640. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6641. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6642. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6643. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6644. do { \
  6645. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6646. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6647. } while (0)
  6648. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6649. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6650. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6651. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6652. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6653. do { \
  6654. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6655. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6656. } while (0)
  6657. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6658. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6659. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6660. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6661. #define HTT_RX_PEER_MAP_BYTES 12
  6662. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6663. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6664. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6665. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6666. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6667. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6668. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6669. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6670. #define HTT_RX_PEER_UNMAP_BYTES 4
  6671. /**
  6672. * @brief target -> host rx peer map V2 message definition
  6673. *
  6674. * @details
  6675. * The following diagram shows the format of the rx peer map v2 message sent
  6676. * from the target to the host. This layout assumes the target operates
  6677. * as little-endian.
  6678. *
  6679. * This message always contains a SW peer ID. The main purpose of the
  6680. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6681. * with, so that the host can use that peer ID to determine which peer
  6682. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6683. * other purposes, such as identifying during tx completions which peer
  6684. * the tx frames in question were transmitted to.
  6685. *
  6686. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6687. * is used during rx --> tx frame forwarding to identify which peer the
  6688. * frame needs to be forwarded to (i.e. the peer assocated with the
  6689. * Destination MAC Address within the packet), and particularly which vdev
  6690. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6691. * This DA-based peer ID that is provided for certain rx frames
  6692. * (the rx frames that need to be re-transmitted as tx frames)
  6693. * is the ID that the HW uses for referring to the peer in question,
  6694. * rather than the peer ID that the SW+FW use to refer to the peer.
  6695. *
  6696. *
  6697. * |31 24|23 16|15 8|7 0|
  6698. * |-----------------------------------------------------------------------|
  6699. * | SW peer ID | VDEV ID | msg type |
  6700. * |-----------------------------------------------------------------------|
  6701. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6702. * |-----------------------------------------------------------------------|
  6703. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6704. * |-----------------------------------------------------------------------|
  6705. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6706. * |-----------------------------------------------------------------------|
  6707. * | Reserved_0 |
  6708. * |-----------------------------------------------------------------------|
  6709. * | Reserved_1 |
  6710. * |-----------------------------------------------------------------------|
  6711. * | Reserved_2 |
  6712. * |-----------------------------------------------------------------------|
  6713. * | Reserved_3 |
  6714. * |-----------------------------------------------------------------------|
  6715. *
  6716. *
  6717. * The following field definitions describe the format of the rx peer map v2
  6718. * messages sent from the target to the host.
  6719. * - MSG_TYPE
  6720. * Bits 7:0
  6721. * Purpose: identifies this as an rx peer map v2 message
  6722. * Value: peer map v2 -> 0x1e
  6723. * - VDEV_ID
  6724. * Bits 15:8
  6725. * Purpose: Indicates which virtual device the peer is associated with.
  6726. * Value: vdev ID (used in the host to look up the vdev object)
  6727. * - SW_PEER_ID
  6728. * Bits 31:16
  6729. * Purpose: The peer ID (index) that WAL is allocating
  6730. * Value: (rx) peer ID
  6731. * - MAC_ADDR_L32
  6732. * Bits 31:0
  6733. * Purpose: Identifies which peer node the peer ID is for.
  6734. * Value: lower 4 bytes of peer node's MAC address
  6735. * - MAC_ADDR_U16
  6736. * Bits 15:0
  6737. * Purpose: Identifies which peer node the peer ID is for.
  6738. * Value: upper 2 bytes of peer node's MAC address
  6739. * - HW_PEER_ID
  6740. * Bits 31:16
  6741. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6742. * address, so for rx frames marked for rx --> tx forwarding, the
  6743. * host can determine from the HW peer ID provided as meta-data with
  6744. * the rx frame which peer the frame is supposed to be forwarded to.
  6745. * Value: ID used by the MAC HW to identify the peer
  6746. * - AST_HASH_VALUE
  6747. * Bits 15:0
  6748. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6749. * override feature.
  6750. * - NEXT_HOP
  6751. * Bit 16
  6752. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6753. * (Wireless Distribution System).
  6754. */
  6755. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6756. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6757. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6758. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6759. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6760. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6761. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6762. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6763. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6764. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6765. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6766. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6767. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6768. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6769. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6770. do { \
  6771. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6772. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6773. } while (0)
  6774. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6775. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6776. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6777. do { \
  6778. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6779. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6780. } while (0)
  6781. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6782. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6783. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6784. do { \
  6785. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6786. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6787. } while (0)
  6788. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6789. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6790. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6793. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6794. } while (0)
  6795. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6796. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6797. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6800. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6801. } while (0)
  6802. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6803. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6804. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6805. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6806. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6807. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6808. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6809. /**
  6810. * @brief target -> host rx peer unmap V2 message definition
  6811. *
  6812. *
  6813. * The following diagram shows the format of the rx peer unmap message sent
  6814. * from the target to the host.
  6815. *
  6816. * |31 24|23 16|15 8|7 0|
  6817. * |-----------------------------------------------------------------------|
  6818. * | SW peer ID | VDEV ID | msg type |
  6819. * |-----------------------------------------------------------------------|
  6820. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6821. * |-----------------------------------------------------------------------|
  6822. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6823. * |-----------------------------------------------------------------------|
  6824. * | Peer Delete Duration |
  6825. * |-----------------------------------------------------------------------|
  6826. * | Reserved_0 |
  6827. * |-----------------------------------------------------------------------|
  6828. * | Reserved_1 |
  6829. * |-----------------------------------------------------------------------|
  6830. * | Reserved_2 |
  6831. * |-----------------------------------------------------------------------|
  6832. *
  6833. *
  6834. * The following field definitions describe the format of the rx peer unmap
  6835. * messages sent from the target to the host.
  6836. * - MSG_TYPE
  6837. * Bits 7:0
  6838. * Purpose: identifies this as an rx peer unmap v2 message
  6839. * Value: peer unmap v2 -> 0x1f
  6840. * - VDEV_ID
  6841. * Bits 15:8
  6842. * Purpose: Indicates which virtual device the peer is associated
  6843. * with.
  6844. * Value: vdev ID (used in the host to look up the vdev object)
  6845. * - SW_PEER_ID
  6846. * Bits 31:16
  6847. * Purpose: The peer ID (index) that WAL is freeing
  6848. * Value: (rx) peer ID
  6849. * - MAC_ADDR_L32
  6850. * Bits 31:0
  6851. * Purpose: Identifies which peer node the peer ID is for.
  6852. * Value: lower 4 bytes of peer node's MAC address
  6853. * - MAC_ADDR_U16
  6854. * Bits 15:0
  6855. * Purpose: Identifies which peer node the peer ID is for.
  6856. * Value: upper 2 bytes of peer node's MAC address
  6857. * - NEXT_HOP
  6858. * Bits 16
  6859. * Purpose: Bit indicates next_hop AST entry used for WDS
  6860. * (Wireless Distribution System).
  6861. * - PEER_DELETE_DURATION
  6862. * Bits 31:0
  6863. * Purpose: Time taken to delete peer, in msec,
  6864. * Used for monitoring / debugging PEER delete response delay
  6865. */
  6866. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6867. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6868. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6869. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6870. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6871. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6872. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6873. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6874. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6875. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6876. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6877. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6878. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6879. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6880. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6881. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6882. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6883. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6884. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6885. do { \
  6886. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6887. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6888. } while (0)
  6889. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6890. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6891. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6892. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6893. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6894. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6895. /**
  6896. * @brief target -> host message specifying security parameters
  6897. *
  6898. * @details
  6899. * The following diagram shows the format of the security specification
  6900. * message sent from the target to the host.
  6901. * This security specification message tells the host whether a PN check is
  6902. * necessary on rx data frames, and if so, how large the PN counter is.
  6903. * This message also tells the host about the security processing to apply
  6904. * to defragmented rx frames - specifically, whether a Message Integrity
  6905. * Check is required, and the Michael key to use.
  6906. *
  6907. * |31 24|23 16|15|14 8|7 0|
  6908. * |-----------------------------------------------------------------------|
  6909. * | peer ID | U| security type | msg type |
  6910. * |-----------------------------------------------------------------------|
  6911. * | Michael Key K0 |
  6912. * |-----------------------------------------------------------------------|
  6913. * | Michael Key K1 |
  6914. * |-----------------------------------------------------------------------|
  6915. * | WAPI RSC Low0 |
  6916. * |-----------------------------------------------------------------------|
  6917. * | WAPI RSC Low1 |
  6918. * |-----------------------------------------------------------------------|
  6919. * | WAPI RSC Hi0 |
  6920. * |-----------------------------------------------------------------------|
  6921. * | WAPI RSC Hi1 |
  6922. * |-----------------------------------------------------------------------|
  6923. *
  6924. * The following field definitions describe the format of the security
  6925. * indication message sent from the target to the host.
  6926. * - MSG_TYPE
  6927. * Bits 7:0
  6928. * Purpose: identifies this as a security specification message
  6929. * Value: 0xb
  6930. * - SEC_TYPE
  6931. * Bits 14:8
  6932. * Purpose: specifies which type of security applies to the peer
  6933. * Value: htt_sec_type enum value
  6934. * - UNICAST
  6935. * Bit 15
  6936. * Purpose: whether this security is applied to unicast or multicast data
  6937. * Value: 1 -> unicast, 0 -> multicast
  6938. * - PEER_ID
  6939. * Bits 31:16
  6940. * Purpose: The ID number for the peer the security specification is for
  6941. * Value: peer ID
  6942. * - MICHAEL_KEY_K0
  6943. * Bits 31:0
  6944. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6945. * Value: Michael Key K0 (if security type is TKIP)
  6946. * - MICHAEL_KEY_K1
  6947. * Bits 31:0
  6948. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6949. * Value: Michael Key K1 (if security type is TKIP)
  6950. * - WAPI_RSC_LOW0
  6951. * Bits 31:0
  6952. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6953. * Value: WAPI RSC Low0 (if security type is WAPI)
  6954. * - WAPI_RSC_LOW1
  6955. * Bits 31:0
  6956. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6957. * Value: WAPI RSC Low1 (if security type is WAPI)
  6958. * - WAPI_RSC_HI0
  6959. * Bits 31:0
  6960. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6961. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6962. * - WAPI_RSC_HI1
  6963. * Bits 31:0
  6964. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6965. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6966. */
  6967. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6968. #define HTT_SEC_IND_SEC_TYPE_S 8
  6969. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6970. #define HTT_SEC_IND_UNICAST_S 15
  6971. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6972. #define HTT_SEC_IND_PEER_ID_S 16
  6973. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6974. do { \
  6975. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6976. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6977. } while (0)
  6978. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6979. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6980. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6981. do { \
  6982. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6983. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6984. } while (0)
  6985. #define HTT_SEC_IND_UNICAST_GET(word) \
  6986. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6987. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6988. do { \
  6989. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6990. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6991. } while (0)
  6992. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6993. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6994. #define HTT_SEC_IND_BYTES 28
  6995. /**
  6996. * @brief target -> host rx ADDBA / DELBA message definitions
  6997. *
  6998. * @details
  6999. * The following diagram shows the format of the rx ADDBA message sent
  7000. * from the target to the host:
  7001. *
  7002. * |31 20|19 16|15 8|7 0|
  7003. * |---------------------------------------------------------------------|
  7004. * | peer ID | TID | window size | msg type |
  7005. * |---------------------------------------------------------------------|
  7006. *
  7007. * The following diagram shows the format of the rx DELBA message sent
  7008. * from the target to the host:
  7009. *
  7010. * |31 20|19 16|15 8|7 0|
  7011. * |---------------------------------------------------------------------|
  7012. * | peer ID | TID | reserved | msg type |
  7013. * |---------------------------------------------------------------------|
  7014. *
  7015. * The following field definitions describe the format of the rx ADDBA
  7016. * and DELBA messages sent from the target to the host.
  7017. * - MSG_TYPE
  7018. * Bits 7:0
  7019. * Purpose: identifies this as an rx ADDBA or DELBA message
  7020. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7021. * - WIN_SIZE
  7022. * Bits 15:8 (ADDBA only)
  7023. * Purpose: Specifies the length of the block ack window (max = 64).
  7024. * Value:
  7025. * block ack window length specified by the received ADDBA
  7026. * management message.
  7027. * - TID
  7028. * Bits 19:16
  7029. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7030. * Value:
  7031. * TID specified by the received ADDBA or DELBA management message.
  7032. * - PEER_ID
  7033. * Bits 31:20
  7034. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7035. * Value:
  7036. * ID (hash value) used by the host for fast, direct lookup of
  7037. * host SW peer info, including rx reorder states.
  7038. */
  7039. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7040. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7041. #define HTT_RX_ADDBA_TID_M 0xf0000
  7042. #define HTT_RX_ADDBA_TID_S 16
  7043. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7044. #define HTT_RX_ADDBA_PEER_ID_S 20
  7045. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7046. do { \
  7047. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7048. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7049. } while (0)
  7050. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7051. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7052. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7053. do { \
  7054. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7055. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7056. } while (0)
  7057. #define HTT_RX_ADDBA_TID_GET(word) \
  7058. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7059. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7060. do { \
  7061. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7062. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7063. } while (0)
  7064. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7065. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7066. #define HTT_RX_ADDBA_BYTES 4
  7067. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7068. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7069. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7070. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7071. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7072. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7073. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7074. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7075. #define HTT_RX_DELBA_BYTES 4
  7076. /**
  7077. * @brief tx queue group information element definition
  7078. *
  7079. * @details
  7080. * The following diagram shows the format of the tx queue group
  7081. * information element, which can be included in target --> host
  7082. * messages to specify the number of tx "credits" (tx descriptors
  7083. * for LL, or tx buffers for HL) available to a particular group
  7084. * of host-side tx queues, and which host-side tx queues belong to
  7085. * the group.
  7086. *
  7087. * |31|30 24|23 16|15|14|13 0|
  7088. * |------------------------------------------------------------------------|
  7089. * | X| reserved | tx queue grp ID | A| S| credit count |
  7090. * |------------------------------------------------------------------------|
  7091. * | vdev ID mask | AC mask |
  7092. * |------------------------------------------------------------------------|
  7093. *
  7094. * The following definitions describe the fields within the tx queue group
  7095. * information element:
  7096. * - credit_count
  7097. * Bits 13:1
  7098. * Purpose: specify how many tx credits are available to the tx queue group
  7099. * Value: An absolute or relative, positive or negative credit value
  7100. * The 'A' bit specifies whether the value is absolute or relative.
  7101. * The 'S' bit specifies whether the value is positive or negative.
  7102. * A negative value can only be relative, not absolute.
  7103. * An absolute value replaces any prior credit value the host has for
  7104. * the tx queue group in question.
  7105. * A relative value is added to the prior credit value the host has for
  7106. * the tx queue group in question.
  7107. * - sign
  7108. * Bit 14
  7109. * Purpose: specify whether the credit count is positive or negative
  7110. * Value: 0 -> positive, 1 -> negative
  7111. * - absolute
  7112. * Bit 15
  7113. * Purpose: specify whether the credit count is absolute or relative
  7114. * Value: 0 -> relative, 1 -> absolute
  7115. * - txq_group_id
  7116. * Bits 23:16
  7117. * Purpose: indicate which tx queue group's credit and/or membership are
  7118. * being specified
  7119. * Value: 0 to max_tx_queue_groups-1
  7120. * - reserved
  7121. * Bits 30:16
  7122. * Value: 0x0
  7123. * - eXtension
  7124. * Bit 31
  7125. * Purpose: specify whether another tx queue group info element follows
  7126. * Value: 0 -> no more tx queue group information elements
  7127. * 1 -> another tx queue group information element immediately follows
  7128. * - ac_mask
  7129. * Bits 15:0
  7130. * Purpose: specify which Access Categories belong to the tx queue group
  7131. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7132. * the tx queue group.
  7133. * The AC bit-mask values are obtained by left-shifting by the
  7134. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7135. * - vdev_id_mask
  7136. * Bits 31:16
  7137. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7138. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7139. * belong to the tx queue group.
  7140. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7141. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7142. */
  7143. PREPACK struct htt_txq_group {
  7144. A_UINT32
  7145. credit_count: 14,
  7146. sign: 1,
  7147. absolute: 1,
  7148. tx_queue_group_id: 8,
  7149. reserved0: 7,
  7150. extension: 1;
  7151. A_UINT32
  7152. ac_mask: 16,
  7153. vdev_id_mask: 16;
  7154. } POSTPACK;
  7155. /* first word */
  7156. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7157. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7158. #define HTT_TXQ_GROUP_SIGN_S 14
  7159. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7160. #define HTT_TXQ_GROUP_ABS_S 15
  7161. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7162. #define HTT_TXQ_GROUP_ID_S 16
  7163. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7164. #define HTT_TXQ_GROUP_EXT_S 31
  7165. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7166. /* second word */
  7167. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7168. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7169. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7170. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7171. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7172. do { \
  7173. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7174. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7175. } while (0)
  7176. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7177. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7178. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7179. do { \
  7180. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7181. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7182. } while (0)
  7183. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7184. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7185. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7186. do { \
  7187. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7188. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7189. } while (0)
  7190. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7191. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7192. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7193. do { \
  7194. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7195. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7196. } while (0)
  7197. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7198. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7199. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7200. do { \
  7201. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7202. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7203. } while (0)
  7204. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7205. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7206. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7207. do { \
  7208. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7209. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7210. } while (0)
  7211. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7212. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7213. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7216. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7217. } while (0)
  7218. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7219. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7220. /**
  7221. * @brief target -> host TX completion indication message definition
  7222. *
  7223. * @details
  7224. * The following diagram shows the format of the TX completion indication sent
  7225. * from the target to the host
  7226. *
  7227. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7228. * |------------------------------------------------------------|
  7229. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7230. * |------------------------------------------------------------|
  7231. * payload: | MSDU1 ID | MSDU0 ID |
  7232. * |------------------------------------------------------------|
  7233. * : MSDU3 ID : MSDU2 ID :
  7234. * |------------------------------------------------------------|
  7235. * | struct htt_tx_compl_ind_append_retries |
  7236. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7237. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7238. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7239. * Where:
  7240. * A0 = append (a.k.a. append0)
  7241. * A1 = append1
  7242. * TP = MSDU tx power presence
  7243. *
  7244. * The following field definitions describe the format of the TX completion
  7245. * indication sent from the target to the host
  7246. * Header fields:
  7247. * - msg_type
  7248. * Bits 7:0
  7249. * Purpose: identifies this as HTT TX completion indication
  7250. * Value: 0x7
  7251. * - status
  7252. * Bits 10:8
  7253. * Purpose: the TX completion status of payload fragmentations descriptors
  7254. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7255. * - tid
  7256. * Bits 14:11
  7257. * Purpose: the tid associated with those fragmentation descriptors. It is
  7258. * valid or not, depending on the tid_invalid bit.
  7259. * Value: 0 to 15
  7260. * - tid_invalid
  7261. * Bits 15:15
  7262. * Purpose: this bit indicates whether the tid field is valid or not
  7263. * Value: 0 indicates valid; 1 indicates invalid
  7264. * - num
  7265. * Bits 23:16
  7266. * Purpose: the number of payload in this indication
  7267. * Value: 1 to 255
  7268. * - append (a.k.a. append0)
  7269. * Bits 24:24
  7270. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7271. * the number of tx retries for one MSDU at the end of this message
  7272. * Value: 0 indicates no appending; 1 indicates appending
  7273. * - append1
  7274. * Bits 25:25
  7275. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7276. * contains the timestamp info for each TX msdu id in payload.
  7277. * The order of the timestamps matches the order of the MSDU IDs.
  7278. * Note that a big-endian host needs to account for the reordering
  7279. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7280. * conversion) when determining which tx timestamp corresponds to
  7281. * which MSDU ID.
  7282. * Value: 0 indicates no appending; 1 indicates appending
  7283. * - msdu_tx_power_presence
  7284. * Bits 26:26
  7285. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7286. * for each MSDU referenced by the TX_COMPL_IND message.
  7287. * The tx power is reported in 0.5 dBm units.
  7288. * The order of the per-MSDU tx power reports matches the order
  7289. * of the MSDU IDs.
  7290. * Note that a big-endian host needs to account for the reordering
  7291. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7292. * conversion) when determining which Tx Power corresponds to
  7293. * which MSDU ID.
  7294. * Value: 0 indicates MSDU tx power reports are not appended,
  7295. * 1 indicates MSDU tx power reports are appended
  7296. * Payload fields:
  7297. * - hmsdu_id
  7298. * Bits 15:0
  7299. * Purpose: this ID is used to track the Tx buffer in host
  7300. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7301. */
  7302. #define HTT_TX_COMPL_IND_STATUS_S 8
  7303. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7304. #define HTT_TX_COMPL_IND_TID_S 11
  7305. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7306. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7307. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7308. #define HTT_TX_COMPL_IND_NUM_S 16
  7309. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7310. #define HTT_TX_COMPL_IND_APPEND_S 24
  7311. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7312. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7313. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7314. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7315. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7316. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7317. do { \
  7318. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7319. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7320. } while (0)
  7321. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7322. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7323. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7324. do { \
  7325. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7326. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7327. } while (0)
  7328. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7329. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7330. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7331. do { \
  7332. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7333. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7334. } while (0)
  7335. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7336. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7337. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7338. do { \
  7339. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7340. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7341. } while (0)
  7342. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7343. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7344. HTT_TX_COMPL_IND_TID_INV_S)
  7345. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7346. do { \
  7347. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7348. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7349. } while (0)
  7350. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7351. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7352. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7353. do { \
  7354. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7355. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7356. } while (0)
  7357. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7358. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7359. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7362. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7363. } while (0)
  7364. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7365. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7366. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7367. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7368. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7369. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7370. #define HTT_TX_COMPL_IND_STAT_OK 0
  7371. /* DISCARD:
  7372. * current meaning:
  7373. * MSDUs were queued for transmission but filtered by HW or SW
  7374. * without any over the air attempts
  7375. * legacy meaning (HL Rome):
  7376. * MSDUs were discarded by the target FW without any over the air
  7377. * attempts due to lack of space
  7378. */
  7379. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7380. /* NO_ACK:
  7381. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7382. */
  7383. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7384. /* POSTPONE:
  7385. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7386. * be downloaded again later (in the appropriate order), when they are
  7387. * deliverable.
  7388. */
  7389. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7390. /*
  7391. * The PEER_DEL tx completion status is used for HL cases
  7392. * where the peer the frame is for has been deleted.
  7393. * The host has already discarded its copy of the frame, but
  7394. * it still needs the tx completion to restore its credit.
  7395. */
  7396. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7397. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7398. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7399. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7400. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7401. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7402. PREPACK struct htt_tx_compl_ind_base {
  7403. A_UINT32 hdr;
  7404. A_UINT16 payload[1/*or more*/];
  7405. } POSTPACK;
  7406. PREPACK struct htt_tx_compl_ind_append_retries {
  7407. A_UINT16 msdu_id;
  7408. A_UINT8 tx_retries;
  7409. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7410. 0: this is the last append_retries struct */
  7411. } POSTPACK;
  7412. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7413. A_UINT32 timestamp[1/*or more*/];
  7414. } POSTPACK;
  7415. /**
  7416. * @brief target -> host rate-control update indication message
  7417. *
  7418. * @details
  7419. * The following diagram shows the format of the RC Update message
  7420. * sent from the target to the host, while processing the tx-completion
  7421. * of a transmitted PPDU.
  7422. *
  7423. * |31 24|23 16|15 8|7 0|
  7424. * |-------------------------------------------------------------|
  7425. * | peer ID | vdev ID | msg_type |
  7426. * |-------------------------------------------------------------|
  7427. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7428. * |-------------------------------------------------------------|
  7429. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7430. * |-------------------------------------------------------------|
  7431. * | : |
  7432. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7433. * | : |
  7434. * |-------------------------------------------------------------|
  7435. * | : |
  7436. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7437. * | : |
  7438. * |-------------------------------------------------------------|
  7439. * : :
  7440. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7441. *
  7442. */
  7443. typedef struct {
  7444. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7445. A_UINT32 rate_code_flags;
  7446. A_UINT32 flags; /* Encodes information such as excessive
  7447. retransmission, aggregate, some info
  7448. from .11 frame control,
  7449. STBC, LDPC, (SGI and Tx Chain Mask
  7450. are encoded in ptx_rc->flags field),
  7451. AMPDU truncation (BT/time based etc.),
  7452. RTS/CTS attempt */
  7453. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7454. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7455. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7456. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7457. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7458. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7459. } HTT_RC_TX_DONE_PARAMS;
  7460. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7461. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7462. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7463. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7464. #define HTT_RC_UPDATE_VDEVID_S 8
  7465. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7466. #define HTT_RC_UPDATE_PEERID_S 16
  7467. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7468. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7469. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7470. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7471. do { \
  7472. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7473. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7474. } while (0)
  7475. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7476. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7477. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7478. do { \
  7479. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7480. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7481. } while (0)
  7482. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7483. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7484. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7485. do { \
  7486. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7487. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7488. } while (0)
  7489. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7490. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7491. /**
  7492. * @brief target -> host rx fragment indication message definition
  7493. *
  7494. * @details
  7495. * The following field definitions describe the format of the rx fragment
  7496. * indication message sent from the target to the host.
  7497. * The rx fragment indication message shares the format of the
  7498. * rx indication message, but not all fields from the rx indication message
  7499. * are relevant to the rx fragment indication message.
  7500. *
  7501. *
  7502. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7503. * |-----------+-------------------+---------------------+-------------|
  7504. * | peer ID | |FV| ext TID | msg type |
  7505. * |-------------------------------------------------------------------|
  7506. * | | flush | flush |
  7507. * | | end | start |
  7508. * | | seq num | seq num |
  7509. * |-------------------------------------------------------------------|
  7510. * | reserved | FW rx desc bytes |
  7511. * |-------------------------------------------------------------------|
  7512. * | | FW MSDU Rx |
  7513. * | | desc B0 |
  7514. * |-------------------------------------------------------------------|
  7515. * Header fields:
  7516. * - MSG_TYPE
  7517. * Bits 7:0
  7518. * Purpose: identifies this as an rx fragment indication message
  7519. * Value: 0xa
  7520. * - EXT_TID
  7521. * Bits 12:8
  7522. * Purpose: identify the traffic ID of the rx data, including
  7523. * special "extended" TID values for multicast, broadcast, and
  7524. * non-QoS data frames
  7525. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7526. * - FLUSH_VALID (FV)
  7527. * Bit 13
  7528. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7529. * is valid
  7530. * Value:
  7531. * 1 -> flush IE is valid and needs to be processed
  7532. * 0 -> flush IE is not valid and should be ignored
  7533. * - PEER_ID
  7534. * Bits 31:16
  7535. * Purpose: Identify, by ID, which peer sent the rx data
  7536. * Value: ID of the peer who sent the rx data
  7537. * - FLUSH_SEQ_NUM_START
  7538. * Bits 5:0
  7539. * Purpose: Indicate the start of a series of MPDUs to flush
  7540. * Not all MPDUs within this series are necessarily valid - the host
  7541. * must check each sequence number within this range to see if the
  7542. * corresponding MPDU is actually present.
  7543. * This field is only valid if the FV bit is set.
  7544. * Value:
  7545. * The sequence number for the first MPDUs to check to flush.
  7546. * The sequence number is masked by 0x3f.
  7547. * - FLUSH_SEQ_NUM_END
  7548. * Bits 11:6
  7549. * Purpose: Indicate the end of a series of MPDUs to flush
  7550. * Value:
  7551. * The sequence number one larger than the sequence number of the
  7552. * last MPDU to check to flush.
  7553. * The sequence number is masked by 0x3f.
  7554. * Not all MPDUs within this series are necessarily valid - the host
  7555. * must check each sequence number within this range to see if the
  7556. * corresponding MPDU is actually present.
  7557. * This field is only valid if the FV bit is set.
  7558. * Rx descriptor fields:
  7559. * - FW_RX_DESC_BYTES
  7560. * Bits 15:0
  7561. * Purpose: Indicate how many bytes in the Rx indication are used for
  7562. * FW Rx descriptors
  7563. * Value: 1
  7564. */
  7565. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7566. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7567. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7568. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7569. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7570. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7571. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7572. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7573. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7574. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7575. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7576. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7577. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7578. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7579. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7580. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7581. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7582. #define HTT_RX_FRAG_IND_BYTES \
  7583. (4 /* msg hdr */ + \
  7584. 4 /* flush spec */ + \
  7585. 4 /* (unused) FW rx desc bytes spec */ + \
  7586. 4 /* FW rx desc */)
  7587. /**
  7588. * @brief target -> host test message definition
  7589. *
  7590. * @details
  7591. * The following field definitions describe the format of the test
  7592. * message sent from the target to the host.
  7593. * The message consists of a 4-octet header, followed by a variable
  7594. * number of 32-bit integer values, followed by a variable number
  7595. * of 8-bit character values.
  7596. *
  7597. * |31 16|15 8|7 0|
  7598. * |-----------------------------------------------------------|
  7599. * | num chars | num ints | msg type |
  7600. * |-----------------------------------------------------------|
  7601. * | int 0 |
  7602. * |-----------------------------------------------------------|
  7603. * | int 1 |
  7604. * |-----------------------------------------------------------|
  7605. * | ... |
  7606. * |-----------------------------------------------------------|
  7607. * | char 3 | char 2 | char 1 | char 0 |
  7608. * |-----------------------------------------------------------|
  7609. * | | | ... | char 4 |
  7610. * |-----------------------------------------------------------|
  7611. * - MSG_TYPE
  7612. * Bits 7:0
  7613. * Purpose: identifies this as a test message
  7614. * Value: HTT_MSG_TYPE_TEST
  7615. * - NUM_INTS
  7616. * Bits 15:8
  7617. * Purpose: indicate how many 32-bit integers follow the message header
  7618. * - NUM_CHARS
  7619. * Bits 31:16
  7620. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7621. */
  7622. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7623. #define HTT_RX_TEST_NUM_INTS_S 8
  7624. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7625. #define HTT_RX_TEST_NUM_CHARS_S 16
  7626. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7627. do { \
  7628. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7629. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7630. } while (0)
  7631. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7632. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7633. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7634. do { \
  7635. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7636. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7637. } while (0)
  7638. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7639. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7640. /**
  7641. * @brief target -> host packet log message
  7642. *
  7643. * @details
  7644. * The following field definitions describe the format of the packet log
  7645. * message sent from the target to the host.
  7646. * The message consists of a 4-octet header,followed by a variable number
  7647. * of 32-bit character values.
  7648. *
  7649. * |31 16|15 12|11 10|9 8|7 0|
  7650. * |------------------------------------------------------------------|
  7651. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7652. * |------------------------------------------------------------------|
  7653. * | payload |
  7654. * |------------------------------------------------------------------|
  7655. * - MSG_TYPE
  7656. * Bits 7:0
  7657. * Purpose: identifies this as a pktlog message
  7658. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7659. * - mac_id
  7660. * Bits 9:8
  7661. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7662. * Value: 0-3
  7663. * - pdev_id
  7664. * Bits 11:10
  7665. * Purpose: pdev_id
  7666. * Value: 0-3
  7667. * 0 (for rings at SOC level),
  7668. * 1/2/3 PDEV -> 0/1/2
  7669. * - payload_size
  7670. * Bits 31:16
  7671. * Purpose: explicitly specify the payload size
  7672. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7673. */
  7674. PREPACK struct htt_pktlog_msg {
  7675. A_UINT32 header;
  7676. A_UINT32 payload[1/* or more */];
  7677. } POSTPACK;
  7678. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7679. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7680. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7681. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7682. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7683. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7684. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7687. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7688. } while (0)
  7689. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7690. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7691. HTT_T2H_PKTLOG_MAC_ID_S)
  7692. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7695. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7696. } while (0)
  7697. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7698. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7699. HTT_T2H_PKTLOG_PDEV_ID_S)
  7700. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7701. do { \
  7702. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7703. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7704. } while (0)
  7705. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7706. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7707. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7708. /*
  7709. * Rx reorder statistics
  7710. * NB: all the fields must be defined in 4 octets size.
  7711. */
  7712. struct rx_reorder_stats {
  7713. /* Non QoS MPDUs received */
  7714. A_UINT32 deliver_non_qos;
  7715. /* MPDUs received in-order */
  7716. A_UINT32 deliver_in_order;
  7717. /* Flush due to reorder timer expired */
  7718. A_UINT32 deliver_flush_timeout;
  7719. /* Flush due to move out of window */
  7720. A_UINT32 deliver_flush_oow;
  7721. /* Flush due to DELBA */
  7722. A_UINT32 deliver_flush_delba;
  7723. /* MPDUs dropped due to FCS error */
  7724. A_UINT32 fcs_error;
  7725. /* MPDUs dropped due to monitor mode non-data packet */
  7726. A_UINT32 mgmt_ctrl;
  7727. /* Unicast-data MPDUs dropped due to invalid peer */
  7728. A_UINT32 invalid_peer;
  7729. /* MPDUs dropped due to duplication (non aggregation) */
  7730. A_UINT32 dup_non_aggr;
  7731. /* MPDUs dropped due to processed before */
  7732. A_UINT32 dup_past;
  7733. /* MPDUs dropped due to duplicate in reorder queue */
  7734. A_UINT32 dup_in_reorder;
  7735. /* Reorder timeout happened */
  7736. A_UINT32 reorder_timeout;
  7737. /* invalid bar ssn */
  7738. A_UINT32 invalid_bar_ssn;
  7739. /* reorder reset due to bar ssn */
  7740. A_UINT32 ssn_reset;
  7741. /* Flush due to delete peer */
  7742. A_UINT32 deliver_flush_delpeer;
  7743. /* Flush due to offload*/
  7744. A_UINT32 deliver_flush_offload;
  7745. /* Flush due to out of buffer*/
  7746. A_UINT32 deliver_flush_oob;
  7747. /* MPDUs dropped due to PN check fail */
  7748. A_UINT32 pn_fail;
  7749. /* MPDUs dropped due to unable to allocate memory */
  7750. A_UINT32 store_fail;
  7751. /* Number of times the tid pool alloc succeeded */
  7752. A_UINT32 tid_pool_alloc_succ;
  7753. /* Number of times the MPDU pool alloc succeeded */
  7754. A_UINT32 mpdu_pool_alloc_succ;
  7755. /* Number of times the MSDU pool alloc succeeded */
  7756. A_UINT32 msdu_pool_alloc_succ;
  7757. /* Number of times the tid pool alloc failed */
  7758. A_UINT32 tid_pool_alloc_fail;
  7759. /* Number of times the MPDU pool alloc failed */
  7760. A_UINT32 mpdu_pool_alloc_fail;
  7761. /* Number of times the MSDU pool alloc failed */
  7762. A_UINT32 msdu_pool_alloc_fail;
  7763. /* Number of times the tid pool freed */
  7764. A_UINT32 tid_pool_free;
  7765. /* Number of times the MPDU pool freed */
  7766. A_UINT32 mpdu_pool_free;
  7767. /* Number of times the MSDU pool freed */
  7768. A_UINT32 msdu_pool_free;
  7769. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7770. A_UINT32 msdu_queued;
  7771. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7772. A_UINT32 msdu_recycled;
  7773. /* Number of MPDUs with invalid peer but A2 found in AST */
  7774. A_UINT32 invalid_peer_a2_in_ast;
  7775. /* Number of MPDUs with invalid peer but A3 found in AST */
  7776. A_UINT32 invalid_peer_a3_in_ast;
  7777. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7778. A_UINT32 invalid_peer_bmc_mpdus;
  7779. /* Number of MSDUs with err attention word */
  7780. A_UINT32 rxdesc_err_att;
  7781. /* Number of MSDUs with flag of peer_idx_invalid */
  7782. A_UINT32 rxdesc_err_peer_idx_inv;
  7783. /* Number of MSDUs with flag of peer_idx_timeout */
  7784. A_UINT32 rxdesc_err_peer_idx_to;
  7785. /* Number of MSDUs with flag of overflow */
  7786. A_UINT32 rxdesc_err_ov;
  7787. /* Number of MSDUs with flag of msdu_length_err */
  7788. A_UINT32 rxdesc_err_msdu_len;
  7789. /* Number of MSDUs with flag of mpdu_length_err */
  7790. A_UINT32 rxdesc_err_mpdu_len;
  7791. /* Number of MSDUs with flag of tkip_mic_err */
  7792. A_UINT32 rxdesc_err_tkip_mic;
  7793. /* Number of MSDUs with flag of decrypt_err */
  7794. A_UINT32 rxdesc_err_decrypt;
  7795. /* Number of MSDUs with flag of fcs_err */
  7796. A_UINT32 rxdesc_err_fcs;
  7797. /* Number of Unicast (bc_mc bit is not set in attention word)
  7798. * frames with invalid peer handler
  7799. */
  7800. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7801. /* Number of unicast frame directly (direct bit is set in attention word)
  7802. * to DUT with invalid peer handler
  7803. */
  7804. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7805. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7806. * frames with invalid peer handler
  7807. */
  7808. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7809. /* Number of MSDUs dropped due to no first MSDU flag */
  7810. A_UINT32 rxdesc_no_1st_msdu;
  7811. /* Number of MSDUs droped due to ring overflow */
  7812. A_UINT32 msdu_drop_ring_ov;
  7813. /* Number of MSDUs dropped due to FC mismatch */
  7814. A_UINT32 msdu_drop_fc_mismatch;
  7815. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7816. A_UINT32 msdu_drop_mgmt_remote_ring;
  7817. /* Number of MSDUs dropped due to errors not reported in attention word */
  7818. A_UINT32 msdu_drop_misc;
  7819. /* Number of MSDUs go to offload before reorder */
  7820. A_UINT32 offload_msdu_wal;
  7821. /* Number of data frame dropped by offload after reorder */
  7822. A_UINT32 offload_msdu_reorder;
  7823. /* Number of MPDUs with sequence number in the past and within the BA window */
  7824. A_UINT32 dup_past_within_window;
  7825. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7826. A_UINT32 dup_past_outside_window;
  7827. /* Number of MSDUs with decrypt/MIC error */
  7828. A_UINT32 rxdesc_err_decrypt_mic;
  7829. /* Number of data MSDUs received on both local and remote rings */
  7830. A_UINT32 data_msdus_on_both_rings;
  7831. /* MPDUs never filled */
  7832. A_UINT32 holes_not_filled;
  7833. };
  7834. /*
  7835. * Rx Remote buffer statistics
  7836. * NB: all the fields must be defined in 4 octets size.
  7837. */
  7838. struct rx_remote_buffer_mgmt_stats {
  7839. /* Total number of MSDUs reaped for Rx processing */
  7840. A_UINT32 remote_reaped;
  7841. /* MSDUs recycled within firmware */
  7842. A_UINT32 remote_recycled;
  7843. /* MSDUs stored by Data Rx */
  7844. A_UINT32 data_rx_msdus_stored;
  7845. /* Number of HTT indications from WAL Rx MSDU */
  7846. A_UINT32 wal_rx_ind;
  7847. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7848. A_UINT32 wal_rx_ind_unconsumed;
  7849. /* Number of HTT indications from Data Rx MSDU */
  7850. A_UINT32 data_rx_ind;
  7851. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7852. A_UINT32 data_rx_ind_unconsumed;
  7853. /* Number of HTT indications from ATHBUF */
  7854. A_UINT32 athbuf_rx_ind;
  7855. /* Number of remote buffers requested for refill */
  7856. A_UINT32 refill_buf_req;
  7857. /* Number of remote buffers filled by the host */
  7858. A_UINT32 refill_buf_rsp;
  7859. /* Number of times MAC hw_index = f/w write_index */
  7860. A_INT32 mac_no_bufs;
  7861. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7862. A_INT32 fw_indices_equal;
  7863. /* Number of times f/w finds no buffers to post */
  7864. A_INT32 host_no_bufs;
  7865. };
  7866. /*
  7867. * TXBF MU/SU packets and NDPA statistics
  7868. * NB: all the fields must be defined in 4 octets size.
  7869. */
  7870. struct rx_txbf_musu_ndpa_pkts_stats {
  7871. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7872. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7873. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7874. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7875. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7876. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7877. };
  7878. /*
  7879. * htt_dbg_stats_status -
  7880. * present - The requested stats have been delivered in full.
  7881. * This indicates that either the stats information was contained
  7882. * in its entirety within this message, or else this message
  7883. * completes the delivery of the requested stats info that was
  7884. * partially delivered through earlier STATS_CONF messages.
  7885. * partial - The requested stats have been delivered in part.
  7886. * One or more subsequent STATS_CONF messages with the same
  7887. * cookie value will be sent to deliver the remainder of the
  7888. * information.
  7889. * error - The requested stats could not be delivered, for example due
  7890. * to a shortage of memory to construct a message holding the
  7891. * requested stats.
  7892. * invalid - The requested stat type is either not recognized, or the
  7893. * target is configured to not gather the stats type in question.
  7894. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7895. * series_done - This special value indicates that no further stats info
  7896. * elements are present within a series of stats info elems
  7897. * (within a stats upload confirmation message).
  7898. */
  7899. enum htt_dbg_stats_status {
  7900. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7901. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7902. HTT_DBG_STATS_STATUS_ERROR = 2,
  7903. HTT_DBG_STATS_STATUS_INVALID = 3,
  7904. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7905. };
  7906. /**
  7907. * @brief target -> host statistics upload
  7908. *
  7909. * @details
  7910. * The following field definitions describe the format of the HTT target
  7911. * to host stats upload confirmation message.
  7912. * The message contains a cookie echoed from the HTT host->target stats
  7913. * upload request, which identifies which request the confirmation is
  7914. * for, and a series of tag-length-value stats information elements.
  7915. * The tag-length header for each stats info element also includes a
  7916. * status field, to indicate whether the request for the stat type in
  7917. * question was fully met, partially met, unable to be met, or invalid
  7918. * (if the stat type in question is disabled in the target).
  7919. * A special value of all 1's in this status field is used to indicate
  7920. * the end of the series of stats info elements.
  7921. *
  7922. *
  7923. * |31 16|15 8|7 5|4 0|
  7924. * |------------------------------------------------------------|
  7925. * | reserved | msg type |
  7926. * |------------------------------------------------------------|
  7927. * | cookie LSBs |
  7928. * |------------------------------------------------------------|
  7929. * | cookie MSBs |
  7930. * |------------------------------------------------------------|
  7931. * | stats entry length | reserved | S |stat type|
  7932. * |------------------------------------------------------------|
  7933. * | |
  7934. * | type-specific stats info |
  7935. * | |
  7936. * |------------------------------------------------------------|
  7937. * | stats entry length | reserved | S |stat type|
  7938. * |------------------------------------------------------------|
  7939. * | |
  7940. * | type-specific stats info |
  7941. * | |
  7942. * |------------------------------------------------------------|
  7943. * | n/a | reserved | 111 | n/a |
  7944. * |------------------------------------------------------------|
  7945. * Header fields:
  7946. * - MSG_TYPE
  7947. * Bits 7:0
  7948. * Purpose: identifies this is a statistics upload confirmation message
  7949. * Value: 0x9
  7950. * - COOKIE_LSBS
  7951. * Bits 31:0
  7952. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7953. * message with its preceding host->target stats request message.
  7954. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7955. * - COOKIE_MSBS
  7956. * Bits 31:0
  7957. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7958. * message with its preceding host->target stats request message.
  7959. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7960. *
  7961. * Stats Information Element tag-length header fields:
  7962. * - STAT_TYPE
  7963. * Bits 4:0
  7964. * Purpose: identifies the type of statistics info held in the
  7965. * following information element
  7966. * Value: htt_dbg_stats_type
  7967. * - STATUS
  7968. * Bits 7:5
  7969. * Purpose: indicate whether the requested stats are present
  7970. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7971. * the completion of the stats entry series
  7972. * - LENGTH
  7973. * Bits 31:16
  7974. * Purpose: indicate the stats information size
  7975. * Value: This field specifies the number of bytes of stats information
  7976. * that follows the element tag-length header.
  7977. * It is expected but not required that this length is a multiple of
  7978. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7979. * subsequent stats entry header will begin on a 4-byte aligned
  7980. * boundary.
  7981. */
  7982. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7983. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7984. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7985. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7986. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7987. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7988. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7989. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7990. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7991. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7992. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7993. do { \
  7994. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7995. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7996. } while (0)
  7997. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7998. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7999. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8000. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8003. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8004. } while (0)
  8005. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8006. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8007. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8008. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8009. do { \
  8010. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8011. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8012. } while (0)
  8013. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8014. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8015. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8016. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8017. #define HTT_MAX_AGGR 64
  8018. #define HTT_HL_MAX_AGGR 18
  8019. /**
  8020. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8021. *
  8022. * @details
  8023. * The following field definitions describe the format of the HTT host
  8024. * to target frag_desc/msdu_ext bank configuration message.
  8025. * The message contains the based address and the min and max id of the
  8026. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8027. * MSDU_EXT/FRAG_DESC.
  8028. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8029. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8030. * the hardware does the mapping/translation.
  8031. *
  8032. * Total banks that can be configured is configured to 16.
  8033. *
  8034. * This should be called before any TX has be initiated by the HTT
  8035. *
  8036. * |31 16|15 8|7 5|4 0|
  8037. * |------------------------------------------------------------|
  8038. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8039. * |------------------------------------------------------------|
  8040. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8041. #if HTT_PADDR64
  8042. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8043. #endif
  8044. * |------------------------------------------------------------|
  8045. * | ... |
  8046. * |------------------------------------------------------------|
  8047. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8048. #if HTT_PADDR64
  8049. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8050. #endif
  8051. * |------------------------------------------------------------|
  8052. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8053. * |------------------------------------------------------------|
  8054. * | ... |
  8055. * |------------------------------------------------------------|
  8056. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8057. * |------------------------------------------------------------|
  8058. * Header fields:
  8059. * - MSG_TYPE
  8060. * Bits 7:0
  8061. * Value: 0x6
  8062. * for systems with 64-bit format for bus addresses:
  8063. * - BANKx_BASE_ADDRESS_LO
  8064. * Bits 31:0
  8065. * Purpose: Provide a mechanism to specify the base address of the
  8066. * MSDU_EXT bank physical/bus address.
  8067. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8068. * - BANKx_BASE_ADDRESS_HI
  8069. * Bits 31:0
  8070. * Purpose: Provide a mechanism to specify the base address of the
  8071. * MSDU_EXT bank physical/bus address.
  8072. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8073. * for systems with 32-bit format for bus addresses:
  8074. * - BANKx_BASE_ADDRESS
  8075. * Bits 31:0
  8076. * Purpose: Provide a mechanism to specify the base address of the
  8077. * MSDU_EXT bank physical/bus address.
  8078. * Value: MSDU_EXT bank physical / bus address
  8079. * - BANKx_MIN_ID
  8080. * Bits 15:0
  8081. * Purpose: Provide a mechanism to specify the min index that needs to
  8082. * mapped.
  8083. * - BANKx_MAX_ID
  8084. * Bits 31:16
  8085. * Purpose: Provide a mechanism to specify the max index that needs to
  8086. * mapped.
  8087. *
  8088. */
  8089. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8090. * safe value.
  8091. * @note MAX supported banks is 16.
  8092. */
  8093. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8094. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8095. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8096. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8097. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8098. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8099. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8100. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8101. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8102. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8103. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8104. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8105. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8106. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8107. do { \
  8108. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8109. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8110. } while (0)
  8111. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8112. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8113. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8114. do { \
  8115. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8116. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8117. } while (0)
  8118. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8119. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8120. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8121. do { \
  8122. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8123. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8124. } while (0)
  8125. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8126. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8127. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8128. do { \
  8129. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8130. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8131. } while (0)
  8132. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8133. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8134. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8135. do { \
  8136. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8137. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8138. } while (0)
  8139. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8140. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8141. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8142. do { \
  8143. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8144. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8145. } while (0)
  8146. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8147. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8148. /*
  8149. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8150. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8151. * addresses are stored in a XXX-bit field.
  8152. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8153. * htt_tx_frag_desc64_bank_cfg_t structs.
  8154. */
  8155. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8156. _paddr_bits_, \
  8157. _paddr__bank_base_address_) \
  8158. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8159. /** word 0 \
  8160. * msg_type: 8, \
  8161. * pdev_id: 2, \
  8162. * swap: 1, \
  8163. * reserved0: 5, \
  8164. * num_banks: 8, \
  8165. * desc_size: 8; \
  8166. */ \
  8167. A_UINT32 word0; \
  8168. /* \
  8169. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8170. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8171. * the second A_UINT32). \
  8172. */ \
  8173. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8174. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8175. } POSTPACK
  8176. /* define htt_tx_frag_desc32_bank_cfg_t */
  8177. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8178. /* define htt_tx_frag_desc64_bank_cfg_t */
  8179. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8180. /*
  8181. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8182. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8183. */
  8184. #if HTT_PADDR64
  8185. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8186. #else
  8187. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8188. #endif
  8189. /**
  8190. * @brief target -> host HTT TX Credit total count update message definition
  8191. *
  8192. *|31 16|15|14 9| 8 |7 0 |
  8193. *|---------------------+--+----------+-------+----------|
  8194. *|cur htt credit delta | Q| reserved | sign | msg type |
  8195. *|------------------------------------------------------|
  8196. *
  8197. * Header fields:
  8198. * - MSG_TYPE
  8199. * Bits 7:0
  8200. * Purpose: identifies this as a htt tx credit delta update message
  8201. * Value: 0xe
  8202. * - SIGN
  8203. * Bits 8
  8204. * identifies whether credit delta is positive or negative
  8205. * Value:
  8206. * - 0x0: credit delta is positive, rebalance in some buffers
  8207. * - 0x1: credit delta is negative, rebalance out some buffers
  8208. * - reserved
  8209. * Bits 14:9
  8210. * Value: 0x0
  8211. * - TXQ_GRP
  8212. * Bit 15
  8213. * Purpose: indicates whether any tx queue group information elements
  8214. * are appended to the tx credit update message
  8215. * Value: 0 -> no tx queue group information element is present
  8216. * 1 -> a tx queue group information element immediately follows
  8217. * - DELTA_COUNT
  8218. * Bits 31:16
  8219. * Purpose: Specify current htt credit delta absolute count
  8220. */
  8221. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8222. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8223. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8224. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8225. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8226. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8227. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8230. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8231. } while (0)
  8232. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8233. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8234. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8237. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8238. } while (0)
  8239. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8240. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8241. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8244. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8245. } while (0)
  8246. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8247. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8248. #define HTT_TX_CREDIT_MSG_BYTES 4
  8249. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8250. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8251. /**
  8252. * @brief HTT WDI_IPA Operation Response Message
  8253. *
  8254. * @details
  8255. * HTT WDI_IPA Operation Response message is sent by target
  8256. * to host confirming suspend or resume operation.
  8257. * |31 24|23 16|15 8|7 0|
  8258. * |----------------+----------------+----------------+----------------|
  8259. * | op_code | Rsvd | msg_type |
  8260. * |-------------------------------------------------------------------|
  8261. * | Rsvd | Response len |
  8262. * |-------------------------------------------------------------------|
  8263. * | |
  8264. * | Response-type specific info |
  8265. * | |
  8266. * | |
  8267. * |-------------------------------------------------------------------|
  8268. * Header fields:
  8269. * - MSG_TYPE
  8270. * Bits 7:0
  8271. * Purpose: Identifies this as WDI_IPA Operation Response message
  8272. * value: = 0x13
  8273. * - OP_CODE
  8274. * Bits 31:16
  8275. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8276. * value: = enum htt_wdi_ipa_op_code
  8277. * - RSP_LEN
  8278. * Bits 16:0
  8279. * Purpose: length for the response-type specific info
  8280. * value: = length in bytes for response-type specific info
  8281. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8282. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8283. */
  8284. PREPACK struct htt_wdi_ipa_op_response_t
  8285. {
  8286. /* DWORD 0: flags and meta-data */
  8287. A_UINT32
  8288. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8289. reserved1: 8,
  8290. op_code: 16;
  8291. A_UINT32
  8292. rsp_len: 16,
  8293. reserved2: 16;
  8294. } POSTPACK;
  8295. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8296. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8297. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8298. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8299. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8300. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8301. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8302. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8303. do { \
  8304. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8305. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8306. } while (0)
  8307. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8308. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8309. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8310. do { \
  8311. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8312. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8313. } while (0)
  8314. enum htt_phy_mode {
  8315. htt_phy_mode_11a = 0,
  8316. htt_phy_mode_11g = 1,
  8317. htt_phy_mode_11b = 2,
  8318. htt_phy_mode_11g_only = 3,
  8319. htt_phy_mode_11na_ht20 = 4,
  8320. htt_phy_mode_11ng_ht20 = 5,
  8321. htt_phy_mode_11na_ht40 = 6,
  8322. htt_phy_mode_11ng_ht40 = 7,
  8323. htt_phy_mode_11ac_vht20 = 8,
  8324. htt_phy_mode_11ac_vht40 = 9,
  8325. htt_phy_mode_11ac_vht80 = 10,
  8326. htt_phy_mode_11ac_vht20_2g = 11,
  8327. htt_phy_mode_11ac_vht40_2g = 12,
  8328. htt_phy_mode_11ac_vht80_2g = 13,
  8329. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8330. htt_phy_mode_11ac_vht160 = 15,
  8331. htt_phy_mode_max,
  8332. };
  8333. /**
  8334. * @brief target -> host HTT channel change indication
  8335. * @details
  8336. * Specify when a channel change occurs.
  8337. * This allows the host to precisely determine which rx frames arrived
  8338. * on the old channel and which rx frames arrived on the new channel.
  8339. *
  8340. *|31 |7 0 |
  8341. *|-------------------------------------------+----------|
  8342. *| reserved | msg type |
  8343. *|------------------------------------------------------|
  8344. *| primary_chan_center_freq_mhz |
  8345. *|------------------------------------------------------|
  8346. *| contiguous_chan1_center_freq_mhz |
  8347. *|------------------------------------------------------|
  8348. *| contiguous_chan2_center_freq_mhz |
  8349. *|------------------------------------------------------|
  8350. *| phy_mode |
  8351. *|------------------------------------------------------|
  8352. *
  8353. * Header fields:
  8354. * - MSG_TYPE
  8355. * Bits 7:0
  8356. * Purpose: identifies this as a htt channel change indication message
  8357. * Value: 0x15
  8358. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8359. * Bits 31:0
  8360. * Purpose: identify the (center of the) new 20 MHz primary channel
  8361. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8362. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8363. * Bits 31:0
  8364. * Purpose: identify the (center of the) contiguous frequency range
  8365. * comprising the new channel.
  8366. * For example, if the new channel is a 80 MHz channel extending
  8367. * 60 MHz beyond the primary channel, this field would be 30 larger
  8368. * than the primary channel center frequency field.
  8369. * Value: center frequency of the contiguous frequency range comprising
  8370. * the full channel in MHz units
  8371. * (80+80 channels also use the CONTIG_CHAN2 field)
  8372. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8373. * Bits 31:0
  8374. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8375. * within a VHT 80+80 channel.
  8376. * This field is only relevant for VHT 80+80 channels.
  8377. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8378. * channel (arbitrary value for cases besides VHT 80+80)
  8379. * - PHY_MODE
  8380. * Bits 31:0
  8381. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8382. * and band
  8383. * Value: htt_phy_mode enum value
  8384. */
  8385. PREPACK struct htt_chan_change_t
  8386. {
  8387. /* DWORD 0: flags and meta-data */
  8388. A_UINT32
  8389. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8390. reserved1: 24;
  8391. A_UINT32 primary_chan_center_freq_mhz;
  8392. A_UINT32 contig_chan1_center_freq_mhz;
  8393. A_UINT32 contig_chan2_center_freq_mhz;
  8394. A_UINT32 phy_mode;
  8395. } POSTPACK;
  8396. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8397. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8398. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8399. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8400. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8401. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8402. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8403. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8404. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8405. do { \
  8406. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8407. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8408. } while (0)
  8409. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8410. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8411. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8412. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8413. do { \
  8414. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8415. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8416. } while (0)
  8417. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8418. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8419. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8420. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8421. do { \
  8422. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8423. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8424. } while (0)
  8425. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8426. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8427. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8428. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8429. do { \
  8430. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8431. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8432. } while (0)
  8433. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8434. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8435. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8436. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8437. /**
  8438. * @brief rx offload packet error message
  8439. *
  8440. * @details
  8441. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8442. * of target payload like mic err.
  8443. *
  8444. * |31 24|23 16|15 8|7 0|
  8445. * |----------------+----------------+----------------+----------------|
  8446. * | tid | vdev_id | msg_sub_type | msg_type |
  8447. * |-------------------------------------------------------------------|
  8448. * : (sub-type dependent content) :
  8449. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8450. * Header fields:
  8451. * - msg_type
  8452. * Bits 7:0
  8453. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8454. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8455. * - msg_sub_type
  8456. * Bits 15:8
  8457. * Purpose: Identifies which type of rx error is reported by this message
  8458. * value: htt_rx_ofld_pkt_err_type
  8459. * - vdev_id
  8460. * Bits 23:16
  8461. * Purpose: Identifies which vdev received the erroneous rx frame
  8462. * value:
  8463. * - tid
  8464. * Bits 31:24
  8465. * Purpose: Identifies the traffic type of the rx frame
  8466. * value:
  8467. *
  8468. * - The payload fields used if the sub-type == MIC error are shown below.
  8469. * Note - MIC err is per MSDU, while PN is per MPDU.
  8470. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8471. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8472. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8473. * instead of sending separate HTT messages for each wrong MSDU within
  8474. * the MPDU.
  8475. *
  8476. * |31 24|23 16|15 8|7 0|
  8477. * |----------------+----------------+----------------+----------------|
  8478. * | Rsvd | key_id | peer_id |
  8479. * |-------------------------------------------------------------------|
  8480. * | receiver MAC addr 31:0 |
  8481. * |-------------------------------------------------------------------|
  8482. * | Rsvd | receiver MAC addr 47:32 |
  8483. * |-------------------------------------------------------------------|
  8484. * | transmitter MAC addr 31:0 |
  8485. * |-------------------------------------------------------------------|
  8486. * | Rsvd | transmitter MAC addr 47:32 |
  8487. * |-------------------------------------------------------------------|
  8488. * | PN 31:0 |
  8489. * |-------------------------------------------------------------------|
  8490. * | Rsvd | PN 47:32 |
  8491. * |-------------------------------------------------------------------|
  8492. * - peer_id
  8493. * Bits 15:0
  8494. * Purpose: identifies which peer is frame is from
  8495. * value:
  8496. * - key_id
  8497. * Bits 23:16
  8498. * Purpose: identifies key_id of rx frame
  8499. * value:
  8500. * - RA_31_0 (receiver MAC addr 31:0)
  8501. * Bits 31:0
  8502. * Purpose: identifies by MAC address which vdev received the frame
  8503. * value: MAC address lower 4 bytes
  8504. * - RA_47_32 (receiver MAC addr 47:32)
  8505. * Bits 15:0
  8506. * Purpose: identifies by MAC address which vdev received the frame
  8507. * value: MAC address upper 2 bytes
  8508. * - TA_31_0 (transmitter MAC addr 31:0)
  8509. * Bits 31:0
  8510. * Purpose: identifies by MAC address which peer transmitted the frame
  8511. * value: MAC address lower 4 bytes
  8512. * - TA_47_32 (transmitter MAC addr 47:32)
  8513. * Bits 15:0
  8514. * Purpose: identifies by MAC address which peer transmitted the frame
  8515. * value: MAC address upper 2 bytes
  8516. * - PN_31_0
  8517. * Bits 31:0
  8518. * Purpose: Identifies pn of rx frame
  8519. * value: PN lower 4 bytes
  8520. * - PN_47_32
  8521. * Bits 15:0
  8522. * Purpose: Identifies pn of rx frame
  8523. * value:
  8524. * TKIP or CCMP: PN upper 2 bytes
  8525. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8526. */
  8527. enum htt_rx_ofld_pkt_err_type {
  8528. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8529. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8530. };
  8531. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8532. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8533. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8534. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8535. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8536. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8537. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8538. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8539. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8540. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8541. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8542. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8543. do { \
  8544. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8545. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8546. } while (0)
  8547. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8548. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8549. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8550. do { \
  8551. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8552. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8553. } while (0)
  8554. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8555. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8556. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8559. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8560. } while (0)
  8561. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8562. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8563. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8577. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8578. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8580. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8581. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8582. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8585. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8586. } while (0)
  8587. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8588. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8589. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8590. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8591. do { \
  8592. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8593. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8594. } while (0)
  8595. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8596. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8597. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8599. do { \
  8600. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8601. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8602. } while (0)
  8603. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8604. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8605. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8606. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8607. do { \
  8608. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8609. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8610. } while (0)
  8611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8612. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8613. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8615. do { \
  8616. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8617. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8618. } while (0)
  8619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8620. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8621. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8623. do { \
  8624. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8625. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8626. } while (0)
  8627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8628. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8629. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8630. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8631. do { \
  8632. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8633. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8634. } while (0)
  8635. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8636. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8637. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8638. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8639. do { \
  8640. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8641. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8642. } while (0)
  8643. /**
  8644. * @brief peer rate report message
  8645. *
  8646. * @details
  8647. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8648. * justified rate of all the peers.
  8649. *
  8650. * |31 24|23 16|15 8|7 0|
  8651. * |----------------+----------------+----------------+----------------|
  8652. * | peer_count | | msg_type |
  8653. * |-------------------------------------------------------------------|
  8654. * : Payload (variant number of peer rate report) :
  8655. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8656. * Header fields:
  8657. * - msg_type
  8658. * Bits 7:0
  8659. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8660. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8661. * - reserved
  8662. * Bits 15:8
  8663. * Purpose:
  8664. * value:
  8665. * - peer_count
  8666. * Bits 31:16
  8667. * Purpose: Specify how many peer rate report elements are present in the payload.
  8668. * value:
  8669. *
  8670. * Payload:
  8671. * There are variant number of peer rate report follow the first 32 bits.
  8672. * The peer rate report is defined as follows.
  8673. *
  8674. * |31 20|19 16|15 0|
  8675. * |-----------------------+---------+---------------------------------|-
  8676. * | reserved | phy | peer_id | \
  8677. * |-------------------------------------------------------------------| -> report #0
  8678. * | rate | /
  8679. * |-----------------------+---------+---------------------------------|-
  8680. * | reserved | phy | peer_id | \
  8681. * |-------------------------------------------------------------------| -> report #1
  8682. * | rate | /
  8683. * |-----------------------+---------+---------------------------------|-
  8684. * | reserved | phy | peer_id | \
  8685. * |-------------------------------------------------------------------| -> report #2
  8686. * | rate | /
  8687. * |-------------------------------------------------------------------|-
  8688. * : :
  8689. * : :
  8690. * : :
  8691. * :-------------------------------------------------------------------:
  8692. *
  8693. * - peer_id
  8694. * Bits 15:0
  8695. * Purpose: identify the peer
  8696. * value:
  8697. * - phy
  8698. * Bits 19:16
  8699. * Purpose: identify which phy is in use
  8700. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8701. * Please see enum htt_peer_report_phy_type for detail.
  8702. * - reserved
  8703. * Bits 31:20
  8704. * Purpose:
  8705. * value:
  8706. * - rate
  8707. * Bits 31:0
  8708. * Purpose: represent the justified rate of the peer specified by peer_id
  8709. * value:
  8710. */
  8711. enum htt_peer_rate_report_phy_type {
  8712. HTT_PEER_RATE_REPORT_11B = 0,
  8713. HTT_PEER_RATE_REPORT_11A_G,
  8714. HTT_PEER_RATE_REPORT_11N,
  8715. HTT_PEER_RATE_REPORT_11AC,
  8716. };
  8717. #define HTT_PEER_RATE_REPORT_SIZE 8
  8718. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8719. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8720. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8721. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8722. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8723. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8724. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8725. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8726. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8727. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8728. do { \
  8729. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8730. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8731. } while (0)
  8732. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8733. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8734. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8735. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8736. do { \
  8737. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8738. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8739. } while (0)
  8740. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8741. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8742. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8743. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8744. do { \
  8745. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8746. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8747. } while (0)
  8748. /**
  8749. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8750. *
  8751. * @details
  8752. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8753. * a flow of descriptors.
  8754. *
  8755. * This message is in TLV format and indicates the parameters to be setup a
  8756. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8757. * receive descriptors from a specified pool.
  8758. *
  8759. * The message would appear as follows:
  8760. *
  8761. * |31 24|23 16|15 8|7 0|
  8762. * |----------------+----------------+----------------+----------------|
  8763. * header | reserved | num_flows | msg_type |
  8764. * |-------------------------------------------------------------------|
  8765. * | |
  8766. * : payload :
  8767. * | |
  8768. * |-------------------------------------------------------------------|
  8769. *
  8770. * The header field is one DWORD long and is interpreted as follows:
  8771. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8772. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8773. * this message
  8774. * b'16-31 - reserved: These bits are reserved for future use
  8775. *
  8776. * Payload:
  8777. * The payload would contain multiple objects of the following structure. Each
  8778. * object represents a flow.
  8779. *
  8780. * |31 24|23 16|15 8|7 0|
  8781. * |----------------+----------------+----------------+----------------|
  8782. * header | reserved | num_flows | msg_type |
  8783. * |-------------------------------------------------------------------|
  8784. * payload0| flow_type |
  8785. * |-------------------------------------------------------------------|
  8786. * | flow_id |
  8787. * |-------------------------------------------------------------------|
  8788. * | reserved0 | flow_pool_id |
  8789. * |-------------------------------------------------------------------|
  8790. * | reserved1 | flow_pool_size |
  8791. * |-------------------------------------------------------------------|
  8792. * | reserved2 |
  8793. * |-------------------------------------------------------------------|
  8794. * payload1| flow_type |
  8795. * |-------------------------------------------------------------------|
  8796. * | flow_id |
  8797. * |-------------------------------------------------------------------|
  8798. * | reserved0 | flow_pool_id |
  8799. * |-------------------------------------------------------------------|
  8800. * | reserved1 | flow_pool_size |
  8801. * |-------------------------------------------------------------------|
  8802. * | reserved2 |
  8803. * |-------------------------------------------------------------------|
  8804. * | . |
  8805. * | . |
  8806. * | . |
  8807. * |-------------------------------------------------------------------|
  8808. *
  8809. * Each payload is 5 DWORDS long and is interpreted as follows:
  8810. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8811. * this flow is associated. It can be VDEV, peer,
  8812. * or tid (AC). Based on enum htt_flow_type.
  8813. *
  8814. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8815. * object. For flow_type vdev it is set to the
  8816. * vdevid, for peer it is peerid and for tid, it is
  8817. * tid_num.
  8818. *
  8819. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8820. * in the host for this flow
  8821. * b'16:31 - reserved0: This field in reserved for the future. In case
  8822. * we have a hierarchical implementation (HCM) of
  8823. * pools, it can be used to indicate the ID of the
  8824. * parent-pool.
  8825. *
  8826. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8827. * Descriptors for this flow will be
  8828. * allocated from this pool in the host.
  8829. * b'16:31 - reserved1: This field in reserved for the future. In case
  8830. * we have a hierarchical implementation of pools,
  8831. * it can be used to indicate the max number of
  8832. * descriptors in the pool. The b'0:15 can be used
  8833. * to indicate min number of descriptors in the
  8834. * HCM scheme.
  8835. *
  8836. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8837. * we have a hierarchical implementation of pools,
  8838. * b'0:15 can be used to indicate the
  8839. * priority-based borrowing (PBB) threshold of
  8840. * the flow's pool. The b'16:31 are still left
  8841. * reserved.
  8842. */
  8843. enum htt_flow_type {
  8844. FLOW_TYPE_VDEV = 0,
  8845. /* Insert new flow types above this line */
  8846. };
  8847. PREPACK struct htt_flow_pool_map_payload_t {
  8848. A_UINT32 flow_type;
  8849. A_UINT32 flow_id;
  8850. A_UINT32 flow_pool_id:16,
  8851. reserved0:16;
  8852. A_UINT32 flow_pool_size:16,
  8853. reserved1:16;
  8854. A_UINT32 reserved2;
  8855. } POSTPACK;
  8856. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8857. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8858. (sizeof(struct htt_flow_pool_map_payload_t))
  8859. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8860. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8861. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8862. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8863. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8864. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8865. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8866. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8867. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8868. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8869. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8870. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8871. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8872. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8873. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8874. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8875. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8876. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8877. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8878. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8879. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8880. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8881. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8882. do { \
  8883. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8884. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8885. } while (0)
  8886. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8887. do { \
  8888. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8889. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8890. } while (0)
  8891. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8892. do { \
  8893. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8894. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8895. } while (0)
  8896. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8897. do { \
  8898. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8899. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8900. } while (0)
  8901. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8902. do { \
  8903. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8904. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8905. } while (0)
  8906. /**
  8907. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8908. *
  8909. * @details
  8910. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8911. * down a flow of descriptors.
  8912. * This message indicates that for the flow (whose ID is provided) is wanting
  8913. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8914. * pool of descriptors from where descriptors are being allocated for this
  8915. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8916. * be unmapped by the host.
  8917. *
  8918. * The message would appear as follows:
  8919. *
  8920. * |31 24|23 16|15 8|7 0|
  8921. * |----------------+----------------+----------------+----------------|
  8922. * | reserved0 | msg_type |
  8923. * |-------------------------------------------------------------------|
  8924. * | flow_type |
  8925. * |-------------------------------------------------------------------|
  8926. * | flow_id |
  8927. * |-------------------------------------------------------------------|
  8928. * | reserved1 | flow_pool_id |
  8929. * |-------------------------------------------------------------------|
  8930. *
  8931. * The message is interpreted as follows:
  8932. * dword0 - b'0:7 - msg_type: This will be set to
  8933. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8934. * b'8:31 - reserved0: Reserved for future use
  8935. *
  8936. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8937. * this flow is associated. It can be VDEV, peer,
  8938. * or tid (AC). Based on enum htt_flow_type.
  8939. *
  8940. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8941. * object. For flow_type vdev it is set to the
  8942. * vdevid, for peer it is peerid and for tid, it is
  8943. * tid_num.
  8944. *
  8945. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8946. * used in the host for this flow
  8947. * b'16:31 - reserved0: This field in reserved for the future.
  8948. *
  8949. */
  8950. PREPACK struct htt_flow_pool_unmap_t {
  8951. A_UINT32 msg_type:8,
  8952. reserved0:24;
  8953. A_UINT32 flow_type;
  8954. A_UINT32 flow_id;
  8955. A_UINT32 flow_pool_id:16,
  8956. reserved1:16;
  8957. } POSTPACK;
  8958. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8959. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8960. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8961. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8962. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8963. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8964. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8965. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8966. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8967. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8968. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8969. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8970. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8971. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8972. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8973. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8976. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8977. } while (0)
  8978. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8981. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8982. } while (0)
  8983. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8986. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8987. } while (0)
  8988. /**
  8989. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8990. *
  8991. * @details
  8992. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8993. * SRNG ring setup is done
  8994. *
  8995. * This message indicates whether the last setup operation is successful.
  8996. * It will be sent to host when host set respose_required bit in
  8997. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8998. * The message would appear as follows:
  8999. *
  9000. * |31 24|23 16|15 8|7 0|
  9001. * |--------------- +----------------+----------------+----------------|
  9002. * | setup_status | ring_id | pdev_id | msg_type |
  9003. * |-------------------------------------------------------------------|
  9004. *
  9005. * The message is interpreted as follows:
  9006. * dword0 - b'0:7 - msg_type: This will be set to
  9007. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9008. * b'8:15 - pdev_id:
  9009. * 0 (for rings at SOC/UMAC level),
  9010. * 1/2/3 mac id (for rings at LMAC level)
  9011. * b'16:23 - ring_id: Identify the ring which is set up
  9012. * More details can be got from enum htt_srng_ring_id
  9013. * b'24:31 - setup_status: Indicate status of setup operation
  9014. * Refer to htt_ring_setup_status
  9015. */
  9016. PREPACK struct htt_sring_setup_done_t {
  9017. A_UINT32 msg_type: 8,
  9018. pdev_id: 8,
  9019. ring_id: 8,
  9020. setup_status: 8;
  9021. } POSTPACK;
  9022. enum htt_ring_setup_status {
  9023. htt_ring_setup_status_ok = 0,
  9024. htt_ring_setup_status_error,
  9025. };
  9026. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9027. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9028. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9029. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9030. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9031. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9032. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9033. do { \
  9034. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9035. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9036. } while (0)
  9037. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9038. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9039. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9040. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9041. HTT_SRING_SETUP_DONE_RING_ID_S)
  9042. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9043. do { \
  9044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9045. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9046. } while (0)
  9047. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9048. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9049. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9050. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9051. HTT_SRING_SETUP_DONE_STATUS_S)
  9052. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9053. do { \
  9054. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9055. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9056. } while (0)
  9057. /**
  9058. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9059. *
  9060. * @details
  9061. * HTT TX map flow entry with tqm flow pointer
  9062. * Sent from firmware to host to add tqm flow pointer in corresponding
  9063. * flow search entry. Flow metadata is replayed back to host as part of this
  9064. * struct to enable host to find the specific flow search entry
  9065. *
  9066. * The message would appear as follows:
  9067. *
  9068. * |31 28|27 18|17 14|13 8|7 0|
  9069. * |-------+------------------------------------------+----------------|
  9070. * | rsvd0 | fse_hsh_idx | msg_type |
  9071. * |-------------------------------------------------------------------|
  9072. * | rsvd1 | tid | peer_id |
  9073. * |-------------------------------------------------------------------|
  9074. * | tqm_flow_pntr_lo |
  9075. * |-------------------------------------------------------------------|
  9076. * | tqm_flow_pntr_hi |
  9077. * |-------------------------------------------------------------------|
  9078. * | fse_meta_data |
  9079. * |-------------------------------------------------------------------|
  9080. *
  9081. * The message is interpreted as follows:
  9082. *
  9083. * dword0 - b'0:7 - msg_type: This will be set to
  9084. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9085. *
  9086. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9087. * for this flow entry
  9088. *
  9089. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9090. *
  9091. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9092. *
  9093. * dword1 - b'14:17 - tid
  9094. *
  9095. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9096. *
  9097. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9098. *
  9099. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9100. *
  9101. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9102. * given by host
  9103. */
  9104. PREPACK struct htt_tx_map_flow_info {
  9105. A_UINT32
  9106. msg_type: 8,
  9107. fse_hsh_idx: 20,
  9108. rsvd0: 4;
  9109. A_UINT32
  9110. peer_id: 14,
  9111. tid: 4,
  9112. rsvd1: 14;
  9113. A_UINT32 tqm_flow_pntr_lo;
  9114. A_UINT32 tqm_flow_pntr_hi;
  9115. struct htt_tx_flow_metadata fse_meta_data;
  9116. } POSTPACK;
  9117. /* DWORD 0 */
  9118. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9119. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9120. /* DWORD 1 */
  9121. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9122. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9123. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9124. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9125. /* DWORD 0 */
  9126. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9127. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9128. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9129. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9130. do { \
  9131. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9132. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9133. } while (0)
  9134. /* DWORD 1 */
  9135. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9136. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9137. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9138. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9141. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9142. } while (0)
  9143. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9144. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9145. HTT_TX_MAP_FLOW_INFO_TID_S)
  9146. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9149. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9150. } while (0)
  9151. /*
  9152. * htt_dbg_ext_stats_status -
  9153. * present - The requested stats have been delivered in full.
  9154. * This indicates that either the stats information was contained
  9155. * in its entirety within this message, or else this message
  9156. * completes the delivery of the requested stats info that was
  9157. * partially delivered through earlier STATS_CONF messages.
  9158. * partial - The requested stats have been delivered in part.
  9159. * One or more subsequent STATS_CONF messages with the same
  9160. * cookie value will be sent to deliver the remainder of the
  9161. * information.
  9162. * error - The requested stats could not be delivered, for example due
  9163. * to a shortage of memory to construct a message holding the
  9164. * requested stats.
  9165. * invalid - The requested stat type is either not recognized, or the
  9166. * target is configured to not gather the stats type in question.
  9167. */
  9168. enum htt_dbg_ext_stats_status {
  9169. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9170. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9171. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9172. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9173. };
  9174. /**
  9175. * @brief target -> host ppdu stats upload
  9176. *
  9177. * @details
  9178. * The following field definitions describe the format of the HTT target
  9179. * to host ppdu stats indication message.
  9180. *
  9181. *
  9182. * |31 16|15 12|11 10|9 8|7 0 |
  9183. * |----------------------------------------------------------------------|
  9184. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9185. * |----------------------------------------------------------------------|
  9186. * | ppdu_id |
  9187. * |----------------------------------------------------------------------|
  9188. * | Timestamp in us |
  9189. * |----------------------------------------------------------------------|
  9190. * | reserved |
  9191. * |----------------------------------------------------------------------|
  9192. * | type-specific stats info |
  9193. * | (see htt_ppdu_stats.h) |
  9194. * |----------------------------------------------------------------------|
  9195. * Header fields:
  9196. * - MSG_TYPE
  9197. * Bits 7:0
  9198. * Purpose: Identifies this is a PPDU STATS indication
  9199. * message.
  9200. * Value: 0x1d
  9201. * - mac_id
  9202. * Bits 9:8
  9203. * Purpose: mac_id of this ppdu_id
  9204. * Value: 0-3
  9205. * - pdev_id
  9206. * Bits 11:10
  9207. * Purpose: pdev_id of this ppdu_id
  9208. * Value: 0-3
  9209. * 0 (for rings at SOC level),
  9210. * 1/2/3 PDEV -> 0/1/2
  9211. * - payload_size
  9212. * Bits 31:16
  9213. * Purpose: total tlv size
  9214. * Value: payload_size in bytes
  9215. */
  9216. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9217. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9218. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9219. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9220. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9221. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9222. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9223. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9224. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9225. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9226. do { \
  9227. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9228. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9229. } while (0)
  9230. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9231. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9232. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9233. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9234. do { \
  9235. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9236. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9237. } while (0)
  9238. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9239. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9240. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9241. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9242. do { \
  9243. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9244. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9245. } while (0)
  9246. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9247. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9248. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9249. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9250. do { \
  9251. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9252. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9253. } while (0)
  9254. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9255. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9256. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9257. /**
  9258. * @brief target -> host extended statistics upload
  9259. *
  9260. * @details
  9261. * The following field definitions describe the format of the HTT target
  9262. * to host stats upload confirmation message.
  9263. * The message contains a cookie echoed from the HTT host->target stats
  9264. * upload request, which identifies which request the confirmation is
  9265. * for, and a single stats can span over multiple HTT stats indication
  9266. * due to the HTT message size limitation so every HTT ext stats indication
  9267. * will have tag-length-value stats information elements.
  9268. * The tag-length header for each HTT stats IND message also includes a
  9269. * status field, to indicate whether the request for the stat type in
  9270. * question was fully met, partially met, unable to be met, or invalid
  9271. * (if the stat type in question is disabled in the target).
  9272. * A Done bit 1's indicate the end of the of stats info elements.
  9273. *
  9274. *
  9275. * |31 16|15 12|11|10 8|7 5|4 0|
  9276. * |--------------------------------------------------------------|
  9277. * | reserved | msg type |
  9278. * |--------------------------------------------------------------|
  9279. * | cookie LSBs |
  9280. * |--------------------------------------------------------------|
  9281. * | cookie MSBs |
  9282. * |--------------------------------------------------------------|
  9283. * | stats entry length | rsvd | D| S | stat type |
  9284. * |--------------------------------------------------------------|
  9285. * | type-specific stats info |
  9286. * | (see htt_stats.h) |
  9287. * |--------------------------------------------------------------|
  9288. * Header fields:
  9289. * - MSG_TYPE
  9290. * Bits 7:0
  9291. * Purpose: Identifies this is a extended statistics upload confirmation
  9292. * message.
  9293. * Value: 0x1c
  9294. * - COOKIE_LSBS
  9295. * Bits 31:0
  9296. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9297. * message with its preceding host->target stats request message.
  9298. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9299. * - COOKIE_MSBS
  9300. * Bits 31:0
  9301. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9302. * message with its preceding host->target stats request message.
  9303. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9304. *
  9305. * Stats Information Element tag-length header fields:
  9306. * - STAT_TYPE
  9307. * Bits 7:0
  9308. * Purpose: identifies the type of statistics info held in the
  9309. * following information element
  9310. * Value: htt_dbg_ext_stats_type
  9311. * - STATUS
  9312. * Bits 10:8
  9313. * Purpose: indicate whether the requested stats are present
  9314. * Value: htt_dbg_ext_stats_status
  9315. * - DONE
  9316. * Bits 11
  9317. * Purpose:
  9318. * Indicates the completion of the stats entry, this will be the last
  9319. * stats conf HTT segment for the requested stats type.
  9320. * Value:
  9321. * 0 -> the stats retrieval is ongoing
  9322. * 1 -> the stats retrieval is complete
  9323. * - LENGTH
  9324. * Bits 31:16
  9325. * Purpose: indicate the stats information size
  9326. * Value: This field specifies the number of bytes of stats information
  9327. * that follows the element tag-length header.
  9328. * It is expected but not required that this length is a multiple of
  9329. * 4 bytes.
  9330. */
  9331. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9332. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9333. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9334. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9335. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9336. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9337. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9338. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9339. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9340. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9341. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9342. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9343. do { \
  9344. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9345. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9346. } while (0)
  9347. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9348. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9349. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9350. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9351. do { \
  9352. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9353. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9354. } while (0)
  9355. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9356. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9357. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9358. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9359. do { \
  9360. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9361. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9362. } while (0)
  9363. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9364. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9365. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9366. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9367. do { \
  9368. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9369. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9370. } while (0)
  9371. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9372. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9373. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9374. typedef enum {
  9375. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9376. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9377. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9378. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9379. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9380. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9381. /* Reserved from 128 - 255 for target internal use.*/
  9382. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9383. } HTT_PEER_TYPE;
  9384. /** 2 word representation of MAC addr */
  9385. typedef struct {
  9386. /** upper 4 bytes of MAC address */
  9387. A_UINT32 mac_addr31to0;
  9388. /** lower 2 bytes of MAC address */
  9389. A_UINT32 mac_addr47to32;
  9390. } htt_mac_addr;
  9391. /** macro to convert MAC address from char array to HTT word format */
  9392. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9393. (phtt_mac_addr)->mac_addr31to0 = \
  9394. (((c_macaddr)[0] << 0) | \
  9395. ((c_macaddr)[1] << 8) | \
  9396. ((c_macaddr)[2] << 16) | \
  9397. ((c_macaddr)[3] << 24)); \
  9398. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9399. } while (0)
  9400. /**
  9401. * @brief target -> host monitor mac header indication message
  9402. *
  9403. * @details
  9404. * The following diagram shows the format of the monitor mac header message
  9405. * sent from the target to the host.
  9406. * This message is primarily sent when promiscuous rx mode is enabled.
  9407. * One message is sent per rx PPDU.
  9408. *
  9409. * |31 24|23 16|15 8|7 0|
  9410. * |-------------------------------------------------------------|
  9411. * | peer_id | reserved0 | msg_type |
  9412. * |-------------------------------------------------------------|
  9413. * | reserved1 | num_mpdu |
  9414. * |-------------------------------------------------------------|
  9415. * | struct hw_rx_desc |
  9416. * | (see wal_rx_desc.h) |
  9417. * |-------------------------------------------------------------|
  9418. * | struct ieee80211_frame_addr4 |
  9419. * | (see ieee80211_defs.h) |
  9420. * |-------------------------------------------------------------|
  9421. * | struct ieee80211_frame_addr4 |
  9422. * | (see ieee80211_defs.h) |
  9423. * |-------------------------------------------------------------|
  9424. * | ...... |
  9425. * |-------------------------------------------------------------|
  9426. *
  9427. * Header fields:
  9428. * - msg_type
  9429. * Bits 7:0
  9430. * Purpose: Identifies this is a monitor mac header indication message.
  9431. * Value: 0x20
  9432. * - peer_id
  9433. * Bits 31:16
  9434. * Purpose: Software peer id given by host during association,
  9435. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9436. * for rx PPDUs received from unassociated peers.
  9437. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9438. * - num_mpdu
  9439. * Bits 15:0
  9440. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9441. * delivered within the message.
  9442. * Value: 1 to 32
  9443. * num_mpdu is limited to a maximum value of 32, due to buffer
  9444. * size limits. For PPDUs with more than 32 MPDUs, only the
  9445. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9446. * the PPDU will be provided.
  9447. */
  9448. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9449. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9450. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9451. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9452. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9453. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9456. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9457. } while (0)
  9458. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9459. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9460. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9461. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9462. do { \
  9463. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9464. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9465. } while (0)
  9466. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9467. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9468. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9469. #endif