htt.h 617 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2HMSG_TYPE_RX_FISA_CFG msg.
  192. */
  193. #define HTT_CURRENT_VERSION_MAJOR 3
  194. #define HTT_CURRENT_VERSION_MINOR 74
  195. #define HTT_NUM_TX_FRAG_DESC 1024
  196. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  197. #define HTT_CHECK_SET_VAL(field, val) \
  198. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  199. /* macros to assist in sign-extending fields from HTT messages */
  200. #define HTT_SIGN_BIT_MASK(field) \
  201. ((field ## _M + (1 << field ## _S)) >> 1)
  202. #define HTT_SIGN_BIT(_val, field) \
  203. (_val & HTT_SIGN_BIT_MASK(field))
  204. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  205. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  206. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  207. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  208. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  209. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  210. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  211. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  212. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  213. /*
  214. * TEMPORARY:
  215. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  216. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  217. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  218. * updated.
  219. */
  220. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  221. /*
  222. * TEMPORARY:
  223. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  224. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  225. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  226. * updated.
  227. */
  228. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  229. /* HTT Access Category values */
  230. enum HTT_AC_WMM {
  231. /* WMM Access Categories */
  232. HTT_AC_WMM_BE = 0x0,
  233. HTT_AC_WMM_BK = 0x1,
  234. HTT_AC_WMM_VI = 0x2,
  235. HTT_AC_WMM_VO = 0x3,
  236. /* extension Access Categories */
  237. HTT_AC_EXT_NON_QOS = 0x4,
  238. HTT_AC_EXT_UCAST_MGMT = 0x5,
  239. HTT_AC_EXT_MCAST_DATA = 0x6,
  240. HTT_AC_EXT_MCAST_MGMT = 0x7,
  241. };
  242. enum HTT_AC_WMM_MASK {
  243. /* WMM Access Categories */
  244. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  245. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  246. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  247. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  248. /* extension Access Categories */
  249. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  250. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  251. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  252. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  253. };
  254. #define HTT_AC_MASK_WMM \
  255. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  256. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  257. #define HTT_AC_MASK_EXT \
  258. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  259. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  260. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  261. /*
  262. * htt_dbg_stats_type -
  263. * bit positions for each stats type within a stats type bitmask
  264. * The bitmask contains 24 bits.
  265. */
  266. enum htt_dbg_stats_type {
  267. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  268. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  269. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  270. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  271. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  272. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  273. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  274. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  275. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  276. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  277. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  278. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  279. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  280. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  281. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  282. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  283. /* bits 16-23 currently reserved */
  284. /* keep this last */
  285. HTT_DBG_NUM_STATS
  286. };
  287. /*=== HTT option selection TLVs ===
  288. * Certain HTT messages have alternatives or options.
  289. * For such cases, the host and target need to agree on which option to use.
  290. * Option specification TLVs can be appended to the VERSION_REQ and
  291. * VERSION_CONF messages to select options other than the default.
  292. * These TLVs are entirely optional - if they are not provided, there is a
  293. * well-defined default for each option. If they are provided, they can be
  294. * provided in any order. Each TLV can be present or absent independent of
  295. * the presence / absence of other TLVs.
  296. *
  297. * The HTT option selection TLVs use the following format:
  298. * |31 16|15 8|7 0|
  299. * |---------------------------------+----------------+----------------|
  300. * | value (payload) | length | tag |
  301. * |-------------------------------------------------------------------|
  302. * The value portion need not be only 2 bytes; it can be extended by any
  303. * integer number of 4-byte units. The total length of the TLV, including
  304. * the tag and length fields, must be a multiple of 4 bytes. The length
  305. * field specifies the total TLV size in 4-byte units. Thus, the typical
  306. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  307. * field, would store 0x1 in its length field, to show that the TLV occupies
  308. * a single 4-byte unit.
  309. */
  310. /*--- TLV header format - applies to all HTT option TLVs ---*/
  311. enum HTT_OPTION_TLV_TAGS {
  312. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  313. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  314. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  315. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  316. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  317. };
  318. PREPACK struct htt_option_tlv_header_t {
  319. A_UINT8 tag;
  320. A_UINT8 length;
  321. } POSTPACK;
  322. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  323. #define HTT_OPTION_TLV_TAG_S 0
  324. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  325. #define HTT_OPTION_TLV_LENGTH_S 8
  326. /*
  327. * value0 - 16 bit value field stored in word0
  328. * The TLV's value field may be longer than 2 bytes, in which case
  329. * the remainder of the value is stored in word1, word2, etc.
  330. */
  331. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  332. #define HTT_OPTION_TLV_VALUE0_S 16
  333. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  334. do { \
  335. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  336. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  337. } while (0)
  338. #define HTT_OPTION_TLV_TAG_GET(word) \
  339. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  340. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  341. do { \
  342. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  343. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  344. } while (0)
  345. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  346. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  347. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  353. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  354. /*--- format of specific HTT option TLVs ---*/
  355. /*
  356. * HTT option TLV for specifying LL bus address size
  357. * Some chips require bus addresses used by the target to access buffers
  358. * within the host's memory to be 32 bits; others require bus addresses
  359. * used by the target to access buffers within the host's memory to be
  360. * 64 bits.
  361. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  362. * a suffix to the VERSION_CONF message to specify which bus address format
  363. * the target requires.
  364. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  365. * default to providing bus addresses to the target in 32-bit format.
  366. */
  367. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  368. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  369. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  370. };
  371. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  372. struct htt_option_tlv_header_t hdr;
  373. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  374. } POSTPACK;
  375. /*
  376. * HTT option TLV for specifying whether HL systems should indicate
  377. * over-the-air tx completion for individual frames, or should instead
  378. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  379. * requests an OTA tx completion for a particular tx frame.
  380. * This option does not apply to LL systems, where the TX_COMPL_IND
  381. * is mandatory.
  382. * This option is primarily intended for HL systems in which the tx frame
  383. * downloads over the host --> target bus are as slow as or slower than
  384. * the transmissions over the WLAN PHY. For cases where the bus is faster
  385. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  386. * and consquently will send one TX_COMPL_IND message that covers several
  387. * tx frames. For cases where the WLAN PHY is faster than the bus,
  388. * the target will end up transmitting very short A-MPDUs, and consequently
  389. * sending many TX_COMPL_IND messages, which each cover a very small number
  390. * of tx frames.
  391. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  392. * a suffix to the VERSION_REQ message to request whether the host desires to
  393. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  394. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  395. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  396. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  397. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  398. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  399. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  400. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  401. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  402. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  403. * TLV.
  404. */
  405. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  406. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  407. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  408. };
  409. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  410. struct htt_option_tlv_header_t hdr;
  411. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  412. } POSTPACK;
  413. /*
  414. * HTT option TLV for specifying how many tx queue groups the target
  415. * may establish.
  416. * This TLV specifies the maximum value the target may send in the
  417. * txq_group_id field of any TXQ_GROUP information elements sent by
  418. * the target to the host. This allows the host to pre-allocate an
  419. * appropriate number of tx queue group structs.
  420. *
  421. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  422. * a suffix to the VERSION_REQ message to specify whether the host supports
  423. * tx queue groups at all, and if so if there is any limit on the number of
  424. * tx queue groups that the host supports.
  425. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  426. * a suffix to the VERSION_CONF message. If the host has specified in the
  427. * VER_REQ message a limit on the number of tx queue groups the host can
  428. * supprt, the target shall limit its specification of the maximum tx groups
  429. * to be no larger than this host-specified limit.
  430. *
  431. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  432. * shall preallocate 4 tx queue group structs, and the target shall not
  433. * specify a txq_group_id larger than 3.
  434. */
  435. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  436. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  437. /*
  438. * values 1 through N specify the max number of tx queue groups
  439. * the sender supports
  440. */
  441. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  442. };
  443. /* TEMPORARY backwards-compatibility alias for a typo fix -
  444. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  445. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  446. * to support the old name (with the typo) until all references to the
  447. * old name are replaced with the new name.
  448. */
  449. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  450. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  451. struct htt_option_tlv_header_t hdr;
  452. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  453. } POSTPACK;
  454. /*
  455. * HTT option TLV for specifying whether the target supports an extended
  456. * version of the HTT tx descriptor. If the target provides this TLV
  457. * and specifies in the TLV that the target supports an extended version
  458. * of the HTT tx descriptor, the target must check the "extension" bit in
  459. * the HTT tx descriptor, and if the extension bit is set, to expect a
  460. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  461. * descriptor. Furthermore, the target must provide room for the HTT
  462. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  463. * This option is intended for systems where the host needs to explicitly
  464. * control the transmission parameters such as tx power for individual
  465. * tx frames.
  466. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  467. * as a suffix to the VERSION_CONF message to explicitly specify whether
  468. * the target supports the HTT tx MSDU extension descriptor.
  469. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  470. * by the host as lack of target support for the HTT tx MSDU extension
  471. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  472. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  473. * the HTT tx MSDU extension descriptor.
  474. * The host is not required to provide the HTT tx MSDU extension descriptor
  475. * just because the target supports it; the target must check the
  476. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  477. * extension descriptor is present.
  478. */
  479. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  480. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  481. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  482. };
  483. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  484. struct htt_option_tlv_header_t hdr;
  485. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  486. } POSTPACK;
  487. /*=== host -> target messages ===============================================*/
  488. enum htt_h2t_msg_type {
  489. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  490. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  491. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  492. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  493. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  494. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  495. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  496. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  497. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  498. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  499. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  500. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  501. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  502. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  503. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  504. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  505. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  506. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  507. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  508. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  509. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  510. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  511. /* keep this last */
  512. HTT_H2T_NUM_MSGS
  513. };
  514. /*
  515. * HTT host to target message type -
  516. * stored in bits 7:0 of the first word of the message
  517. */
  518. #define HTT_H2T_MSG_TYPE_M 0xff
  519. #define HTT_H2T_MSG_TYPE_S 0
  520. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  521. do { \
  522. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  523. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  524. } while (0)
  525. #define HTT_H2T_MSG_TYPE_GET(word) \
  526. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  527. /**
  528. * @brief host -> target version number request message definition
  529. *
  530. * |31 24|23 16|15 8|7 0|
  531. * |----------------+----------------+----------------+----------------|
  532. * | reserved | msg type |
  533. * |-------------------------------------------------------------------|
  534. * : option request TLV (optional) |
  535. * :...................................................................:
  536. *
  537. * The VER_REQ message may consist of a single 4-byte word, or may be
  538. * extended with TLVs that specify which HTT options the host is requesting
  539. * from the target.
  540. * The following option TLVs may be appended to the VER_REQ message:
  541. * - HL_SUPPRESS_TX_COMPL_IND
  542. * - HL_MAX_TX_QUEUE_GROUPS
  543. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  544. * may be appended to the VER_REQ message (but only one TLV of each type).
  545. *
  546. * Header fields:
  547. * - MSG_TYPE
  548. * Bits 7:0
  549. * Purpose: identifies this as a version number request message
  550. * Value: 0x0
  551. */
  552. #define HTT_VER_REQ_BYTES 4
  553. /* TBDXXX: figure out a reasonable number */
  554. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  555. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  556. /**
  557. * @brief HTT tx MSDU descriptor
  558. *
  559. * @details
  560. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  561. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  562. * the target firmware needs for the FW's tx processing, particularly
  563. * for creating the HW msdu descriptor.
  564. * The same HTT tx descriptor is used for HL and LL systems, though
  565. * a few fields within the tx descriptor are used only by LL or
  566. * only by HL.
  567. * The HTT tx descriptor is defined in two manners: by a struct with
  568. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  569. * definitions.
  570. * The target should use the struct def, for simplicitly and clarity,
  571. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  572. * neutral. Specifically, the host shall use the get/set macros built
  573. * around the mask + shift defs.
  574. */
  575. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  576. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  577. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  578. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  579. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  580. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  581. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  582. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  583. #define HTT_TX_VDEV_ID_WORD 0
  584. #define HTT_TX_VDEV_ID_MASK 0x3f
  585. #define HTT_TX_VDEV_ID_SHIFT 16
  586. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  587. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  588. #define HTT_TX_MSDU_LEN_DWORD 1
  589. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  590. /*
  591. * HTT_VAR_PADDR macros
  592. * Allow physical / bus addresses to be either a single 32-bit value,
  593. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  594. */
  595. #define HTT_VAR_PADDR32(var_name) \
  596. A_UINT32 var_name
  597. #define HTT_VAR_PADDR64_LE(var_name) \
  598. struct { \
  599. /* little-endian: lo precedes hi */ \
  600. A_UINT32 lo; \
  601. A_UINT32 hi; \
  602. } var_name
  603. /*
  604. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  605. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  606. * addresses are stored in a XXX-bit field.
  607. * This macro is used to define both htt_tx_msdu_desc32_t and
  608. * htt_tx_msdu_desc64_t structs.
  609. */
  610. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  611. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  612. { \
  613. /* DWORD 0: flags and meta-data */ \
  614. A_UINT32 \
  615. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  616. \
  617. /* pkt_subtype - \
  618. * Detailed specification of the tx frame contents, extending the \
  619. * general specification provided by pkt_type. \
  620. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  621. * pkt_type | pkt_subtype \
  622. * ============================================================== \
  623. * 802.3 | bit 0:3 - Reserved \
  624. * | bit 4: 0x0 - Copy-Engine Classification Results \
  625. * | not appended to the HTT message \
  626. * | 0x1 - Copy-Engine Classification Results \
  627. * | appended to the HTT message in the \
  628. * | format: \
  629. * | [HTT tx desc, frame header, \
  630. * | CE classification results] \
  631. * | The CE classification results begin \
  632. * | at the next 4-byte boundary after \
  633. * | the frame header. \
  634. * ------------+------------------------------------------------- \
  635. * Eth2 | bit 0:3 - Reserved \
  636. * | bit 4: 0x0 - Copy-Engine Classification Results \
  637. * | not appended to the HTT message \
  638. * | 0x1 - Copy-Engine Classification Results \
  639. * | appended to the HTT message. \
  640. * | See the above specification of the \
  641. * | CE classification results location. \
  642. * ------------+------------------------------------------------- \
  643. * native WiFi | bit 0:3 - Reserved \
  644. * | bit 4: 0x0 - Copy-Engine Classification Results \
  645. * | not appended to the HTT message \
  646. * | 0x1 - Copy-Engine Classification Results \
  647. * | appended to the HTT message. \
  648. * | See the above specification of the \
  649. * | CE classification results location. \
  650. * ------------+------------------------------------------------- \
  651. * mgmt | 0x0 - 802.11 MAC header absent \
  652. * | 0x1 - 802.11 MAC header present \
  653. * ------------+------------------------------------------------- \
  654. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  655. * | 0x1 - 802.11 MAC header present \
  656. * | bit 1: 0x0 - allow aggregation \
  657. * | 0x1 - don't allow aggregation \
  658. * | bit 2: 0x0 - perform encryption \
  659. * | 0x1 - don't perform encryption \
  660. * | bit 3: 0x0 - perform tx classification / queuing \
  661. * | 0x1 - don't perform tx classification; \
  662. * | insert the frame into the "misc" \
  663. * | tx queue \
  664. * | bit 4: 0x0 - Copy-Engine Classification Results \
  665. * | not appended to the HTT message \
  666. * | 0x1 - Copy-Engine Classification Results \
  667. * | appended to the HTT message. \
  668. * | See the above specification of the \
  669. * | CE classification results location. \
  670. */ \
  671. pkt_subtype: 5, \
  672. \
  673. /* pkt_type - \
  674. * General specification of the tx frame contents. \
  675. * The htt_pkt_type enum should be used to specify and check the \
  676. * value of this field. \
  677. */ \
  678. pkt_type: 3, \
  679. \
  680. /* vdev_id - \
  681. * ID for the vdev that is sending this tx frame. \
  682. * For certain non-standard packet types, e.g. pkt_type == raw \
  683. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  684. * This field is used primarily for determining where to queue \
  685. * broadcast and multicast frames. \
  686. */ \
  687. vdev_id: 6, \
  688. /* ext_tid - \
  689. * The extended traffic ID. \
  690. * If the TID is unknown, the extended TID is set to \
  691. * HTT_TX_EXT_TID_INVALID. \
  692. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  693. * value of the QoS TID. \
  694. * If the tx frame is non-QoS data, then the extended TID is set to \
  695. * HTT_TX_EXT_TID_NON_QOS. \
  696. * If the tx frame is multicast or broadcast, then the extended TID \
  697. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  698. */ \
  699. ext_tid: 5, \
  700. \
  701. /* postponed - \
  702. * This flag indicates whether the tx frame has been downloaded to \
  703. * the target before but discarded by the target, and now is being \
  704. * downloaded again; or if this is a new frame that is being \
  705. * downloaded for the first time. \
  706. * This flag allows the target to determine the correct order for \
  707. * transmitting new vs. old frames. \
  708. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  709. * This flag only applies to HL systems, since in LL systems, \
  710. * the tx flow control is handled entirely within the target. \
  711. */ \
  712. postponed: 1, \
  713. \
  714. /* extension - \
  715. * This flag indicates whether a HTT tx MSDU extension descriptor \
  716. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  717. * \
  718. * 0x0 - no extension MSDU descriptor is present \
  719. * 0x1 - an extension MSDU descriptor immediately follows the \
  720. * regular MSDU descriptor \
  721. */ \
  722. extension: 1, \
  723. \
  724. /* cksum_offload - \
  725. * This flag indicates whether checksum offload is enabled or not \
  726. * for this frame. Target FW use this flag to turn on HW checksumming \
  727. * 0x0 - No checksum offload \
  728. * 0x1 - L3 header checksum only \
  729. * 0x2 - L4 checksum only \
  730. * 0x3 - L3 header checksum + L4 checksum \
  731. */ \
  732. cksum_offload: 2, \
  733. \
  734. /* tx_comp_req - \
  735. * This flag indicates whether Tx Completion \
  736. * from fw is required or not. \
  737. * This flag is only relevant if tx completion is not \
  738. * universally enabled. \
  739. * For all LL systems, tx completion is mandatory, \
  740. * so this flag will be irrelevant. \
  741. * For HL systems tx completion is optional, but HL systems in which \
  742. * the bus throughput exceeds the WLAN throughput will \
  743. * probably want to always use tx completion, and thus \
  744. * would not check this flag. \
  745. * This flag is required when tx completions are not used universally, \
  746. * but are still required for certain tx frames for which \
  747. * an OTA delivery acknowledgment is needed by the host. \
  748. * In practice, this would be for HL systems in which the \
  749. * bus throughput is less than the WLAN throughput. \
  750. * \
  751. * 0x0 - Tx Completion Indication from Fw not required \
  752. * 0x1 - Tx Completion Indication from Fw is required \
  753. */ \
  754. tx_compl_req: 1; \
  755. \
  756. \
  757. /* DWORD 1: MSDU length and ID */ \
  758. A_UINT32 \
  759. len: 16, /* MSDU length, in bytes */ \
  760. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  761. * and this id is used to calculate fragmentation \
  762. * descriptor pointer inside the target based on \
  763. * the base address, configured inside the target. \
  764. */ \
  765. \
  766. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  767. /* frags_desc_ptr - \
  768. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  769. * where the tx frame's fragments reside in memory. \
  770. * This field only applies to LL systems, since in HL systems the \
  771. * (degenerate single-fragment) fragmentation descriptor is created \
  772. * within the target. \
  773. */ \
  774. _paddr__frags_desc_ptr_; \
  775. \
  776. /* DWORD 3 (or 4): peerid, chanfreq */ \
  777. /* \
  778. * Peer ID : Target can use this value to know which peer-id packet \
  779. * destined to. \
  780. * It's intended to be specified by host in case of NAWDS. \
  781. */ \
  782. A_UINT16 peerid; \
  783. \
  784. /* \
  785. * Channel frequency: This identifies the desired channel \
  786. * frequency (in mhz) for tx frames. This is used by FW to help \
  787. * determine when it is safe to transmit or drop frames for \
  788. * off-channel operation. \
  789. * The default value of zero indicates to FW that the corresponding \
  790. * VDEV's home channel (if there is one) is the desired channel \
  791. * frequency. \
  792. */ \
  793. A_UINT16 chanfreq; \
  794. \
  795. /* Reason reserved is commented is increasing the htt structure size \
  796. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  797. * A_UINT32 reserved_dword3_bits0_31; \
  798. */ \
  799. } POSTPACK
  800. /* define a htt_tx_msdu_desc32_t type */
  801. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  802. /* define a htt_tx_msdu_desc64_t type */
  803. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  804. /*
  805. * Make htt_tx_msdu_desc_t be an alias for either
  806. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  807. */
  808. #if HTT_PADDR64
  809. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  810. #else
  811. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  812. #endif
  813. /* decriptor information for Management frame*/
  814. /*
  815. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  816. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  817. */
  818. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  819. extern A_UINT32 mgmt_hdr_len;
  820. PREPACK struct htt_mgmt_tx_desc_t {
  821. A_UINT32 msg_type;
  822. #if HTT_PADDR64
  823. A_UINT64 frag_paddr; /* DMAble address of the data */
  824. #else
  825. A_UINT32 frag_paddr; /* DMAble address of the data */
  826. #endif
  827. A_UINT32 desc_id; /* returned to host during completion
  828. * to free the meory*/
  829. A_UINT32 len; /* Fragment length */
  830. A_UINT32 vdev_id; /* virtual device ID*/
  831. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  832. } POSTPACK;
  833. PREPACK struct htt_mgmt_tx_compl_ind {
  834. A_UINT32 desc_id;
  835. A_UINT32 status;
  836. } POSTPACK;
  837. /*
  838. * This SDU header size comes from the summation of the following:
  839. * 1. Max of:
  840. * a. Native WiFi header, for native WiFi frames: 24 bytes
  841. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  842. * b. 802.11 header, for raw frames: 36 bytes
  843. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  844. * QoS header, HT header)
  845. * c. 802.3 header, for ethernet frames: 14 bytes
  846. * (destination address, source address, ethertype / length)
  847. * 2. Max of:
  848. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  849. * b. IPv6 header, up through the Traffic Class: 2 bytes
  850. * 3. 802.1Q VLAN header: 4 bytes
  851. * 4. LLC/SNAP header: 8 bytes
  852. */
  853. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  854. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  855. #define HTT_TX_HDR_SIZE_ETHERNET 14
  856. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  857. A_COMPILE_TIME_ASSERT(
  858. htt_encap_hdr_size_max_check_nwifi,
  859. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  860. A_COMPILE_TIME_ASSERT(
  861. htt_encap_hdr_size_max_check_enet,
  862. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  863. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  864. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  865. #define HTT_TX_HDR_SIZE_802_1Q 4
  866. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  867. #define HTT_COMMON_TX_FRM_HDR_LEN \
  868. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  869. HTT_TX_HDR_SIZE_802_1Q + \
  870. HTT_TX_HDR_SIZE_LLC_SNAP)
  871. #define HTT_HL_TX_FRM_HDR_LEN \
  872. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  873. #define HTT_LL_TX_FRM_HDR_LEN \
  874. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  875. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  876. /* dword 0 */
  877. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  880. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  881. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  882. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  884. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  885. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  886. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  887. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  888. #define HTT_TX_DESC_PKT_TYPE_S 13
  889. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  890. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  892. #define HTT_TX_DESC_VDEV_ID_S 16
  893. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  894. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  895. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  896. #define HTT_TX_DESC_EXT_TID_S 22
  897. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  898. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  899. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  900. #define HTT_TX_DESC_POSTPONED_S 27
  901. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  902. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  903. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  904. #define HTT_TX_DESC_EXTENSION_S 28
  905. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  906. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  907. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  908. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  909. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  910. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  911. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  912. #define HTT_TX_DESC_TX_COMP_S 31
  913. /* dword 1 */
  914. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  915. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  916. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  917. #define HTT_TX_DESC_FRM_LEN_S 0
  918. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  919. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  920. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  921. #define HTT_TX_DESC_FRM_ID_S 16
  922. /* dword 2 */
  923. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  925. /* for systems using 64-bit format for bus addresses */
  926. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  927. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  928. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  929. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  930. /* for systems using 32-bit format for bus addresses */
  931. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  932. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  933. /* dword 3 */
  934. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  935. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  936. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  937. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  938. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  939. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  940. #if HTT_PADDR64
  941. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  942. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  943. #else
  944. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  945. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  946. #endif
  947. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  948. #define HTT_TX_DESC_PEER_ID_S 0
  949. /*
  950. * TEMPORARY:
  951. * The original definitions for the PEER_ID fields contained typos
  952. * (with _DESC_PADDR appended to this PEER_ID field name).
  953. * Retain deprecated original names for PEER_ID fields until all code that
  954. * refers to them has been updated.
  955. */
  956. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  957. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  958. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  959. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  960. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  961. HTT_TX_DESC_PEER_ID_M
  962. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  963. HTT_TX_DESC_PEER_ID_S
  964. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  965. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  966. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  967. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  968. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  969. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  970. #if HTT_PADDR64
  971. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  972. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  973. #else
  974. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  975. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  976. #endif
  977. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  978. #define HTT_TX_DESC_CHAN_FREQ_S 16
  979. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  980. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  981. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  987. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  988. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  994. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  995. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1002. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1009. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1016. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1023. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1030. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1034. } while (0)
  1035. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1036. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1037. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1038. do { \
  1039. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1040. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1041. } while (0)
  1042. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1043. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1044. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1045. do { \
  1046. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1047. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1048. } while (0)
  1049. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1050. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1051. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1052. do { \
  1053. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1054. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1055. } while (0)
  1056. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1057. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1058. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1059. do { \
  1060. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1061. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1062. } while (0)
  1063. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1064. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1065. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1066. do { \
  1067. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1068. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1069. } while (0)
  1070. /* enums used in the HTT tx MSDU extension descriptor */
  1071. enum {
  1072. htt_tx_guard_interval_regular = 0,
  1073. htt_tx_guard_interval_short = 1,
  1074. };
  1075. enum {
  1076. htt_tx_preamble_type_ofdm = 0,
  1077. htt_tx_preamble_type_cck = 1,
  1078. htt_tx_preamble_type_ht = 2,
  1079. htt_tx_preamble_type_vht = 3,
  1080. };
  1081. enum {
  1082. htt_tx_bandwidth_5MHz = 0,
  1083. htt_tx_bandwidth_10MHz = 1,
  1084. htt_tx_bandwidth_20MHz = 2,
  1085. htt_tx_bandwidth_40MHz = 3,
  1086. htt_tx_bandwidth_80MHz = 4,
  1087. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1088. };
  1089. /**
  1090. * @brief HTT tx MSDU extension descriptor
  1091. * @details
  1092. * If the target supports HTT tx MSDU extension descriptors, the host has
  1093. * the option of appending the following struct following the regular
  1094. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1095. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1096. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1097. * tx specs for each frame.
  1098. */
  1099. PREPACK struct htt_tx_msdu_desc_ext_t {
  1100. /* DWORD 0: flags */
  1101. A_UINT32
  1102. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1103. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1104. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1105. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1106. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1107. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1108. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1109. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1110. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1111. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1112. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1113. /* DWORD 1: tx power, tx rate, tx BW */
  1114. A_UINT32
  1115. /* pwr -
  1116. * Specify what power the tx frame needs to be transmitted at.
  1117. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1118. * The value needs to be appropriately sign-extended when extracting
  1119. * the value from the message and storing it in a variable that is
  1120. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1121. * automatically handles this sign-extension.)
  1122. * If the transmission uses multiple tx chains, this power spec is
  1123. * the total transmit power, assuming incoherent combination of
  1124. * per-chain power to produce the total power.
  1125. */
  1126. pwr: 8,
  1127. /* mcs_mask -
  1128. * Specify the allowable values for MCS index (modulation and coding)
  1129. * to use for transmitting the frame.
  1130. *
  1131. * For HT / VHT preamble types, this mask directly corresponds to
  1132. * the HT or VHT MCS indices that are allowed. For each bit N set
  1133. * within the mask, MCS index N is allowed for transmitting the frame.
  1134. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1135. * rates versus OFDM rates, so the host has the option of specifying
  1136. * that the target must transmit the frame with CCK or OFDM rates
  1137. * (not HT or VHT), but leaving the decision to the target whether
  1138. * to use CCK or OFDM.
  1139. *
  1140. * For CCK and OFDM, the bits within this mask are interpreted as
  1141. * follows:
  1142. * bit 0 -> CCK 1 Mbps rate is allowed
  1143. * bit 1 -> CCK 2 Mbps rate is allowed
  1144. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1145. * bit 3 -> CCK 11 Mbps rate is allowed
  1146. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1147. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1148. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1149. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1150. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1151. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1152. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1153. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1154. *
  1155. * The MCS index specification needs to be compatible with the
  1156. * bandwidth mask specification. For example, a MCS index == 9
  1157. * specification is inconsistent with a preamble type == VHT,
  1158. * Nss == 1, and channel bandwidth == 20 MHz.
  1159. *
  1160. * Furthermore, the host has only a limited ability to specify to
  1161. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1162. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1163. */
  1164. mcs_mask: 12,
  1165. /* nss_mask -
  1166. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1167. * Each bit in this mask corresponds to a Nss value:
  1168. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1169. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1170. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1171. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1172. * The values in the Nss mask must be suitable for the recipient, e.g.
  1173. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1174. * recipient which only supports 2x2 MIMO.
  1175. */
  1176. nss_mask: 4,
  1177. /* guard_interval -
  1178. * Specify a htt_tx_guard_interval enum value to indicate whether
  1179. * the transmission should use a regular guard interval or a
  1180. * short guard interval.
  1181. */
  1182. guard_interval: 1,
  1183. /* preamble_type_mask -
  1184. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1185. * may choose from for transmitting this frame.
  1186. * The bits in this mask correspond to the values in the
  1187. * htt_tx_preamble_type enum. For example, to allow the target
  1188. * to transmit the frame as either CCK or OFDM, this field would
  1189. * be set to
  1190. * (1 << htt_tx_preamble_type_ofdm) |
  1191. * (1 << htt_tx_preamble_type_cck)
  1192. */
  1193. preamble_type_mask: 4,
  1194. reserved1_31_29: 3; /* unused, set to 0x0 */
  1195. /* DWORD 2: tx chain mask, tx retries */
  1196. A_UINT32
  1197. /* chain_mask - specify which chains to transmit from */
  1198. chain_mask: 4,
  1199. /* retry_limit -
  1200. * Specify the maximum number of transmissions, including the
  1201. * initial transmission, to attempt before giving up if no ack
  1202. * is received.
  1203. * If the tx rate is specified, then all retries shall use the
  1204. * same rate as the initial transmission.
  1205. * If no tx rate is specified, the target can choose whether to
  1206. * retain the original rate during the retransmissions, or to
  1207. * fall back to a more robust rate.
  1208. */
  1209. retry_limit: 4,
  1210. /* bandwidth_mask -
  1211. * Specify what channel widths may be used for the transmission.
  1212. * A value of zero indicates "don't care" - the target may choose
  1213. * the transmission bandwidth.
  1214. * The bits within this mask correspond to the htt_tx_bandwidth
  1215. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1216. * The bandwidth_mask must be consistent with the preamble_type_mask
  1217. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1218. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1219. */
  1220. bandwidth_mask: 6,
  1221. reserved2_31_14: 18; /* unused, set to 0x0 */
  1222. /* DWORD 3: tx expiry time (TSF) LSBs */
  1223. A_UINT32 expire_tsf_lo;
  1224. /* DWORD 4: tx expiry time (TSF) MSBs */
  1225. A_UINT32 expire_tsf_hi;
  1226. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1227. } POSTPACK;
  1228. /* DWORD 0 */
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1249. /* DWORD 1 */
  1250. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1251. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1252. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1253. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1254. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1255. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1256. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1257. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1258. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1259. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1260. /* DWORD 2 */
  1261. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1262. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1263. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1264. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1265. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1266. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1267. /* DWORD 0 */
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1269. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1275. } while (0)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1277. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1283. } while (0)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1285. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL( \
  1290. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1291. ((_var) |= ((_val) \
  1292. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1293. } while (0)
  1294. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1295. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1296. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1298. do { \
  1299. HTT_CHECK_SET_VAL( \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1301. ((_var) |= ((_val) \
  1302. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1303. } while (0)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1305. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1306. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1311. } while (0)
  1312. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1313. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1314. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1315. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1316. do { \
  1317. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1318. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1319. } while (0)
  1320. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1321. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1322. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1323. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1327. } while (0)
  1328. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1335. } while (0)
  1336. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1337. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1338. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1339. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1342. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1343. } while (0)
  1344. /* DWORD 1 */
  1345. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1349. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1350. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1351. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1352. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1353. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1354. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1355. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1356. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1357. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1361. } while (0)
  1362. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1363. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1364. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1365. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1369. } while (0)
  1370. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1377. } while (0)
  1378. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1379. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1380. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1381. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1384. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1385. } while (0)
  1386. /* DWORD 2 */
  1387. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1388. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1389. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1390. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1391. do { \
  1392. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1393. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1394. } while (0)
  1395. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1396. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1397. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1398. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1399. do { \
  1400. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1401. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1402. } while (0)
  1403. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1404. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1405. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1406. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1407. do { \
  1408. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1409. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1410. } while (0)
  1411. typedef enum {
  1412. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1413. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1414. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1415. } htt_11ax_ltf_subtype_t;
  1416. typedef enum {
  1417. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1418. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1419. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1420. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1421. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1422. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1423. } htt_tx_ext2_preamble_type_t;
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1431. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1432. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1433. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1434. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1435. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1436. /**
  1437. * @brief HTT tx MSDU extension descriptor v2
  1438. * @details
  1439. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1440. * is received as tcl_exit_base->host_meta_info in firmware.
  1441. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1442. * are already part of tcl_exit_base.
  1443. */
  1444. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1445. /* DWORD 0: flags */
  1446. A_UINT32
  1447. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1448. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1449. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1450. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1451. valid_retries : 1, /* if set, tx retries spec is valid */
  1452. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1453. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1454. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1455. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1456. valid_key_flags : 1, /* if set, key flags is valid */
  1457. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1458. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1459. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1460. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1461. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1462. 1 = ENCRYPT,
  1463. 2 ~ 3 - Reserved */
  1464. /* retry_limit -
  1465. * Specify the maximum number of transmissions, including the
  1466. * initial transmission, to attempt before giving up if no ack
  1467. * is received.
  1468. * If the tx rate is specified, then all retries shall use the
  1469. * same rate as the initial transmission.
  1470. * If no tx rate is specified, the target can choose whether to
  1471. * retain the original rate during the retransmissions, or to
  1472. * fall back to a more robust rate.
  1473. */
  1474. retry_limit : 4,
  1475. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1476. * Valid only for 11ax preamble types HE_SU
  1477. * and HE_EXT_SU
  1478. */
  1479. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1480. * Valid only for 11ax preamble types HE_SU
  1481. * and HE_EXT_SU
  1482. */
  1483. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1484. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1485. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1486. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1487. */
  1488. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1489. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1490. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1491. * Use cases:
  1492. * Any time firmware uses TQM-BYPASS for Data
  1493. * TID, firmware expect host to set this bit.
  1494. */
  1495. /* DWORD 1: tx power, tx rate */
  1496. A_UINT32
  1497. power : 8, /* unit of the power field is 0.5 dbm
  1498. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1499. * signed value ranging from -64dbm to 63.5 dbm
  1500. */
  1501. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1502. * Setting more than one MCS isn't currently
  1503. * supported by the target (but is supported
  1504. * in the interface in case in the future
  1505. * the target supports specifications of
  1506. * a limited set of MCS values.
  1507. */
  1508. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1509. * Setting more than one Nss isn't currently
  1510. * supported by the target (but is supported
  1511. * in the interface in case in the future
  1512. * the target supports specifications of
  1513. * a limited set of Nss values.
  1514. */
  1515. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1516. update_peer_cache : 1; /* When set these custom values will be
  1517. * used for all packets, until the next
  1518. * update via this ext header.
  1519. * This is to make sure not all packets
  1520. * need to include this header.
  1521. */
  1522. /* DWORD 2: tx chain mask, tx retries */
  1523. A_UINT32
  1524. /* chain_mask - specify which chains to transmit from */
  1525. chain_mask : 8,
  1526. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1527. * TODO: Update Enum values for key_flags
  1528. */
  1529. /*
  1530. * Channel frequency: This identifies the desired channel
  1531. * frequency (in MHz) for tx frames. This is used by FW to help
  1532. * determine when it is safe to transmit or drop frames for
  1533. * off-channel operation.
  1534. * The default value of zero indicates to FW that the corresponding
  1535. * VDEV's home channel (if there is one) is the desired channel
  1536. * frequency.
  1537. */
  1538. chanfreq : 16;
  1539. /* DWORD 3: tx expiry time (TSF) LSBs */
  1540. A_UINT32 expire_tsf_lo;
  1541. /* DWORD 4: tx expiry time (TSF) MSBs */
  1542. A_UINT32 expire_tsf_hi;
  1543. /* DWORD 5: flags to control routing / processing of the MSDU */
  1544. A_UINT32
  1545. /* learning_frame
  1546. * When this flag is set, this frame will be dropped by FW
  1547. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1548. */
  1549. learning_frame : 1,
  1550. /* send_as_standalone
  1551. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1552. * i.e. with no A-MSDU or A-MPDU aggregation.
  1553. * The scope is extended to other use-cases.
  1554. */
  1555. send_as_standalone : 1,
  1556. /* is_host_opaque_valid
  1557. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1558. * with valid information.
  1559. */
  1560. is_host_opaque_valid : 1,
  1561. rsvd0 : 29;
  1562. /* DWORD 6 : Host opaque cookie for special frames */
  1563. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1564. rsvd1 : 16;
  1565. /*
  1566. * This structure can be expanded further up to 40 bytes
  1567. * by adding further DWORDs as needed.
  1568. */
  1569. } POSTPACK;
  1570. /* DWORD 0 */
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1597. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1598. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1599. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1600. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1601. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1602. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1603. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1604. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1605. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1606. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1607. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1608. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1611. /* DWORD 1 */
  1612. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1613. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1614. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1615. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1616. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1617. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1618. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1619. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1620. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1621. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1622. /* DWORD 2 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1624. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1625. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1626. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1627. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1628. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1629. /* DWORD 5 */
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1636. /* DWORD 6 */
  1637. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1638. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1639. /* DWORD 0 */
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL( \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1671. ((_var) |= ((_val) \
  1672. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1676. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1689. } while (0)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1691. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1692. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1694. do { \
  1695. HTT_CHECK_SET_VAL( \
  1696. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1697. ((_var) |= ((_val) \
  1698. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1699. } while (0)
  1700. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1701. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1702. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1703. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1704. do { \
  1705. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1706. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1707. } while (0)
  1708. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1709. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1710. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1711. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1712. do { \
  1713. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1714. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1715. } while (0)
  1716. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1717. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1718. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1719. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1720. do { \
  1721. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1722. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1723. } while (0)
  1724. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1725. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1726. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1727. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1728. do { \
  1729. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1730. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1731. } while (0)
  1732. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1733. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1734. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1735. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1736. do { \
  1737. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1738. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1739. } while (0)
  1740. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1741. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1742. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1743. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1744. do { \
  1745. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1746. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1747. } while (0)
  1748. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1752. do { \
  1753. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1754. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1755. } while (0)
  1756. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1757. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1758. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1759. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1760. do { \
  1761. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1762. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1763. } while (0)
  1764. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1765. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1766. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1767. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1768. do { \
  1769. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1770. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1771. } while (0)
  1772. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1773. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1774. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1775. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1776. do { \
  1777. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1778. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1779. } while (0)
  1780. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1781. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1782. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1783. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1784. do { \
  1785. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1786. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1787. } while (0)
  1788. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1794. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1795. } while (0)
  1796. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1797. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1798. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1799. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1800. do { \
  1801. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1802. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1803. } while (0)
  1804. /* DWORD 1 */
  1805. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1809. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1810. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1811. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1812. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1813. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1814. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1815. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1816. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1817. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1818. do { \
  1819. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1820. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1821. } while (0)
  1822. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1829. } while (0)
  1830. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1840. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1841. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1845. } while (0)
  1846. /* DWORD 2 */
  1847. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1848. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1849. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1850. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1851. do { \
  1852. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1853. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1854. } while (0)
  1855. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1856. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1857. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1858. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1859. do { \
  1860. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1861. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1862. } while (0)
  1863. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1864. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1865. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1866. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1867. do { \
  1868. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1869. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1870. } while (0)
  1871. /* DWORD 5 */
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1873. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1874. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1878. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1879. } while (0)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1881. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1882. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1886. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1887. } while (0)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1889. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1890. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1895. } while (0)
  1896. /* DWORD 6 */
  1897. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1898. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1899. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1900. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1904. } while (0)
  1905. typedef enum {
  1906. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1907. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1908. } htt_tcl_metadata_type;
  1909. /**
  1910. * @brief HTT TCL command number format
  1911. * @details
  1912. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1913. * available to firmware as tcl_exit_base->tcl_status_number.
  1914. * For regular / multicast packets host will send vdev and mac id and for
  1915. * NAWDS packets, host will send peer id.
  1916. * A_UINT32 is used to avoid endianness conversion problems.
  1917. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1918. */
  1919. typedef struct {
  1920. A_UINT32
  1921. type: 1, /* vdev_id based or peer_id based */
  1922. rsvd: 31;
  1923. } htt_tx_tcl_vdev_or_peer_t;
  1924. typedef struct {
  1925. A_UINT32
  1926. type: 1, /* vdev_id based or peer_id based */
  1927. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1928. vdev_id: 8,
  1929. pdev_id: 2,
  1930. host_inspected:1,
  1931. rsvd: 19;
  1932. } htt_tx_tcl_vdev_metadata;
  1933. typedef struct {
  1934. A_UINT32
  1935. type: 1, /* vdev_id based or peer_id based */
  1936. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1937. peer_id: 14,
  1938. rsvd: 16;
  1939. } htt_tx_tcl_peer_metadata;
  1940. PREPACK struct htt_tx_tcl_metadata {
  1941. union {
  1942. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1943. htt_tx_tcl_vdev_metadata vdev_meta;
  1944. htt_tx_tcl_peer_metadata peer_meta;
  1945. };
  1946. } POSTPACK;
  1947. /* DWORD 0 */
  1948. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1949. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1950. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1951. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1952. /* VDEV metadata */
  1953. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1954. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1955. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1956. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1957. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1958. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1959. /* PEER metadata */
  1960. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1961. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1962. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1963. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1964. HTT_TX_TCL_METADATA_TYPE_S)
  1965. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1969. } while (0)
  1970. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1971. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1972. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1973. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1977. } while (0)
  1978. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1979. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1980. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1981. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1985. } while (0)
  1986. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1987. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1988. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1989. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1992. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1993. } while (0)
  1994. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1995. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1996. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1997. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2001. } while (0)
  2002. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2003. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2004. HTT_TX_TCL_METADATA_PEER_ID_S)
  2005. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2009. } while (0)
  2010. typedef enum {
  2011. HTT_TX_FW2WBM_TX_STATUS_OK,
  2012. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2013. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2014. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2015. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2016. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2017. HTT_TX_FW2WBM_TX_STATUS_MAX
  2018. } htt_tx_fw2wbm_tx_status_t;
  2019. typedef enum {
  2020. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2021. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2022. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2023. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2024. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2025. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2026. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2027. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2028. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2029. } htt_tx_fw2wbm_reinject_reason_t;
  2030. /**
  2031. * @brief HTT TX WBM Completion from firmware to host
  2032. * @details
  2033. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2034. * DWORD 3 and 4 for software based completions (Exception frames and
  2035. * TQM bypass frames)
  2036. * For software based completions, wbm_release_ring->release_source_module will
  2037. * be set to release_source_fw
  2038. */
  2039. PREPACK struct htt_tx_wbm_completion {
  2040. A_UINT32
  2041. sch_cmd_id: 24,
  2042. exception_frame: 1, /* If set, this packet was queued via exception path */
  2043. rsvd0_31_25: 7;
  2044. A_UINT32
  2045. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2046. * reception of an ACK or BA, this field indicates
  2047. * the RSSI of the received ACK or BA frame.
  2048. * When the frame is removed as result of a direct
  2049. * remove command from the SW, this field is set
  2050. * to 0x0 (which is never a valid value when real
  2051. * RSSI is available).
  2052. * Units: dB w.r.t noise floor
  2053. */
  2054. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2055. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2056. rsvd1_31_16: 16;
  2057. } POSTPACK;
  2058. /* DWORD 0 */
  2059. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2060. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2061. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2062. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2063. /* DWORD 1 */
  2064. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2065. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2066. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2067. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2068. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2069. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2070. /* DWORD 0 */
  2071. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2072. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2073. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2074. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2078. } while (0)
  2079. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2080. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2081. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2082. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2086. } while (0)
  2087. /* DWORD 1 */
  2088. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2090. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2091. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2098. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2099. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2103. } while (0)
  2104. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2105. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2106. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2107. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2111. } while (0)
  2112. /**
  2113. * @brief HTT TX WBM Completion from firmware to host
  2114. * @details
  2115. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2116. * (WBM) offload HW.
  2117. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2118. * For software based completions, release_source_module will
  2119. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2120. * struct wbm_release_ring and then switch to this after looking at
  2121. * release_source_module.
  2122. */
  2123. PREPACK struct htt_tx_wbm_completion_v2 {
  2124. A_UINT32
  2125. used_by_hw0; /* Refer to struct wbm_release_ring */
  2126. A_UINT32
  2127. used_by_hw1; /* Refer to struct wbm_release_ring */
  2128. A_UINT32
  2129. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2130. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2131. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2132. exception_frame: 1,
  2133. rsvd0: 12, /* For future use */
  2134. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2135. rsvd1: 1; /* For future use */
  2136. A_UINT32
  2137. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2138. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2139. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2140. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2141. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2142. */
  2143. A_UINT32
  2144. data1: 32;
  2145. A_UINT32
  2146. data2: 32;
  2147. A_UINT32
  2148. used_by_hw3; /* Refer to struct wbm_release_ring */
  2149. } POSTPACK;
  2150. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2151. /* DWORD 3 */
  2152. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2153. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2154. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2155. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2156. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2157. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2158. /* DWORD 3 */
  2159. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2160. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2161. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2162. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2166. } while (0)
  2167. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2168. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2169. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2170. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2174. } while (0)
  2175. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2176. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2177. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2178. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2182. } while (0)
  2183. /**
  2184. * @brief HTT TX WBM transmit status from firmware to host
  2185. * @details
  2186. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2187. * (WBM) offload HW.
  2188. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2189. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2190. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2191. */
  2192. PREPACK struct htt_tx_wbm_transmit_status {
  2193. A_UINT32
  2194. sch_cmd_id: 24,
  2195. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2196. * reception of an ACK or BA, this field indicates
  2197. * the RSSI of the received ACK or BA frame.
  2198. * When the frame is removed as result of a direct
  2199. * remove command from the SW, this field is set
  2200. * to 0x0 (which is never a valid value when real
  2201. * RSSI is available).
  2202. * Units: dB w.r.t noise floor
  2203. */
  2204. A_UINT32
  2205. sw_peer_id: 16,
  2206. tid_num: 5,
  2207. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2208. * and tid_num fields contain valid data.
  2209. * If this "valid" flag is not set, the
  2210. * sw_peer_id and tid_num fields must be ignored.
  2211. */
  2212. mcast: 1,
  2213. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2214. * contains valid data.
  2215. */
  2216. reserved0: 8;
  2217. A_UINT32
  2218. reserved1: 32;
  2219. } POSTPACK;
  2220. /* DWORD 4 */
  2221. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2222. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2223. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2224. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2225. /* DWORD 5 */
  2226. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2227. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2228. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2229. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2230. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2231. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2232. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2233. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2234. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2235. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2236. /* DWORD 4 */
  2237. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2238. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2239. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2240. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2244. } while (0)
  2245. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2246. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2247. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2248. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2252. } while (0)
  2253. /* DWORD 5 */
  2254. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2255. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2256. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2257. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2261. } while (0)
  2262. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2264. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2265. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2269. } while (0)
  2270. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2272. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2273. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2277. } while (0)
  2278. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2279. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2280. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2281. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2285. } while (0)
  2286. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2287. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2288. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2289. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2290. do { \
  2291. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2292. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2293. } while (0)
  2294. /**
  2295. * @brief HTT TX WBM reinject status from firmware to host
  2296. * @details
  2297. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2298. * (WBM) offload HW.
  2299. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2300. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2301. */
  2302. PREPACK struct htt_tx_wbm_reinject_status {
  2303. A_UINT32
  2304. reserved0: 32;
  2305. A_UINT32
  2306. reserved1: 32;
  2307. A_UINT32
  2308. reserved2: 32;
  2309. } POSTPACK;
  2310. /**
  2311. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2312. * @details
  2313. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2314. * (WBM) offload HW.
  2315. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2316. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2317. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2318. * STA side.
  2319. */
  2320. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2321. A_UINT32
  2322. mec_sa_addr_31_0;
  2323. A_UINT32
  2324. mec_sa_addr_47_32: 16,
  2325. sa_ast_index: 16;
  2326. A_UINT32
  2327. vdev_id: 8,
  2328. reserved0: 24;
  2329. } POSTPACK;
  2330. /* DWORD 4 - mec_sa_addr_31_0 */
  2331. /* DWORD 5 */
  2332. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2333. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2334. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2336. /* DWORD 6 */
  2337. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2338. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2339. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2340. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2341. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2342. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2343. do { \
  2344. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2345. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2346. } while (0)
  2347. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2348. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2349. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2350. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2354. } while (0)
  2355. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2356. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2357. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2358. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2359. do { \
  2360. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2361. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2362. } while (0)
  2363. typedef enum {
  2364. TX_FLOW_PRIORITY_BE,
  2365. TX_FLOW_PRIORITY_HIGH,
  2366. TX_FLOW_PRIORITY_LOW,
  2367. } htt_tx_flow_priority_t;
  2368. typedef enum {
  2369. TX_FLOW_LATENCY_SENSITIVE,
  2370. TX_FLOW_LATENCY_INSENSITIVE,
  2371. } htt_tx_flow_latency_t;
  2372. typedef enum {
  2373. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2374. TX_FLOW_INTERACTIVE_TRAFFIC,
  2375. TX_FLOW_PERIODIC_TRAFFIC,
  2376. TX_FLOW_BURSTY_TRAFFIC,
  2377. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2378. } htt_tx_flow_traffic_pattern_t;
  2379. /**
  2380. * @brief HTT TX Flow search metadata format
  2381. * @details
  2382. * Host will set this metadata in flow table's flow search entry along with
  2383. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2384. * firmware and TQM ring if the flow search entry wins.
  2385. * This metadata is available to firmware in that first MSDU's
  2386. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2387. * to one of the available flows for specific tid and returns the tqm flow
  2388. * pointer as part of htt_tx_map_flow_info message.
  2389. */
  2390. PREPACK struct htt_tx_flow_metadata {
  2391. A_UINT32
  2392. rsvd0_1_0: 2,
  2393. tid: 4,
  2394. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2395. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2396. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2397. * Else choose final tid based on latency, priority.
  2398. */
  2399. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2400. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2401. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2402. } POSTPACK;
  2403. /* DWORD 0 */
  2404. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2405. #define HTT_TX_FLOW_METADATA_TID_S 2
  2406. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2407. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2408. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2409. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2410. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2411. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2412. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2413. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2414. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2415. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2416. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2417. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2418. /* DWORD 0 */
  2419. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2420. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2421. HTT_TX_FLOW_METADATA_TID_S)
  2422. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2423. do { \
  2424. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2425. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2426. } while (0)
  2427. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2428. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2429. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2430. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2431. do { \
  2432. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2433. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2434. } while (0)
  2435. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2436. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2437. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2438. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2442. } while (0)
  2443. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2444. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2445. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2446. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2450. } while (0)
  2451. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2452. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2453. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2454. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2458. } while (0)
  2459. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2460. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2461. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2462. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2465. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2466. } while (0)
  2467. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2468. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2469. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2470. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2471. do { \
  2472. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2473. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2474. } while (0)
  2475. /**
  2476. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2477. *
  2478. * @details
  2479. * HTT wds entry from source port learning
  2480. * Host will learn wds entries from rx and send this message to firmware
  2481. * to enable firmware to configure/delete AST entries for wds clients.
  2482. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2483. * and when SA's entry is deleted, firmware removes this AST entry
  2484. *
  2485. * The message would appear as follows:
  2486. *
  2487. * |31 30|29 |17 16|15 8|7 0|
  2488. * |----------------+----------------+----------------+----------------|
  2489. * | rsvd0 |PDVID| vdev_id | msg_type |
  2490. * |-------------------------------------------------------------------|
  2491. * | sa_addr_31_0 |
  2492. * |-------------------------------------------------------------------|
  2493. * | | ta_peer_id | sa_addr_47_32 |
  2494. * |-------------------------------------------------------------------|
  2495. * Where PDVID = pdev_id
  2496. *
  2497. * The message is interpreted as follows:
  2498. *
  2499. * dword0 - b'0:7 - msg_type: This will be set to
  2500. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2501. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2502. *
  2503. * dword0 - b'8:15 - vdev_id
  2504. *
  2505. * dword0 - b'16:17 - pdev_id
  2506. *
  2507. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2508. *
  2509. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2510. *
  2511. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2512. *
  2513. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2514. */
  2515. PREPACK struct htt_wds_entry {
  2516. A_UINT32
  2517. msg_type: 8,
  2518. vdev_id: 8,
  2519. pdev_id: 2,
  2520. rsvd0: 14;
  2521. A_UINT32 sa_addr_31_0;
  2522. A_UINT32
  2523. sa_addr_47_32: 16,
  2524. ta_peer_id: 14,
  2525. rsvd2: 2;
  2526. } POSTPACK;
  2527. /* DWORD 0 */
  2528. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2529. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2530. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2531. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2532. /* DWORD 2 */
  2533. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2534. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2535. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2536. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2537. /* DWORD 0 */
  2538. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2539. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2540. HTT_WDS_ENTRY_VDEV_ID_S)
  2541. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2544. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2545. } while (0)
  2546. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2547. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2548. HTT_WDS_ENTRY_PDEV_ID_S)
  2549. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2550. do { \
  2551. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2552. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2553. } while (0)
  2554. /* DWORD 2 */
  2555. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2556. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2557. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2558. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2559. do { \
  2560. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2561. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2562. } while (0)
  2563. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2564. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2565. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2566. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2567. do { \
  2568. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2569. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2570. } while (0)
  2571. /**
  2572. * @brief MAC DMA rx ring setup specification
  2573. * @details
  2574. * To allow for dynamic rx ring reconfiguration and to avoid race
  2575. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2576. * it uses. Instead, it sends this message to the target, indicating how
  2577. * the rx ring used by the host should be set up and maintained.
  2578. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2579. * specifications.
  2580. *
  2581. * |31 16|15 8|7 0|
  2582. * |---------------------------------------------------------------|
  2583. * header: | reserved | num rings | msg type |
  2584. * |---------------------------------------------------------------|
  2585. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2586. #if HTT_PADDR64
  2587. * | FW_IDX shadow register physical address (bits 63:32) |
  2588. #endif
  2589. * |---------------------------------------------------------------|
  2590. * | rx ring base physical address (bits 31:0) |
  2591. #if HTT_PADDR64
  2592. * | rx ring base physical address (bits 63:32) |
  2593. #endif
  2594. * |---------------------------------------------------------------|
  2595. * | rx ring buffer size | rx ring length |
  2596. * |---------------------------------------------------------------|
  2597. * | FW_IDX initial value | enabled flags |
  2598. * |---------------------------------------------------------------|
  2599. * | MSDU payload offset | 802.11 header offset |
  2600. * |---------------------------------------------------------------|
  2601. * | PPDU end offset | PPDU start offset |
  2602. * |---------------------------------------------------------------|
  2603. * | MPDU end offset | MPDU start offset |
  2604. * |---------------------------------------------------------------|
  2605. * | MSDU end offset | MSDU start offset |
  2606. * |---------------------------------------------------------------|
  2607. * | frag info offset | rx attention offset |
  2608. * |---------------------------------------------------------------|
  2609. * payload 2, if present, has the same format as payload 1
  2610. * Header fields:
  2611. * - MSG_TYPE
  2612. * Bits 7:0
  2613. * Purpose: identifies this as an rx ring configuration message
  2614. * Value: 0x2
  2615. * - NUM_RINGS
  2616. * Bits 15:8
  2617. * Purpose: indicates whether the host is setting up one rx ring or two
  2618. * Value: 1 or 2
  2619. * Payload:
  2620. * for systems using 64-bit format for bus addresses:
  2621. * - IDX_SHADOW_REG_PADDR_LO
  2622. * Bits 31:0
  2623. * Value: lower 4 bytes of physical address of the host's
  2624. * FW_IDX shadow register
  2625. * - IDX_SHADOW_REG_PADDR_HI
  2626. * Bits 31:0
  2627. * Value: upper 4 bytes of physical address of the host's
  2628. * FW_IDX shadow register
  2629. * - RING_BASE_PADDR_LO
  2630. * Bits 31:0
  2631. * Value: lower 4 bytes of physical address of the host's rx ring
  2632. * - RING_BASE_PADDR_HI
  2633. * Bits 31:0
  2634. * Value: uppper 4 bytes of physical address of the host's rx ring
  2635. * for systems using 32-bit format for bus addresses:
  2636. * - IDX_SHADOW_REG_PADDR
  2637. * Bits 31:0
  2638. * Value: physical address of the host's FW_IDX shadow register
  2639. * - RING_BASE_PADDR
  2640. * Bits 31:0
  2641. * Value: physical address of the host's rx ring
  2642. * - RING_LEN
  2643. * Bits 15:0
  2644. * Value: number of elements in the rx ring
  2645. * - RING_BUF_SZ
  2646. * Bits 31:16
  2647. * Value: size of the buffers referenced by the rx ring, in byte units
  2648. * - ENABLED_FLAGS
  2649. * Bits 15:0
  2650. * Value: 1-bit flags to show whether different rx fields are enabled
  2651. * bit 0: 802.11 header enabled (1) or disabled (0)
  2652. * bit 1: MSDU payload enabled (1) or disabled (0)
  2653. * bit 2: PPDU start enabled (1) or disabled (0)
  2654. * bit 3: PPDU end enabled (1) or disabled (0)
  2655. * bit 4: MPDU start enabled (1) or disabled (0)
  2656. * bit 5: MPDU end enabled (1) or disabled (0)
  2657. * bit 6: MSDU start enabled (1) or disabled (0)
  2658. * bit 7: MSDU end enabled (1) or disabled (0)
  2659. * bit 8: rx attention enabled (1) or disabled (0)
  2660. * bit 9: frag info enabled (1) or disabled (0)
  2661. * bit 10: unicast rx enabled (1) or disabled (0)
  2662. * bit 11: multicast rx enabled (1) or disabled (0)
  2663. * bit 12: ctrl rx enabled (1) or disabled (0)
  2664. * bit 13: mgmt rx enabled (1) or disabled (0)
  2665. * bit 14: null rx enabled (1) or disabled (0)
  2666. * bit 15: phy data rx enabled (1) or disabled (0)
  2667. * - IDX_INIT_VAL
  2668. * Bits 31:16
  2669. * Purpose: Specify the initial value for the FW_IDX.
  2670. * Value: the number of buffers initially present in the host's rx ring
  2671. * - OFFSET_802_11_HDR
  2672. * Bits 15:0
  2673. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2674. * - OFFSET_MSDU_PAYLOAD
  2675. * Bits 31:16
  2676. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2677. * - OFFSET_PPDU_START
  2678. * Bits 15:0
  2679. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2680. * - OFFSET_PPDU_END
  2681. * Bits 31:16
  2682. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2683. * - OFFSET_MPDU_START
  2684. * Bits 15:0
  2685. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2686. * - OFFSET_MPDU_END
  2687. * Bits 31:16
  2688. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2689. * - OFFSET_MSDU_START
  2690. * Bits 15:0
  2691. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2692. * - OFFSET_MSDU_END
  2693. * Bits 31:16
  2694. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2695. * - OFFSET_RX_ATTN
  2696. * Bits 15:0
  2697. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2698. * - OFFSET_FRAG_INFO
  2699. * Bits 31:16
  2700. * Value: offset in QUAD-bytes of frag info table
  2701. */
  2702. /* header fields */
  2703. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2704. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2705. /* payload fields */
  2706. /* for systems using a 64-bit format for bus addresses */
  2707. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2708. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2709. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2710. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2711. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2712. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2713. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2714. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2715. /* for systems using a 32-bit format for bus addresses */
  2716. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2717. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2718. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2719. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2720. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2721. #define HTT_RX_RING_CFG_LEN_S 0
  2722. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2723. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2724. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2725. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2726. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2727. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2728. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2729. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2730. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2731. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2732. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2733. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2734. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2735. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2736. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2737. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2738. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2740. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2741. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2742. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2743. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2744. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2745. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2746. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2747. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2748. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2749. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2750. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2751. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2752. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2753. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2754. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2755. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2756. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2757. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2758. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2759. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2760. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2761. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2762. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2763. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2764. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2765. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2766. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2767. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2768. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2769. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2770. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2771. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2772. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2774. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2775. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2776. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2777. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2778. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2779. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2780. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2781. #if HTT_PADDR64
  2782. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2783. #else
  2784. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2785. #endif
  2786. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2787. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2788. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2789. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2790. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2793. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2794. } while (0)
  2795. /* degenerate case for 32-bit fields */
  2796. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2797. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2798. ((_var) = (_val))
  2799. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2800. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2801. ((_var) = (_val))
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2804. ((_var) = (_val))
  2805. /* degenerate case for 32-bit fields */
  2806. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2807. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2808. ((_var) = (_val))
  2809. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2810. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2811. ((_var) = (_val))
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2814. ((_var) = (_val))
  2815. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2816. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2817. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2824. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2831. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2832. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2839. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2840. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2843. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2844. } while (0)
  2845. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2846. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2847. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2848. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2851. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2852. } while (0)
  2853. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2854. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2855. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2856. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2859. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2860. } while (0)
  2861. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2862. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2863. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2864. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2867. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2868. } while (0)
  2869. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2870. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2871. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2872. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2875. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2876. } while (0)
  2877. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2878. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2879. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2880. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2881. do { \
  2882. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2883. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2884. } while (0)
  2885. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2886. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2887. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2888. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2891. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2892. } while (0)
  2893. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2894. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2895. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2896. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2899. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2900. } while (0)
  2901. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2902. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2903. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2904. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2905. do { \
  2906. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2907. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2908. } while (0)
  2909. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2910. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2911. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2912. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2913. do { \
  2914. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2915. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2916. } while (0)
  2917. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2918. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2919. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2920. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2921. do { \
  2922. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2923. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2924. } while (0)
  2925. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2926. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2927. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2928. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2929. do { \
  2930. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2931. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2932. } while (0)
  2933. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2934. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2935. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2936. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2937. do { \
  2938. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2939. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2940. } while (0)
  2941. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2942. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2943. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2944. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2945. do { \
  2946. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2947. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2948. } while (0)
  2949. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2950. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2951. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2952. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2953. do { \
  2954. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2955. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2956. } while (0)
  2957. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2958. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2959. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2960. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2961. do { \
  2962. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2963. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2964. } while (0)
  2965. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2966. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2967. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2968. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2969. do { \
  2970. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2971. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2972. } while (0)
  2973. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2974. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2975. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2976. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2977. do { \
  2978. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2979. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2980. } while (0)
  2981. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2982. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2983. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2984. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2987. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2988. } while (0)
  2989. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2990. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2991. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2992. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2995. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2996. } while (0)
  2997. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2998. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2999. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3000. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3001. do { \
  3002. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3003. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3004. } while (0)
  3005. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3006. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3007. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3008. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3009. do { \
  3010. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3011. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3012. } while (0)
  3013. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3014. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3015. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3016. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3017. do { \
  3018. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3019. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3020. } while (0)
  3021. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3022. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3023. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3024. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3025. do { \
  3026. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3027. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3028. } while (0)
  3029. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3030. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3031. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3032. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3033. do { \
  3034. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3035. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3036. } while (0)
  3037. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3038. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3039. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3040. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3043. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3044. } while (0)
  3045. /**
  3046. * @brief host -> target FW statistics retrieve
  3047. *
  3048. * @details
  3049. * The following field definitions describe the format of the HTT host
  3050. * to target FW stats retrieve message. The message specifies the type of
  3051. * stats host wants to retrieve.
  3052. *
  3053. * |31 24|23 16|15 8|7 0|
  3054. * |-----------------------------------------------------------|
  3055. * | stats types request bitmask | msg type |
  3056. * |-----------------------------------------------------------|
  3057. * | stats types reset bitmask | reserved |
  3058. * |-----------------------------------------------------------|
  3059. * | stats type | config value |
  3060. * |-----------------------------------------------------------|
  3061. * | cookie LSBs |
  3062. * |-----------------------------------------------------------|
  3063. * | cookie MSBs |
  3064. * |-----------------------------------------------------------|
  3065. * Header fields:
  3066. * - MSG_TYPE
  3067. * Bits 7:0
  3068. * Purpose: identifies this is a stats upload request message
  3069. * Value: 0x3
  3070. * - UPLOAD_TYPES
  3071. * Bits 31:8
  3072. * Purpose: identifies which types of FW statistics to upload
  3073. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3074. * - RESET_TYPES
  3075. * Bits 31:8
  3076. * Purpose: identifies which types of FW statistics to reset
  3077. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3078. * - CFG_VAL
  3079. * Bits 23:0
  3080. * Purpose: give an opaque configuration value to the specified stats type
  3081. * Value: stats-type specific configuration value
  3082. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3083. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3084. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3085. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3086. * - CFG_STAT_TYPE
  3087. * Bits 31:24
  3088. * Purpose: specify which stats type (if any) the config value applies to
  3089. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3090. * a valid configuration specification
  3091. * - COOKIE_LSBS
  3092. * Bits 31:0
  3093. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3094. * message with its preceding host->target stats request message.
  3095. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3096. * - COOKIE_MSBS
  3097. * Bits 31:0
  3098. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3099. * message with its preceding host->target stats request message.
  3100. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3101. */
  3102. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3103. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3104. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3105. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3106. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3107. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3108. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3109. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3110. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3111. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3112. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3113. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3114. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3115. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3118. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3119. } while (0)
  3120. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3121. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3122. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3123. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3126. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3127. } while (0)
  3128. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3129. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3130. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3131. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3134. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3135. } while (0)
  3136. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3137. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3138. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3139. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3142. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3143. } while (0)
  3144. /**
  3145. * @brief host -> target HTT out-of-band sync request
  3146. *
  3147. * @details
  3148. * The HTT SYNC tells the target to suspend processing of subsequent
  3149. * HTT host-to-target messages until some other target agent locally
  3150. * informs the target HTT FW that the current sync counter is equal to
  3151. * or greater than (in a modulo sense) the sync counter specified in
  3152. * the SYNC message.
  3153. * This allows other host-target components to synchronize their operation
  3154. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3155. * security key has been downloaded to and activated by the target.
  3156. * In the absence of any explicit synchronization counter value
  3157. * specification, the target HTT FW will use zero as the default current
  3158. * sync value.
  3159. *
  3160. * |31 24|23 16|15 8|7 0|
  3161. * |-----------------------------------------------------------|
  3162. * | reserved | sync count | msg type |
  3163. * |-----------------------------------------------------------|
  3164. * Header fields:
  3165. * - MSG_TYPE
  3166. * Bits 7:0
  3167. * Purpose: identifies this as a sync message
  3168. * Value: 0x4
  3169. * - SYNC_COUNT
  3170. * Bits 15:8
  3171. * Purpose: specifies what sync value the HTT FW will wait for from
  3172. * an out-of-band specification to resume its operation
  3173. * Value: in-band sync counter value to compare against the out-of-band
  3174. * counter spec.
  3175. * The HTT target FW will suspend its host->target message processing
  3176. * as long as
  3177. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3178. */
  3179. #define HTT_H2T_SYNC_MSG_SZ 4
  3180. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3181. #define HTT_H2T_SYNC_COUNT_S 8
  3182. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3183. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3184. HTT_H2T_SYNC_COUNT_S)
  3185. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3186. do { \
  3187. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3188. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3189. } while (0)
  3190. /**
  3191. * @brief HTT aggregation configuration
  3192. */
  3193. #define HTT_AGGR_CFG_MSG_SZ 4
  3194. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3195. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3196. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3197. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3198. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3199. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3200. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3201. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3202. do { \
  3203. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3204. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3205. } while (0)
  3206. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3207. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3208. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3210. do { \
  3211. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3212. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3213. } while (0)
  3214. /**
  3215. * @brief host -> target HTT configure max amsdu info per vdev
  3216. *
  3217. * @details
  3218. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3219. *
  3220. * |31 21|20 16|15 8|7 0|
  3221. * |-----------------------------------------------------------|
  3222. * | reserved | vdev id | max amsdu | msg type |
  3223. * |-----------------------------------------------------------|
  3224. * Header fields:
  3225. * - MSG_TYPE
  3226. * Bits 7:0
  3227. * Purpose: identifies this as a aggr cfg ex message
  3228. * Value: 0xa
  3229. * - MAX_NUM_AMSDU_SUBFRM
  3230. * Bits 15:8
  3231. * Purpose: max MSDUs per A-MSDU
  3232. * - VDEV_ID
  3233. * Bits 20:16
  3234. * Purpose: ID of the vdev to which this limit is applied
  3235. */
  3236. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3237. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3238. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3239. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3240. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3241. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3242. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3243. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3244. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3245. do { \
  3246. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3247. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3248. } while (0)
  3249. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3250. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3251. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3252. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3253. do { \
  3254. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3255. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3256. } while (0)
  3257. /**
  3258. * @brief HTT WDI_IPA Config Message
  3259. *
  3260. * @details
  3261. * The HTT WDI_IPA config message is created/sent by host at driver
  3262. * init time. It contains information about data structures used on
  3263. * WDI_IPA TX and RX path.
  3264. * TX CE ring is used for pushing packet metadata from IPA uC
  3265. * to WLAN FW
  3266. * TX Completion ring is used for generating TX completions from
  3267. * WLAN FW to IPA uC
  3268. * RX Indication ring is used for indicating RX packets from FW
  3269. * to IPA uC
  3270. * RX Ring2 is used as either completion ring or as second
  3271. * indication ring. when Ring2 is used as completion ring, IPA uC
  3272. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3273. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3274. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3275. * indicated in RX Indication ring. Please see WDI_IPA specification
  3276. * for more details.
  3277. * |31 24|23 16|15 8|7 0|
  3278. * |----------------+----------------+----------------+----------------|
  3279. * | tx pkt pool size | Rsvd | msg_type |
  3280. * |-------------------------------------------------------------------|
  3281. * | tx comp ring base (bits 31:0) |
  3282. #if HTT_PADDR64
  3283. * | tx comp ring base (bits 63:32) |
  3284. #endif
  3285. * |-------------------------------------------------------------------|
  3286. * | tx comp ring size |
  3287. * |-------------------------------------------------------------------|
  3288. * | tx comp WR_IDX physical address (bits 31:0) |
  3289. #if HTT_PADDR64
  3290. * | tx comp WR_IDX physical address (bits 63:32) |
  3291. #endif
  3292. * |-------------------------------------------------------------------|
  3293. * | tx CE WR_IDX physical address (bits 31:0) |
  3294. #if HTT_PADDR64
  3295. * | tx CE WR_IDX physical address (bits 63:32) |
  3296. #endif
  3297. * |-------------------------------------------------------------------|
  3298. * | rx indication ring base (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | rx indication ring base (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * | rx indication ring size |
  3304. * |-------------------------------------------------------------------|
  3305. * | rx ind RD_IDX physical address (bits 31:0) |
  3306. #if HTT_PADDR64
  3307. * | rx ind RD_IDX physical address (bits 63:32) |
  3308. #endif
  3309. * |-------------------------------------------------------------------|
  3310. * | rx ind WR_IDX physical address (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | rx ind WR_IDX physical address (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. * |-------------------------------------------------------------------|
  3316. * | rx ring2 base (bits 31:0) |
  3317. #if HTT_PADDR64
  3318. * | rx ring2 base (bits 63:32) |
  3319. #endif
  3320. * |-------------------------------------------------------------------|
  3321. * | rx ring2 size |
  3322. * |-------------------------------------------------------------------|
  3323. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3324. #if HTT_PADDR64
  3325. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3326. #endif
  3327. * |-------------------------------------------------------------------|
  3328. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3329. #if HTT_PADDR64
  3330. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3331. #endif
  3332. * |-------------------------------------------------------------------|
  3333. *
  3334. * Header fields:
  3335. * Header fields:
  3336. * - MSG_TYPE
  3337. * Bits 7:0
  3338. * Purpose: Identifies this as WDI_IPA config message
  3339. * value: = 0x8
  3340. * - TX_PKT_POOL_SIZE
  3341. * Bits 15:0
  3342. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3343. * WDI_IPA TX path
  3344. * For systems using 32-bit format for bus addresses:
  3345. * - TX_COMP_RING_BASE_ADDR
  3346. * Bits 31:0
  3347. * Purpose: TX Completion Ring base address in DDR
  3348. * - TX_COMP_RING_SIZE
  3349. * Bits 31:0
  3350. * Purpose: TX Completion Ring size (must be power of 2)
  3351. * - TX_COMP_WR_IDX_ADDR
  3352. * Bits 31:0
  3353. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3354. * updates the Write Index for WDI_IPA TX completion ring
  3355. * - TX_CE_WR_IDX_ADDR
  3356. * Bits 31:0
  3357. * Purpose: DDR address where IPA uC
  3358. * updates the WR Index for TX CE ring
  3359. * (needed for fusion platforms)
  3360. * - RX_IND_RING_BASE_ADDR
  3361. * Bits 31:0
  3362. * Purpose: RX Indication Ring base address in DDR
  3363. * - RX_IND_RING_SIZE
  3364. * Bits 31:0
  3365. * Purpose: RX Indication Ring size
  3366. * - RX_IND_RD_IDX_ADDR
  3367. * Bits 31:0
  3368. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3369. * RX indication ring
  3370. * - RX_IND_WR_IDX_ADDR
  3371. * Bits 31:0
  3372. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3373. * updates the Write Index for WDI_IPA RX indication ring
  3374. * - RX_RING2_BASE_ADDR
  3375. * Bits 31:0
  3376. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3377. * - RX_RING2_SIZE
  3378. * Bits 31:0
  3379. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3380. * - RX_RING2_RD_IDX_ADDR
  3381. * Bits 31:0
  3382. * Purpose: If Second RX ring is Indication ring, DDR address where
  3383. * IPA uC updates the Read Index for Ring2.
  3384. * If Second RX ring is completion ring, this is NOT used
  3385. * - RX_RING2_WR_IDX_ADDR
  3386. * Bits 31:0
  3387. * Purpose: If Second RX ring is Indication ring, DDR address where
  3388. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3389. * If second RX ring is completion ring, DDR address where
  3390. * IPA uC updates the Write Index for Ring 2.
  3391. * For systems using 64-bit format for bus addresses:
  3392. * - TX_COMP_RING_BASE_ADDR_LO
  3393. * Bits 31:0
  3394. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3395. * - TX_COMP_RING_BASE_ADDR_HI
  3396. * Bits 31:0
  3397. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3398. * - TX_COMP_RING_SIZE
  3399. * Bits 31:0
  3400. * Purpose: TX Completion Ring size (must be power of 2)
  3401. * - TX_COMP_WR_IDX_ADDR_LO
  3402. * Bits 31:0
  3403. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3404. * Lower 4 bytes of DDR address where WIFI FW
  3405. * updates the Write Index for WDI_IPA TX completion ring
  3406. * - TX_COMP_WR_IDX_ADDR_HI
  3407. * Bits 31:0
  3408. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3409. * Higher 4 bytes of DDR address where WIFI FW
  3410. * updates the Write Index for WDI_IPA TX completion ring
  3411. * - TX_CE_WR_IDX_ADDR_LO
  3412. * Bits 31:0
  3413. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3414. * updates the WR Index for TX CE ring
  3415. * (needed for fusion platforms)
  3416. * - TX_CE_WR_IDX_ADDR_HI
  3417. * Bits 31:0
  3418. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3419. * updates the WR Index for TX CE ring
  3420. * (needed for fusion platforms)
  3421. * - RX_IND_RING_BASE_ADDR_LO
  3422. * Bits 31:0
  3423. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3424. * - RX_IND_RING_BASE_ADDR_HI
  3425. * Bits 31:0
  3426. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3427. * - RX_IND_RING_SIZE
  3428. * Bits 31:0
  3429. * Purpose: RX Indication Ring size
  3430. * - RX_IND_RD_IDX_ADDR_LO
  3431. * Bits 31:0
  3432. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3433. * for WDI_IPA RX indication ring
  3434. * - RX_IND_RD_IDX_ADDR_HI
  3435. * Bits 31:0
  3436. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3437. * for WDI_IPA RX indication ring
  3438. * - RX_IND_WR_IDX_ADDR_LO
  3439. * Bits 31:0
  3440. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3441. * Lower 4 bytes of DDR address where WIFI FW
  3442. * updates the Write Index for WDI_IPA RX indication ring
  3443. * - RX_IND_WR_IDX_ADDR_HI
  3444. * Bits 31:0
  3445. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3446. * Higher 4 bytes of DDR address where WIFI FW
  3447. * updates the Write Index for WDI_IPA RX indication ring
  3448. * - RX_RING2_BASE_ADDR_LO
  3449. * Bits 31:0
  3450. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3451. * - RX_RING2_BASE_ADDR_HI
  3452. * Bits 31:0
  3453. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3454. * - RX_RING2_SIZE
  3455. * Bits 31:0
  3456. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3457. * - RX_RING2_RD_IDX_ADDR_LO
  3458. * Bits 31:0
  3459. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3460. * DDR address where IPA uC updates the Read Index for Ring2.
  3461. * If Second RX ring is completion ring, this is NOT used
  3462. * - RX_RING2_RD_IDX_ADDR_HI
  3463. * Bits 31:0
  3464. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3465. * DDR address where IPA uC updates the Read Index for Ring2.
  3466. * If Second RX ring is completion ring, this is NOT used
  3467. * - RX_RING2_WR_IDX_ADDR_LO
  3468. * Bits 31:0
  3469. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3470. * DDR address where WIFI FW updates the Write Index
  3471. * for WDI_IPA RX ring2
  3472. * If second RX ring is completion ring, lower 4 bytes of
  3473. * DDR address where IPA uC updates the Write Index for Ring 2.
  3474. * - RX_RING2_WR_IDX_ADDR_HI
  3475. * Bits 31:0
  3476. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3477. * DDR address where WIFI FW updates the Write Index
  3478. * for WDI_IPA RX ring2
  3479. * If second RX ring is completion ring, higher 4 bytes of
  3480. * DDR address where IPA uC updates the Write Index for Ring 2.
  3481. */
  3482. #if HTT_PADDR64
  3483. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3484. #else
  3485. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3486. #endif
  3487. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3488. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3503. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3505. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3507. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3537. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3538. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3539. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3540. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3541. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3549. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3551. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3555. } while (0)
  3556. /* for systems using 32-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3559. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3563. } while (0)
  3564. /* for systems using 64-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3567. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3571. } while (0)
  3572. /* for systems using 64-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3575. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3579. } while (0)
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3582. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3586. } while (0)
  3587. /* for systems using 32-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3590. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3594. } while (0)
  3595. /* for systems using 64-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3598. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3602. } while (0)
  3603. /* for systems using 64-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3606. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3610. } while (0)
  3611. /* for systems using 32-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3614. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3618. } while (0)
  3619. /* for systems using 64-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3622. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3626. } while (0)
  3627. /* for systems using 64-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3630. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3634. } while (0)
  3635. /* for systems using 32-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3638. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3642. } while (0)
  3643. /* for systems using 64-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3646. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3650. } while (0)
  3651. /* for systems using 64-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3654. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3658. } while (0)
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3660. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3661. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3665. } while (0)
  3666. /* for systems using 32-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3669. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3673. } while (0)
  3674. /* for systems using 64-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3677. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3681. } while (0)
  3682. /* for systems using 64-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3685. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3689. } while (0)
  3690. /* for systems using 32-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3693. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3697. } while (0)
  3698. /* for systems using 64-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3701. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3705. } while (0)
  3706. /* for systems using 64-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3709. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3713. } while (0)
  3714. /* for systems using 32-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3717. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3721. } while (0)
  3722. /* for systems using 64-bit format for bus addr */
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3724. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3728. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3729. } while (0)
  3730. /* for systems using 64-bit format for bus addr */
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3732. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3736. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3737. } while (0)
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3739. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3741. do { \
  3742. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3743. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3744. } while (0)
  3745. /* for systems using 32-bit format for bus addr */
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3747. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3751. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3752. } while (0)
  3753. /* for systems using 64-bit format for bus addr */
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3755. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3759. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3760. } while (0)
  3761. /* for systems using 64-bit format for bus addr */
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3764. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3768. } while (0)
  3769. /* for systems using 32-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3772. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3776. } while (0)
  3777. /* for systems using 64-bit format for bus addr */
  3778. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3779. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3780. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3783. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3784. } while (0)
  3785. /* for systems using 64-bit format for bus addr */
  3786. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3787. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3788. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3789. do { \
  3790. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3791. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3792. } while (0)
  3793. /*
  3794. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3795. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3796. * addresses are stored in a XXX-bit field.
  3797. * This macro is used to define both htt_wdi_ipa_config32_t and
  3798. * htt_wdi_ipa_config64_t structs.
  3799. */
  3800. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3801. _paddr__tx_comp_ring_base_addr_, \
  3802. _paddr__tx_comp_wr_idx_addr_, \
  3803. _paddr__tx_ce_wr_idx_addr_, \
  3804. _paddr__rx_ind_ring_base_addr_, \
  3805. _paddr__rx_ind_rd_idx_addr_, \
  3806. _paddr__rx_ind_wr_idx_addr_, \
  3807. _paddr__rx_ring2_base_addr_,\
  3808. _paddr__rx_ring2_rd_idx_addr_,\
  3809. _paddr__rx_ring2_wr_idx_addr_) \
  3810. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3811. { \
  3812. /* DWORD 0: flags and meta-data */ \
  3813. A_UINT32 \
  3814. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3815. reserved: 8, \
  3816. tx_pkt_pool_size: 16;\
  3817. /* DWORD 1 */\
  3818. _paddr__tx_comp_ring_base_addr_;\
  3819. /* DWORD 2 (or 3)*/\
  3820. A_UINT32 tx_comp_ring_size;\
  3821. /* DWORD 3 (or 4)*/\
  3822. _paddr__tx_comp_wr_idx_addr_;\
  3823. /* DWORD 4 (or 6)*/\
  3824. _paddr__tx_ce_wr_idx_addr_;\
  3825. /* DWORD 5 (or 8)*/\
  3826. _paddr__rx_ind_ring_base_addr_;\
  3827. /* DWORD 6 (or 10)*/\
  3828. A_UINT32 rx_ind_ring_size;\
  3829. /* DWORD 7 (or 11)*/\
  3830. _paddr__rx_ind_rd_idx_addr_;\
  3831. /* DWORD 8 (or 13)*/\
  3832. _paddr__rx_ind_wr_idx_addr_;\
  3833. /* DWORD 9 (or 15)*/\
  3834. _paddr__rx_ring2_base_addr_;\
  3835. /* DWORD 10 (or 17) */\
  3836. A_UINT32 rx_ring2_size;\
  3837. /* DWORD 11 (or 18) */\
  3838. _paddr__rx_ring2_rd_idx_addr_;\
  3839. /* DWORD 12 (or 20) */\
  3840. _paddr__rx_ring2_wr_idx_addr_;\
  3841. } POSTPACK
  3842. /* define a htt_wdi_ipa_config32_t type */
  3843. 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));
  3844. /* define a htt_wdi_ipa_config64_t type */
  3845. 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));
  3846. #if HTT_PADDR64
  3847. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3848. #else
  3849. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3850. #endif
  3851. enum htt_wdi_ipa_op_code {
  3852. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3853. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3854. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3855. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3856. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3857. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3858. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3859. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3860. /* keep this last */
  3861. HTT_WDI_IPA_OPCODE_MAX
  3862. };
  3863. /**
  3864. * @brief HTT WDI_IPA Operation Request Message
  3865. *
  3866. * @details
  3867. * HTT WDI_IPA Operation Request message is sent by host
  3868. * to either suspend or resume WDI_IPA TX or RX path.
  3869. * |31 24|23 16|15 8|7 0|
  3870. * |----------------+----------------+----------------+----------------|
  3871. * | op_code | Rsvd | msg_type |
  3872. * |-------------------------------------------------------------------|
  3873. *
  3874. * Header fields:
  3875. * - MSG_TYPE
  3876. * Bits 7:0
  3877. * Purpose: Identifies this as WDI_IPA Operation Request message
  3878. * value: = 0x9
  3879. * - OP_CODE
  3880. * Bits 31:16
  3881. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3882. * value: = enum htt_wdi_ipa_op_code
  3883. */
  3884. PREPACK struct htt_wdi_ipa_op_request_t
  3885. {
  3886. /* DWORD 0: flags and meta-data */
  3887. A_UINT32
  3888. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3889. reserved: 8,
  3890. op_code: 16;
  3891. } POSTPACK;
  3892. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3893. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3894. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3895. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3896. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3897. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3898. do { \
  3899. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3900. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3901. } while (0)
  3902. /*
  3903. * @brief host -> target HTT_SRING_SETUP message
  3904. *
  3905. * @details
  3906. * After target is booted up, Host can send SRING setup message for
  3907. * each host facing LMAC SRING. Target setups up HW registers based
  3908. * on setup message and confirms back to Host if response_required is set.
  3909. * Host should wait for confirmation message before sending new SRING
  3910. * setup message
  3911. *
  3912. * The message would appear as follows:
  3913. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3914. * |--------------- +-----------------+-----------------+-----------------|
  3915. * | ring_type | ring_id | pdev_id | msg_type |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_base_addr_lo |
  3918. * |----------------------------------------------------------------------|
  3919. * | ring_base_addr_hi |
  3920. * |----------------------------------------------------------------------|
  3921. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3922. * |----------------------------------------------------------------------|
  3923. * | ring_head_offset32_remote_addr_lo |
  3924. * |----------------------------------------------------------------------|
  3925. * | ring_head_offset32_remote_addr_hi |
  3926. * |----------------------------------------------------------------------|
  3927. * | ring_tail_offset32_remote_addr_lo |
  3928. * |----------------------------------------------------------------------|
  3929. * | ring_tail_offset32_remote_addr_hi |
  3930. * |----------------------------------------------------------------------|
  3931. * | ring_msi_addr_lo |
  3932. * |----------------------------------------------------------------------|
  3933. * | ring_msi_addr_hi |
  3934. * |----------------------------------------------------------------------|
  3935. * | ring_msi_data |
  3936. * |----------------------------------------------------------------------|
  3937. * | intr_timer_th |IM| intr_batch_counter_th |
  3938. * |----------------------------------------------------------------------|
  3939. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3940. * |----------------------------------------------------------------------|
  3941. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3942. * |----------------------------------------------------------------------|
  3943. * Where
  3944. * IM = sw_intr_mode
  3945. * RR = response_required
  3946. * PTCF = prefetch_timer_cfg
  3947. * IP = IPA drop flag
  3948. *
  3949. * The message is interpreted as follows:
  3950. * dword0 - b'0:7 - msg_type: This will be set to
  3951. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3952. * b'8:15 - pdev_id:
  3953. * 0 (for rings at SOC/UMAC level),
  3954. * 1/2/3 mac id (for rings at LMAC level)
  3955. * b'16:23 - ring_id: identify which ring is to setup,
  3956. * more details can be got from enum htt_srng_ring_id
  3957. * b'24:31 - ring_type: identify type of host rings,
  3958. * more details can be got from enum htt_srng_ring_type
  3959. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3960. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3961. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3962. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3963. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3964. * SW_TO_HW_RING.
  3965. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3966. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3967. * Lower 32 bits of memory address of the remote variable
  3968. * storing the 4-byte word offset that identifies the head
  3969. * element within the ring.
  3970. * (The head offset variable has type A_UINT32.)
  3971. * Valid for HW_TO_SW and SW_TO_SW rings.
  3972. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3973. * Upper 32 bits of memory address of the remote variable
  3974. * storing the 4-byte word offset that identifies the head
  3975. * element within the ring.
  3976. * (The head offset variable has type A_UINT32.)
  3977. * Valid for HW_TO_SW and SW_TO_SW rings.
  3978. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3979. * Lower 32 bits of memory address of the remote variable
  3980. * storing the 4-byte word offset that identifies the tail
  3981. * element within the ring.
  3982. * (The tail offset variable has type A_UINT32.)
  3983. * Valid for HW_TO_SW and SW_TO_SW rings.
  3984. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3985. * Upper 32 bits of memory address of the remote variable
  3986. * storing the 4-byte word offset that identifies the tail
  3987. * element within the ring.
  3988. * (The tail offset variable has type A_UINT32.)
  3989. * Valid for HW_TO_SW and SW_TO_SW rings.
  3990. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3991. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3992. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3993. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3994. * dword10 - b'0:31 - ring_msi_data: MSI data
  3995. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3996. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3997. * dword11 - b'0:14 - intr_batch_counter_th:
  3998. * batch counter threshold is in units of 4-byte words.
  3999. * HW internally maintains and increments batch count.
  4000. * (see SRING spec for detail description).
  4001. * When batch count reaches threshold value, an interrupt
  4002. * is generated by HW.
  4003. * b'15 - sw_intr_mode:
  4004. * This configuration shall be static.
  4005. * Only programmed at power up.
  4006. * 0: generate pulse style sw interrupts
  4007. * 1: generate level style sw interrupts
  4008. * b'16:31 - intr_timer_th:
  4009. * The timer init value when timer is idle or is
  4010. * initialized to start downcounting.
  4011. * In 8us units (to cover a range of 0 to 524 ms)
  4012. * dword12 - b'0:15 - intr_low_threshold:
  4013. * Used only by Consumer ring to generate ring_sw_int_p.
  4014. * Ring entries low threshold water mark, that is used
  4015. * in combination with the interrupt timer as well as
  4016. * the the clearing of the level interrupt.
  4017. * b'16:18 - prefetch_timer_cfg:
  4018. * Used only by Consumer ring to set timer mode to
  4019. * support Application prefetch handling.
  4020. * The external tail offset/pointer will be updated
  4021. * at following intervals:
  4022. * 3'b000: (Prefetch feature disabled; used only for debug)
  4023. * 3'b001: 1 usec
  4024. * 3'b010: 4 usec
  4025. * 3'b011: 8 usec (default)
  4026. * 3'b100: 16 usec
  4027. * Others: Reserverd
  4028. * b'19 - response_required:
  4029. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4030. * b'20 - ipa_drop_flag:
  4031. Indicates that host will config ipa drop threshold percentage
  4032. * b'21:31 - reserved: reserved for future use
  4033. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4034. * b'8:15 - ipa drop high threshold percentage:
  4035. * b'16:31 - Reserved
  4036. */
  4037. PREPACK struct htt_sring_setup_t {
  4038. A_UINT32 msg_type: 8,
  4039. pdev_id: 8,
  4040. ring_id: 8,
  4041. ring_type: 8;
  4042. A_UINT32 ring_base_addr_lo;
  4043. A_UINT32 ring_base_addr_hi;
  4044. A_UINT32 ring_size: 16,
  4045. ring_entry_size: 8,
  4046. ring_misc_cfg_flag: 8;
  4047. A_UINT32 ring_head_offset32_remote_addr_lo;
  4048. A_UINT32 ring_head_offset32_remote_addr_hi;
  4049. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4050. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4051. A_UINT32 ring_msi_addr_lo;
  4052. A_UINT32 ring_msi_addr_hi;
  4053. A_UINT32 ring_msi_data;
  4054. A_UINT32 intr_batch_counter_th: 15,
  4055. sw_intr_mode: 1,
  4056. intr_timer_th: 16;
  4057. A_UINT32 intr_low_threshold: 16,
  4058. prefetch_timer_cfg: 3,
  4059. response_required: 1,
  4060. ipa_drop_flag: 1,
  4061. reserved1: 11;
  4062. A_UINT32 ipa_drop_low_threshold: 8,
  4063. ipa_drop_high_threshold: 8,
  4064. reserved: 16;
  4065. } POSTPACK;
  4066. enum htt_srng_ring_type {
  4067. HTT_HW_TO_SW_RING = 0,
  4068. HTT_SW_TO_HW_RING,
  4069. HTT_SW_TO_SW_RING,
  4070. /* Insert new ring types above this line */
  4071. };
  4072. enum htt_srng_ring_id {
  4073. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4074. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4075. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4076. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4077. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4078. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4079. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4080. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4081. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4082. /* Add Other SRING which can't be directly configured by host software above this line */
  4083. };
  4084. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4085. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4086. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4087. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4088. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4089. HTT_SRING_SETUP_PDEV_ID_S)
  4090. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4093. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4094. } while (0)
  4095. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4096. #define HTT_SRING_SETUP_RING_ID_S 16
  4097. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4098. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4099. HTT_SRING_SETUP_RING_ID_S)
  4100. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4101. do { \
  4102. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4103. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4104. } while (0)
  4105. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4106. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4107. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4109. HTT_SRING_SETUP_RING_TYPE_S)
  4110. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4113. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4114. } while (0)
  4115. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4116. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4117. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4119. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4120. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4124. } while (0)
  4125. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4126. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4127. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4129. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4134. } while (0)
  4135. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4136. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4137. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4138. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4139. HTT_SRING_SETUP_RING_SIZE_S)
  4140. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4143. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4144. } while (0)
  4145. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4146. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4147. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4149. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4150. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4156. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4157. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4159. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4160. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4164. } while (0)
  4165. /* This control bit is applicable to only Producer, which updates Ring ID field
  4166. * of each descriptor before pushing into the ring.
  4167. * 0: updates ring_id(default)
  4168. * 1: ring_id updating disabled */
  4169. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4171. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4172. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4173. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4174. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4177. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4178. } while (0)
  4179. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4180. * of each descriptor before pushing into the ring.
  4181. * 0: updates Loopcnt(default)
  4182. * 1: Loopcnt updating disabled */
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4187. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4192. } while (0)
  4193. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4194. * into security_id port of GXI/AXI. */
  4195. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4199. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4204. } while (0)
  4205. /* During MSI write operation, SRNG drives value of this register bit into
  4206. * swap bit of GXI/AXI. */
  4207. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4210. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4211. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4215. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4216. } while (0)
  4217. /* During Pointer write operation, SRNG drives value of this register bit into
  4218. * swap bit of GXI/AXI. */
  4219. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4222. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4223. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4227. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4228. } while (0)
  4229. /* During any data or TLV write operation, SRNG drives value of this register
  4230. * bit into swap bit of GXI/AXI. */
  4231. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4232. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4234. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4235. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4239. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4240. } while (0)
  4241. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4242. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4243. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4244. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4245. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4246. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4247. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4248. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4251. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4252. } while (0)
  4253. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4254. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4255. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4256. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4257. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4261. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4262. } while (0)
  4263. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4264. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4265. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4266. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4267. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4268. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4271. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4272. } while (0)
  4273. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4274. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4275. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4276. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4277. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4281. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4282. } while (0)
  4283. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4284. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4285. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4286. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4287. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4288. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4291. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4292. } while (0)
  4293. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4294. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4295. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4296. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4297. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4301. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4302. } while (0)
  4303. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4304. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4305. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4306. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4307. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4308. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4311. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4312. } while (0)
  4313. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4314. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4315. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4316. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4317. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4318. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4321. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4322. } while (0)
  4323. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4324. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4325. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4326. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4327. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4328. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4331. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4332. } while (0)
  4333. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4334. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4335. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4336. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4337. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4338. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4341. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4342. } while (0)
  4343. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4344. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4345. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4346. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4347. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4348. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4351. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4352. } while (0)
  4353. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4354. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4355. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4356. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4357. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4358. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4359. do { \
  4360. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4361. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4362. } while (0)
  4363. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4364. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4365. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4366. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4367. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4368. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4369. do { \
  4370. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4371. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4372. } while (0)
  4373. /**
  4374. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4375. *
  4376. * @details
  4377. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4378. * configure RXDMA rings.
  4379. * The configuration is per ring based and includes both packet subtypes
  4380. * and PPDU/MPDU TLVs.
  4381. *
  4382. * The message would appear as follows:
  4383. *
  4384. * |31 28|27|26|25|24|23 16|15 |9 8|7 0|
  4385. * |-----+--+--+--+--+----------------+------------+---+---------------|
  4386. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4387. * |-------------------------------------------------------------------|
  4388. * | rsvd2 | ring_buffer_size |
  4389. * |-------------------------------------------------------------------|
  4390. * | packet_type_enable_flags_0 |
  4391. * |-------------------------------------------------------------------|
  4392. * | packet_type_enable_flags_1 |
  4393. * |-------------------------------------------------------------------|
  4394. * | packet_type_enable_flags_2 |
  4395. * |-------------------------------------------------------------------|
  4396. * | packet_type_enable_flags_3 |
  4397. * |-------------------------------------------------------------------|
  4398. * | tlv_filter_in_flags |
  4399. * |-------------------------------------------------------------------|
  4400. * | rx_header_offset | rx_packet_offset |
  4401. * |-------------------------------------------------------------------|
  4402. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4403. * |-------------------------------------------------------------------|
  4404. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4405. * |-------------------------------------------------------------------|
  4406. * | rsvd3 | rx_attention_offset |
  4407. * |-------------------------------------------------------------------|
  4408. * | rsvd4 | rx_drop_threshold |
  4409. * |-------------------------------------------------------------------|
  4410. * Where:
  4411. * PS = pkt_swap
  4412. * SS = status_swap
  4413. * OV = rx_offsets_valid
  4414. * DT = drop_thresh_valid
  4415. * The message is interpreted as follows:
  4416. * dword0 - b'0:7 - msg_type: This will be set to
  4417. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4418. * b'8:15 - pdev_id:
  4419. * 0 (for rings at SOC/UMAC level),
  4420. * 1/2/3 mac id (for rings at LMAC level)
  4421. * b'16:23 - ring_id : Identify the ring to configure.
  4422. * More details can be got from enum htt_srng_ring_id
  4423. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4424. * BUF_RING_CFG_0 defs within HW .h files,
  4425. * e.g. wmac_top_reg_seq_hwioreg.h
  4426. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4427. * BUF_RING_CFG_0 defs within HW .h files,
  4428. * e.g. wmac_top_reg_seq_hwioreg.h
  4429. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4430. * configuration fields are valid
  4431. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4432. * rx_drop_threshold field is valid
  4433. * b'28:31 - rsvd1: reserved for future use
  4434. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4435. * in byte units.
  4436. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4437. * - b'16:31 - rsvd2: Reserved for future use
  4438. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4439. * Enable MGMT packet from 0b0000 to 0b1001
  4440. * bits from low to high: FP, MD, MO - 3 bits
  4441. * FP: Filter_Pass
  4442. * MD: Monitor_Direct
  4443. * MO: Monitor_Other
  4444. * 10 mgmt subtypes * 3 bits -> 30 bits
  4445. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4446. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4447. * Enable MGMT packet from 0b1010 to 0b1111
  4448. * bits from low to high: FP, MD, MO - 3 bits
  4449. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4450. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4451. * Enable CTRL packet from 0b0000 to 0b1001
  4452. * bits from low to high: FP, MD, MO - 3 bits
  4453. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4454. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4455. * Enable CTRL packet from 0b1010 to 0b1111,
  4456. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4457. * bits from low to high: FP, MD, MO - 3 bits
  4458. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4459. * dword6 - b'0:31 - tlv_filter_in_flags:
  4460. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4461. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4462. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4463. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4464. * A value of 0 will be considered as ignore this config.
  4465. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4466. * e.g. wmac_top_reg_seq_hwioreg.h
  4467. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4468. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4469. * A value of 0 will be considered as ignore this config.
  4470. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4471. * e.g. wmac_top_reg_seq_hwioreg.h
  4472. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4473. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4474. * A value of 0 will be considered as ignore this config.
  4475. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4476. * e.g. wmac_top_reg_seq_hwioreg.h
  4477. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4478. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4479. * A value of 0 will be considered as ignore this config.
  4480. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4481. * e.g. wmac_top_reg_seq_hwioreg.h
  4482. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4483. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4484. * A value of 0 will be considered as ignore this config.
  4485. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4486. * e.g. wmac_top_reg_seq_hwioreg.h
  4487. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4488. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4489. * A value of 0 will be considered as ignore this config.
  4490. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4491. * e.g. wmac_top_reg_seq_hwioreg.h
  4492. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4493. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4494. * A value of 0 will be considered as ignore this config.
  4495. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4496. * e.g. wmac_top_reg_seq_hwioreg.h
  4497. * - b'16:31 - rsvd3 for future use
  4498. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4499. * to source rings. Consumer drops packets if the available
  4500. * words in the ring falls below the configured threshold
  4501. * value.
  4502. */
  4503. PREPACK struct htt_rx_ring_selection_cfg_t {
  4504. A_UINT32 msg_type: 8,
  4505. pdev_id: 8,
  4506. ring_id: 8,
  4507. status_swap: 1,
  4508. pkt_swap: 1,
  4509. rx_offsets_valid: 1,
  4510. drop_thresh_valid: 1,
  4511. rsvd1: 4;
  4512. A_UINT32 ring_buffer_size: 16,
  4513. rsvd2: 16;
  4514. A_UINT32 packet_type_enable_flags_0;
  4515. A_UINT32 packet_type_enable_flags_1;
  4516. A_UINT32 packet_type_enable_flags_2;
  4517. A_UINT32 packet_type_enable_flags_3;
  4518. A_UINT32 tlv_filter_in_flags;
  4519. A_UINT32 rx_packet_offset: 16,
  4520. rx_header_offset: 16;
  4521. A_UINT32 rx_mpdu_end_offset: 16,
  4522. rx_mpdu_start_offset: 16;
  4523. A_UINT32 rx_msdu_end_offset: 16,
  4524. rx_msdu_start_offset: 16;
  4525. A_UINT32 rx_attn_offset: 16,
  4526. rsvd3: 16;
  4527. A_UINT32 rx_drop_threshold: 10,
  4528. rsvd4: 22;
  4529. } POSTPACK;
  4530. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4531. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4532. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4533. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4534. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4535. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4536. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4537. do { \
  4538. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4539. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4540. } while (0)
  4541. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4542. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4543. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4544. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4545. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4546. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4547. do { \
  4548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4550. } while (0)
  4551. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4552. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4553. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4554. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4555. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4556. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4557. do { \
  4558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4560. } while (0)
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4564. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4565. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4570. } while (0)
  4571. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4572. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4573. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4574. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4575. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4576. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4580. } while (0)
  4581. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4582. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4583. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4584. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4585. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4586. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4587. do { \
  4588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4590. } while (0)
  4591. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4592. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4593. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4594. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4595. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4596. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4597. do { \
  4598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4600. } while (0)
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4604. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4605. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4607. do { \
  4608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4610. } while (0)
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4614. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4615. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4617. do { \
  4618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4620. } while (0)
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4624. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4625. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4627. do { \
  4628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4630. } while (0)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4634. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4635. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4642. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4650. } while (0)
  4651. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4652. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4653. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4654. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4655. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4656. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4657. do { \
  4658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4660. } while (0)
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4662. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4664. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4665. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4667. do { \
  4668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4670. } while (0)
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4672. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4674. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4675. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4677. do { \
  4678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4680. } while (0)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4684. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4685. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4687. do { \
  4688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4690. } while (0)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4695. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4697. do { \
  4698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4700. } while (0)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4705. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4707. do { \
  4708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4710. } while (0)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4714. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4715. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4720. } while (0)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4724. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4725. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4726. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4730. } while (0)
  4731. /*
  4732. * Subtype based MGMT frames enable bits.
  4733. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4734. */
  4735. /* association request */
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4742. /* association response */
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4749. /* Reassociation request */
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4756. /* Reassociation response */
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4763. /* Probe request */
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4770. /* Probe response */
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4777. /* Timing Advertisement */
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4784. /* Reserved */
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4791. /* Beacon */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4798. /* ATIM */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4805. /* Disassociation */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4812. /* Authentication */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4819. /* Deauthentication */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4826. /* Action */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4833. /* Action No Ack */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4840. /* Reserved */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4847. /*
  4848. * Subtype based CTRL frames enable bits.
  4849. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4850. */
  4851. /* Reserved */
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4858. /* Reserved */
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4865. /* Reserved */
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4872. /* Reserved */
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4879. /* Reserved */
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4886. /* Reserved */
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4893. /* Reserved */
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4900. /* Control Wrapper */
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4907. /* Block Ack Request */
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4914. /* Block Ack*/
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4921. /* PS-POLL */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4928. /* RTS */
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4935. /* CTS */
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4942. /* ACK */
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4949. /* CF-END */
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4956. /* CF-END + CF-ACK */
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4963. /* Multicast data */
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4970. /* Unicast data */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4977. /* NULL data */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(httsym, value); \
  4987. (word) |= (value) << httsym##_S; \
  4988. } while (0)
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4990. (((word) & httsym##_M) >> httsym##_S)
  4991. #define htt_rx_ring_pkt_enable_subtype_set( \
  4992. word, flag, mode, type, subtype, val) \
  4993. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4994. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4995. #define htt_rx_ring_pkt_enable_subtype_get( \
  4996. word, flag, mode, type, subtype) \
  4997. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4998. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4999. /* Definition to filter in TLVs */
  5000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5026. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5027. do { \
  5028. HTT_CHECK_SET_VAL(httsym, enable); \
  5029. (word) |= (enable) << httsym##_S; \
  5030. } while (0)
  5031. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5032. (((word) & httsym##_M) >> httsym##_S)
  5033. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5034. HTT_RX_RING_TLV_ENABLE_SET( \
  5035. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5036. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5037. HTT_RX_RING_TLV_ENABLE_GET( \
  5038. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5039. /**
  5040. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5041. * host --> target Receive Flow Steering configuration message definition.
  5042. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5043. * The reason for this is we want RFS to be configured and ready before MAC
  5044. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5045. *
  5046. * |31 24|23 16|15 9|8|7 0|
  5047. * |----------------+----------------+----------------+----------------|
  5048. * | reserved |E| msg type |
  5049. * |-------------------------------------------------------------------|
  5050. * Where E = RFS enable flag
  5051. *
  5052. * The RFS_CONFIG message consists of a single 4-byte word.
  5053. *
  5054. * Header fields:
  5055. * - MSG_TYPE
  5056. * Bits 7:0
  5057. * Purpose: identifies this as a RFS config msg
  5058. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5059. * - RFS_CONFIG
  5060. * Bit 8
  5061. * Purpose: Tells target whether to enable (1) or disable (0)
  5062. * flow steering feature when sending rx indication messages to host
  5063. */
  5064. #define HTT_H2T_RFS_CONFIG_M 0x100
  5065. #define HTT_H2T_RFS_CONFIG_S 8
  5066. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5067. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5068. HTT_H2T_RFS_CONFIG_S)
  5069. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5070. do { \
  5071. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5072. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5073. } while (0)
  5074. #define HTT_RFS_CFG_REQ_BYTES 4
  5075. /**
  5076. * @brief host -> target FW extended statistics retrieve
  5077. *
  5078. * @details
  5079. * The following field definitions describe the format of the HTT host
  5080. * to target FW extended stats retrieve message.
  5081. * The message specifies the type of stats the host wants to retrieve.
  5082. *
  5083. * |31 24|23 16|15 8|7 0|
  5084. * |-----------------------------------------------------------|
  5085. * | reserved | stats type | pdev_mask | msg type |
  5086. * |-----------------------------------------------------------|
  5087. * | config param [0] |
  5088. * |-----------------------------------------------------------|
  5089. * | config param [1] |
  5090. * |-----------------------------------------------------------|
  5091. * | config param [2] |
  5092. * |-----------------------------------------------------------|
  5093. * | config param [3] |
  5094. * |-----------------------------------------------------------|
  5095. * | reserved |
  5096. * |-----------------------------------------------------------|
  5097. * | cookie LSBs |
  5098. * |-----------------------------------------------------------|
  5099. * | cookie MSBs |
  5100. * |-----------------------------------------------------------|
  5101. * Header fields:
  5102. * - MSG_TYPE
  5103. * Bits 7:0
  5104. * Purpose: identifies this is a extended stats upload request message
  5105. * Value: 0x10
  5106. * - PDEV_MASK
  5107. * Bits 8:15
  5108. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5109. * Value: This is a overloaded field, refer to usage and interpretation of
  5110. * PDEV in interface document.
  5111. * Bit 8 : Reserved for SOC stats
  5112. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5113. * Indicates MACID_MASK in DBS
  5114. * - STATS_TYPE
  5115. * Bits 23:16
  5116. * Purpose: identifies which FW statistics to upload
  5117. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5118. * - Reserved
  5119. * Bits 31:24
  5120. * - CONFIG_PARAM [0]
  5121. * Bits 31:0
  5122. * Purpose: give an opaque configuration value to the specified stats type
  5123. * Value: stats-type specific configuration value
  5124. * Refer to htt_stats.h for interpretation for each stats sub_type
  5125. * - CONFIG_PARAM [1]
  5126. * Bits 31:0
  5127. * Purpose: give an opaque configuration value to the specified stats type
  5128. * Value: stats-type specific configuration value
  5129. * Refer to htt_stats.h for interpretation for each stats sub_type
  5130. * - CONFIG_PARAM [2]
  5131. * Bits 31:0
  5132. * Purpose: give an opaque configuration value to the specified stats type
  5133. * Value: stats-type specific configuration value
  5134. * Refer to htt_stats.h for interpretation for each stats sub_type
  5135. * - CONFIG_PARAM [3]
  5136. * Bits 31:0
  5137. * Purpose: give an opaque configuration value to the specified stats type
  5138. * Value: stats-type specific configuration value
  5139. * Refer to htt_stats.h for interpretation for each stats sub_type
  5140. * - Reserved [31:0] for future use.
  5141. * - COOKIE_LSBS
  5142. * Bits 31:0
  5143. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5144. * message with its preceding host->target stats request message.
  5145. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5146. * - COOKIE_MSBS
  5147. * Bits 31:0
  5148. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5149. * message with its preceding host->target stats request message.
  5150. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5151. */
  5152. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5153. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5154. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5155. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5156. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5157. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5158. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5159. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5160. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5161. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5162. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5163. do { \
  5164. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5165. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5166. } while (0)
  5167. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5168. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5169. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5170. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5171. do { \
  5172. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5173. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5174. } while (0)
  5175. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5176. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5177. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5178. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5179. do { \
  5180. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5181. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5182. } while (0)
  5183. /**
  5184. * @brief host -> target FW PPDU_STATS request message
  5185. *
  5186. * @details
  5187. * The following field definitions describe the format of the HTT host
  5188. * to target FW for PPDU_STATS_CFG msg.
  5189. * The message allows the host to configure the PPDU_STATS_IND messages
  5190. * produced by the target.
  5191. *
  5192. * |31 24|23 16|15 8|7 0|
  5193. * |-----------------------------------------------------------|
  5194. * | REQ bit mask | pdev_mask | msg type |
  5195. * |-----------------------------------------------------------|
  5196. * Header fields:
  5197. * - MSG_TYPE
  5198. * Bits 7:0
  5199. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5200. * Value: 0x11
  5201. * - PDEV_MASK
  5202. * Bits 8:15
  5203. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5204. * Value: This is a overloaded field, refer to usage and interpretation of
  5205. * PDEV in interface document.
  5206. * Bit 8 : Reserved for SOC stats
  5207. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5208. * Indicates MACID_MASK in DBS
  5209. * - REQ_TLV_BIT_MASK
  5210. * Bits 16:31
  5211. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5212. * needs to be included in the target's PPDU_STATS_IND messages.
  5213. * Value: refer htt_ppdu_stats_tlv_tag_t
  5214. *
  5215. */
  5216. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5217. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5218. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5219. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5220. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5221. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5222. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5223. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5224. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5225. do { \
  5226. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5227. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5228. } while (0)
  5229. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5230. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5231. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5232. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5235. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5236. } while (0)
  5237. /**
  5238. * @brief Host-->target HTT RX FSE setup message
  5239. * @details
  5240. * Through this message, the host will provide details of the flow tables
  5241. * in host DDR along with hash keys.
  5242. * This message can be sent per SOC or per PDEV, which is differentiated
  5243. * by pdev id values.
  5244. * The host will allocate flow search table and sends table size,
  5245. * physical DMA address of flow table, and hash keys to firmware to
  5246. * program into the RXOLE FSE HW block.
  5247. *
  5248. * The following field definitions describe the format of the RX FSE setup
  5249. * message sent from the host to target
  5250. *
  5251. * Header fields:
  5252. * dword0 - b'7:0 - msg_type: This will be set to
  5253. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5254. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5255. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5256. * pdev's LMAC ring.
  5257. * b'31:16 - reserved : Reserved for future use
  5258. * dword1 - b'19:0 - number of records: This field indicates the number of
  5259. * entries in the flow table. For example: 8k number of
  5260. * records is equivalent to
  5261. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5262. * b'27:20 - max search: This field specifies the skid length to FSE
  5263. * parser HW module whenever match is not found at the
  5264. * exact index pointed by hash.
  5265. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5266. * Refer htt_ip_da_sa_prefix below for more details.
  5267. * b'31:30 - reserved: Reserved for future use
  5268. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5269. * table allocated by host in DDR
  5270. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5271. * table allocated by host in DDR
  5272. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5273. * entry hashing
  5274. *
  5275. *
  5276. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5277. * |---------------------------------------------------------------|
  5278. * | reserved | pdev_id | MSG_TYPE |
  5279. * |---------------------------------------------------------------|
  5280. * |resvd|IPDSA| max_search | Number of records |
  5281. * |---------------------------------------------------------------|
  5282. * | base address lo |
  5283. * |---------------------------------------------------------------|
  5284. * | base address high |
  5285. * |---------------------------------------------------------------|
  5286. * | toeplitz key 31_0 |
  5287. * |---------------------------------------------------------------|
  5288. * | toeplitz key 63_32 |
  5289. * |---------------------------------------------------------------|
  5290. * | toeplitz key 95_64 |
  5291. * |---------------------------------------------------------------|
  5292. * | toeplitz key 127_96 |
  5293. * |---------------------------------------------------------------|
  5294. * | toeplitz key 159_128 |
  5295. * |---------------------------------------------------------------|
  5296. * | toeplitz key 191_160 |
  5297. * |---------------------------------------------------------------|
  5298. * | toeplitz key 223_192 |
  5299. * |---------------------------------------------------------------|
  5300. * | toeplitz key 255_224 |
  5301. * |---------------------------------------------------------------|
  5302. * | toeplitz key 287_256 |
  5303. * |---------------------------------------------------------------|
  5304. * | reserved | toeplitz key 314_288(26:0 bits) |
  5305. * |---------------------------------------------------------------|
  5306. * where:
  5307. * IPDSA = ip_da_sa
  5308. */
  5309. /**
  5310. * @brief: htt_ip_da_sa_prefix
  5311. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5312. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5313. * documentation per RFC3849
  5314. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5315. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5316. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5317. */
  5318. enum htt_ip_da_sa_prefix {
  5319. HTT_RX_IPV6_20010db8,
  5320. HTT_RX_IPV4_MAPPED_IPV6,
  5321. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5322. HTT_RX_IPV6_64FF9B,
  5323. };
  5324. /**
  5325. * @brief Host-->target HTT RX FISA configure and enable
  5326. * @details
  5327. * The host will send this command down to configure and enable the FISA
  5328. * operational params.
  5329. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5330. * register.
  5331. * Should configure both the MACs.
  5332. *
  5333. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5334. *
  5335. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5336. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5337. * pdev's LMAC ring.
  5338. * b'31:16 - reserved : Reserved for future use
  5339. *
  5340. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5341. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5342. * packets. 1 flow search will be skipped
  5343. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5344. * tcp,udp packets
  5345. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5346. * calculation
  5347. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5348. * calculation
  5349. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5350. * calculation
  5351. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5352. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5353. * length
  5354. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5355. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5356. * length
  5357. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5358. * num jump
  5359. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5360. * num jump
  5361. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5362. * data type switch has happend for MPDU Sequence num jump
  5363. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5364. * for MPDU Sequence num jump
  5365. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5366. * for decrypt errors
  5367. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5368. * while aggregating a msdu
  5369. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5370. * The aggregation is done until (number of MSDUs aggregated
  5371. * < LIMIT + 1)
  5372. * b'31:18 - Reserved
  5373. *
  5374. * fisa_control_value - 32bit value FW can write to register
  5375. *
  5376. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5377. * Threshold value for FISA timeout (units are microseconds).
  5378. * When the global timestamp exceeds this threshold, FISA
  5379. * aggregation will be restarted.
  5380. * A value of 0 means timeout is disabled.
  5381. * Compare the threshold register with timestamp field in
  5382. * flow entry to generate timeout for the flow.
  5383. *
  5384. * |31 18 |17 16|15 8|7 0|
  5385. * |-------------------------------------------------------------|
  5386. * | reserved | pdev_mask | msg type |
  5387. * |-------------------------------------------------------------|
  5388. * | reserved | FISA_CTRL |
  5389. * |-------------------------------------------------------------|
  5390. * | FISA_TIMEOUT_THRESH |
  5391. * |-------------------------------------------------------------|
  5392. */
  5393. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5394. A_UINT32 msg_type:8,
  5395. pdev_id:8,
  5396. reserved0:16;
  5397. /**
  5398. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5399. * [17:0]
  5400. */
  5401. union {
  5402. struct {
  5403. A_UINT32 fisa_enable: 1,
  5404. ipsec_skip_search: 1,
  5405. nontcp_skip_search: 1,
  5406. add_ipv4_fixed_hdr_len: 1,
  5407. add_ipv6_fixed_hdr_len: 1,
  5408. add_tcp_fixed_hdr_len: 1,
  5409. add_udp_hdr_len: 1,
  5410. chksum_cum_ip_len_en: 1,
  5411. disable_tid_check: 1,
  5412. disable_ta_check: 1,
  5413. disable_qos_check: 1,
  5414. disable_raw_check: 1,
  5415. disable_decrypt_err_check: 1,
  5416. disable_msdu_drop_check: 1,
  5417. fisa_aggr_limit: 4,
  5418. reserved: 14;
  5419. } fisa_control_bits;
  5420. A_UINT32 fisa_control_value;
  5421. } u_fisa_control;
  5422. /**
  5423. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5424. * timeout threshold for aggregation. Unit in usec.
  5425. * [31:0]
  5426. */
  5427. A_UINT32 fisa_timeout_threshold;
  5428. } POSTPACK;
  5429. /* DWord 0: pdev-ID */
  5430. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5431. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5432. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5433. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5434. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5435. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5436. do { \
  5437. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5438. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5439. } while (0)
  5440. /* Dword 1: fisa_control_value fisa config */
  5441. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5442. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5443. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5444. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5445. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5446. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5447. do { \
  5448. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5449. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5450. } while (0)
  5451. /* Dword 1: fisa_control_value ipsec_skip_search */
  5452. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5453. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5454. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5455. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5456. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5457. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5458. do { \
  5459. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5460. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5461. } while (0)
  5462. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5463. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5464. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5465. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5466. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5467. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5468. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5471. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5472. } while (0)
  5473. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5474. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5475. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5476. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5477. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5478. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5479. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5482. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5483. } while (0)
  5484. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5485. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5486. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5487. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5488. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5489. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5490. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5491. do { \
  5492. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5493. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5494. } while (0)
  5495. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5496. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5497. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5498. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5499. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5500. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5501. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5505. } while (0)
  5506. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5507. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5508. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5509. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5510. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5511. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5512. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5513. do { \
  5514. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5515. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5516. } while (0)
  5517. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5518. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5519. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5520. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5521. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5522. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5523. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5524. do { \
  5525. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5526. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5527. } while (0)
  5528. /* Dword 1: fisa_control_value disable_tid_check */
  5529. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5530. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5531. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5532. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5533. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5534. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5537. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5538. } while (0)
  5539. /* Dword 1: fisa_control_value disable_ta_check */
  5540. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5541. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5542. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5543. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5544. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5545. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5546. do { \
  5547. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5548. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5549. } while (0)
  5550. /* Dword 1: fisa_control_value disable_qos_check */
  5551. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5552. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5553. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5554. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5555. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5556. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5557. do { \
  5558. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5559. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5560. } while (0)
  5561. /* Dword 1: fisa_control_value disable_raw_check */
  5562. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5563. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5564. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5565. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5566. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5567. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5568. do { \
  5569. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5570. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5571. } while (0)
  5572. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5573. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5574. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5575. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5576. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5577. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5578. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5581. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5582. } while (0)
  5583. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5584. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5586. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5587. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5588. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5589. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5592. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5593. } while (0)
  5594. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5595. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5596. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5597. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5598. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5599. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5600. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5601. do { \
  5602. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5603. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5604. } while (0)
  5605. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5606. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5607. pdev_id:8,
  5608. reserved0:16;
  5609. A_UINT32 num_records:20,
  5610. max_search:8,
  5611. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5612. reserved1:2;
  5613. A_UINT32 base_addr_lo;
  5614. A_UINT32 base_addr_hi;
  5615. A_UINT32 toeplitz31_0;
  5616. A_UINT32 toeplitz63_32;
  5617. A_UINT32 toeplitz95_64;
  5618. A_UINT32 toeplitz127_96;
  5619. A_UINT32 toeplitz159_128;
  5620. A_UINT32 toeplitz191_160;
  5621. A_UINT32 toeplitz223_192;
  5622. A_UINT32 toeplitz255_224;
  5623. A_UINT32 toeplitz287_256;
  5624. A_UINT32 toeplitz314_288:27,
  5625. reserved2:5;
  5626. } POSTPACK;
  5627. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5628. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5629. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5630. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5631. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5632. /* DWORD 0: Pdev ID */
  5633. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5634. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5635. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5636. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5637. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5638. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5641. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5642. } while (0)
  5643. /* DWORD 1:num of records */
  5644. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5645. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5646. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5647. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5648. HTT_RX_FSE_SETUP_NUM_REC_S)
  5649. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5652. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5653. } while (0)
  5654. /* DWORD 1:max_search */
  5655. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5656. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5657. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5658. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5659. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5660. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5661. do { \
  5662. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5663. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5664. } while (0)
  5665. /* DWORD 1:ip_da_sa prefix */
  5666. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5667. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5668. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5669. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5670. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5671. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5675. } while (0)
  5676. /* DWORD 2: Base Address LO */
  5677. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5678. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5679. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5680. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5681. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5682. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5686. } while (0)
  5687. /* DWORD 3: Base Address High */
  5688. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5689. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5690. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5691. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5692. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5693. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5696. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5697. } while (0)
  5698. /* DWORD 4-12: Hash Value */
  5699. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5700. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5701. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5702. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5703. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5704. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5707. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5708. } while (0)
  5709. /* DWORD 13: Hash Value 314:288 bits */
  5710. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5711. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5712. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5713. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5716. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5717. } while (0)
  5718. /**
  5719. * @brief Host-->target HTT RX FSE operation message
  5720. * @details
  5721. * The host will send this Flow Search Engine (FSE) operation message for
  5722. * every flow add/delete operation.
  5723. * The FSE operation includes FSE full cache invalidation or individual entry
  5724. * invalidation.
  5725. * This message can be sent per SOC or per PDEV which is differentiated
  5726. * by pdev id values.
  5727. *
  5728. * |31 16|15 8|7 1|0|
  5729. * |-------------------------------------------------------------|
  5730. * | reserved | pdev_id | MSG_TYPE |
  5731. * |-------------------------------------------------------------|
  5732. * | reserved | operation |I|
  5733. * |-------------------------------------------------------------|
  5734. * | ip_src_addr_31_0 |
  5735. * |-------------------------------------------------------------|
  5736. * | ip_src_addr_63_32 |
  5737. * |-------------------------------------------------------------|
  5738. * | ip_src_addr_95_64 |
  5739. * |-------------------------------------------------------------|
  5740. * | ip_src_addr_127_96 |
  5741. * |-------------------------------------------------------------|
  5742. * | ip_dst_addr_31_0 |
  5743. * |-------------------------------------------------------------|
  5744. * | ip_dst_addr_63_32 |
  5745. * |-------------------------------------------------------------|
  5746. * | ip_dst_addr_95_64 |
  5747. * |-------------------------------------------------------------|
  5748. * | ip_dst_addr_127_96 |
  5749. * |-------------------------------------------------------------|
  5750. * | l4_dst_port | l4_src_port |
  5751. * | (32-bit SPI incase of IPsec) |
  5752. * |-------------------------------------------------------------|
  5753. * | reserved | l4_proto |
  5754. * |-------------------------------------------------------------|
  5755. *
  5756. * where I is 1-bit ipsec_valid.
  5757. *
  5758. * The following field definitions describe the format of the RX FSE operation
  5759. * message sent from the host to target for every add/delete flow entry to flow
  5760. * table.
  5761. *
  5762. * Header fields:
  5763. * dword0 - b'7:0 - msg_type: This will be set to
  5764. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5765. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5766. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5767. * specified pdev's LMAC ring.
  5768. * b'31:16 - reserved : Reserved for future use
  5769. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5770. * (Internet Protocol Security).
  5771. * IPsec describes the framework for providing security at
  5772. * IP layer. IPsec is defined for both versions of IP:
  5773. * IPV4 and IPV6.
  5774. * Please refer to htt_rx_flow_proto enumeration below for
  5775. * more info.
  5776. * ipsec_valid = 1 for IPSEC packets
  5777. * ipsec_valid = 0 for IP Packets
  5778. * b'7:1 - operation: This indicates types of FSE operation.
  5779. * Refer to htt_rx_fse_operation enumeration:
  5780. * 0 - No Cache Invalidation required
  5781. * 1 - Cache invalidate only one entry given by IP
  5782. * src/dest address at DWORD[2:9]
  5783. * 2 - Complete FSE Cache Invalidation
  5784. * 3 - FSE Disable
  5785. * 4 - FSE Enable
  5786. * b'31:8 - reserved: Reserved for future use
  5787. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5788. * for per flow addition/deletion
  5789. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5790. * and the subsequent 3 A_UINT32 will be padding bytes.
  5791. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5792. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5793. * from 0 to 65535 but only 0 to 1023 are designated as
  5794. * well-known ports. Refer to [RFC1700] for more details.
  5795. * This field is valid only if
  5796. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5797. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5798. * range from 0 to 65535 but only 0 to 1023 are designated
  5799. * as well-known ports. Refer to [RFC1700] for more details.
  5800. * This field is valid only if
  5801. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5802. * - SPI (31:0): Security Parameters Index is an
  5803. * identification tag added to the header while using IPsec
  5804. * for tunneling the IP traffici.
  5805. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5806. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5807. * Assigned Internet Protocol Numbers.
  5808. * l4_proto numbers for standard protocol like UDP/TCP
  5809. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5810. * l4_proto = 17 for UDP etc.
  5811. * b'31:8 - reserved: Reserved for future use.
  5812. *
  5813. */
  5814. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5815. A_UINT32 msg_type:8,
  5816. pdev_id:8,
  5817. reserved0:16;
  5818. A_UINT32 ipsec_valid:1,
  5819. operation:7,
  5820. reserved1:24;
  5821. A_UINT32 ip_src_addr_31_0;
  5822. A_UINT32 ip_src_addr_63_32;
  5823. A_UINT32 ip_src_addr_95_64;
  5824. A_UINT32 ip_src_addr_127_96;
  5825. A_UINT32 ip_dest_addr_31_0;
  5826. A_UINT32 ip_dest_addr_63_32;
  5827. A_UINT32 ip_dest_addr_95_64;
  5828. A_UINT32 ip_dest_addr_127_96;
  5829. union {
  5830. A_UINT32 spi;
  5831. struct {
  5832. A_UINT32 l4_src_port:16,
  5833. l4_dest_port:16;
  5834. } ip;
  5835. } u;
  5836. A_UINT32 l4_proto:8,
  5837. reserved:24;
  5838. } POSTPACK;
  5839. /**
  5840. * Enumeration for IP Protocol or IPSEC Protocol
  5841. * IPsec describes the framework for providing security at IP layer.
  5842. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  5843. */
  5844. enum htt_rx_flow_proto {
  5845. HTT_RX_FLOW_IP_PROTO,
  5846. HTT_RX_FLOW_IPSEC_PROTO,
  5847. };
  5848. /**
  5849. * Enumeration for FSE Cache Invalidation
  5850. * 0 - No Cache Invalidation required
  5851. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  5852. * 2 - Complete FSE Cache Invalidation
  5853. * 3 - FSE Disable
  5854. * 4 - FSE Enable
  5855. */
  5856. enum htt_rx_fse_operation {
  5857. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  5858. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  5859. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  5860. HTT_RX_FSE_DISABLE,
  5861. HTT_RX_FSE_ENABLE,
  5862. };
  5863. /* DWORD 0: Pdev ID */
  5864. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  5865. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  5866. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  5867. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  5868. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  5869. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  5870. do { \
  5871. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  5872. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  5873. } while (0)
  5874. /* DWORD 1:IP PROTO or IPSEC */
  5875. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  5876. #define HTT_RX_FSE_IPSEC_VALID_S 0
  5877. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  5878. do { \
  5879. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  5880. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  5881. } while (0)
  5882. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  5883. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  5884. /* DWORD 1:FSE Operation */
  5885. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  5886. #define HTT_RX_FSE_OPERATION_S 1
  5887. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  5888. do { \
  5889. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  5890. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  5891. } while (0)
  5892. #define HTT_RX_FSE_OPERATION_GET(word) \
  5893. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  5894. /* DWORD 2-9:IP Address */
  5895. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  5896. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  5897. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  5898. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  5899. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  5900. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  5901. do { \
  5902. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  5903. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  5904. } while (0)
  5905. /* DWORD 10:Source Port Number */
  5906. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  5907. #define HTT_RX_FSE_SOURCEPORT_S 0
  5908. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  5909. do { \
  5910. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  5911. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  5912. } while (0)
  5913. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  5914. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  5915. /* DWORD 11:Destination Port Number */
  5916. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  5917. #define HTT_RX_FSE_DESTPORT_S 16
  5918. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  5921. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  5922. } while (0)
  5923. #define HTT_RX_FSE_DESTPORT_GET(word) \
  5924. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  5925. /* DWORD 10-11:SPI (In case of IPSEC) */
  5926. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  5927. #define HTT_RX_FSE_OPERATION_SPI_S 0
  5928. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  5929. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  5930. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  5931. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  5932. do { \
  5933. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  5934. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  5935. } while (0)
  5936. /* DWORD 12:L4 PROTO */
  5937. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  5938. #define HTT_RX_FSE_L4_PROTO_S 0
  5939. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  5942. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  5943. } while (0)
  5944. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  5945. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  5946. /*=== target -> host messages ===============================================*/
  5947. enum htt_t2h_msg_type {
  5948. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5949. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5950. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5951. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5952. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5953. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5954. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5955. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5956. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5957. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5958. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5959. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5960. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5961. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5962. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5963. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5964. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5965. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5966. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5967. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5968. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5969. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5970. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5971. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5972. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5973. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5974. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5975. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5976. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5977. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5978. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5979. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5980. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5981. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5982. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5983. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5984. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5985. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5986. /* TX_OFFLOAD_DELIVER_IND:
  5987. * Forward the target's locally-generated packets to the host,
  5988. * to provide to the monitor mode interface.
  5989. */
  5990. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5991. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  5992. HTT_T2H_MSG_TYPE_TEST,
  5993. /* keep this last */
  5994. HTT_T2H_NUM_MSGS
  5995. };
  5996. /*
  5997. * HTT target to host message type -
  5998. * stored in bits 7:0 of the first word of the message
  5999. */
  6000. #define HTT_T2H_MSG_TYPE_M 0xff
  6001. #define HTT_T2H_MSG_TYPE_S 0
  6002. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6003. do { \
  6004. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6005. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6006. } while (0)
  6007. #define HTT_T2H_MSG_TYPE_GET(word) \
  6008. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6009. /**
  6010. * @brief target -> host version number confirmation message definition
  6011. *
  6012. * |31 24|23 16|15 8|7 0|
  6013. * |----------------+----------------+----------------+----------------|
  6014. * | reserved | major number | minor number | msg type |
  6015. * |-------------------------------------------------------------------|
  6016. * : option request TLV (optional) |
  6017. * :...................................................................:
  6018. *
  6019. * The VER_CONF message may consist of a single 4-byte word, or may be
  6020. * extended with TLVs that specify HTT options selected by the target.
  6021. * The following option TLVs may be appended to the VER_CONF message:
  6022. * - LL_BUS_ADDR_SIZE
  6023. * - HL_SUPPRESS_TX_COMPL_IND
  6024. * - MAX_TX_QUEUE_GROUPS
  6025. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6026. * may be appended to the VER_CONF message (but only one TLV of each type).
  6027. *
  6028. * Header fields:
  6029. * - MSG_TYPE
  6030. * Bits 7:0
  6031. * Purpose: identifies this as a version number confirmation message
  6032. * Value: 0x0
  6033. * - VER_MINOR
  6034. * Bits 15:8
  6035. * Purpose: Specify the minor number of the HTT message library version
  6036. * in use by the target firmware.
  6037. * The minor number specifies the specific revision within a range
  6038. * of fundamentally compatible HTT message definition revisions.
  6039. * Compatible revisions involve adding new messages or perhaps
  6040. * adding new fields to existing messages, in a backwards-compatible
  6041. * manner.
  6042. * Incompatible revisions involve changing the message type values,
  6043. * or redefining existing messages.
  6044. * Value: minor number
  6045. * - VER_MAJOR
  6046. * Bits 15:8
  6047. * Purpose: Specify the major number of the HTT message library version
  6048. * in use by the target firmware.
  6049. * The major number specifies the family of minor revisions that are
  6050. * fundamentally compatible with each other, but not with prior or
  6051. * later families.
  6052. * Value: major number
  6053. */
  6054. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6055. #define HTT_VER_CONF_MINOR_S 8
  6056. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6057. #define HTT_VER_CONF_MAJOR_S 16
  6058. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6059. do { \
  6060. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6061. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6062. } while (0)
  6063. #define HTT_VER_CONF_MINOR_GET(word) \
  6064. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6065. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6068. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6069. } while (0)
  6070. #define HTT_VER_CONF_MAJOR_GET(word) \
  6071. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6072. #define HTT_VER_CONF_BYTES 4
  6073. /**
  6074. * @brief - target -> host HTT Rx In order indication message
  6075. *
  6076. * @details
  6077. *
  6078. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6079. * |----------------+-------------------+---------------------+---------------|
  6080. * | peer ID | P| F| O| ext TID | msg type |
  6081. * |--------------------------------------------------------------------------|
  6082. * | MSDU count | Reserved | vdev id |
  6083. * |--------------------------------------------------------------------------|
  6084. * | MSDU 0 bus address (bits 31:0) |
  6085. #if HTT_PADDR64
  6086. * | MSDU 0 bus address (bits 63:32) |
  6087. #endif
  6088. * |--------------------------------------------------------------------------|
  6089. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6090. * |--------------------------------------------------------------------------|
  6091. * | MSDU 1 bus address (bits 31:0) |
  6092. #if HTT_PADDR64
  6093. * | MSDU 1 bus address (bits 63:32) |
  6094. #endif
  6095. * |--------------------------------------------------------------------------|
  6096. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6097. * |--------------------------------------------------------------------------|
  6098. */
  6099. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6100. *
  6101. * @details
  6102. * bits
  6103. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6104. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6105. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6106. * | | frag | | | | fail |chksum fail|
  6107. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6108. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6109. */
  6110. struct htt_rx_in_ord_paddr_ind_hdr_t
  6111. {
  6112. A_UINT32 /* word 0 */
  6113. msg_type: 8,
  6114. ext_tid: 5,
  6115. offload: 1,
  6116. frag: 1,
  6117. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6118. peer_id: 16;
  6119. A_UINT32 /* word 1 */
  6120. vap_id: 8,
  6121. /* NOTE:
  6122. * This reserved_1 field is not truly reserved - certain targets use
  6123. * this field internally to store debug information, and do not zero
  6124. * out the contents of the field before uploading the message to the
  6125. * host. Thus, any host-target communication supported by this field
  6126. * is limited to using values that are never used by the debug
  6127. * information stored by certain targets in the reserved_1 field.
  6128. * In particular, the targets in question don't use the value 0x3
  6129. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6130. * so this previously-unused value within these bits is available to
  6131. * use as the host / target PKT_CAPTURE_MODE flag.
  6132. */
  6133. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6134. /* if pkt_capture_mode == 0x3, host should
  6135. * send rx frames to monitor mode interface
  6136. */
  6137. msdu_cnt: 16;
  6138. };
  6139. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6140. {
  6141. A_UINT32 dma_addr;
  6142. A_UINT32
  6143. length: 16,
  6144. fw_desc: 8,
  6145. msdu_info:8;
  6146. };
  6147. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6148. {
  6149. A_UINT32 dma_addr_lo;
  6150. A_UINT32 dma_addr_hi;
  6151. A_UINT32
  6152. length: 16,
  6153. fw_desc: 8,
  6154. msdu_info:8;
  6155. };
  6156. #if HTT_PADDR64
  6157. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6158. #else
  6159. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6160. #endif
  6161. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6162. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6163. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6165. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6168. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6171. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6172. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6173. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6174. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6175. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6176. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6177. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6178. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6179. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6180. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6181. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6182. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6183. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6184. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6185. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6186. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6187. /* for systems using 64-bit format for bus addresses */
  6188. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6192. /* for systems using 32-bit format for bus addresses */
  6193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6197. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6198. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6201. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6202. do { \
  6203. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6204. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6205. } while (0)
  6206. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6207. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6208. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6209. do { \
  6210. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6211. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6212. } while (0)
  6213. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6214. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6215. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6218. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6219. } while (0)
  6220. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6221. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6222. /*
  6223. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6224. * deliver the rx frames to the monitor mode interface.
  6225. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6226. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6227. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6228. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6229. */
  6230. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6231. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6232. do { \
  6233. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6234. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6235. } while (0)
  6236. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6237. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6238. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6239. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6240. do { \
  6241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6243. } while (0)
  6244. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6245. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6246. /* for systems using 64-bit format for bus addresses */
  6247. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6250. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6251. } while (0)
  6252. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6253. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6254. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6257. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6258. } while (0)
  6259. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6260. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6261. /* for systems using 32-bit format for bus addresses */
  6262. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6263. do { \
  6264. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6265. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6266. } while (0)
  6267. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6268. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6269. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6270. do { \
  6271. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6272. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6273. } while (0)
  6274. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6275. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6276. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6277. do { \
  6278. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6279. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6280. } while (0)
  6281. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6282. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6283. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6284. do { \
  6285. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6286. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6287. } while (0)
  6288. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6289. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6290. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6291. do { \
  6292. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6293. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6294. } while (0)
  6295. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6296. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6297. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6298. do { \
  6299. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6300. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6301. } while (0)
  6302. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6303. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6304. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6307. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6308. } while (0)
  6309. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6310. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6311. /* definitions used within target -> host rx indication message */
  6312. PREPACK struct htt_rx_ind_hdr_prefix_t
  6313. {
  6314. A_UINT32 /* word 0 */
  6315. msg_type: 8,
  6316. ext_tid: 5,
  6317. release_valid: 1,
  6318. flush_valid: 1,
  6319. reserved0: 1,
  6320. peer_id: 16;
  6321. A_UINT32 /* word 1 */
  6322. flush_start_seq_num: 6,
  6323. flush_end_seq_num: 6,
  6324. release_start_seq_num: 6,
  6325. release_end_seq_num: 6,
  6326. num_mpdu_ranges: 8;
  6327. } POSTPACK;
  6328. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6329. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6330. #define HTT_TGT_RSSI_INVALID 0x80
  6331. PREPACK struct htt_rx_ppdu_desc_t
  6332. {
  6333. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6334. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6335. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6336. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6337. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6338. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6339. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6340. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6341. A_UINT32 /* word 0 */
  6342. rssi_cmb: 8,
  6343. timestamp_submicrosec: 8,
  6344. phy_err_code: 8,
  6345. phy_err: 1,
  6346. legacy_rate: 4,
  6347. legacy_rate_sel: 1,
  6348. end_valid: 1,
  6349. start_valid: 1;
  6350. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6351. union {
  6352. A_UINT32 /* word 1 */
  6353. rssi0_pri20: 8,
  6354. rssi0_ext20: 8,
  6355. rssi0_ext40: 8,
  6356. rssi0_ext80: 8;
  6357. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6358. } u0;
  6359. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6360. union {
  6361. A_UINT32 /* word 2 */
  6362. rssi1_pri20: 8,
  6363. rssi1_ext20: 8,
  6364. rssi1_ext40: 8,
  6365. rssi1_ext80: 8;
  6366. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6367. } u1;
  6368. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6369. union {
  6370. A_UINT32 /* word 3 */
  6371. rssi2_pri20: 8,
  6372. rssi2_ext20: 8,
  6373. rssi2_ext40: 8,
  6374. rssi2_ext80: 8;
  6375. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6376. } u2;
  6377. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6378. union {
  6379. A_UINT32 /* word 4 */
  6380. rssi3_pri20: 8,
  6381. rssi3_ext20: 8,
  6382. rssi3_ext40: 8,
  6383. rssi3_ext80: 8;
  6384. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6385. } u3;
  6386. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6387. A_UINT32 tsf32; /* word 5 */
  6388. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6389. A_UINT32 timestamp_microsec; /* word 6 */
  6390. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6391. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6392. A_UINT32 /* word 7 */
  6393. vht_sig_a1: 24,
  6394. preamble_type: 8;
  6395. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6396. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6397. A_UINT32 /* word 8 */
  6398. vht_sig_a2: 24,
  6399. /* sa_ant_matrix
  6400. * For cases where a single rx chain has options to be connected to
  6401. * different rx antennas, show which rx antennas were in use during
  6402. * receipt of a given PPDU.
  6403. * This sa_ant_matrix provides a bitmask of the antennas used while
  6404. * receiving this frame.
  6405. */
  6406. sa_ant_matrix: 8;
  6407. } POSTPACK;
  6408. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6409. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6410. PREPACK struct htt_rx_ind_hdr_suffix_t
  6411. {
  6412. A_UINT32 /* word 0 */
  6413. fw_rx_desc_bytes: 16,
  6414. reserved0: 16;
  6415. } POSTPACK;
  6416. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6417. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6418. PREPACK struct htt_rx_ind_hdr_t
  6419. {
  6420. struct htt_rx_ind_hdr_prefix_t prefix;
  6421. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6422. struct htt_rx_ind_hdr_suffix_t suffix;
  6423. } POSTPACK;
  6424. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6425. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6426. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6427. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6428. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6429. /*
  6430. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6431. * the offset into the HTT rx indication message at which the
  6432. * FW rx PPDU descriptor resides
  6433. */
  6434. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6435. /*
  6436. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6437. * the offset into the HTT rx indication message at which the
  6438. * header suffix (FW rx MSDU byte count) resides
  6439. */
  6440. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6441. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6442. /*
  6443. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6444. * the offset into the HTT rx indication message at which the per-MSDU
  6445. * information starts
  6446. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6447. * per-MSDU information portion of the message. The per-MSDU info itself
  6448. * starts at byte 12.
  6449. */
  6450. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6451. /**
  6452. * @brief target -> host rx indication message definition
  6453. *
  6454. * @details
  6455. * The following field definitions describe the format of the rx indication
  6456. * message sent from the target to the host.
  6457. * The message consists of three major sections:
  6458. * 1. a fixed-length header
  6459. * 2. a variable-length list of firmware rx MSDU descriptors
  6460. * 3. one or more 4-octet MPDU range information elements
  6461. * The fixed length header itself has two sub-sections
  6462. * 1. the message meta-information, including identification of the
  6463. * sender and type of the received data, and a 4-octet flush/release IE
  6464. * 2. the firmware rx PPDU descriptor
  6465. *
  6466. * The format of the message is depicted below.
  6467. * in this depiction, the following abbreviations are used for information
  6468. * elements within the message:
  6469. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6470. * elements associated with the PPDU start are valid.
  6471. * Specifically, the following fields are valid only if SV is set:
  6472. * RSSI (all variants), L, legacy rate, preamble type, service,
  6473. * VHT-SIG-A
  6474. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6475. * elements associated with the PPDU end are valid.
  6476. * Specifically, the following fields are valid only if EV is set:
  6477. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6478. * - L - Legacy rate selector - if legacy rates are used, this flag
  6479. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6480. * (L == 0) PHY.
  6481. * - P - PHY error flag - boolean indication of whether the rx frame had
  6482. * a PHY error
  6483. *
  6484. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6485. * |----------------+-------------------+---------------------+---------------|
  6486. * | peer ID | |RV|FV| ext TID | msg type |
  6487. * |--------------------------------------------------------------------------|
  6488. * | num | release | release | flush | flush |
  6489. * | MPDU | end | start | end | start |
  6490. * | ranges | seq num | seq num | seq num | seq num |
  6491. * |==========================================================================|
  6492. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6493. * |V|V| | rate | | | timestamp | RSSI |
  6494. * |--------------------------------------------------------------------------|
  6495. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6496. * |--------------------------------------------------------------------------|
  6497. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6498. * |--------------------------------------------------------------------------|
  6499. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6500. * |--------------------------------------------------------------------------|
  6501. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6502. * |--------------------------------------------------------------------------|
  6503. * | TSF LSBs |
  6504. * |--------------------------------------------------------------------------|
  6505. * | microsec timestamp |
  6506. * |--------------------------------------------------------------------------|
  6507. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6508. * |--------------------------------------------------------------------------|
  6509. * | service | HT-SIG / VHT-SIG-A2 |
  6510. * |==========================================================================|
  6511. * | reserved | FW rx desc bytes |
  6512. * |--------------------------------------------------------------------------|
  6513. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6514. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6515. * |--------------------------------------------------------------------------|
  6516. * : : :
  6517. * |--------------------------------------------------------------------------|
  6518. * | alignment | MSDU Rx |
  6519. * | padding | desc Bn |
  6520. * |--------------------------------------------------------------------------|
  6521. * | reserved | MPDU range status | MPDU count |
  6522. * |--------------------------------------------------------------------------|
  6523. * : reserved : MPDU range status : MPDU count :
  6524. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6525. *
  6526. * Header fields:
  6527. * - MSG_TYPE
  6528. * Bits 7:0
  6529. * Purpose: identifies this as an rx indication message
  6530. * Value: 0x1
  6531. * - EXT_TID
  6532. * Bits 12:8
  6533. * Purpose: identify the traffic ID of the rx data, including
  6534. * special "extended" TID values for multicast, broadcast, and
  6535. * non-QoS data frames
  6536. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6537. * - FLUSH_VALID (FV)
  6538. * Bit 13
  6539. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6540. * is valid
  6541. * Value:
  6542. * 1 -> flush IE is valid and needs to be processed
  6543. * 0 -> flush IE is not valid and should be ignored
  6544. * - REL_VALID (RV)
  6545. * Bit 13
  6546. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6547. * is valid
  6548. * Value:
  6549. * 1 -> release IE is valid and needs to be processed
  6550. * 0 -> release IE is not valid and should be ignored
  6551. * - PEER_ID
  6552. * Bits 31:16
  6553. * Purpose: Identify, by ID, which peer sent the rx data
  6554. * Value: ID of the peer who sent the rx data
  6555. * - FLUSH_SEQ_NUM_START
  6556. * Bits 5:0
  6557. * Purpose: Indicate the start of a series of MPDUs to flush
  6558. * Not all MPDUs within this series are necessarily valid - the host
  6559. * must check each sequence number within this range to see if the
  6560. * corresponding MPDU is actually present.
  6561. * This field is only valid if the FV bit is set.
  6562. * Value:
  6563. * The sequence number for the first MPDUs to check to flush.
  6564. * The sequence number is masked by 0x3f.
  6565. * - FLUSH_SEQ_NUM_END
  6566. * Bits 11:6
  6567. * Purpose: Indicate the end of a series of MPDUs to flush
  6568. * Value:
  6569. * The sequence number one larger than the sequence number of the
  6570. * last MPDU to check to flush.
  6571. * The sequence number is masked by 0x3f.
  6572. * Not all MPDUs within this series are necessarily valid - the host
  6573. * must check each sequence number within this range to see if the
  6574. * corresponding MPDU is actually present.
  6575. * This field is only valid if the FV bit is set.
  6576. * - REL_SEQ_NUM_START
  6577. * Bits 17:12
  6578. * Purpose: Indicate the start of a series of MPDUs to release.
  6579. * All MPDUs within this series are present and valid - the host
  6580. * need not check each sequence number within this range to see if
  6581. * the corresponding MPDU is actually present.
  6582. * This field is only valid if the RV bit is set.
  6583. * Value:
  6584. * The sequence number for the first MPDUs to check to release.
  6585. * The sequence number is masked by 0x3f.
  6586. * - REL_SEQ_NUM_END
  6587. * Bits 23:18
  6588. * Purpose: Indicate the end of a series of MPDUs to release.
  6589. * Value:
  6590. * The sequence number one larger than the sequence number of the
  6591. * last MPDU to check to release.
  6592. * The sequence number is masked by 0x3f.
  6593. * All MPDUs within this series are present and valid - the host
  6594. * need not check each sequence number within this range to see if
  6595. * the corresponding MPDU is actually present.
  6596. * This field is only valid if the RV bit is set.
  6597. * - NUM_MPDU_RANGES
  6598. * Bits 31:24
  6599. * Purpose: Indicate how many ranges of MPDUs are present.
  6600. * Each MPDU range consists of a series of contiguous MPDUs within the
  6601. * rx frame sequence which all have the same MPDU status.
  6602. * Value: 1-63 (typically a small number, like 1-3)
  6603. *
  6604. * Rx PPDU descriptor fields:
  6605. * - RSSI_CMB
  6606. * Bits 7:0
  6607. * Purpose: Combined RSSI from all active rx chains, across the active
  6608. * bandwidth.
  6609. * Value: RSSI dB units w.r.t. noise floor
  6610. * - TIMESTAMP_SUBMICROSEC
  6611. * Bits 15:8
  6612. * Purpose: high-resolution timestamp
  6613. * Value:
  6614. * Sub-microsecond time of PPDU reception.
  6615. * This timestamp ranges from [0,MAC clock MHz).
  6616. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6617. * to form a high-resolution, large range rx timestamp.
  6618. * - PHY_ERR_CODE
  6619. * Bits 23:16
  6620. * Purpose:
  6621. * If the rx frame processing resulted in a PHY error, indicate what
  6622. * type of rx PHY error occurred.
  6623. * Value:
  6624. * This field is valid if the "P" (PHY_ERR) flag is set.
  6625. * TBD: document/specify the values for this field
  6626. * - PHY_ERR
  6627. * Bit 24
  6628. * Purpose: indicate whether the rx PPDU had a PHY error
  6629. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6630. * - LEGACY_RATE
  6631. * Bits 28:25
  6632. * Purpose:
  6633. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6634. * specify which rate was used.
  6635. * Value:
  6636. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6637. * flag.
  6638. * If LEGACY_RATE_SEL is 0:
  6639. * 0x8: OFDM 48 Mbps
  6640. * 0x9: OFDM 24 Mbps
  6641. * 0xA: OFDM 12 Mbps
  6642. * 0xB: OFDM 6 Mbps
  6643. * 0xC: OFDM 54 Mbps
  6644. * 0xD: OFDM 36 Mbps
  6645. * 0xE: OFDM 18 Mbps
  6646. * 0xF: OFDM 9 Mbps
  6647. * If LEGACY_RATE_SEL is 1:
  6648. * 0x8: CCK 11 Mbps long preamble
  6649. * 0x9: CCK 5.5 Mbps long preamble
  6650. * 0xA: CCK 2 Mbps long preamble
  6651. * 0xB: CCK 1 Mbps long preamble
  6652. * 0xC: CCK 11 Mbps short preamble
  6653. * 0xD: CCK 5.5 Mbps short preamble
  6654. * 0xE: CCK 2 Mbps short preamble
  6655. * - LEGACY_RATE_SEL
  6656. * Bit 29
  6657. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6658. * Value:
  6659. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6660. * used a legacy rate.
  6661. * 0 -> OFDM, 1 -> CCK
  6662. * - END_VALID
  6663. * Bit 30
  6664. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6665. * the start of the PPDU are valid. Specifically, the following
  6666. * fields are only valid if END_VALID is set:
  6667. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6668. * TIMESTAMP_SUBMICROSEC
  6669. * Value:
  6670. * 0 -> rx PPDU desc end fields are not valid
  6671. * 1 -> rx PPDU desc end fields are valid
  6672. * - START_VALID
  6673. * Bit 31
  6674. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6675. * the end of the PPDU are valid. Specifically, the following
  6676. * fields are only valid if START_VALID is set:
  6677. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6678. * VHT-SIG-A
  6679. * Value:
  6680. * 0 -> rx PPDU desc start fields are not valid
  6681. * 1 -> rx PPDU desc start fields are valid
  6682. * - RSSI0_PRI20
  6683. * Bits 7:0
  6684. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6685. * Value: RSSI dB units w.r.t. noise floor
  6686. *
  6687. * - RSSI0_EXT20
  6688. * Bits 7:0
  6689. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6690. * (if the rx bandwidth was >= 40 MHz)
  6691. * Value: RSSI dB units w.r.t. noise floor
  6692. * - RSSI0_EXT40
  6693. * Bits 7:0
  6694. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6695. * (if the rx bandwidth was >= 80 MHz)
  6696. * Value: RSSI dB units w.r.t. noise floor
  6697. * - RSSI0_EXT80
  6698. * Bits 7:0
  6699. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6700. * (if the rx bandwidth was >= 160 MHz)
  6701. * Value: RSSI dB units w.r.t. noise floor
  6702. *
  6703. * - RSSI1_PRI20
  6704. * Bits 7:0
  6705. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6706. * Value: RSSI dB units w.r.t. noise floor
  6707. * - RSSI1_EXT20
  6708. * Bits 7:0
  6709. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6710. * (if the rx bandwidth was >= 40 MHz)
  6711. * Value: RSSI dB units w.r.t. noise floor
  6712. * - RSSI1_EXT40
  6713. * Bits 7:0
  6714. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6715. * (if the rx bandwidth was >= 80 MHz)
  6716. * Value: RSSI dB units w.r.t. noise floor
  6717. * - RSSI1_EXT80
  6718. * Bits 7:0
  6719. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6720. * (if the rx bandwidth was >= 160 MHz)
  6721. * Value: RSSI dB units w.r.t. noise floor
  6722. *
  6723. * - RSSI2_PRI20
  6724. * Bits 7:0
  6725. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6726. * Value: RSSI dB units w.r.t. noise floor
  6727. * - RSSI2_EXT20
  6728. * Bits 7:0
  6729. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6730. * (if the rx bandwidth was >= 40 MHz)
  6731. * Value: RSSI dB units w.r.t. noise floor
  6732. * - RSSI2_EXT40
  6733. * Bits 7:0
  6734. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6735. * (if the rx bandwidth was >= 80 MHz)
  6736. * Value: RSSI dB units w.r.t. noise floor
  6737. * - RSSI2_EXT80
  6738. * Bits 7:0
  6739. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6740. * (if the rx bandwidth was >= 160 MHz)
  6741. * Value: RSSI dB units w.r.t. noise floor
  6742. *
  6743. * - RSSI3_PRI20
  6744. * Bits 7:0
  6745. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6746. * Value: RSSI dB units w.r.t. noise floor
  6747. * - RSSI3_EXT20
  6748. * Bits 7:0
  6749. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6750. * (if the rx bandwidth was >= 40 MHz)
  6751. * Value: RSSI dB units w.r.t. noise floor
  6752. * - RSSI3_EXT40
  6753. * Bits 7:0
  6754. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6755. * (if the rx bandwidth was >= 80 MHz)
  6756. * Value: RSSI dB units w.r.t. noise floor
  6757. * - RSSI3_EXT80
  6758. * Bits 7:0
  6759. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6760. * (if the rx bandwidth was >= 160 MHz)
  6761. * Value: RSSI dB units w.r.t. noise floor
  6762. *
  6763. * - TSF32
  6764. * Bits 31:0
  6765. * Purpose: specify the time the rx PPDU was received, in TSF units
  6766. * Value: 32 LSBs of the TSF
  6767. * - TIMESTAMP_MICROSEC
  6768. * Bits 31:0
  6769. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6770. * Value: PPDU rx time, in microseconds
  6771. * - VHT_SIG_A1
  6772. * Bits 23:0
  6773. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6774. * from the rx PPDU
  6775. * Value:
  6776. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6777. * VHT-SIG-A1 data.
  6778. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6779. * first 24 bits of the HT-SIG data.
  6780. * Otherwise, this field is invalid.
  6781. * Refer to the the 802.11 protocol for the definition of the
  6782. * HT-SIG and VHT-SIG-A1 fields
  6783. * - VHT_SIG_A2
  6784. * Bits 23:0
  6785. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6786. * from the rx PPDU
  6787. * Value:
  6788. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6789. * VHT-SIG-A2 data.
  6790. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6791. * last 24 bits of the HT-SIG data.
  6792. * Otherwise, this field is invalid.
  6793. * Refer to the the 802.11 protocol for the definition of the
  6794. * HT-SIG and VHT-SIG-A2 fields
  6795. * - PREAMBLE_TYPE
  6796. * Bits 31:24
  6797. * Purpose: indicate the PHY format of the received burst
  6798. * Value:
  6799. * 0x4: Legacy (OFDM/CCK)
  6800. * 0x8: HT
  6801. * 0x9: HT with TxBF
  6802. * 0xC: VHT
  6803. * 0xD: VHT with TxBF
  6804. * - SERVICE
  6805. * Bits 31:24
  6806. * Purpose: TBD
  6807. * Value: TBD
  6808. *
  6809. * Rx MSDU descriptor fields:
  6810. * - FW_RX_DESC_BYTES
  6811. * Bits 15:0
  6812. * Purpose: Indicate how many bytes in the Rx indication are used for
  6813. * FW Rx descriptors
  6814. *
  6815. * Payload fields:
  6816. * - MPDU_COUNT
  6817. * Bits 7:0
  6818. * Purpose: Indicate how many sequential MPDUs share the same status.
  6819. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6820. * - MPDU_STATUS
  6821. * Bits 15:8
  6822. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6823. * received successfully.
  6824. * Value:
  6825. * 0x1: success
  6826. * 0x2: FCS error
  6827. * 0x3: duplicate error
  6828. * 0x4: replay error
  6829. * 0x5: invalid peer
  6830. */
  6831. /* header fields */
  6832. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6833. #define HTT_RX_IND_EXT_TID_S 8
  6834. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6835. #define HTT_RX_IND_FLUSH_VALID_S 13
  6836. #define HTT_RX_IND_REL_VALID_M 0x4000
  6837. #define HTT_RX_IND_REL_VALID_S 14
  6838. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6839. #define HTT_RX_IND_PEER_ID_S 16
  6840. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6841. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6842. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6843. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6844. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6845. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6846. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6847. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6848. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6849. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6850. /* rx PPDU descriptor fields */
  6851. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6852. #define HTT_RX_IND_RSSI_CMB_S 0
  6853. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6854. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6855. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6856. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6857. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6858. #define HTT_RX_IND_PHY_ERR_S 24
  6859. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6860. #define HTT_RX_IND_LEGACY_RATE_S 25
  6861. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6862. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6863. #define HTT_RX_IND_END_VALID_M 0x40000000
  6864. #define HTT_RX_IND_END_VALID_S 30
  6865. #define HTT_RX_IND_START_VALID_M 0x80000000
  6866. #define HTT_RX_IND_START_VALID_S 31
  6867. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6868. #define HTT_RX_IND_RSSI_PRI20_S 0
  6869. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6870. #define HTT_RX_IND_RSSI_EXT20_S 8
  6871. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6872. #define HTT_RX_IND_RSSI_EXT40_S 16
  6873. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6874. #define HTT_RX_IND_RSSI_EXT80_S 24
  6875. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6876. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6877. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6878. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6879. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6880. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6881. #define HTT_RX_IND_SERVICE_M 0xff000000
  6882. #define HTT_RX_IND_SERVICE_S 24
  6883. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6884. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6885. /* rx MSDU descriptor fields */
  6886. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6887. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6888. /* payload fields */
  6889. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6890. #define HTT_RX_IND_MPDU_COUNT_S 0
  6891. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6892. #define HTT_RX_IND_MPDU_STATUS_S 8
  6893. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6894. do { \
  6895. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6896. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6897. } while (0)
  6898. #define HTT_RX_IND_EXT_TID_GET(word) \
  6899. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6900. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6901. do { \
  6902. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6903. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6904. } while (0)
  6905. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6906. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6907. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6908. do { \
  6909. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6910. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6911. } while (0)
  6912. #define HTT_RX_IND_REL_VALID_GET(word) \
  6913. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6914. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6915. do { \
  6916. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6917. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6918. } while (0)
  6919. #define HTT_RX_IND_PEER_ID_GET(word) \
  6920. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6921. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6922. do { \
  6923. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6924. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6925. } while (0)
  6926. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6927. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6928. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6929. do { \
  6930. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6931. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6932. } while (0)
  6933. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6934. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6935. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6936. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6937. do { \
  6938. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6939. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6940. } while (0)
  6941. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6942. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6943. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6944. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6945. do { \
  6946. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6947. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6948. } while (0)
  6949. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6950. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6951. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6952. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6953. do { \
  6954. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6955. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6956. } while (0)
  6957. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6958. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6959. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6960. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6961. do { \
  6962. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6963. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6964. } while (0)
  6965. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6966. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6967. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6968. /* FW rx PPDU descriptor fields */
  6969. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6970. do { \
  6971. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6972. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6973. } while (0)
  6974. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6975. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6976. HTT_RX_IND_RSSI_CMB_S)
  6977. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6978. do { \
  6979. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6980. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6981. } while (0)
  6982. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6983. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6984. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6985. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6986. do { \
  6987. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6988. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6989. } while (0)
  6990. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6991. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6992. HTT_RX_IND_PHY_ERR_CODE_S)
  6993. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6994. do { \
  6995. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6996. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6997. } while (0)
  6998. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6999. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7000. HTT_RX_IND_PHY_ERR_S)
  7001. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7002. do { \
  7003. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7004. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7005. } while (0)
  7006. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7007. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7008. HTT_RX_IND_LEGACY_RATE_S)
  7009. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7010. do { \
  7011. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7012. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7013. } while (0)
  7014. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7015. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7016. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7017. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7018. do { \
  7019. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7020. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7021. } while (0)
  7022. #define HTT_RX_IND_END_VALID_GET(word) \
  7023. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7024. HTT_RX_IND_END_VALID_S)
  7025. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7026. do { \
  7027. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7028. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7029. } while (0)
  7030. #define HTT_RX_IND_START_VALID_GET(word) \
  7031. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7032. HTT_RX_IND_START_VALID_S)
  7033. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7036. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7037. } while (0)
  7038. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7039. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7040. HTT_RX_IND_RSSI_PRI20_S)
  7041. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7042. do { \
  7043. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7044. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7045. } while (0)
  7046. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7047. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7048. HTT_RX_IND_RSSI_EXT20_S)
  7049. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7050. do { \
  7051. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7052. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7053. } while (0)
  7054. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7055. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7056. HTT_RX_IND_RSSI_EXT40_S)
  7057. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7058. do { \
  7059. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7060. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7061. } while (0)
  7062. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7063. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7064. HTT_RX_IND_RSSI_EXT80_S)
  7065. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7066. do { \
  7067. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7068. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7069. } while (0)
  7070. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7071. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7072. HTT_RX_IND_VHT_SIG_A1_S)
  7073. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7074. do { \
  7075. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7076. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7077. } while (0)
  7078. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7079. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7080. HTT_RX_IND_VHT_SIG_A2_S)
  7081. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7082. do { \
  7083. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7084. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7085. } while (0)
  7086. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7087. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7088. HTT_RX_IND_PREAMBLE_TYPE_S)
  7089. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7090. do { \
  7091. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7092. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7093. } while (0)
  7094. #define HTT_RX_IND_SERVICE_GET(word) \
  7095. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7096. HTT_RX_IND_SERVICE_S)
  7097. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7098. do { \
  7099. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7100. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7101. } while (0)
  7102. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7103. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7104. HTT_RX_IND_SA_ANT_MATRIX_S)
  7105. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7106. do { \
  7107. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7108. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7109. } while (0)
  7110. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7111. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7112. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7113. do { \
  7114. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7115. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7116. } while (0)
  7117. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7118. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7119. #define HTT_RX_IND_HL_BYTES \
  7120. (HTT_RX_IND_HDR_BYTES + \
  7121. 4 /* single FW rx MSDU descriptor */ + \
  7122. 4 /* single MPDU range information element */)
  7123. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7124. /* Could we use one macro entry? */
  7125. #define HTT_WORD_SET(word, field, value) \
  7126. do { \
  7127. HTT_CHECK_SET_VAL(field, value); \
  7128. (word) |= ((value) << field ## _S); \
  7129. } while (0)
  7130. #define HTT_WORD_GET(word, field) \
  7131. (((word) & field ## _M) >> field ## _S)
  7132. PREPACK struct hl_htt_rx_ind_base {
  7133. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7134. } POSTPACK;
  7135. /*
  7136. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7137. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7138. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7139. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7140. * htt_rx_ind_hl_rx_desc_t.
  7141. */
  7142. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7143. struct htt_rx_ind_hl_rx_desc_t {
  7144. A_UINT8 ver;
  7145. A_UINT8 len;
  7146. struct {
  7147. A_UINT8
  7148. first_msdu: 1,
  7149. last_msdu: 1,
  7150. c3_failed: 1,
  7151. c4_failed: 1,
  7152. ipv6: 1,
  7153. tcp: 1,
  7154. udp: 1,
  7155. reserved: 1;
  7156. } flags;
  7157. /* NOTE: no reserved space - don't append any new fields here */
  7158. };
  7159. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7160. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7161. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7162. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7163. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7164. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7165. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7166. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7167. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7168. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7169. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7170. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7171. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7172. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7173. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7174. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7175. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7176. /* This structure is used in HL, the basic descriptor information
  7177. * used by host. the structure is translated by FW from HW desc
  7178. * or generated by FW. But in HL monitor mode, the host would use
  7179. * the same structure with LL.
  7180. */
  7181. PREPACK struct hl_htt_rx_desc_base {
  7182. A_UINT32
  7183. seq_num:12,
  7184. encrypted:1,
  7185. chan_info_present:1,
  7186. resv0:2,
  7187. mcast_bcast:1,
  7188. fragment:1,
  7189. key_id_oct:8,
  7190. resv1:6;
  7191. A_UINT32
  7192. pn_31_0;
  7193. union {
  7194. struct {
  7195. A_UINT16 pn_47_32;
  7196. A_UINT16 pn_63_48;
  7197. } pn16;
  7198. A_UINT32 pn_63_32;
  7199. } u0;
  7200. A_UINT32
  7201. pn_95_64;
  7202. A_UINT32
  7203. pn_127_96;
  7204. } POSTPACK;
  7205. /*
  7206. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7207. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7208. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7209. * Please see htt_chan_change_t for description of the fields.
  7210. */
  7211. PREPACK struct htt_chan_info_t
  7212. {
  7213. A_UINT32 primary_chan_center_freq_mhz: 16,
  7214. contig_chan1_center_freq_mhz: 16;
  7215. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7216. phy_mode: 8,
  7217. reserved: 8;
  7218. } POSTPACK;
  7219. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7220. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7221. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7222. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7223. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7224. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7225. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7226. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7227. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7228. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7229. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7230. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7231. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7232. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7233. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7234. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7235. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7236. /* Channel information */
  7237. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7238. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7239. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7240. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7241. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7242. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7243. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7244. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7245. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7246. do { \
  7247. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7248. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7249. } while (0)
  7250. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7251. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7252. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7253. do { \
  7254. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7255. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7256. } while (0)
  7257. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7258. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7259. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7260. do { \
  7261. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7262. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7263. } while (0)
  7264. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7265. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7266. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7267. do { \
  7268. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7269. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7270. } while (0)
  7271. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7272. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7273. /*
  7274. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7275. * @brief target -> host message definition for FW offloaded pkts
  7276. *
  7277. * @details
  7278. * The following field definitions describe the format of the firmware
  7279. * offload deliver message sent from the target to the host.
  7280. *
  7281. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7282. *
  7283. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7284. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7285. * | reserved_1 | msg type |
  7286. * |--------------------------------------------------------------------------|
  7287. * | phy_timestamp_l32 |
  7288. * |--------------------------------------------------------------------------|
  7289. * | WORD2 (see below) |
  7290. * |--------------------------------------------------------------------------|
  7291. * | seqno | framectrl |
  7292. * |--------------------------------------------------------------------------|
  7293. * | reserved_3 | vdev_id | tid_num|
  7294. * |--------------------------------------------------------------------------|
  7295. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7296. * |--------------------------------------------------------------------------|
  7297. *
  7298. * where:
  7299. * STAT = status
  7300. * F = format (802.3 vs. 802.11)
  7301. *
  7302. * definition for word 2
  7303. *
  7304. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7305. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7306. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7307. * |--------------------------------------------------------------------------|
  7308. *
  7309. * where:
  7310. * PR = preamble
  7311. * BF = beamformed
  7312. */
  7313. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7314. {
  7315. A_UINT32 /* word 0 */
  7316. msg_type:8, /* [ 7: 0] */
  7317. reserved_1:24; /* [31: 8] */
  7318. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7319. A_UINT32 /* word 2 */
  7320. /* preamble:
  7321. * 0-OFDM,
  7322. * 1-CCk,
  7323. * 2-HT,
  7324. * 3-VHT
  7325. */
  7326. preamble: 2, /* [1:0] */
  7327. /* mcs:
  7328. * In case of HT preamble interpret
  7329. * MCS along with NSS.
  7330. * Valid values for HT are 0 to 7.
  7331. * HT mcs 0 with NSS 2 is mcs 8.
  7332. * Valid values for VHT are 0 to 9.
  7333. */
  7334. mcs: 4, /* [5:2] */
  7335. /* rate:
  7336. * This is applicable only for
  7337. * CCK and OFDM preamble type
  7338. * rate 0: OFDM 48 Mbps,
  7339. * 1: OFDM 24 Mbps,
  7340. * 2: OFDM 12 Mbps
  7341. * 3: OFDM 6 Mbps
  7342. * 4: OFDM 54 Mbps
  7343. * 5: OFDM 36 Mbps
  7344. * 6: OFDM 18 Mbps
  7345. * 7: OFDM 9 Mbps
  7346. * rate 0: CCK 11 Mbps Long
  7347. * 1: CCK 5.5 Mbps Long
  7348. * 2: CCK 2 Mbps Long
  7349. * 3: CCK 1 Mbps Long
  7350. * 4: CCK 11 Mbps Short
  7351. * 5: CCK 5.5 Mbps Short
  7352. * 6: CCK 2 Mbps Short
  7353. */
  7354. rate : 3, /* [ 8: 6] */
  7355. rssi : 8, /* [16: 9] units=dBm */
  7356. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7357. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7358. stbc : 1, /* [22] */
  7359. sgi : 1, /* [23] */
  7360. ldpc : 1, /* [24] */
  7361. beamformed: 1, /* [25] */
  7362. reserved_2: 6; /* [31:26] */
  7363. A_UINT32 /* word 3 */
  7364. framectrl:16, /* [15: 0] */
  7365. seqno:16; /* [31:16] */
  7366. A_UINT32 /* word 4 */
  7367. tid_num:5, /* [ 4: 0] actual TID number */
  7368. vdev_id:8, /* [12: 5] */
  7369. reserved_3:19; /* [31:13] */
  7370. A_UINT32 /* word 5 */
  7371. /* status:
  7372. * 0: tx_ok
  7373. * 1: retry
  7374. * 2: drop
  7375. * 3: filtered
  7376. * 4: abort
  7377. * 5: tid delete
  7378. * 6: sw abort
  7379. * 7: dropped by peer migration
  7380. */
  7381. status:3, /* [2:0] */
  7382. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7383. tx_mpdu_bytes:16, /* [19:4] */
  7384. /* Indicates retry count of offloaded/local generated Data tx frames */
  7385. tx_retry_cnt:6, /* [25:20] */
  7386. reserved_4:6; /* [31:26] */
  7387. } POSTPACK;
  7388. /* FW offload deliver ind message header fields */
  7389. /* DWORD one */
  7390. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7391. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7392. /* DWORD two */
  7393. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7394. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7395. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7396. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7397. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7398. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7399. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7400. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7401. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7402. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7403. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7404. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7405. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7406. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7407. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7408. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7409. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7410. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7411. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7412. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7413. /* DWORD three*/
  7414. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7415. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7416. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7417. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7418. /* DWORD four */
  7419. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7420. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7421. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7422. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7423. /* DWORD five */
  7424. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7425. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7426. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7427. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7428. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7429. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7430. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7431. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7432. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7435. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7436. } while (0)
  7437. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7438. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7439. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7442. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7443. } while (0)
  7444. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7445. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7446. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7449. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7450. } while (0)
  7451. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7452. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7453. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7454. do { \
  7455. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7456. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7457. } while (0)
  7458. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7459. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7460. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7461. do { \
  7462. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7463. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7464. } while (0)
  7465. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7466. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7467. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7468. do { \
  7469. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7470. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7471. } while (0)
  7472. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7473. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7474. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7477. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7478. } while (0)
  7479. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7480. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7481. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7482. do { \
  7483. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7484. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7485. } while (0)
  7486. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7487. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7488. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7489. do { \
  7490. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7491. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7492. } while (0)
  7493. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7494. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7495. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7498. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7499. } while (0)
  7500. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7501. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7502. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7505. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7506. } while (0)
  7507. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7508. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7509. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7510. do { \
  7511. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7512. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7513. } while (0)
  7514. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7515. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7516. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7517. do { \
  7518. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7519. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7520. } while (0)
  7521. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7522. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7523. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7524. do { \
  7525. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7526. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7527. } while (0)
  7528. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7529. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7530. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7531. do { \
  7532. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7533. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7534. } while (0)
  7535. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7536. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7537. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7538. do { \
  7539. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7540. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7541. } while (0)
  7542. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7543. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7544. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7545. do { \
  7546. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7547. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7548. } while (0)
  7549. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7550. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7551. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7552. do { \
  7553. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7554. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7555. } while (0)
  7556. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7557. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7558. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7559. do { \
  7560. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7561. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7562. } while (0)
  7563. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7564. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7565. /*
  7566. * @brief target -> host rx reorder flush message definition
  7567. *
  7568. * @details
  7569. * The following field definitions describe the format of the rx flush
  7570. * message sent from the target to the host.
  7571. * The message consists of a 4-octet header, followed by one or more
  7572. * 4-octet payload information elements.
  7573. *
  7574. * |31 24|23 8|7 0|
  7575. * |--------------------------------------------------------------|
  7576. * | TID | peer ID | msg type |
  7577. * |--------------------------------------------------------------|
  7578. * | seq num end | seq num start | MPDU status | reserved |
  7579. * |--------------------------------------------------------------|
  7580. * First DWORD:
  7581. * - MSG_TYPE
  7582. * Bits 7:0
  7583. * Purpose: identifies this as an rx flush message
  7584. * Value: 0x2
  7585. * - PEER_ID
  7586. * Bits 23:8 (only bits 18:8 actually used)
  7587. * Purpose: identify which peer's rx data is being flushed
  7588. * Value: (rx) peer ID
  7589. * - TID
  7590. * Bits 31:24 (only bits 27:24 actually used)
  7591. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7592. * Value: traffic identifier
  7593. * Second DWORD:
  7594. * - MPDU_STATUS
  7595. * Bits 15:8
  7596. * Purpose:
  7597. * Indicate whether the flushed MPDUs should be discarded or processed.
  7598. * Value:
  7599. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7600. * stages of rx processing
  7601. * other: discard the MPDUs
  7602. * It is anticipated that flush messages will always have
  7603. * MPDU status == 1, but the status flag is included for
  7604. * flexibility.
  7605. * - SEQ_NUM_START
  7606. * Bits 23:16
  7607. * Purpose:
  7608. * Indicate the start of a series of consecutive MPDUs being flushed.
  7609. * Not all MPDUs within this range are necessarily valid - the host
  7610. * must check each sequence number within this range to see if the
  7611. * corresponding MPDU is actually present.
  7612. * Value:
  7613. * The sequence number for the first MPDU in the sequence.
  7614. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7615. * - SEQ_NUM_END
  7616. * Bits 30:24
  7617. * Purpose:
  7618. * Indicate the end of a series of consecutive MPDUs being flushed.
  7619. * Value:
  7620. * The sequence number one larger than the sequence number of the
  7621. * last MPDU being flushed.
  7622. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7623. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7624. * are to be released for further rx processing.
  7625. * Not all MPDUs within this range are necessarily valid - the host
  7626. * must check each sequence number within this range to see if the
  7627. * corresponding MPDU is actually present.
  7628. */
  7629. /* first DWORD */
  7630. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7631. #define HTT_RX_FLUSH_PEER_ID_S 8
  7632. #define HTT_RX_FLUSH_TID_M 0xff000000
  7633. #define HTT_RX_FLUSH_TID_S 24
  7634. /* second DWORD */
  7635. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7636. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7637. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7638. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7639. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7640. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7641. #define HTT_RX_FLUSH_BYTES 8
  7642. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7643. do { \
  7644. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7645. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7646. } while (0)
  7647. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7648. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7649. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7650. do { \
  7651. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7652. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7653. } while (0)
  7654. #define HTT_RX_FLUSH_TID_GET(word) \
  7655. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7656. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7657. do { \
  7658. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7659. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7660. } while (0)
  7661. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7662. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7663. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7664. do { \
  7665. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7666. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7667. } while (0)
  7668. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7669. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7670. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7673. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7674. } while (0)
  7675. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7676. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7677. /*
  7678. * @brief target -> host rx pn check indication message
  7679. *
  7680. * @details
  7681. * The following field definitions describe the format of the Rx PN check
  7682. * indication message sent from the target to the host.
  7683. * The message consists of a 4-octet header, followed by the start and
  7684. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7685. * IE is one octet containing the sequence number that failed the PN
  7686. * check.
  7687. *
  7688. * |31 24|23 8|7 0|
  7689. * |--------------------------------------------------------------|
  7690. * | TID | peer ID | msg type |
  7691. * |--------------------------------------------------------------|
  7692. * | Reserved | PN IE count | seq num end | seq num start|
  7693. * |--------------------------------------------------------------|
  7694. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7695. * |--------------------------------------------------------------|
  7696. * First DWORD:
  7697. * - MSG_TYPE
  7698. * Bits 7:0
  7699. * Purpose: Identifies this as an rx pn check indication message
  7700. * Value: 0x2
  7701. * - PEER_ID
  7702. * Bits 23:8 (only bits 18:8 actually used)
  7703. * Purpose: identify which peer
  7704. * Value: (rx) peer ID
  7705. * - TID
  7706. * Bits 31:24 (only bits 27:24 actually used)
  7707. * Purpose: identify traffic identifier
  7708. * Value: traffic identifier
  7709. * Second DWORD:
  7710. * - SEQ_NUM_START
  7711. * Bits 7:0
  7712. * Purpose:
  7713. * Indicates the starting sequence number of the MPDU in this
  7714. * series of MPDUs that went though PN check.
  7715. * Value:
  7716. * The sequence number for the first MPDU in the sequence.
  7717. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7718. * - SEQ_NUM_END
  7719. * Bits 15:8
  7720. * Purpose:
  7721. * Indicates the ending sequence number of the MPDU in this
  7722. * series of MPDUs that went though PN check.
  7723. * Value:
  7724. * The sequence number one larger then the sequence number of the last
  7725. * MPDU being flushed.
  7726. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7727. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7728. * for invalid PN numbers and are ready to be released for further processing.
  7729. * Not all MPDUs within this range are necessarily valid - the host
  7730. * must check each sequence number within this range to see if the
  7731. * corresponding MPDU is actually present.
  7732. * - PN_IE_COUNT
  7733. * Bits 23:16
  7734. * Purpose:
  7735. * Used to determine the variable number of PN information elements in this
  7736. * message
  7737. *
  7738. * PN information elements:
  7739. * - PN_IE_x-
  7740. * Purpose:
  7741. * Each PN information element contains the sequence number of the MPDU that
  7742. * has failed the target PN check.
  7743. * Value:
  7744. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7745. * that failed the PN check.
  7746. */
  7747. /* first DWORD */
  7748. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7749. #define HTT_RX_PN_IND_PEER_ID_S 8
  7750. #define HTT_RX_PN_IND_TID_M 0xff000000
  7751. #define HTT_RX_PN_IND_TID_S 24
  7752. /* second DWORD */
  7753. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7754. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7755. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7756. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7757. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7758. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7759. #define HTT_RX_PN_IND_BYTES 8
  7760. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7761. do { \
  7762. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7763. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7764. } while (0)
  7765. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7766. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7767. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7770. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7771. } while (0)
  7772. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7773. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7774. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7775. do { \
  7776. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7777. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7778. } while (0)
  7779. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7780. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7781. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7782. do { \
  7783. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7784. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7785. } while (0)
  7786. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7787. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7788. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7791. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7792. } while (0)
  7793. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7794. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7795. /*
  7796. * @brief target -> host rx offload deliver message for LL system
  7797. *
  7798. * @details
  7799. * In a low latency system this message is sent whenever the offload
  7800. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7801. * The DMA of the actual packets into host memory is done before sending out
  7802. * this message. This message indicates only how many MSDUs to reap. The
  7803. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7804. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7805. * DMA'd by the MAC directly into host memory these packets do not contain
  7806. * the MAC descriptors in the header portion of the packet. Instead they contain
  7807. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7808. * message, the packets are delivered directly to the NW stack without going
  7809. * through the regular reorder buffering and PN checking path since it has
  7810. * already been done in target.
  7811. *
  7812. * |31 24|23 16|15 8|7 0|
  7813. * |-----------------------------------------------------------------------|
  7814. * | Total MSDU count | reserved | msg type |
  7815. * |-----------------------------------------------------------------------|
  7816. *
  7817. * @brief target -> host rx offload deliver message for HL system
  7818. *
  7819. * @details
  7820. * In a high latency system this message is sent whenever the offload manager
  7821. * flushes out the packets it has coalesced in its coalescing buffer. The
  7822. * actual packets are also carried along with this message. When the host
  7823. * receives this message, it is expected to deliver these packets to the NW
  7824. * stack directly instead of routing them through the reorder buffering and
  7825. * PN checking path since it has already been done in target.
  7826. *
  7827. * |31 24|23 16|15 8|7 0|
  7828. * |-----------------------------------------------------------------------|
  7829. * | Total MSDU count | reserved | msg type |
  7830. * |-----------------------------------------------------------------------|
  7831. * | peer ID | MSDU length |
  7832. * |-----------------------------------------------------------------------|
  7833. * | MSDU payload | FW Desc | tid | vdev ID |
  7834. * |-----------------------------------------------------------------------|
  7835. * | MSDU payload contd. |
  7836. * |-----------------------------------------------------------------------|
  7837. * | peer ID | MSDU length |
  7838. * |-----------------------------------------------------------------------|
  7839. * | MSDU payload | FW Desc | tid | vdev ID |
  7840. * |-----------------------------------------------------------------------|
  7841. * | MSDU payload contd. |
  7842. * |-----------------------------------------------------------------------|
  7843. *
  7844. */
  7845. /* first DWORD */
  7846. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7847. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7848. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7849. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7850. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7851. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7852. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7853. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7854. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7855. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7856. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7857. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7858. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7859. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7860. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7861. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7862. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7863. do { \
  7864. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7865. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7866. } while (0)
  7867. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7868. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7869. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7870. do { \
  7871. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7872. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7873. } while (0)
  7874. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7875. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7876. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7877. do { \
  7878. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7879. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7880. } while (0)
  7881. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7882. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7883. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7886. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7887. } while (0)
  7888. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7889. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7893. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7894. } while (0)
  7895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7896. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7897. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7900. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7901. } while (0)
  7902. /**
  7903. * @brief target -> host rx peer map/unmap message definition
  7904. *
  7905. * @details
  7906. * The following diagram shows the format of the rx peer map message sent
  7907. * from the target to the host. This layout assumes the target operates
  7908. * as little-endian.
  7909. *
  7910. * This message always contains a SW peer ID. The main purpose of the
  7911. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7912. * with, so that the host can use that peer ID to determine which peer
  7913. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7914. * other purposes, such as identifying during tx completions which peer
  7915. * the tx frames in question were transmitted to.
  7916. *
  7917. * In certain generations of chips, the peer map message also contains
  7918. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7919. * to identify which peer the frame needs to be forwarded to (i.e. the
  7920. * peer assocated with the Destination MAC Address within the packet),
  7921. * and particularly which vdev needs to transmit the frame (for cases
  7922. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  7923. * meaning as AST_INDEX_0.
  7924. * This DA-based peer ID that is provided for certain rx frames
  7925. * (the rx frames that need to be re-transmitted as tx frames)
  7926. * is the ID that the HW uses for referring to the peer in question,
  7927. * rather than the peer ID that the SW+FW use to refer to the peer.
  7928. *
  7929. *
  7930. * |31 24|23 16|15 8|7 0|
  7931. * |-----------------------------------------------------------------------|
  7932. * | SW peer ID | VDEV ID | msg type |
  7933. * |-----------------------------------------------------------------------|
  7934. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7935. * |-----------------------------------------------------------------------|
  7936. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7937. * |-----------------------------------------------------------------------|
  7938. *
  7939. *
  7940. * The following diagram shows the format of the rx peer unmap message sent
  7941. * from the target to the host.
  7942. *
  7943. * |31 24|23 16|15 8|7 0|
  7944. * |-----------------------------------------------------------------------|
  7945. * | SW peer ID | VDEV ID | msg type |
  7946. * |-----------------------------------------------------------------------|
  7947. *
  7948. * The following field definitions describe the format of the rx peer map
  7949. * and peer unmap messages sent from the target to the host.
  7950. * - MSG_TYPE
  7951. * Bits 7:0
  7952. * Purpose: identifies this as an rx peer map or peer unmap message
  7953. * Value: peer map -> 0x3, peer unmap -> 0x4
  7954. * - VDEV_ID
  7955. * Bits 15:8
  7956. * Purpose: Indicates which virtual device the peer is associated
  7957. * with.
  7958. * Value: vdev ID (used in the host to look up the vdev object)
  7959. * - PEER_ID (a.k.a. SW_PEER_ID)
  7960. * Bits 31:16
  7961. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7962. * freeing (unmap)
  7963. * Value: (rx) peer ID
  7964. * - MAC_ADDR_L32 (peer map only)
  7965. * Bits 31:0
  7966. * Purpose: Identifies which peer node the peer ID is for.
  7967. * Value: lower 4 bytes of peer node's MAC address
  7968. * - MAC_ADDR_U16 (peer map only)
  7969. * Bits 15:0
  7970. * Purpose: Identifies which peer node the peer ID is for.
  7971. * Value: upper 2 bytes of peer node's MAC address
  7972. * - HW_PEER_ID
  7973. * Bits 31:16
  7974. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7975. * address, so for rx frames marked for rx --> tx forwarding, the
  7976. * host can determine from the HW peer ID provided as meta-data with
  7977. * the rx frame which peer the frame is supposed to be forwarded to.
  7978. * Value: ID used by the MAC HW to identify the peer
  7979. */
  7980. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7981. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7982. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7983. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7984. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7985. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7986. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7987. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7988. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7989. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7990. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7991. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7992. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7993. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7994. do { \
  7995. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7996. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7997. } while (0)
  7998. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7999. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8000. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8001. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8002. do { \
  8003. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8004. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8005. } while (0)
  8006. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8007. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8008. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8009. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8010. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8011. do { \
  8012. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8013. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8014. } while (0)
  8015. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8016. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8017. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8018. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8019. #define HTT_RX_PEER_MAP_BYTES 12
  8020. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8021. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8022. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8023. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8024. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8025. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8026. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8027. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8028. #define HTT_RX_PEER_UNMAP_BYTES 4
  8029. /**
  8030. * @brief target -> host rx peer map V2 message definition
  8031. *
  8032. * @details
  8033. * The following diagram shows the format of the rx peer map v2 message sent
  8034. * from the target to the host. This layout assumes the target operates
  8035. * as little-endian.
  8036. *
  8037. * This message always contains a SW peer ID. The main purpose of the
  8038. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8039. * with, so that the host can use that peer ID to determine which peer
  8040. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8041. * other purposes, such as identifying during tx completions which peer
  8042. * the tx frames in question were transmitted to.
  8043. *
  8044. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8045. * is used during rx --> tx frame forwarding to identify which peer the
  8046. * frame needs to be forwarded to (i.e. the peer assocated with the
  8047. * Destination MAC Address within the packet), and particularly which vdev
  8048. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8049. * This DA-based peer ID that is provided for certain rx frames
  8050. * (the rx frames that need to be re-transmitted as tx frames)
  8051. * is the ID that the HW uses for referring to the peer in question,
  8052. * rather than the peer ID that the SW+FW use to refer to the peer.
  8053. *
  8054. * The HW peer id here is the same meaning as AST_INDEX_0.
  8055. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8056. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8057. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8058. * AST is valid.
  8059. *
  8060. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8061. * |-----------------------------------------------------------------------|
  8062. * | SW peer ID | VDEV ID | msg type |
  8063. * |-----------------------------------------------------------------------|
  8064. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8065. * |-----------------------------------------------------------------------|
  8066. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8067. * |-----------------------------------------------------------------------|
  8068. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8069. * |-----------------------------------------------------------------------|
  8070. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8071. * |-----------------------------------------------------------------------|
  8072. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8073. * |-----------------------------------------------------------------------|
  8074. * | Reserved_1 | AST index 3 |
  8075. * |-----------------------------------------------------------------------|
  8076. * | Reserved_2 |
  8077. * |-----------------------------------------------------------------------|
  8078. * Where:
  8079. * NH = Next Hop
  8080. * ASTVM = AST valid mask
  8081. * ASTFM = AST flow mask
  8082. *
  8083. * The following field definitions describe the format of the rx peer map v2
  8084. * messages sent from the target to the host.
  8085. * - MSG_TYPE
  8086. * Bits 7:0
  8087. * Purpose: identifies this as an rx peer map v2 message
  8088. * Value: peer map v2 -> 0x1e
  8089. * - VDEV_ID
  8090. * Bits 15:8
  8091. * Purpose: Indicates which virtual device the peer is associated with.
  8092. * Value: vdev ID (used in the host to look up the vdev object)
  8093. * - SW_PEER_ID
  8094. * Bits 31:16
  8095. * Purpose: The peer ID (index) that WAL is allocating
  8096. * Value: (rx) peer ID
  8097. * - MAC_ADDR_L32
  8098. * Bits 31:0
  8099. * Purpose: Identifies which peer node the peer ID is for.
  8100. * Value: lower 4 bytes of peer node's MAC address
  8101. * - MAC_ADDR_U16
  8102. * Bits 15:0
  8103. * Purpose: Identifies which peer node the peer ID is for.
  8104. * Value: upper 2 bytes of peer node's MAC address
  8105. * - HW_PEER_ID / AST_INDEX_0
  8106. * Bits 31:16
  8107. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8108. * address, so for rx frames marked for rx --> tx forwarding, the
  8109. * host can determine from the HW peer ID provided as meta-data with
  8110. * the rx frame which peer the frame is supposed to be forwarded to.
  8111. * Value: ID used by the MAC HW to identify the peer
  8112. * - AST_HASH_VALUE
  8113. * Bits 15:0
  8114. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8115. * override feature.
  8116. * - NEXT_HOP
  8117. * Bit 16
  8118. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8119. * (Wireless Distribution System).
  8120. * - AST_VALID_MASK
  8121. * Bits 19:17
  8122. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8123. * - AST_INDEX_1
  8124. * Bits 15:0
  8125. * Purpose: indicate the second AST index for this peer
  8126. * - AST_0_FLOW_MASK
  8127. * Bits 19:16
  8128. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8129. * - AST_1_FLOW_MASK
  8130. * Bits 23:20
  8131. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8132. * - AST_2_FLOW_MASK
  8133. * Bits 27:24
  8134. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8135. * - AST_3_FLOW_MASK
  8136. * Bits 31:28
  8137. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8138. * - AST_INDEX_2
  8139. * Bits 15:0
  8140. * Purpose: indicate the third AST index for this peer
  8141. * - TID_VALID_HI_PRI
  8142. * Bits 23:16
  8143. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8144. * - TID_VALID_LOW_PRI
  8145. * Bits 31:24
  8146. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8147. * - AST_INDEX_3
  8148. * Bits 15:0
  8149. * Purpose: indicate the fourth AST index for this peer
  8150. */
  8151. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8152. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8153. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8154. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8155. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8156. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8157. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8158. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8159. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8160. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8161. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8162. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8163. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8164. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8165. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8166. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8167. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8168. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8169. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8170. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8171. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8172. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8173. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8174. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8175. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8176. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8177. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8178. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8179. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8180. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8181. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8182. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8183. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8184. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8185. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8186. do { \
  8187. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8188. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8189. } while (0)
  8190. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8191. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8192. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8193. do { \
  8194. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8195. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8196. } while (0)
  8197. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8198. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8199. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8200. do { \
  8201. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8202. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8203. } while (0)
  8204. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8205. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8206. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8207. do { \
  8208. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8209. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8210. } while (0)
  8211. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8212. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8213. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8214. do { \
  8215. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8216. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8217. } while (0)
  8218. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8219. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8220. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8223. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8224. } while (0)
  8225. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8226. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8227. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8230. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8231. } while (0)
  8232. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8233. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8234. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8237. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8238. } while (0)
  8239. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8240. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8241. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8244. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8245. } while (0)
  8246. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8247. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8248. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8251. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8252. } while (0)
  8253. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8254. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8255. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8258. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8259. } while (0)
  8260. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8261. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8262. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8263. do { \
  8264. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8265. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8266. } while (0)
  8267. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8268. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8269. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8272. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8273. } while (0)
  8274. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8275. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8276. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8279. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8280. } while (0)
  8281. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8282. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8283. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8284. do { \
  8285. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8286. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8287. } while (0)
  8288. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8289. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8290. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8291. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8292. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8293. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8294. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8295. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8296. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8297. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8298. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8299. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8300. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8301. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8302. /**
  8303. * @brief target -> host rx peer unmap V2 message definition
  8304. *
  8305. *
  8306. * The following diagram shows the format of the rx peer unmap message sent
  8307. * from the target to the host.
  8308. *
  8309. * |31 24|23 16|15 8|7 0|
  8310. * |-----------------------------------------------------------------------|
  8311. * | SW peer ID | VDEV ID | msg type |
  8312. * |-----------------------------------------------------------------------|
  8313. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8314. * |-----------------------------------------------------------------------|
  8315. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8316. * |-----------------------------------------------------------------------|
  8317. * | Peer Delete Duration |
  8318. * |-----------------------------------------------------------------------|
  8319. * | Reserved_0 |
  8320. * |-----------------------------------------------------------------------|
  8321. * | Reserved_1 |
  8322. * |-----------------------------------------------------------------------|
  8323. * | Reserved_2 |
  8324. * |-----------------------------------------------------------------------|
  8325. *
  8326. *
  8327. * The following field definitions describe the format of the rx peer unmap
  8328. * messages sent from the target to the host.
  8329. * - MSG_TYPE
  8330. * Bits 7:0
  8331. * Purpose: identifies this as an rx peer unmap v2 message
  8332. * Value: peer unmap v2 -> 0x1f
  8333. * - VDEV_ID
  8334. * Bits 15:8
  8335. * Purpose: Indicates which virtual device the peer is associated
  8336. * with.
  8337. * Value: vdev ID (used in the host to look up the vdev object)
  8338. * - SW_PEER_ID
  8339. * Bits 31:16
  8340. * Purpose: The peer ID (index) that WAL is freeing
  8341. * Value: (rx) peer ID
  8342. * - MAC_ADDR_L32
  8343. * Bits 31:0
  8344. * Purpose: Identifies which peer node the peer ID is for.
  8345. * Value: lower 4 bytes of peer node's MAC address
  8346. * - MAC_ADDR_U16
  8347. * Bits 15:0
  8348. * Purpose: Identifies which peer node the peer ID is for.
  8349. * Value: upper 2 bytes of peer node's MAC address
  8350. * - NEXT_HOP
  8351. * Bits 16
  8352. * Purpose: Bit indicates next_hop AST entry used for WDS
  8353. * (Wireless Distribution System).
  8354. * - PEER_DELETE_DURATION
  8355. * Bits 31:0
  8356. * Purpose: Time taken to delete peer, in msec,
  8357. * Used for monitoring / debugging PEER delete response delay
  8358. */
  8359. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8360. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8361. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8362. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8363. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8364. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8365. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8366. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8367. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8368. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8369. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8370. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8371. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8372. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8373. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8374. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8375. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8376. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8377. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8378. do { \
  8379. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8380. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8381. } while (0)
  8382. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8383. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8384. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8385. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8386. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8387. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8388. /**
  8389. * @brief target -> host message specifying security parameters
  8390. *
  8391. * @details
  8392. * The following diagram shows the format of the security specification
  8393. * message sent from the target to the host.
  8394. * This security specification message tells the host whether a PN check is
  8395. * necessary on rx data frames, and if so, how large the PN counter is.
  8396. * This message also tells the host about the security processing to apply
  8397. * to defragmented rx frames - specifically, whether a Message Integrity
  8398. * Check is required, and the Michael key to use.
  8399. *
  8400. * |31 24|23 16|15|14 8|7 0|
  8401. * |-----------------------------------------------------------------------|
  8402. * | peer ID | U| security type | msg type |
  8403. * |-----------------------------------------------------------------------|
  8404. * | Michael Key K0 |
  8405. * |-----------------------------------------------------------------------|
  8406. * | Michael Key K1 |
  8407. * |-----------------------------------------------------------------------|
  8408. * | WAPI RSC Low0 |
  8409. * |-----------------------------------------------------------------------|
  8410. * | WAPI RSC Low1 |
  8411. * |-----------------------------------------------------------------------|
  8412. * | WAPI RSC Hi0 |
  8413. * |-----------------------------------------------------------------------|
  8414. * | WAPI RSC Hi1 |
  8415. * |-----------------------------------------------------------------------|
  8416. *
  8417. * The following field definitions describe the format of the security
  8418. * indication message sent from the target to the host.
  8419. * - MSG_TYPE
  8420. * Bits 7:0
  8421. * Purpose: identifies this as a security specification message
  8422. * Value: 0xb
  8423. * - SEC_TYPE
  8424. * Bits 14:8
  8425. * Purpose: specifies which type of security applies to the peer
  8426. * Value: htt_sec_type enum value
  8427. * - UNICAST
  8428. * Bit 15
  8429. * Purpose: whether this security is applied to unicast or multicast data
  8430. * Value: 1 -> unicast, 0 -> multicast
  8431. * - PEER_ID
  8432. * Bits 31:16
  8433. * Purpose: The ID number for the peer the security specification is for
  8434. * Value: peer ID
  8435. * - MICHAEL_KEY_K0
  8436. * Bits 31:0
  8437. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8438. * Value: Michael Key K0 (if security type is TKIP)
  8439. * - MICHAEL_KEY_K1
  8440. * Bits 31:0
  8441. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8442. * Value: Michael Key K1 (if security type is TKIP)
  8443. * - WAPI_RSC_LOW0
  8444. * Bits 31:0
  8445. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8446. * Value: WAPI RSC Low0 (if security type is WAPI)
  8447. * - WAPI_RSC_LOW1
  8448. * Bits 31:0
  8449. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8450. * Value: WAPI RSC Low1 (if security type is WAPI)
  8451. * - WAPI_RSC_HI0
  8452. * Bits 31:0
  8453. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8454. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8455. * - WAPI_RSC_HI1
  8456. * Bits 31:0
  8457. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8458. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8459. */
  8460. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8461. #define HTT_SEC_IND_SEC_TYPE_S 8
  8462. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8463. #define HTT_SEC_IND_UNICAST_S 15
  8464. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8465. #define HTT_SEC_IND_PEER_ID_S 16
  8466. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8467. do { \
  8468. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8469. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8470. } while (0)
  8471. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8472. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8473. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8474. do { \
  8475. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8476. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8477. } while (0)
  8478. #define HTT_SEC_IND_UNICAST_GET(word) \
  8479. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8480. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8481. do { \
  8482. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8483. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8484. } while (0)
  8485. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8486. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8487. #define HTT_SEC_IND_BYTES 28
  8488. /**
  8489. * @brief target -> host rx ADDBA / DELBA message definitions
  8490. *
  8491. * @details
  8492. * The following diagram shows the format of the rx ADDBA message sent
  8493. * from the target to the host:
  8494. *
  8495. * |31 20|19 16|15 8|7 0|
  8496. * |---------------------------------------------------------------------|
  8497. * | peer ID | TID | window size | msg type |
  8498. * |---------------------------------------------------------------------|
  8499. *
  8500. * The following diagram shows the format of the rx DELBA message sent
  8501. * from the target to the host:
  8502. *
  8503. * |31 20|19 16|15 10|9 8|7 0|
  8504. * |---------------------------------------------------------------------|
  8505. * | peer ID | TID | reserved | IR| msg type |
  8506. * |---------------------------------------------------------------------|
  8507. *
  8508. * The following field definitions describe the format of the rx ADDBA
  8509. * and DELBA messages sent from the target to the host.
  8510. * - MSG_TYPE
  8511. * Bits 7:0
  8512. * Purpose: identifies this as an rx ADDBA or DELBA message
  8513. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8514. * - IR (initiator / recipient)
  8515. * Bits 9:8 (DELBA only)
  8516. * Purpose: specify whether the DELBA handshake was initiated by the
  8517. * local STA/AP, or by the peer STA/AP
  8518. * Value:
  8519. * 0 - unspecified
  8520. * 1 - initiator (a.k.a. originator)
  8521. * 2 - recipient (a.k.a. responder)
  8522. * 3 - unused / reserved
  8523. * - WIN_SIZE
  8524. * Bits 15:8 (ADDBA only)
  8525. * Purpose: Specifies the length of the block ack window (max = 64).
  8526. * Value:
  8527. * block ack window length specified by the received ADDBA
  8528. * management message.
  8529. * - TID
  8530. * Bits 19:16
  8531. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8532. * Value:
  8533. * TID specified by the received ADDBA or DELBA management message.
  8534. * - PEER_ID
  8535. * Bits 31:20
  8536. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8537. * Value:
  8538. * ID (hash value) used by the host for fast, direct lookup of
  8539. * host SW peer info, including rx reorder states.
  8540. */
  8541. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8542. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8543. #define HTT_RX_ADDBA_TID_M 0xf0000
  8544. #define HTT_RX_ADDBA_TID_S 16
  8545. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8546. #define HTT_RX_ADDBA_PEER_ID_S 20
  8547. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8550. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8551. } while (0)
  8552. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8553. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8554. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8555. do { \
  8556. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8557. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8558. } while (0)
  8559. #define HTT_RX_ADDBA_TID_GET(word) \
  8560. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8561. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8562. do { \
  8563. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8564. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8565. } while (0)
  8566. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8567. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8568. #define HTT_RX_ADDBA_BYTES 4
  8569. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8570. #define HTT_RX_DELBA_INITIATOR_S 8
  8571. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8572. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8573. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8574. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8575. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8576. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8577. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8578. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8579. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8580. do { \
  8581. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8582. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8583. } while (0)
  8584. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8585. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8586. #define HTT_RX_DELBA_BYTES 4
  8587. /**
  8588. * @brief tx queue group information element definition
  8589. *
  8590. * @details
  8591. * The following diagram shows the format of the tx queue group
  8592. * information element, which can be included in target --> host
  8593. * messages to specify the number of tx "credits" (tx descriptors
  8594. * for LL, or tx buffers for HL) available to a particular group
  8595. * of host-side tx queues, and which host-side tx queues belong to
  8596. * the group.
  8597. *
  8598. * |31|30 24|23 16|15|14|13 0|
  8599. * |------------------------------------------------------------------------|
  8600. * | X| reserved | tx queue grp ID | A| S| credit count |
  8601. * |------------------------------------------------------------------------|
  8602. * | vdev ID mask | AC mask |
  8603. * |------------------------------------------------------------------------|
  8604. *
  8605. * The following definitions describe the fields within the tx queue group
  8606. * information element:
  8607. * - credit_count
  8608. * Bits 13:1
  8609. * Purpose: specify how many tx credits are available to the tx queue group
  8610. * Value: An absolute or relative, positive or negative credit value
  8611. * The 'A' bit specifies whether the value is absolute or relative.
  8612. * The 'S' bit specifies whether the value is positive or negative.
  8613. * A negative value can only be relative, not absolute.
  8614. * An absolute value replaces any prior credit value the host has for
  8615. * the tx queue group in question.
  8616. * A relative value is added to the prior credit value the host has for
  8617. * the tx queue group in question.
  8618. * - sign
  8619. * Bit 14
  8620. * Purpose: specify whether the credit count is positive or negative
  8621. * Value: 0 -> positive, 1 -> negative
  8622. * - absolute
  8623. * Bit 15
  8624. * Purpose: specify whether the credit count is absolute or relative
  8625. * Value: 0 -> relative, 1 -> absolute
  8626. * - txq_group_id
  8627. * Bits 23:16
  8628. * Purpose: indicate which tx queue group's credit and/or membership are
  8629. * being specified
  8630. * Value: 0 to max_tx_queue_groups-1
  8631. * - reserved
  8632. * Bits 30:16
  8633. * Value: 0x0
  8634. * - eXtension
  8635. * Bit 31
  8636. * Purpose: specify whether another tx queue group info element follows
  8637. * Value: 0 -> no more tx queue group information elements
  8638. * 1 -> another tx queue group information element immediately follows
  8639. * - ac_mask
  8640. * Bits 15:0
  8641. * Purpose: specify which Access Categories belong to the tx queue group
  8642. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8643. * the tx queue group.
  8644. * The AC bit-mask values are obtained by left-shifting by the
  8645. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8646. * - vdev_id_mask
  8647. * Bits 31:16
  8648. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8649. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8650. * belong to the tx queue group.
  8651. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8652. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8653. */
  8654. PREPACK struct htt_txq_group {
  8655. A_UINT32
  8656. credit_count: 14,
  8657. sign: 1,
  8658. absolute: 1,
  8659. tx_queue_group_id: 8,
  8660. reserved0: 7,
  8661. extension: 1;
  8662. A_UINT32
  8663. ac_mask: 16,
  8664. vdev_id_mask: 16;
  8665. } POSTPACK;
  8666. /* first word */
  8667. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8668. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8669. #define HTT_TXQ_GROUP_SIGN_S 14
  8670. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8671. #define HTT_TXQ_GROUP_ABS_S 15
  8672. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8673. #define HTT_TXQ_GROUP_ID_S 16
  8674. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8675. #define HTT_TXQ_GROUP_EXT_S 31
  8676. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8677. /* second word */
  8678. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8679. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8680. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8681. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8682. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8683. do { \
  8684. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8685. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8686. } while (0)
  8687. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8688. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8689. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8690. do { \
  8691. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8692. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8693. } while (0)
  8694. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8695. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8696. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8697. do { \
  8698. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8699. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8700. } while (0)
  8701. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8702. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8703. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8706. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8707. } while (0)
  8708. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8709. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8710. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8713. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8714. } while (0)
  8715. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8716. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8717. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8718. do { \
  8719. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8720. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8721. } while (0)
  8722. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8723. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8724. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8725. do { \
  8726. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8727. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8728. } while (0)
  8729. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8730. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8731. /**
  8732. * @brief target -> host TX completion indication message definition
  8733. *
  8734. * @details
  8735. * The following diagram shows the format of the TX completion indication sent
  8736. * from the target to the host
  8737. *
  8738. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8739. * |-------------------------------------------------------------------|
  8740. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8741. * |-------------------------------------------------------------------|
  8742. * payload:| MSDU1 ID | MSDU0 ID |
  8743. * |-------------------------------------------------------------------|
  8744. * : MSDU3 ID | MSDU2 ID :
  8745. * |-------------------------------------------------------------------|
  8746. * | struct htt_tx_compl_ind_append_retries |
  8747. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8748. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8749. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8750. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8751. * |-------------------------------------------------------------------|
  8752. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8753. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8754. * | MSDU0 tx_tsf64_low |
  8755. * |-------------------------------------------------------------------|
  8756. * | MSDU0 tx_tsf64_high |
  8757. * |-------------------------------------------------------------------|
  8758. * | MSDU1 tx_tsf64_low |
  8759. * |-------------------------------------------------------------------|
  8760. * | MSDU1 tx_tsf64_high |
  8761. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8762. * | phy_timestamp |
  8763. * |-------------------------------------------------------------------|
  8764. * | rate specs (see below) |
  8765. * |-------------------------------------------------------------------|
  8766. * | seqctrl | framectrl |
  8767. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8768. * Where:
  8769. * A0 = append (a.k.a. append0)
  8770. * A1 = append1
  8771. * TP = MSDU tx power presence
  8772. * A2 = append2
  8773. * A3 = append3
  8774. * A4 = append4
  8775. *
  8776. * The following field definitions describe the format of the TX completion
  8777. * indication sent from the target to the host
  8778. * Header fields:
  8779. * - msg_type
  8780. * Bits 7:0
  8781. * Purpose: identifies this as HTT TX completion indication
  8782. * Value: 0x7
  8783. * - status
  8784. * Bits 10:8
  8785. * Purpose: the TX completion status of payload fragmentations descriptors
  8786. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  8787. * - tid
  8788. * Bits 14:11
  8789. * Purpose: the tid associated with those fragmentation descriptors. It is
  8790. * valid or not, depending on the tid_invalid bit.
  8791. * Value: 0 to 15
  8792. * - tid_invalid
  8793. * Bits 15:15
  8794. * Purpose: this bit indicates whether the tid field is valid or not
  8795. * Value: 0 indicates valid; 1 indicates invalid
  8796. * - num
  8797. * Bits 23:16
  8798. * Purpose: the number of payload in this indication
  8799. * Value: 1 to 255
  8800. * - append (a.k.a. append0)
  8801. * Bits 24:24
  8802. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  8803. * the number of tx retries for one MSDU at the end of this message
  8804. * Value: 0 indicates no appending; 1 indicates appending
  8805. * - append1
  8806. * Bits 25:25
  8807. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  8808. * contains the timestamp info for each TX msdu id in payload.
  8809. * The order of the timestamps matches the order of the MSDU IDs.
  8810. * Note that a big-endian host needs to account for the reordering
  8811. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8812. * conversion) when determining which tx timestamp corresponds to
  8813. * which MSDU ID.
  8814. * Value: 0 indicates no appending; 1 indicates appending
  8815. * - msdu_tx_power_presence
  8816. * Bits 26:26
  8817. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  8818. * for each MSDU referenced by the TX_COMPL_IND message.
  8819. * The tx power is reported in 0.5 dBm units.
  8820. * The order of the per-MSDU tx power reports matches the order
  8821. * of the MSDU IDs.
  8822. * Note that a big-endian host needs to account for the reordering
  8823. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8824. * conversion) when determining which Tx Power corresponds to
  8825. * which MSDU ID.
  8826. * Value: 0 indicates MSDU tx power reports are not appended,
  8827. * 1 indicates MSDU tx power reports are appended
  8828. * - append2
  8829. * Bits 27:27
  8830. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  8831. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  8832. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  8833. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  8834. * for each MSDU, for convenience.
  8835. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  8836. * this append2 bit is set).
  8837. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  8838. * dB above the noise floor.
  8839. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  8840. * 1 indicates MSDU ACK RSSI values are appended.
  8841. * - append3
  8842. * Bits 28:28
  8843. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  8844. * contains the tx tsf info based on wlan global TSF for
  8845. * each TX msdu id in payload.
  8846. * The order of the tx tsf matches the order of the MSDU IDs.
  8847. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  8848. * values to indicate the the lower 32 bits and higher 32 bits of
  8849. * the tx tsf.
  8850. * The tx_tsf64 here represents the time MSDU was acked and the
  8851. * tx_tsf64 has microseconds units.
  8852. * Value: 0 indicates no appending; 1 indicates appending
  8853. * - append4
  8854. * Bits 29:29
  8855. * Purpose: Indicate whether data frame control fields and fields required
  8856. * for radio tap header are appended for each MSDU in TX_COMP_IND
  8857. * message. The order of the this message matches the order of
  8858. * the MSDU IDs.
  8859. * Value: 0 indicates frame control fields and fields required for
  8860. * radio tap header values are not appended,
  8861. * 1 indicates frame control fields and fields required for
  8862. * radio tap header values are appended.
  8863. * Payload fields:
  8864. * - hmsdu_id
  8865. * Bits 15:0
  8866. * Purpose: this ID is used to track the Tx buffer in host
  8867. * Value: 0 to "size of host MSDU descriptor pool - 1"
  8868. */
  8869. PREPACK struct htt_tx_data_hdr_information {
  8870. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8871. A_UINT32 /* word 1 */
  8872. /* preamble:
  8873. * 0-OFDM,
  8874. * 1-CCk,
  8875. * 2-HT,
  8876. * 3-VHT
  8877. */
  8878. preamble: 2, /* [1:0] */
  8879. /* mcs:
  8880. * In case of HT preamble interpret
  8881. * MCS along with NSS.
  8882. * Valid values for HT are 0 to 7.
  8883. * HT mcs 0 with NSS 2 is mcs 8.
  8884. * Valid values for VHT are 0 to 9.
  8885. */
  8886. mcs: 4, /* [5:2] */
  8887. /* rate:
  8888. * This is applicable only for
  8889. * CCK and OFDM preamble type
  8890. * rate 0: OFDM 48 Mbps,
  8891. * 1: OFDM 24 Mbps,
  8892. * 2: OFDM 12 Mbps
  8893. * 3: OFDM 6 Mbps
  8894. * 4: OFDM 54 Mbps
  8895. * 5: OFDM 36 Mbps
  8896. * 6: OFDM 18 Mbps
  8897. * 7: OFDM 9 Mbps
  8898. * rate 0: CCK 11 Mbps Long
  8899. * 1: CCK 5.5 Mbps Long
  8900. * 2: CCK 2 Mbps Long
  8901. * 3: CCK 1 Mbps Long
  8902. * 4: CCK 11 Mbps Short
  8903. * 5: CCK 5.5 Mbps Short
  8904. * 6: CCK 2 Mbps Short
  8905. */
  8906. rate : 3, /* [ 8: 6] */
  8907. rssi : 8, /* [16: 9] units=dBm */
  8908. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8909. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8910. stbc : 1, /* [22] */
  8911. sgi : 1, /* [23] */
  8912. ldpc : 1, /* [24] */
  8913. beamformed: 1, /* [25] */
  8914. /* tx_retry_cnt:
  8915. * Indicates retry count of data tx frames provided by the host.
  8916. */
  8917. tx_retry_cnt: 6; /* [31:26] */
  8918. A_UINT32 /* word 2 */
  8919. framectrl:16, /* [15: 0] */
  8920. seqno:16; /* [31:16] */
  8921. } POSTPACK;
  8922. #define HTT_TX_COMPL_IND_STATUS_S 8
  8923. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8924. #define HTT_TX_COMPL_IND_TID_S 11
  8925. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8926. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8927. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8928. #define HTT_TX_COMPL_IND_NUM_S 16
  8929. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8930. #define HTT_TX_COMPL_IND_APPEND_S 24
  8931. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8932. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8933. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8934. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8935. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8936. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8937. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8938. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8939. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8940. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8941. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8942. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8943. do { \
  8944. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8945. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8946. } while (0)
  8947. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8948. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8949. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8950. do { \
  8951. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8952. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8953. } while (0)
  8954. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8955. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8956. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8957. do { \
  8958. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8959. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8960. } while (0)
  8961. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8962. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8963. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8964. do { \
  8965. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8966. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8967. } while (0)
  8968. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8969. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8970. HTT_TX_COMPL_IND_TID_INV_S)
  8971. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8974. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8975. } while (0)
  8976. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8977. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8978. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8981. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8982. } while (0)
  8983. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8984. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8985. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8988. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8989. } while (0)
  8990. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8991. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8992. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8993. do { \
  8994. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8995. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8996. } while (0)
  8997. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8998. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8999. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9000. do { \
  9001. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9002. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9003. } while (0)
  9004. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9005. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9006. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9007. do { \
  9008. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9009. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9010. } while (0)
  9011. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9012. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9013. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9014. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9015. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9016. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9017. #define HTT_TX_COMPL_IND_STAT_OK 0
  9018. /* DISCARD:
  9019. * current meaning:
  9020. * MSDUs were queued for transmission but filtered by HW or SW
  9021. * without any over the air attempts
  9022. * legacy meaning (HL Rome):
  9023. * MSDUs were discarded by the target FW without any over the air
  9024. * attempts due to lack of space
  9025. */
  9026. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9027. /* NO_ACK:
  9028. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9029. */
  9030. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9031. /* POSTPONE:
  9032. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9033. * be downloaded again later (in the appropriate order), when they are
  9034. * deliverable.
  9035. */
  9036. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9037. /*
  9038. * The PEER_DEL tx completion status is used for HL cases
  9039. * where the peer the frame is for has been deleted.
  9040. * The host has already discarded its copy of the frame, but
  9041. * it still needs the tx completion to restore its credit.
  9042. */
  9043. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9044. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9045. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9046. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9047. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9048. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9049. PREPACK struct htt_tx_compl_ind_base {
  9050. A_UINT32 hdr;
  9051. A_UINT16 payload[1/*or more*/];
  9052. } POSTPACK;
  9053. PREPACK struct htt_tx_compl_ind_append_retries {
  9054. A_UINT16 msdu_id;
  9055. A_UINT8 tx_retries;
  9056. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9057. 0: this is the last append_retries struct */
  9058. } POSTPACK;
  9059. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9060. A_UINT32 timestamp[1/*or more*/];
  9061. } POSTPACK;
  9062. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9063. A_UINT32 tx_tsf64_low;
  9064. A_UINT32 tx_tsf64_high;
  9065. } POSTPACK;
  9066. /* htt_tx_data_hdr_information payload extension fields: */
  9067. /* DWORD zero */
  9068. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9069. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9070. /* DWORD one */
  9071. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9072. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9073. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9074. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9075. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9076. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9077. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9078. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9079. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9080. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9081. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9082. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9083. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9084. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9085. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9086. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9087. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9088. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9089. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9090. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9091. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9092. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9093. /* DWORD two */
  9094. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9095. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9096. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9097. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9098. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9099. do { \
  9100. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9101. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9102. } while (0)
  9103. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9104. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9105. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9106. do { \
  9107. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9108. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9109. } while (0)
  9110. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9111. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9112. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9113. do { \
  9114. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9115. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9116. } while (0)
  9117. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9118. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9119. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9120. do { \
  9121. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9122. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9123. } while (0)
  9124. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9125. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9126. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9129. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9130. } while (0)
  9131. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9132. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9133. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9136. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9137. } while (0)
  9138. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9139. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9140. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9143. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9144. } while (0)
  9145. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9146. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9147. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9150. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9151. } while (0)
  9152. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9153. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9154. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9157. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9158. } while (0)
  9159. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9160. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9161. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9162. do { \
  9163. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9164. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9165. } while (0)
  9166. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9167. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9168. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9169. do { \
  9170. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9171. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9172. } while (0)
  9173. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9174. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9175. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9176. do { \
  9177. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9178. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9179. } while (0)
  9180. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9181. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9182. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9185. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9186. } while (0)
  9187. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9188. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9189. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9190. do { \
  9191. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9192. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9193. } while (0)
  9194. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9195. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9196. /**
  9197. * @brief target -> host rate-control update indication message
  9198. *
  9199. * @details
  9200. * The following diagram shows the format of the RC Update message
  9201. * sent from the target to the host, while processing the tx-completion
  9202. * of a transmitted PPDU.
  9203. *
  9204. * |31 24|23 16|15 8|7 0|
  9205. * |-------------------------------------------------------------|
  9206. * | peer ID | vdev ID | msg_type |
  9207. * |-------------------------------------------------------------|
  9208. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9209. * |-------------------------------------------------------------|
  9210. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9211. * |-------------------------------------------------------------|
  9212. * | : |
  9213. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9214. * | : |
  9215. * |-------------------------------------------------------------|
  9216. * | : |
  9217. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9218. * | : |
  9219. * |-------------------------------------------------------------|
  9220. * : :
  9221. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9222. *
  9223. */
  9224. typedef struct {
  9225. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9226. A_UINT32 rate_code_flags;
  9227. A_UINT32 flags; /* Encodes information such as excessive
  9228. retransmission, aggregate, some info
  9229. from .11 frame control,
  9230. STBC, LDPC, (SGI and Tx Chain Mask
  9231. are encoded in ptx_rc->flags field),
  9232. AMPDU truncation (BT/time based etc.),
  9233. RTS/CTS attempt */
  9234. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9235. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9236. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9237. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9238. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9239. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9240. } HTT_RC_TX_DONE_PARAMS;
  9241. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9242. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9243. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9244. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9245. #define HTT_RC_UPDATE_VDEVID_S 8
  9246. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9247. #define HTT_RC_UPDATE_PEERID_S 16
  9248. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9249. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9250. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9251. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9252. do { \
  9253. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9254. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9255. } while (0)
  9256. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9257. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9258. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9259. do { \
  9260. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9261. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9262. } while (0)
  9263. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9264. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9265. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9266. do { \
  9267. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9268. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9269. } while (0)
  9270. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9271. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9272. /**
  9273. * @brief target -> host rx fragment indication message definition
  9274. *
  9275. * @details
  9276. * The following field definitions describe the format of the rx fragment
  9277. * indication message sent from the target to the host.
  9278. * The rx fragment indication message shares the format of the
  9279. * rx indication message, but not all fields from the rx indication message
  9280. * are relevant to the rx fragment indication message.
  9281. *
  9282. *
  9283. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9284. * |-----------+-------------------+---------------------+-------------|
  9285. * | peer ID | |FV| ext TID | msg type |
  9286. * |-------------------------------------------------------------------|
  9287. * | | flush | flush |
  9288. * | | end | start |
  9289. * | | seq num | seq num |
  9290. * |-------------------------------------------------------------------|
  9291. * | reserved | FW rx desc bytes |
  9292. * |-------------------------------------------------------------------|
  9293. * | | FW MSDU Rx |
  9294. * | | desc B0 |
  9295. * |-------------------------------------------------------------------|
  9296. * Header fields:
  9297. * - MSG_TYPE
  9298. * Bits 7:0
  9299. * Purpose: identifies this as an rx fragment indication message
  9300. * Value: 0xa
  9301. * - EXT_TID
  9302. * Bits 12:8
  9303. * Purpose: identify the traffic ID of the rx data, including
  9304. * special "extended" TID values for multicast, broadcast, and
  9305. * non-QoS data frames
  9306. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9307. * - FLUSH_VALID (FV)
  9308. * Bit 13
  9309. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9310. * is valid
  9311. * Value:
  9312. * 1 -> flush IE is valid and needs to be processed
  9313. * 0 -> flush IE is not valid and should be ignored
  9314. * - PEER_ID
  9315. * Bits 31:16
  9316. * Purpose: Identify, by ID, which peer sent the rx data
  9317. * Value: ID of the peer who sent the rx data
  9318. * - FLUSH_SEQ_NUM_START
  9319. * Bits 5:0
  9320. * Purpose: Indicate the start of a series of MPDUs to flush
  9321. * Not all MPDUs within this series are necessarily valid - the host
  9322. * must check each sequence number within this range to see if the
  9323. * corresponding MPDU is actually present.
  9324. * This field is only valid if the FV bit is set.
  9325. * Value:
  9326. * The sequence number for the first MPDUs to check to flush.
  9327. * The sequence number is masked by 0x3f.
  9328. * - FLUSH_SEQ_NUM_END
  9329. * Bits 11:6
  9330. * Purpose: Indicate the end of a series of MPDUs to flush
  9331. * Value:
  9332. * The sequence number one larger than the sequence number of the
  9333. * last MPDU to check to flush.
  9334. * The sequence number is masked by 0x3f.
  9335. * Not all MPDUs within this series are necessarily valid - the host
  9336. * must check each sequence number within this range to see if the
  9337. * corresponding MPDU is actually present.
  9338. * This field is only valid if the FV bit is set.
  9339. * Rx descriptor fields:
  9340. * - FW_RX_DESC_BYTES
  9341. * Bits 15:0
  9342. * Purpose: Indicate how many bytes in the Rx indication are used for
  9343. * FW Rx descriptors
  9344. * Value: 1
  9345. */
  9346. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9347. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9348. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9349. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9350. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9351. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9352. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9353. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9354. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9355. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9356. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9357. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9358. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9359. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9360. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9361. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9362. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9363. #define HTT_RX_FRAG_IND_BYTES \
  9364. (4 /* msg hdr */ + \
  9365. 4 /* flush spec */ + \
  9366. 4 /* (unused) FW rx desc bytes spec */ + \
  9367. 4 /* FW rx desc */)
  9368. /**
  9369. * @brief target -> host test message definition
  9370. *
  9371. * @details
  9372. * The following field definitions describe the format of the test
  9373. * message sent from the target to the host.
  9374. * The message consists of a 4-octet header, followed by a variable
  9375. * number of 32-bit integer values, followed by a variable number
  9376. * of 8-bit character values.
  9377. *
  9378. * |31 16|15 8|7 0|
  9379. * |-----------------------------------------------------------|
  9380. * | num chars | num ints | msg type |
  9381. * |-----------------------------------------------------------|
  9382. * | int 0 |
  9383. * |-----------------------------------------------------------|
  9384. * | int 1 |
  9385. * |-----------------------------------------------------------|
  9386. * | ... |
  9387. * |-----------------------------------------------------------|
  9388. * | char 3 | char 2 | char 1 | char 0 |
  9389. * |-----------------------------------------------------------|
  9390. * | | | ... | char 4 |
  9391. * |-----------------------------------------------------------|
  9392. * - MSG_TYPE
  9393. * Bits 7:0
  9394. * Purpose: identifies this as a test message
  9395. * Value: HTT_MSG_TYPE_TEST
  9396. * - NUM_INTS
  9397. * Bits 15:8
  9398. * Purpose: indicate how many 32-bit integers follow the message header
  9399. * - NUM_CHARS
  9400. * Bits 31:16
  9401. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9402. */
  9403. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9404. #define HTT_RX_TEST_NUM_INTS_S 8
  9405. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9406. #define HTT_RX_TEST_NUM_CHARS_S 16
  9407. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9410. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9411. } while (0)
  9412. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9413. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9414. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9415. do { \
  9416. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9417. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9418. } while (0)
  9419. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9420. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9421. /**
  9422. * @brief target -> host packet log message
  9423. *
  9424. * @details
  9425. * The following field definitions describe the format of the packet log
  9426. * message sent from the target to the host.
  9427. * The message consists of a 4-octet header,followed by a variable number
  9428. * of 32-bit character values.
  9429. *
  9430. * |31 16|15 12|11 10|9 8|7 0|
  9431. * |------------------------------------------------------------------|
  9432. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9433. * |------------------------------------------------------------------|
  9434. * | payload |
  9435. * |------------------------------------------------------------------|
  9436. * - MSG_TYPE
  9437. * Bits 7:0
  9438. * Purpose: identifies this as a pktlog message
  9439. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9440. * - mac_id
  9441. * Bits 9:8
  9442. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9443. * Value: 0-3
  9444. * - pdev_id
  9445. * Bits 11:10
  9446. * Purpose: pdev_id
  9447. * Value: 0-3
  9448. * 0 (for rings at SOC level),
  9449. * 1/2/3 PDEV -> 0/1/2
  9450. * - payload_size
  9451. * Bits 31:16
  9452. * Purpose: explicitly specify the payload size
  9453. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9454. */
  9455. PREPACK struct htt_pktlog_msg {
  9456. A_UINT32 header;
  9457. A_UINT32 payload[1/* or more */];
  9458. } POSTPACK;
  9459. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9460. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9461. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9462. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9463. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9464. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9465. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9466. do { \
  9467. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9468. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9469. } while (0)
  9470. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9471. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9472. HTT_T2H_PKTLOG_MAC_ID_S)
  9473. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9474. do { \
  9475. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9476. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9477. } while (0)
  9478. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9479. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9480. HTT_T2H_PKTLOG_PDEV_ID_S)
  9481. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9484. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9485. } while (0)
  9486. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9487. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9488. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9489. /*
  9490. * Rx reorder statistics
  9491. * NB: all the fields must be defined in 4 octets size.
  9492. */
  9493. struct rx_reorder_stats {
  9494. /* Non QoS MPDUs received */
  9495. A_UINT32 deliver_non_qos;
  9496. /* MPDUs received in-order */
  9497. A_UINT32 deliver_in_order;
  9498. /* Flush due to reorder timer expired */
  9499. A_UINT32 deliver_flush_timeout;
  9500. /* Flush due to move out of window */
  9501. A_UINT32 deliver_flush_oow;
  9502. /* Flush due to DELBA */
  9503. A_UINT32 deliver_flush_delba;
  9504. /* MPDUs dropped due to FCS error */
  9505. A_UINT32 fcs_error;
  9506. /* MPDUs dropped due to monitor mode non-data packet */
  9507. A_UINT32 mgmt_ctrl;
  9508. /* Unicast-data MPDUs dropped due to invalid peer */
  9509. A_UINT32 invalid_peer;
  9510. /* MPDUs dropped due to duplication (non aggregation) */
  9511. A_UINT32 dup_non_aggr;
  9512. /* MPDUs dropped due to processed before */
  9513. A_UINT32 dup_past;
  9514. /* MPDUs dropped due to duplicate in reorder queue */
  9515. A_UINT32 dup_in_reorder;
  9516. /* Reorder timeout happened */
  9517. A_UINT32 reorder_timeout;
  9518. /* invalid bar ssn */
  9519. A_UINT32 invalid_bar_ssn;
  9520. /* reorder reset due to bar ssn */
  9521. A_UINT32 ssn_reset;
  9522. /* Flush due to delete peer */
  9523. A_UINT32 deliver_flush_delpeer;
  9524. /* Flush due to offload*/
  9525. A_UINT32 deliver_flush_offload;
  9526. /* Flush due to out of buffer*/
  9527. A_UINT32 deliver_flush_oob;
  9528. /* MPDUs dropped due to PN check fail */
  9529. A_UINT32 pn_fail;
  9530. /* MPDUs dropped due to unable to allocate memory */
  9531. A_UINT32 store_fail;
  9532. /* Number of times the tid pool alloc succeeded */
  9533. A_UINT32 tid_pool_alloc_succ;
  9534. /* Number of times the MPDU pool alloc succeeded */
  9535. A_UINT32 mpdu_pool_alloc_succ;
  9536. /* Number of times the MSDU pool alloc succeeded */
  9537. A_UINT32 msdu_pool_alloc_succ;
  9538. /* Number of times the tid pool alloc failed */
  9539. A_UINT32 tid_pool_alloc_fail;
  9540. /* Number of times the MPDU pool alloc failed */
  9541. A_UINT32 mpdu_pool_alloc_fail;
  9542. /* Number of times the MSDU pool alloc failed */
  9543. A_UINT32 msdu_pool_alloc_fail;
  9544. /* Number of times the tid pool freed */
  9545. A_UINT32 tid_pool_free;
  9546. /* Number of times the MPDU pool freed */
  9547. A_UINT32 mpdu_pool_free;
  9548. /* Number of times the MSDU pool freed */
  9549. A_UINT32 msdu_pool_free;
  9550. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9551. A_UINT32 msdu_queued;
  9552. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9553. A_UINT32 msdu_recycled;
  9554. /* Number of MPDUs with invalid peer but A2 found in AST */
  9555. A_UINT32 invalid_peer_a2_in_ast;
  9556. /* Number of MPDUs with invalid peer but A3 found in AST */
  9557. A_UINT32 invalid_peer_a3_in_ast;
  9558. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9559. A_UINT32 invalid_peer_bmc_mpdus;
  9560. /* Number of MSDUs with err attention word */
  9561. A_UINT32 rxdesc_err_att;
  9562. /* Number of MSDUs with flag of peer_idx_invalid */
  9563. A_UINT32 rxdesc_err_peer_idx_inv;
  9564. /* Number of MSDUs with flag of peer_idx_timeout */
  9565. A_UINT32 rxdesc_err_peer_idx_to;
  9566. /* Number of MSDUs with flag of overflow */
  9567. A_UINT32 rxdesc_err_ov;
  9568. /* Number of MSDUs with flag of msdu_length_err */
  9569. A_UINT32 rxdesc_err_msdu_len;
  9570. /* Number of MSDUs with flag of mpdu_length_err */
  9571. A_UINT32 rxdesc_err_mpdu_len;
  9572. /* Number of MSDUs with flag of tkip_mic_err */
  9573. A_UINT32 rxdesc_err_tkip_mic;
  9574. /* Number of MSDUs with flag of decrypt_err */
  9575. A_UINT32 rxdesc_err_decrypt;
  9576. /* Number of MSDUs with flag of fcs_err */
  9577. A_UINT32 rxdesc_err_fcs;
  9578. /* Number of Unicast (bc_mc bit is not set in attention word)
  9579. * frames with invalid peer handler
  9580. */
  9581. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9582. /* Number of unicast frame directly (direct bit is set in attention word)
  9583. * to DUT with invalid peer handler
  9584. */
  9585. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9586. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9587. * frames with invalid peer handler
  9588. */
  9589. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9590. /* Number of MSDUs dropped due to no first MSDU flag */
  9591. A_UINT32 rxdesc_no_1st_msdu;
  9592. /* Number of MSDUs droped due to ring overflow */
  9593. A_UINT32 msdu_drop_ring_ov;
  9594. /* Number of MSDUs dropped due to FC mismatch */
  9595. A_UINT32 msdu_drop_fc_mismatch;
  9596. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9597. A_UINT32 msdu_drop_mgmt_remote_ring;
  9598. /* Number of MSDUs dropped due to errors not reported in attention word */
  9599. A_UINT32 msdu_drop_misc;
  9600. /* Number of MSDUs go to offload before reorder */
  9601. A_UINT32 offload_msdu_wal;
  9602. /* Number of data frame dropped by offload after reorder */
  9603. A_UINT32 offload_msdu_reorder;
  9604. /* Number of MPDUs with sequence number in the past and within the BA window */
  9605. A_UINT32 dup_past_within_window;
  9606. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9607. A_UINT32 dup_past_outside_window;
  9608. /* Number of MSDUs with decrypt/MIC error */
  9609. A_UINT32 rxdesc_err_decrypt_mic;
  9610. /* Number of data MSDUs received on both local and remote rings */
  9611. A_UINT32 data_msdus_on_both_rings;
  9612. /* MPDUs never filled */
  9613. A_UINT32 holes_not_filled;
  9614. };
  9615. /*
  9616. * Rx Remote buffer statistics
  9617. * NB: all the fields must be defined in 4 octets size.
  9618. */
  9619. struct rx_remote_buffer_mgmt_stats {
  9620. /* Total number of MSDUs reaped for Rx processing */
  9621. A_UINT32 remote_reaped;
  9622. /* MSDUs recycled within firmware */
  9623. A_UINT32 remote_recycled;
  9624. /* MSDUs stored by Data Rx */
  9625. A_UINT32 data_rx_msdus_stored;
  9626. /* Number of HTT indications from WAL Rx MSDU */
  9627. A_UINT32 wal_rx_ind;
  9628. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9629. A_UINT32 wal_rx_ind_unconsumed;
  9630. /* Number of HTT indications from Data Rx MSDU */
  9631. A_UINT32 data_rx_ind;
  9632. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9633. A_UINT32 data_rx_ind_unconsumed;
  9634. /* Number of HTT indications from ATHBUF */
  9635. A_UINT32 athbuf_rx_ind;
  9636. /* Number of remote buffers requested for refill */
  9637. A_UINT32 refill_buf_req;
  9638. /* Number of remote buffers filled by the host */
  9639. A_UINT32 refill_buf_rsp;
  9640. /* Number of times MAC hw_index = f/w write_index */
  9641. A_INT32 mac_no_bufs;
  9642. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9643. A_INT32 fw_indices_equal;
  9644. /* Number of times f/w finds no buffers to post */
  9645. A_INT32 host_no_bufs;
  9646. };
  9647. /*
  9648. * TXBF MU/SU packets and NDPA statistics
  9649. * NB: all the fields must be defined in 4 octets size.
  9650. */
  9651. struct rx_txbf_musu_ndpa_pkts_stats {
  9652. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9653. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9654. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9655. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9656. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9657. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9658. };
  9659. /*
  9660. * htt_dbg_stats_status -
  9661. * present - The requested stats have been delivered in full.
  9662. * This indicates that either the stats information was contained
  9663. * in its entirety within this message, or else this message
  9664. * completes the delivery of the requested stats info that was
  9665. * partially delivered through earlier STATS_CONF messages.
  9666. * partial - The requested stats have been delivered in part.
  9667. * One or more subsequent STATS_CONF messages with the same
  9668. * cookie value will be sent to deliver the remainder of the
  9669. * information.
  9670. * error - The requested stats could not be delivered, for example due
  9671. * to a shortage of memory to construct a message holding the
  9672. * requested stats.
  9673. * invalid - The requested stat type is either not recognized, or the
  9674. * target is configured to not gather the stats type in question.
  9675. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9676. * series_done - This special value indicates that no further stats info
  9677. * elements are present within a series of stats info elems
  9678. * (within a stats upload confirmation message).
  9679. */
  9680. enum htt_dbg_stats_status {
  9681. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9682. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9683. HTT_DBG_STATS_STATUS_ERROR = 2,
  9684. HTT_DBG_STATS_STATUS_INVALID = 3,
  9685. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9686. };
  9687. /**
  9688. * @brief target -> host statistics upload
  9689. *
  9690. * @details
  9691. * The following field definitions describe the format of the HTT target
  9692. * to host stats upload confirmation message.
  9693. * The message contains a cookie echoed from the HTT host->target stats
  9694. * upload request, which identifies which request the confirmation is
  9695. * for, and a series of tag-length-value stats information elements.
  9696. * The tag-length header for each stats info element also includes a
  9697. * status field, to indicate whether the request for the stat type in
  9698. * question was fully met, partially met, unable to be met, or invalid
  9699. * (if the stat type in question is disabled in the target).
  9700. * A special value of all 1's in this status field is used to indicate
  9701. * the end of the series of stats info elements.
  9702. *
  9703. *
  9704. * |31 16|15 8|7 5|4 0|
  9705. * |------------------------------------------------------------|
  9706. * | reserved | msg type |
  9707. * |------------------------------------------------------------|
  9708. * | cookie LSBs |
  9709. * |------------------------------------------------------------|
  9710. * | cookie MSBs |
  9711. * |------------------------------------------------------------|
  9712. * | stats entry length | reserved | S |stat type|
  9713. * |------------------------------------------------------------|
  9714. * | |
  9715. * | type-specific stats info |
  9716. * | |
  9717. * |------------------------------------------------------------|
  9718. * | stats entry length | reserved | S |stat type|
  9719. * |------------------------------------------------------------|
  9720. * | |
  9721. * | type-specific stats info |
  9722. * | |
  9723. * |------------------------------------------------------------|
  9724. * | n/a | reserved | 111 | n/a |
  9725. * |------------------------------------------------------------|
  9726. * Header fields:
  9727. * - MSG_TYPE
  9728. * Bits 7:0
  9729. * Purpose: identifies this is a statistics upload confirmation message
  9730. * Value: 0x9
  9731. * - COOKIE_LSBS
  9732. * Bits 31:0
  9733. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9734. * message with its preceding host->target stats request message.
  9735. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9736. * - COOKIE_MSBS
  9737. * Bits 31:0
  9738. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9739. * message with its preceding host->target stats request message.
  9740. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9741. *
  9742. * Stats Information Element tag-length header fields:
  9743. * - STAT_TYPE
  9744. * Bits 4:0
  9745. * Purpose: identifies the type of statistics info held in the
  9746. * following information element
  9747. * Value: htt_dbg_stats_type
  9748. * - STATUS
  9749. * Bits 7:5
  9750. * Purpose: indicate whether the requested stats are present
  9751. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9752. * the completion of the stats entry series
  9753. * - LENGTH
  9754. * Bits 31:16
  9755. * Purpose: indicate the stats information size
  9756. * Value: This field specifies the number of bytes of stats information
  9757. * that follows the element tag-length header.
  9758. * It is expected but not required that this length is a multiple of
  9759. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9760. * subsequent stats entry header will begin on a 4-byte aligned
  9761. * boundary.
  9762. */
  9763. #define HTT_T2H_STATS_COOKIE_SIZE 8
  9764. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  9765. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  9766. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  9767. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  9768. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  9769. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  9770. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  9771. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9772. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  9773. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  9774. do { \
  9775. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  9776. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  9777. } while (0)
  9778. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  9779. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  9780. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  9781. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  9784. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  9785. } while (0)
  9786. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  9787. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  9788. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  9789. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9790. do { \
  9791. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  9792. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  9793. } while (0)
  9794. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  9795. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  9796. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  9797. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  9798. #define HTT_MAX_AGGR 64
  9799. #define HTT_HL_MAX_AGGR 18
  9800. /**
  9801. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  9802. *
  9803. * @details
  9804. * The following field definitions describe the format of the HTT host
  9805. * to target frag_desc/msdu_ext bank configuration message.
  9806. * The message contains the based address and the min and max id of the
  9807. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  9808. * MSDU_EXT/FRAG_DESC.
  9809. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  9810. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  9811. * the hardware does the mapping/translation.
  9812. *
  9813. * Total banks that can be configured is configured to 16.
  9814. *
  9815. * This should be called before any TX has be initiated by the HTT
  9816. *
  9817. * |31 16|15 8|7 5|4 0|
  9818. * |------------------------------------------------------------|
  9819. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  9820. * |------------------------------------------------------------|
  9821. * | BANK0_BASE_ADDRESS (bits 31:0) |
  9822. #if HTT_PADDR64
  9823. * | BANK0_BASE_ADDRESS (bits 63:32) |
  9824. #endif
  9825. * |------------------------------------------------------------|
  9826. * | ... |
  9827. * |------------------------------------------------------------|
  9828. * | BANK15_BASE_ADDRESS (bits 31:0) |
  9829. #if HTT_PADDR64
  9830. * | BANK15_BASE_ADDRESS (bits 63:32) |
  9831. #endif
  9832. * |------------------------------------------------------------|
  9833. * | BANK0_MAX_ID | BANK0_MIN_ID |
  9834. * |------------------------------------------------------------|
  9835. * | ... |
  9836. * |------------------------------------------------------------|
  9837. * | BANK15_MAX_ID | BANK15_MIN_ID |
  9838. * |------------------------------------------------------------|
  9839. * Header fields:
  9840. * - MSG_TYPE
  9841. * Bits 7:0
  9842. * Value: 0x6
  9843. * for systems with 64-bit format for bus addresses:
  9844. * - BANKx_BASE_ADDRESS_LO
  9845. * Bits 31:0
  9846. * Purpose: Provide a mechanism to specify the base address of the
  9847. * MSDU_EXT bank physical/bus address.
  9848. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  9849. * - BANKx_BASE_ADDRESS_HI
  9850. * Bits 31:0
  9851. * Purpose: Provide a mechanism to specify the base address of the
  9852. * MSDU_EXT bank physical/bus address.
  9853. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  9854. * for systems with 32-bit format for bus addresses:
  9855. * - BANKx_BASE_ADDRESS
  9856. * Bits 31:0
  9857. * Purpose: Provide a mechanism to specify the base address of the
  9858. * MSDU_EXT bank physical/bus address.
  9859. * Value: MSDU_EXT bank physical / bus address
  9860. * - BANKx_MIN_ID
  9861. * Bits 15:0
  9862. * Purpose: Provide a mechanism to specify the min index that needs to
  9863. * mapped.
  9864. * - BANKx_MAX_ID
  9865. * Bits 31:16
  9866. * Purpose: Provide a mechanism to specify the max index that needs to
  9867. * mapped.
  9868. *
  9869. */
  9870. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  9871. * safe value.
  9872. * @note MAX supported banks is 16.
  9873. */
  9874. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  9875. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  9876. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  9877. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  9878. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  9879. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  9880. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  9881. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9882. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9883. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  9884. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  9885. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  9886. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  9887. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  9888. do { \
  9889. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  9890. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  9891. } while (0)
  9892. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  9893. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  9894. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  9895. do { \
  9896. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9897. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9898. } while (0)
  9899. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9900. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9901. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9902. do { \
  9903. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9904. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9905. } while (0)
  9906. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9907. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9908. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9909. do { \
  9910. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9911. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9912. } while (0)
  9913. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9914. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9915. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9916. do { \
  9917. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9918. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9919. } while (0)
  9920. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9921. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9922. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9925. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9926. } while (0)
  9927. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9928. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9929. /*
  9930. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9931. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9932. * addresses are stored in a XXX-bit field.
  9933. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9934. * htt_tx_frag_desc64_bank_cfg_t structs.
  9935. */
  9936. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9937. _paddr_bits_, \
  9938. _paddr__bank_base_address_) \
  9939. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9940. /** word 0 \
  9941. * msg_type: 8, \
  9942. * pdev_id: 2, \
  9943. * swap: 1, \
  9944. * reserved0: 5, \
  9945. * num_banks: 8, \
  9946. * desc_size: 8; \
  9947. */ \
  9948. A_UINT32 word0; \
  9949. /* \
  9950. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9951. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9952. * the second A_UINT32). \
  9953. */ \
  9954. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9955. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9956. } POSTPACK
  9957. /* define htt_tx_frag_desc32_bank_cfg_t */
  9958. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9959. /* define htt_tx_frag_desc64_bank_cfg_t */
  9960. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9961. /*
  9962. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9963. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9964. */
  9965. #if HTT_PADDR64
  9966. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9967. #else
  9968. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9969. #endif
  9970. /**
  9971. * @brief target -> host HTT TX Credit total count update message definition
  9972. *
  9973. *|31 16|15|14 9| 8 |7 0 |
  9974. *|---------------------+--+----------+-------+----------|
  9975. *|cur htt credit delta | Q| reserved | sign | msg type |
  9976. *|------------------------------------------------------|
  9977. *
  9978. * Header fields:
  9979. * - MSG_TYPE
  9980. * Bits 7:0
  9981. * Purpose: identifies this as a htt tx credit delta update message
  9982. * Value: 0xe
  9983. * - SIGN
  9984. * Bits 8
  9985. * identifies whether credit delta is positive or negative
  9986. * Value:
  9987. * - 0x0: credit delta is positive, rebalance in some buffers
  9988. * - 0x1: credit delta is negative, rebalance out some buffers
  9989. * - reserved
  9990. * Bits 14:9
  9991. * Value: 0x0
  9992. * - TXQ_GRP
  9993. * Bit 15
  9994. * Purpose: indicates whether any tx queue group information elements
  9995. * are appended to the tx credit update message
  9996. * Value: 0 -> no tx queue group information element is present
  9997. * 1 -> a tx queue group information element immediately follows
  9998. * - DELTA_COUNT
  9999. * Bits 31:16
  10000. * Purpose: Specify current htt credit delta absolute count
  10001. */
  10002. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10003. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10004. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10005. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10006. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10007. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10008. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10011. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10012. } while (0)
  10013. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10014. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10015. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10016. do { \
  10017. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10018. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10019. } while (0)
  10020. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10021. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10022. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10025. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10026. } while (0)
  10027. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10028. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10029. #define HTT_TX_CREDIT_MSG_BYTES 4
  10030. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10031. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10032. /**
  10033. * @brief HTT WDI_IPA Operation Response Message
  10034. *
  10035. * @details
  10036. * HTT WDI_IPA Operation Response message is sent by target
  10037. * to host confirming suspend or resume operation.
  10038. * |31 24|23 16|15 8|7 0|
  10039. * |----------------+----------------+----------------+----------------|
  10040. * | op_code | Rsvd | msg_type |
  10041. * |-------------------------------------------------------------------|
  10042. * | Rsvd | Response len |
  10043. * |-------------------------------------------------------------------|
  10044. * | |
  10045. * | Response-type specific info |
  10046. * | |
  10047. * | |
  10048. * |-------------------------------------------------------------------|
  10049. * Header fields:
  10050. * - MSG_TYPE
  10051. * Bits 7:0
  10052. * Purpose: Identifies this as WDI_IPA Operation Response message
  10053. * value: = 0x13
  10054. * - OP_CODE
  10055. * Bits 31:16
  10056. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10057. * value: = enum htt_wdi_ipa_op_code
  10058. * - RSP_LEN
  10059. * Bits 16:0
  10060. * Purpose: length for the response-type specific info
  10061. * value: = length in bytes for response-type specific info
  10062. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10063. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10064. */
  10065. PREPACK struct htt_wdi_ipa_op_response_t
  10066. {
  10067. /* DWORD 0: flags and meta-data */
  10068. A_UINT32
  10069. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10070. reserved1: 8,
  10071. op_code: 16;
  10072. A_UINT32
  10073. rsp_len: 16,
  10074. reserved2: 16;
  10075. } POSTPACK;
  10076. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10077. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10078. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10079. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10080. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10081. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10082. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10083. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10084. do { \
  10085. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10086. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10087. } while (0)
  10088. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10089. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10090. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10091. do { \
  10092. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10093. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10094. } while (0)
  10095. enum htt_phy_mode {
  10096. htt_phy_mode_11a = 0,
  10097. htt_phy_mode_11g = 1,
  10098. htt_phy_mode_11b = 2,
  10099. htt_phy_mode_11g_only = 3,
  10100. htt_phy_mode_11na_ht20 = 4,
  10101. htt_phy_mode_11ng_ht20 = 5,
  10102. htt_phy_mode_11na_ht40 = 6,
  10103. htt_phy_mode_11ng_ht40 = 7,
  10104. htt_phy_mode_11ac_vht20 = 8,
  10105. htt_phy_mode_11ac_vht40 = 9,
  10106. htt_phy_mode_11ac_vht80 = 10,
  10107. htt_phy_mode_11ac_vht20_2g = 11,
  10108. htt_phy_mode_11ac_vht40_2g = 12,
  10109. htt_phy_mode_11ac_vht80_2g = 13,
  10110. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10111. htt_phy_mode_11ac_vht160 = 15,
  10112. htt_phy_mode_max,
  10113. };
  10114. /**
  10115. * @brief target -> host HTT channel change indication
  10116. * @details
  10117. * Specify when a channel change occurs.
  10118. * This allows the host to precisely determine which rx frames arrived
  10119. * on the old channel and which rx frames arrived on the new channel.
  10120. *
  10121. *|31 |7 0 |
  10122. *|-------------------------------------------+----------|
  10123. *| reserved | msg type |
  10124. *|------------------------------------------------------|
  10125. *| primary_chan_center_freq_mhz |
  10126. *|------------------------------------------------------|
  10127. *| contiguous_chan1_center_freq_mhz |
  10128. *|------------------------------------------------------|
  10129. *| contiguous_chan2_center_freq_mhz |
  10130. *|------------------------------------------------------|
  10131. *| phy_mode |
  10132. *|------------------------------------------------------|
  10133. *
  10134. * Header fields:
  10135. * - MSG_TYPE
  10136. * Bits 7:0
  10137. * Purpose: identifies this as a htt channel change indication message
  10138. * Value: 0x15
  10139. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10140. * Bits 31:0
  10141. * Purpose: identify the (center of the) new 20 MHz primary channel
  10142. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10143. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10144. * Bits 31:0
  10145. * Purpose: identify the (center of the) contiguous frequency range
  10146. * comprising the new channel.
  10147. * For example, if the new channel is a 80 MHz channel extending
  10148. * 60 MHz beyond the primary channel, this field would be 30 larger
  10149. * than the primary channel center frequency field.
  10150. * Value: center frequency of the contiguous frequency range comprising
  10151. * the full channel in MHz units
  10152. * (80+80 channels also use the CONTIG_CHAN2 field)
  10153. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10154. * Bits 31:0
  10155. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10156. * within a VHT 80+80 channel.
  10157. * This field is only relevant for VHT 80+80 channels.
  10158. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10159. * channel (arbitrary value for cases besides VHT 80+80)
  10160. * - PHY_MODE
  10161. * Bits 31:0
  10162. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10163. * and band
  10164. * Value: htt_phy_mode enum value
  10165. */
  10166. PREPACK struct htt_chan_change_t
  10167. {
  10168. /* DWORD 0: flags and meta-data */
  10169. A_UINT32
  10170. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10171. reserved1: 24;
  10172. A_UINT32 primary_chan_center_freq_mhz;
  10173. A_UINT32 contig_chan1_center_freq_mhz;
  10174. A_UINT32 contig_chan2_center_freq_mhz;
  10175. A_UINT32 phy_mode;
  10176. } POSTPACK;
  10177. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10178. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10179. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10180. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10181. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10182. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10183. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10184. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10185. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10186. do { \
  10187. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10188. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10189. } while (0)
  10190. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10191. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10192. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10193. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10194. do { \
  10195. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10196. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10197. } while (0)
  10198. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10199. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10200. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10201. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10202. do { \
  10203. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10204. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10205. } while (0)
  10206. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10207. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10208. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10209. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10210. do { \
  10211. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10212. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10213. } while (0)
  10214. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10215. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10216. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10217. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10218. /**
  10219. * @brief rx offload packet error message
  10220. *
  10221. * @details
  10222. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10223. * of target payload like mic err.
  10224. *
  10225. * |31 24|23 16|15 8|7 0|
  10226. * |----------------+----------------+----------------+----------------|
  10227. * | tid | vdev_id | msg_sub_type | msg_type |
  10228. * |-------------------------------------------------------------------|
  10229. * : (sub-type dependent content) :
  10230. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10231. * Header fields:
  10232. * - msg_type
  10233. * Bits 7:0
  10234. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10235. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10236. * - msg_sub_type
  10237. * Bits 15:8
  10238. * Purpose: Identifies which type of rx error is reported by this message
  10239. * value: htt_rx_ofld_pkt_err_type
  10240. * - vdev_id
  10241. * Bits 23:16
  10242. * Purpose: Identifies which vdev received the erroneous rx frame
  10243. * value:
  10244. * - tid
  10245. * Bits 31:24
  10246. * Purpose: Identifies the traffic type of the rx frame
  10247. * value:
  10248. *
  10249. * - The payload fields used if the sub-type == MIC error are shown below.
  10250. * Note - MIC err is per MSDU, while PN is per MPDU.
  10251. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10252. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10253. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10254. * instead of sending separate HTT messages for each wrong MSDU within
  10255. * the MPDU.
  10256. *
  10257. * |31 24|23 16|15 8|7 0|
  10258. * |----------------+----------------+----------------+----------------|
  10259. * | Rsvd | key_id | peer_id |
  10260. * |-------------------------------------------------------------------|
  10261. * | receiver MAC addr 31:0 |
  10262. * |-------------------------------------------------------------------|
  10263. * | Rsvd | receiver MAC addr 47:32 |
  10264. * |-------------------------------------------------------------------|
  10265. * | transmitter MAC addr 31:0 |
  10266. * |-------------------------------------------------------------------|
  10267. * | Rsvd | transmitter MAC addr 47:32 |
  10268. * |-------------------------------------------------------------------|
  10269. * | PN 31:0 |
  10270. * |-------------------------------------------------------------------|
  10271. * | Rsvd | PN 47:32 |
  10272. * |-------------------------------------------------------------------|
  10273. * - peer_id
  10274. * Bits 15:0
  10275. * Purpose: identifies which peer is frame is from
  10276. * value:
  10277. * - key_id
  10278. * Bits 23:16
  10279. * Purpose: identifies key_id of rx frame
  10280. * value:
  10281. * - RA_31_0 (receiver MAC addr 31:0)
  10282. * Bits 31:0
  10283. * Purpose: identifies by MAC address which vdev received the frame
  10284. * value: MAC address lower 4 bytes
  10285. * - RA_47_32 (receiver MAC addr 47:32)
  10286. * Bits 15:0
  10287. * Purpose: identifies by MAC address which vdev received the frame
  10288. * value: MAC address upper 2 bytes
  10289. * - TA_31_0 (transmitter MAC addr 31:0)
  10290. * Bits 31:0
  10291. * Purpose: identifies by MAC address which peer transmitted the frame
  10292. * value: MAC address lower 4 bytes
  10293. * - TA_47_32 (transmitter MAC addr 47:32)
  10294. * Bits 15:0
  10295. * Purpose: identifies by MAC address which peer transmitted the frame
  10296. * value: MAC address upper 2 bytes
  10297. * - PN_31_0
  10298. * Bits 31:0
  10299. * Purpose: Identifies pn of rx frame
  10300. * value: PN lower 4 bytes
  10301. * - PN_47_32
  10302. * Bits 15:0
  10303. * Purpose: Identifies pn of rx frame
  10304. * value:
  10305. * TKIP or CCMP: PN upper 2 bytes
  10306. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10307. */
  10308. enum htt_rx_ofld_pkt_err_type {
  10309. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10310. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10311. };
  10312. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10313. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10314. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10315. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10316. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10317. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10318. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10319. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10320. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10321. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10322. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10323. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10326. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10327. } while (0)
  10328. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10329. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10330. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10331. do { \
  10332. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10333. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10334. } while (0)
  10335. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10336. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10337. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10338. do { \
  10339. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10340. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10341. } while (0)
  10342. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10343. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10344. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10345. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10346. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10347. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10348. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10349. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10350. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10351. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10352. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10353. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10354. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10355. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10356. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10357. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10358. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10359. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10360. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10361. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10362. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10363. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10366. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10367. } while (0)
  10368. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10369. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10370. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10371. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10374. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10375. } while (0)
  10376. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10377. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10378. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10379. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10382. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10383. } while (0)
  10384. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10385. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10386. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10387. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10388. do { \
  10389. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10390. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10391. } while (0)
  10392. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10393. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10394. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10395. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10398. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10399. } while (0)
  10400. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10401. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10402. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10403. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10404. do { \
  10405. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10406. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10407. } while (0)
  10408. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10409. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10410. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10411. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10412. do { \
  10413. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10414. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10415. } while (0)
  10416. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10417. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10418. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10419. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10420. do { \
  10421. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10422. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10423. } while (0)
  10424. /**
  10425. * @brief peer rate report message
  10426. *
  10427. * @details
  10428. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10429. * justified rate of all the peers.
  10430. *
  10431. * |31 24|23 16|15 8|7 0|
  10432. * |----------------+----------------+----------------+----------------|
  10433. * | peer_count | | msg_type |
  10434. * |-------------------------------------------------------------------|
  10435. * : Payload (variant number of peer rate report) :
  10436. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10437. * Header fields:
  10438. * - msg_type
  10439. * Bits 7:0
  10440. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10441. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10442. * - reserved
  10443. * Bits 15:8
  10444. * Purpose:
  10445. * value:
  10446. * - peer_count
  10447. * Bits 31:16
  10448. * Purpose: Specify how many peer rate report elements are present in the payload.
  10449. * value:
  10450. *
  10451. * Payload:
  10452. * There are variant number of peer rate report follow the first 32 bits.
  10453. * The peer rate report is defined as follows.
  10454. *
  10455. * |31 20|19 16|15 0|
  10456. * |-----------------------+---------+---------------------------------|-
  10457. * | reserved | phy | peer_id | \
  10458. * |-------------------------------------------------------------------| -> report #0
  10459. * | rate | /
  10460. * |-----------------------+---------+---------------------------------|-
  10461. * | reserved | phy | peer_id | \
  10462. * |-------------------------------------------------------------------| -> report #1
  10463. * | rate | /
  10464. * |-----------------------+---------+---------------------------------|-
  10465. * | reserved | phy | peer_id | \
  10466. * |-------------------------------------------------------------------| -> report #2
  10467. * | rate | /
  10468. * |-------------------------------------------------------------------|-
  10469. * : :
  10470. * : :
  10471. * : :
  10472. * :-------------------------------------------------------------------:
  10473. *
  10474. * - peer_id
  10475. * Bits 15:0
  10476. * Purpose: identify the peer
  10477. * value:
  10478. * - phy
  10479. * Bits 19:16
  10480. * Purpose: identify which phy is in use
  10481. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10482. * Please see enum htt_peer_report_phy_type for detail.
  10483. * - reserved
  10484. * Bits 31:20
  10485. * Purpose:
  10486. * value:
  10487. * - rate
  10488. * Bits 31:0
  10489. * Purpose: represent the justified rate of the peer specified by peer_id
  10490. * value:
  10491. */
  10492. enum htt_peer_rate_report_phy_type {
  10493. HTT_PEER_RATE_REPORT_11B = 0,
  10494. HTT_PEER_RATE_REPORT_11A_G,
  10495. HTT_PEER_RATE_REPORT_11N,
  10496. HTT_PEER_RATE_REPORT_11AC,
  10497. };
  10498. #define HTT_PEER_RATE_REPORT_SIZE 8
  10499. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10500. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10501. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10502. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10503. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10504. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10505. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10506. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10507. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10508. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10509. do { \
  10510. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10511. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10512. } while (0)
  10513. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10514. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10515. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10516. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10519. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10520. } while (0)
  10521. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10522. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10523. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10524. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10527. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10528. } while (0)
  10529. /**
  10530. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10531. *
  10532. * @details
  10533. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10534. * a flow of descriptors.
  10535. *
  10536. * This message is in TLV format and indicates the parameters to be setup a
  10537. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10538. * receive descriptors from a specified pool.
  10539. *
  10540. * The message would appear as follows:
  10541. *
  10542. * |31 24|23 16|15 8|7 0|
  10543. * |----------------+----------------+----------------+----------------|
  10544. * header | reserved | num_flows | msg_type |
  10545. * |-------------------------------------------------------------------|
  10546. * | |
  10547. * : payload :
  10548. * | |
  10549. * |-------------------------------------------------------------------|
  10550. *
  10551. * The header field is one DWORD long and is interpreted as follows:
  10552. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10553. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10554. * this message
  10555. * b'16-31 - reserved: These bits are reserved for future use
  10556. *
  10557. * Payload:
  10558. * The payload would contain multiple objects of the following structure. Each
  10559. * object represents a flow.
  10560. *
  10561. * |31 24|23 16|15 8|7 0|
  10562. * |----------------+----------------+----------------+----------------|
  10563. * header | reserved | num_flows | msg_type |
  10564. * |-------------------------------------------------------------------|
  10565. * payload0| flow_type |
  10566. * |-------------------------------------------------------------------|
  10567. * | flow_id |
  10568. * |-------------------------------------------------------------------|
  10569. * | reserved0 | flow_pool_id |
  10570. * |-------------------------------------------------------------------|
  10571. * | reserved1 | flow_pool_size |
  10572. * |-------------------------------------------------------------------|
  10573. * | reserved2 |
  10574. * |-------------------------------------------------------------------|
  10575. * payload1| flow_type |
  10576. * |-------------------------------------------------------------------|
  10577. * | flow_id |
  10578. * |-------------------------------------------------------------------|
  10579. * | reserved0 | flow_pool_id |
  10580. * |-------------------------------------------------------------------|
  10581. * | reserved1 | flow_pool_size |
  10582. * |-------------------------------------------------------------------|
  10583. * | reserved2 |
  10584. * |-------------------------------------------------------------------|
  10585. * | . |
  10586. * | . |
  10587. * | . |
  10588. * |-------------------------------------------------------------------|
  10589. *
  10590. * Each payload is 5 DWORDS long and is interpreted as follows:
  10591. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10592. * this flow is associated. It can be VDEV, peer,
  10593. * or tid (AC). Based on enum htt_flow_type.
  10594. *
  10595. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10596. * object. For flow_type vdev it is set to the
  10597. * vdevid, for peer it is peerid and for tid, it is
  10598. * tid_num.
  10599. *
  10600. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10601. * in the host for this flow
  10602. * b'16:31 - reserved0: This field in reserved for the future. In case
  10603. * we have a hierarchical implementation (HCM) of
  10604. * pools, it can be used to indicate the ID of the
  10605. * parent-pool.
  10606. *
  10607. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10608. * Descriptors for this flow will be
  10609. * allocated from this pool in the host.
  10610. * b'16:31 - reserved1: This field in reserved for the future. In case
  10611. * we have a hierarchical implementation of pools,
  10612. * it can be used to indicate the max number of
  10613. * descriptors in the pool. The b'0:15 can be used
  10614. * to indicate min number of descriptors in the
  10615. * HCM scheme.
  10616. *
  10617. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10618. * we have a hierarchical implementation of pools,
  10619. * b'0:15 can be used to indicate the
  10620. * priority-based borrowing (PBB) threshold of
  10621. * the flow's pool. The b'16:31 are still left
  10622. * reserved.
  10623. */
  10624. enum htt_flow_type {
  10625. FLOW_TYPE_VDEV = 0,
  10626. /* Insert new flow types above this line */
  10627. };
  10628. PREPACK struct htt_flow_pool_map_payload_t {
  10629. A_UINT32 flow_type;
  10630. A_UINT32 flow_id;
  10631. A_UINT32 flow_pool_id:16,
  10632. reserved0:16;
  10633. A_UINT32 flow_pool_size:16,
  10634. reserved1:16;
  10635. A_UINT32 reserved2;
  10636. } POSTPACK;
  10637. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10638. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10639. (sizeof(struct htt_flow_pool_map_payload_t))
  10640. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10641. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10642. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10643. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10644. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10645. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10646. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10647. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10648. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10649. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10650. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10651. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10652. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10653. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10654. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10655. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10656. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10657. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10658. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10659. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10660. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10661. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10662. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10663. do { \
  10664. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10665. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10666. } while (0)
  10667. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10668. do { \
  10669. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10670. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10671. } while (0)
  10672. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10673. do { \
  10674. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10675. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10676. } while (0)
  10677. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10678. do { \
  10679. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10680. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10681. } while (0)
  10682. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10683. do { \
  10684. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10685. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10686. } while (0)
  10687. /**
  10688. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10689. *
  10690. * @details
  10691. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10692. * down a flow of descriptors.
  10693. * This message indicates that for the flow (whose ID is provided) is wanting
  10694. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10695. * pool of descriptors from where descriptors are being allocated for this
  10696. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10697. * be unmapped by the host.
  10698. *
  10699. * The message would appear as follows:
  10700. *
  10701. * |31 24|23 16|15 8|7 0|
  10702. * |----------------+----------------+----------------+----------------|
  10703. * | reserved0 | msg_type |
  10704. * |-------------------------------------------------------------------|
  10705. * | flow_type |
  10706. * |-------------------------------------------------------------------|
  10707. * | flow_id |
  10708. * |-------------------------------------------------------------------|
  10709. * | reserved1 | flow_pool_id |
  10710. * |-------------------------------------------------------------------|
  10711. *
  10712. * The message is interpreted as follows:
  10713. * dword0 - b'0:7 - msg_type: This will be set to
  10714. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10715. * b'8:31 - reserved0: Reserved for future use
  10716. *
  10717. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10718. * this flow is associated. It can be VDEV, peer,
  10719. * or tid (AC). Based on enum htt_flow_type.
  10720. *
  10721. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10722. * object. For flow_type vdev it is set to the
  10723. * vdevid, for peer it is peerid and for tid, it is
  10724. * tid_num.
  10725. *
  10726. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10727. * used in the host for this flow
  10728. * b'16:31 - reserved0: This field in reserved for the future.
  10729. *
  10730. */
  10731. PREPACK struct htt_flow_pool_unmap_t {
  10732. A_UINT32 msg_type:8,
  10733. reserved0:24;
  10734. A_UINT32 flow_type;
  10735. A_UINT32 flow_id;
  10736. A_UINT32 flow_pool_id:16,
  10737. reserved1:16;
  10738. } POSTPACK;
  10739. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  10740. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  10741. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  10742. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  10743. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  10744. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10745. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10746. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10747. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10748. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10749. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10750. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10751. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10752. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10753. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10754. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10755. do { \
  10756. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10757. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10758. } while (0)
  10759. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10760. do { \
  10761. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  10762. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  10763. } while (0)
  10764. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  10765. do { \
  10766. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  10767. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  10768. } while (0)
  10769. /**
  10770. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  10771. *
  10772. * @details
  10773. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  10774. * SRNG ring setup is done
  10775. *
  10776. * This message indicates whether the last setup operation is successful.
  10777. * It will be sent to host when host set respose_required bit in
  10778. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  10779. * The message would appear as follows:
  10780. *
  10781. * |31 24|23 16|15 8|7 0|
  10782. * |--------------- +----------------+----------------+----------------|
  10783. * | setup_status | ring_id | pdev_id | msg_type |
  10784. * |-------------------------------------------------------------------|
  10785. *
  10786. * The message is interpreted as follows:
  10787. * dword0 - b'0:7 - msg_type: This will be set to
  10788. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  10789. * b'8:15 - pdev_id:
  10790. * 0 (for rings at SOC/UMAC level),
  10791. * 1/2/3 mac id (for rings at LMAC level)
  10792. * b'16:23 - ring_id: Identify the ring which is set up
  10793. * More details can be got from enum htt_srng_ring_id
  10794. * b'24:31 - setup_status: Indicate status of setup operation
  10795. * Refer to htt_ring_setup_status
  10796. */
  10797. PREPACK struct htt_sring_setup_done_t {
  10798. A_UINT32 msg_type: 8,
  10799. pdev_id: 8,
  10800. ring_id: 8,
  10801. setup_status: 8;
  10802. } POSTPACK;
  10803. enum htt_ring_setup_status {
  10804. htt_ring_setup_status_ok = 0,
  10805. htt_ring_setup_status_error,
  10806. };
  10807. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  10808. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  10809. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  10810. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  10811. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  10812. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  10813. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  10814. do { \
  10815. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  10816. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  10817. } while (0)
  10818. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  10819. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  10820. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  10821. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  10822. HTT_SRING_SETUP_DONE_RING_ID_S)
  10823. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  10826. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  10827. } while (0)
  10828. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  10829. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  10830. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  10831. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  10832. HTT_SRING_SETUP_DONE_STATUS_S)
  10833. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  10834. do { \
  10835. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  10836. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  10837. } while (0)
  10838. /**
  10839. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  10840. *
  10841. * @details
  10842. * HTT TX map flow entry with tqm flow pointer
  10843. * Sent from firmware to host to add tqm flow pointer in corresponding
  10844. * flow search entry. Flow metadata is replayed back to host as part of this
  10845. * struct to enable host to find the specific flow search entry
  10846. *
  10847. * The message would appear as follows:
  10848. *
  10849. * |31 28|27 18|17 14|13 8|7 0|
  10850. * |-------+------------------------------------------+----------------|
  10851. * | rsvd0 | fse_hsh_idx | msg_type |
  10852. * |-------------------------------------------------------------------|
  10853. * | rsvd1 | tid | peer_id |
  10854. * |-------------------------------------------------------------------|
  10855. * | tqm_flow_pntr_lo |
  10856. * |-------------------------------------------------------------------|
  10857. * | tqm_flow_pntr_hi |
  10858. * |-------------------------------------------------------------------|
  10859. * | fse_meta_data |
  10860. * |-------------------------------------------------------------------|
  10861. *
  10862. * The message is interpreted as follows:
  10863. *
  10864. * dword0 - b'0:7 - msg_type: This will be set to
  10865. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  10866. *
  10867. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  10868. * for this flow entry
  10869. *
  10870. * dword0 - b'28:31 - rsvd0: Reserved for future use
  10871. *
  10872. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  10873. *
  10874. * dword1 - b'14:17 - tid
  10875. *
  10876. * dword1 - b'18:31 - rsvd1: Reserved for future use
  10877. *
  10878. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  10879. *
  10880. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  10881. *
  10882. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10883. * given by host
  10884. */
  10885. PREPACK struct htt_tx_map_flow_info {
  10886. A_UINT32
  10887. msg_type: 8,
  10888. fse_hsh_idx: 20,
  10889. rsvd0: 4;
  10890. A_UINT32
  10891. peer_id: 14,
  10892. tid: 4,
  10893. rsvd1: 14;
  10894. A_UINT32 tqm_flow_pntr_lo;
  10895. A_UINT32 tqm_flow_pntr_hi;
  10896. struct htt_tx_flow_metadata fse_meta_data;
  10897. } POSTPACK;
  10898. /* DWORD 0 */
  10899. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10900. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10901. /* DWORD 1 */
  10902. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10903. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10904. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10905. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10906. /* DWORD 0 */
  10907. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10908. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10909. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10910. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10911. do { \
  10912. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10913. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10914. } while (0)
  10915. /* DWORD 1 */
  10916. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10917. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10918. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10919. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10920. do { \
  10921. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10922. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10923. } while (0)
  10924. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10925. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10926. HTT_TX_MAP_FLOW_INFO_TID_S)
  10927. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10928. do { \
  10929. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10930. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10931. } while (0)
  10932. /*
  10933. * htt_dbg_ext_stats_status -
  10934. * present - The requested stats have been delivered in full.
  10935. * This indicates that either the stats information was contained
  10936. * in its entirety within this message, or else this message
  10937. * completes the delivery of the requested stats info that was
  10938. * partially delivered through earlier STATS_CONF messages.
  10939. * partial - The requested stats have been delivered in part.
  10940. * One or more subsequent STATS_CONF messages with the same
  10941. * cookie value will be sent to deliver the remainder of the
  10942. * information.
  10943. * error - The requested stats could not be delivered, for example due
  10944. * to a shortage of memory to construct a message holding the
  10945. * requested stats.
  10946. * invalid - The requested stat type is either not recognized, or the
  10947. * target is configured to not gather the stats type in question.
  10948. */
  10949. enum htt_dbg_ext_stats_status {
  10950. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10951. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10952. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10953. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10954. };
  10955. /**
  10956. * @brief target -> host ppdu stats upload
  10957. *
  10958. * @details
  10959. * The following field definitions describe the format of the HTT target
  10960. * to host ppdu stats indication message.
  10961. *
  10962. *
  10963. * |31 16|15 12|11 10|9 8|7 0 |
  10964. * |----------------------------------------------------------------------|
  10965. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10966. * |----------------------------------------------------------------------|
  10967. * | ppdu_id |
  10968. * |----------------------------------------------------------------------|
  10969. * | Timestamp in us |
  10970. * |----------------------------------------------------------------------|
  10971. * | reserved |
  10972. * |----------------------------------------------------------------------|
  10973. * | type-specific stats info |
  10974. * | (see htt_ppdu_stats.h) |
  10975. * |----------------------------------------------------------------------|
  10976. * Header fields:
  10977. * - MSG_TYPE
  10978. * Bits 7:0
  10979. * Purpose: Identifies this is a PPDU STATS indication
  10980. * message.
  10981. * Value: 0x1d
  10982. * - mac_id
  10983. * Bits 9:8
  10984. * Purpose: mac_id of this ppdu_id
  10985. * Value: 0-3
  10986. * - pdev_id
  10987. * Bits 11:10
  10988. * Purpose: pdev_id of this ppdu_id
  10989. * Value: 0-3
  10990. * 0 (for rings at SOC level),
  10991. * 1/2/3 PDEV -> 0/1/2
  10992. * - payload_size
  10993. * Bits 31:16
  10994. * Purpose: total tlv size
  10995. * Value: payload_size in bytes
  10996. */
  10997. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10998. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10999. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11000. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11001. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11002. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11003. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11004. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11005. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11006. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11009. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11010. } while (0)
  11011. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11012. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11013. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11014. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11015. do { \
  11016. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11017. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11018. } while (0)
  11019. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11020. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11021. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11022. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11023. do { \
  11024. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11025. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11026. } while (0)
  11027. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11028. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11029. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11030. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11031. do { \
  11032. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11033. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11034. } while (0)
  11035. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11036. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11037. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11038. /* htt_t2h_ppdu_stats_ind_hdr_t
  11039. * This struct contains the fields within the header of the
  11040. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11041. * stats info.
  11042. * This struct assumes little-endian layout, and thus is only
  11043. * suitable for use within processors known to be little-endian
  11044. * (such as the target).
  11045. * In contrast, the above macros provide endian-portable methods
  11046. * to get and set the bitfields within this PPDU_STATS_IND header.
  11047. */
  11048. typedef struct {
  11049. A_UINT32 msg_type: 8, /* bits 7:0 */
  11050. mac_id: 2, /* bits 9:8 */
  11051. pdev_id: 2, /* bits 11:10 */
  11052. reserved1: 4, /* bits 15:12 */
  11053. payload_size: 16; /* bits 31:16 */
  11054. A_UINT32 ppdu_id;
  11055. A_UINT32 timestamp_us;
  11056. A_UINT32 reserved2;
  11057. } htt_t2h_ppdu_stats_ind_hdr_t;
  11058. /**
  11059. * @brief target -> host extended statistics upload
  11060. *
  11061. * @details
  11062. * The following field definitions describe the format of the HTT target
  11063. * to host stats upload confirmation message.
  11064. * The message contains a cookie echoed from the HTT host->target stats
  11065. * upload request, which identifies which request the confirmation is
  11066. * for, and a single stats can span over multiple HTT stats indication
  11067. * due to the HTT message size limitation so every HTT ext stats indication
  11068. * will have tag-length-value stats information elements.
  11069. * The tag-length header for each HTT stats IND message also includes a
  11070. * status field, to indicate whether the request for the stat type in
  11071. * question was fully met, partially met, unable to be met, or invalid
  11072. * (if the stat type in question is disabled in the target).
  11073. * A Done bit 1's indicate the end of the of stats info elements.
  11074. *
  11075. *
  11076. * |31 16|15 12|11|10 8|7 5|4 0|
  11077. * |--------------------------------------------------------------|
  11078. * | reserved | msg type |
  11079. * |--------------------------------------------------------------|
  11080. * | cookie LSBs |
  11081. * |--------------------------------------------------------------|
  11082. * | cookie MSBs |
  11083. * |--------------------------------------------------------------|
  11084. * | stats entry length | rsvd | D| S | stat type |
  11085. * |--------------------------------------------------------------|
  11086. * | type-specific stats info |
  11087. * | (see htt_stats.h) |
  11088. * |--------------------------------------------------------------|
  11089. * Header fields:
  11090. * - MSG_TYPE
  11091. * Bits 7:0
  11092. * Purpose: Identifies this is a extended statistics upload confirmation
  11093. * message.
  11094. * Value: 0x1c
  11095. * - COOKIE_LSBS
  11096. * Bits 31:0
  11097. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11098. * message with its preceding host->target stats request message.
  11099. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11100. * - COOKIE_MSBS
  11101. * Bits 31:0
  11102. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11103. * message with its preceding host->target stats request message.
  11104. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11105. *
  11106. * Stats Information Element tag-length header fields:
  11107. * - STAT_TYPE
  11108. * Bits 7:0
  11109. * Purpose: identifies the type of statistics info held in the
  11110. * following information element
  11111. * Value: htt_dbg_ext_stats_type
  11112. * - STATUS
  11113. * Bits 10:8
  11114. * Purpose: indicate whether the requested stats are present
  11115. * Value: htt_dbg_ext_stats_status
  11116. * - DONE
  11117. * Bits 11
  11118. * Purpose:
  11119. * Indicates the completion of the stats entry, this will be the last
  11120. * stats conf HTT segment for the requested stats type.
  11121. * Value:
  11122. * 0 -> the stats retrieval is ongoing
  11123. * 1 -> the stats retrieval is complete
  11124. * - LENGTH
  11125. * Bits 31:16
  11126. * Purpose: indicate the stats information size
  11127. * Value: This field specifies the number of bytes of stats information
  11128. * that follows the element tag-length header.
  11129. * It is expected but not required that this length is a multiple of
  11130. * 4 bytes.
  11131. */
  11132. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11133. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11134. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11135. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11136. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11137. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11138. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11139. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11140. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11141. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11142. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11143. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11144. do { \
  11145. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11146. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11147. } while (0)
  11148. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11149. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11150. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11151. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11152. do { \
  11153. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11154. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11155. } while (0)
  11156. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11157. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11158. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11159. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11160. do { \
  11161. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11162. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11163. } while (0)
  11164. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11165. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11166. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11167. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11168. do { \
  11169. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11170. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11171. } while (0)
  11172. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11173. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11174. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11175. typedef enum {
  11176. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11177. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11178. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11179. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11180. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11181. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11182. /* Reserved from 128 - 255 for target internal use.*/
  11183. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11184. } HTT_PEER_TYPE;
  11185. /** 2 word representation of MAC addr */
  11186. typedef struct {
  11187. /** upper 4 bytes of MAC address */
  11188. A_UINT32 mac_addr31to0;
  11189. /** lower 2 bytes of MAC address */
  11190. A_UINT32 mac_addr47to32;
  11191. } htt_mac_addr;
  11192. /** macro to convert MAC address from char array to HTT word format */
  11193. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11194. (phtt_mac_addr)->mac_addr31to0 = \
  11195. (((c_macaddr)[0] << 0) | \
  11196. ((c_macaddr)[1] << 8) | \
  11197. ((c_macaddr)[2] << 16) | \
  11198. ((c_macaddr)[3] << 24)); \
  11199. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11200. } while (0)
  11201. /**
  11202. * @brief target -> host monitor mac header indication message
  11203. *
  11204. * @details
  11205. * The following diagram shows the format of the monitor mac header message
  11206. * sent from the target to the host.
  11207. * This message is primarily sent when promiscuous rx mode is enabled.
  11208. * One message is sent per rx PPDU.
  11209. *
  11210. * |31 24|23 16|15 8|7 0|
  11211. * |-------------------------------------------------------------|
  11212. * | peer_id | reserved0 | msg_type |
  11213. * |-------------------------------------------------------------|
  11214. * | reserved1 | num_mpdu |
  11215. * |-------------------------------------------------------------|
  11216. * | struct hw_rx_desc |
  11217. * | (see wal_rx_desc.h) |
  11218. * |-------------------------------------------------------------|
  11219. * | struct ieee80211_frame_addr4 |
  11220. * | (see ieee80211_defs.h) |
  11221. * |-------------------------------------------------------------|
  11222. * | struct ieee80211_frame_addr4 |
  11223. * | (see ieee80211_defs.h) |
  11224. * |-------------------------------------------------------------|
  11225. * | ...... |
  11226. * |-------------------------------------------------------------|
  11227. *
  11228. * Header fields:
  11229. * - msg_type
  11230. * Bits 7:0
  11231. * Purpose: Identifies this is a monitor mac header indication message.
  11232. * Value: 0x20
  11233. * - peer_id
  11234. * Bits 31:16
  11235. * Purpose: Software peer id given by host during association,
  11236. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11237. * for rx PPDUs received from unassociated peers.
  11238. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11239. * - num_mpdu
  11240. * Bits 15:0
  11241. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11242. * delivered within the message.
  11243. * Value: 1 to 32
  11244. * num_mpdu is limited to a maximum value of 32, due to buffer
  11245. * size limits. For PPDUs with more than 32 MPDUs, only the
  11246. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11247. * the PPDU will be provided.
  11248. */
  11249. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11250. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11251. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11252. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11253. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11254. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11255. do { \
  11256. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11257. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11258. } while (0)
  11259. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11260. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11261. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11262. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11263. do { \
  11264. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11265. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11266. } while (0)
  11267. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11268. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11269. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11270. /**
  11271. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11272. *
  11273. * @details
  11274. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11275. * the flow pool associated with the specified ID is resized
  11276. *
  11277. * The message would appear as follows:
  11278. *
  11279. * |31 16|15 8|7 0|
  11280. * |---------------------------------+----------------+----------------|
  11281. * | reserved0 | Msg type |
  11282. * |-------------------------------------------------------------------|
  11283. * | flow pool new size | flow pool ID |
  11284. * |-------------------------------------------------------------------|
  11285. *
  11286. * The message is interpreted as follows:
  11287. * b'0:7 - msg_type: This will be set to
  11288. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11289. *
  11290. * b'0:15 - flow pool ID: Existing flow pool ID
  11291. *
  11292. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11293. *
  11294. */
  11295. PREPACK struct htt_flow_pool_resize_t {
  11296. A_UINT32 msg_type:8,
  11297. reserved0:24;
  11298. A_UINT32 flow_pool_id:16,
  11299. flow_pool_new_size:16;
  11300. } POSTPACK;
  11301. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11302. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11303. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11304. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11305. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11306. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11307. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11308. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11309. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11310. do { \
  11311. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11312. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11313. } while (0)
  11314. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11315. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11316. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11317. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11318. do { \
  11319. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11320. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11321. } while (0)
  11322. /**
  11323. * @brief host -> target channel change message
  11324. *
  11325. * @details
  11326. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11327. * to associate RX frames to correct channel they were received on.
  11328. * The following field definitions describe the format of the HTT target
  11329. * to host channel change message.
  11330. * |31 16|15 8|7 5|4 0|
  11331. * |------------------------------------------------------------|
  11332. * | reserved | MSG_TYPE |
  11333. * |------------------------------------------------------------|
  11334. * | CHAN_MHZ |
  11335. * |------------------------------------------------------------|
  11336. * | BAND_CENTER_FREQ1 |
  11337. * |------------------------------------------------------------|
  11338. * | BAND_CENTER_FREQ2 |
  11339. * |------------------------------------------------------------|
  11340. * | CHAN_PHY_MODE |
  11341. * |------------------------------------------------------------|
  11342. * Header fields:
  11343. * - MSG_TYPE
  11344. * Bits 7:0
  11345. * Value: 0xf
  11346. * - CHAN_MHZ
  11347. * Bits 31:0
  11348. * Purpose: frequency of the primary 20mhz channel.
  11349. * - BAND_CENTER_FREQ1
  11350. * Bits 31:0
  11351. * Purpose: centre frequency of the full channel.
  11352. * - BAND_CENTER_FREQ2
  11353. * Bits 31:0
  11354. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11355. * - CHAN_PHY_MODE
  11356. * Bits 31:0
  11357. * Purpose: phy mode of the channel.
  11358. */
  11359. PREPACK struct htt_chan_change_msg {
  11360. A_UINT32 chan_mhz; /* frequency in mhz */
  11361. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11362. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11363. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11364. } POSTPACK;
  11365. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11366. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11367. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11368. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11369. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11370. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11371. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11372. /*
  11373. * The read and write indices point to the data within the host buffer.
  11374. * Because the first 4 bytes of the host buffer is used for the read index and
  11375. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11376. * The read index and write index are the byte offsets from the base of the
  11377. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11378. * Refer the ASCII text picture below.
  11379. */
  11380. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11381. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11382. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11383. /*
  11384. ***************************************************************************
  11385. *
  11386. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11387. *
  11388. ***************************************************************************
  11389. *
  11390. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11391. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11392. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11393. * written into the Host memory region mentioned below.
  11394. *
  11395. * Read index is updated by the Host. At any point of time, the read index will
  11396. * indicate the index that will next be read by the Host. The read index is
  11397. * in units of bytes offset from the base of the meta-data buffer.
  11398. *
  11399. * Write index is updated by the FW. At any point of time, the write index will
  11400. * indicate from where the FW can start writing any new data. The write index is
  11401. * in units of bytes offset from the base of the meta-data buffer.
  11402. *
  11403. * If the Host is not fast enough in reading the CFR data, any new capture data
  11404. * would be dropped if there is no space left to write the new captures.
  11405. *
  11406. * The last 4 bytes of the memory region will have the magic pattern
  11407. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11408. * not overrun the host buffer.
  11409. *
  11410. * ,--------------------. read and write indices store the
  11411. * | | byte offset from the base of the
  11412. * | ,--------+--------. meta-data buffer to the next
  11413. * | | | | location within the data buffer
  11414. * | | v v that will be read / written
  11415. * ************************************************************************
  11416. * * Read * Write * * Magic *
  11417. * * index * index * CFR data1 ...... CFR data N * pattern *
  11418. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11419. * ************************************************************************
  11420. * |<---------- data buffer ---------->|
  11421. *
  11422. * |<----------------- meta-data buffer allocated in Host ----------------|
  11423. *
  11424. * Note:
  11425. * - Considering the 4 bytes needed to store the Read index (R) and the
  11426. * Write index (W), the initial value is as follows:
  11427. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11428. * - Buffer empty condition:
  11429. * R = W
  11430. *
  11431. * Regarding CFR data format:
  11432. * --------------------------
  11433. *
  11434. * Each CFR tone is stored in HW as 16-bits with the following format:
  11435. * {bits[15:12], bits[11:6], bits[5:0]} =
  11436. * {unsigned exponent (4 bits),
  11437. * signed mantissa_real (6 bits),
  11438. * signed mantissa_imag (6 bits)}
  11439. *
  11440. * CFR_real = mantissa_real * 2^(exponent-5)
  11441. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11442. *
  11443. *
  11444. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11445. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11446. *
  11447. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11448. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11449. * .
  11450. * .
  11451. * .
  11452. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11453. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11454. */
  11455. /* Bandwidth of peer CFR captures */
  11456. typedef enum {
  11457. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11458. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11459. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11460. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11461. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11462. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11463. } HTT_PEER_CFR_CAPTURE_BW;
  11464. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11465. * was captured
  11466. */
  11467. typedef enum {
  11468. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11469. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11470. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11471. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11472. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11473. } HTT_PEER_CFR_CAPTURE_MODE;
  11474. typedef enum {
  11475. /* This message type is currently used for the below purpose:
  11476. *
  11477. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11478. * wmi_peer_cfr_capture_cmd.
  11479. * If payload_present bit is set to 0 then the associated memory region
  11480. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11481. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11482. * message; the CFR dump will be present at the end of the message,
  11483. * after the chan_phy_mode.
  11484. */
  11485. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11486. /* Always keep this last */
  11487. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11488. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11489. /**
  11490. * @brief target -> host CFR dump completion indication message definition
  11491. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11492. *
  11493. * @details
  11494. * The following diagram shows the format of the Channel Frequency Response
  11495. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11496. * the channel capture of a peer is copied by Firmware into the Host memory
  11497. *
  11498. * **************************************************************************
  11499. *
  11500. * Message format when the CFR capture message type is
  11501. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11502. *
  11503. * **************************************************************************
  11504. *
  11505. * |31 16|15 |8|7 0|
  11506. * |----------------------------------------------------------------|
  11507. * header: | reserved |P| msg_type |
  11508. * word 0 | | | |
  11509. * |----------------------------------------------------------------|
  11510. * payload: | cfr_capture_msg_type |
  11511. * word 1 | |
  11512. * |----------------------------------------------------------------|
  11513. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11514. * word 2 | | | | | | | | |
  11515. * |----------------------------------------------------------------|
  11516. * | mac_addr31to0 |
  11517. * word 3 | |
  11518. * |----------------------------------------------------------------|
  11519. * | unused / reserved | mac_addr47to32 |
  11520. * word 4 | | |
  11521. * |----------------------------------------------------------------|
  11522. * | index |
  11523. * word 5 | |
  11524. * |----------------------------------------------------------------|
  11525. * | length |
  11526. * word 6 | |
  11527. * |----------------------------------------------------------------|
  11528. * | timestamp |
  11529. * word 7 | |
  11530. * |----------------------------------------------------------------|
  11531. * | counter |
  11532. * word 8 | |
  11533. * |----------------------------------------------------------------|
  11534. * | chan_mhz |
  11535. * word 9 | |
  11536. * |----------------------------------------------------------------|
  11537. * | band_center_freq1 |
  11538. * word 10 | |
  11539. * |----------------------------------------------------------------|
  11540. * | band_center_freq2 |
  11541. * word 11 | |
  11542. * |----------------------------------------------------------------|
  11543. * | chan_phy_mode |
  11544. * word 12 | |
  11545. * |----------------------------------------------------------------|
  11546. * where,
  11547. * P - payload present bit (payload_present explained below)
  11548. * req_id - memory request id (mem_req_id explained below)
  11549. * S - status field (status explained below)
  11550. * capbw - capture bandwidth (capture_bw explained below)
  11551. * mode - mode of capture (mode explained below)
  11552. * sts - space time streams (sts_count explained below)
  11553. * chbw - channel bandwidth (channel_bw explained below)
  11554. * captype - capture type (cap_type explained below)
  11555. *
  11556. * The following field definitions describe the format of the CFR dump
  11557. * completion indication sent from the target to the host
  11558. *
  11559. * Header fields:
  11560. *
  11561. * Word 0
  11562. * - msg_type
  11563. * Bits 7:0
  11564. * Purpose: Identifies this as CFR TX completion indication
  11565. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11566. * - payload_present
  11567. * Bit 8
  11568. * Purpose: Identifies how CFR data is sent to host
  11569. * Value: 0 - If CFR Payload is written to host memory
  11570. * 1 - If CFR Payload is sent as part of HTT message
  11571. * (This is the requirement for SDIO/USB where it is
  11572. * not possible to write CFR data to host memory)
  11573. * - reserved
  11574. * Bits 31:9
  11575. * Purpose: Reserved
  11576. * Value: 0
  11577. *
  11578. * Payload fields:
  11579. *
  11580. * Word 1
  11581. * - cfr_capture_msg_type
  11582. * Bits 31:0
  11583. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11584. * to specify the format used for the remainder of the message
  11585. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11586. * (currently only MSG_TYPE_1 is defined)
  11587. *
  11588. * Word 2
  11589. * - mem_req_id
  11590. * Bits 6:0
  11591. * Purpose: Contain the mem request id of the region where the CFR capture
  11592. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11593. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11594. this value is invalid)
  11595. * - status
  11596. * Bit 7
  11597. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11598. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11599. * - capture_bw
  11600. * Bits 10:8
  11601. * Purpose: Carry the bandwidth of the CFR capture
  11602. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11603. * - mode
  11604. * Bits 13:11
  11605. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11606. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11607. * - sts_count
  11608. * Bits 16:14
  11609. * Purpose: Carry the number of space time streams
  11610. * Value: Number of space time streams
  11611. * - channel_bw
  11612. * Bits 19:17
  11613. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11614. * measurement
  11615. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11616. * - cap_type
  11617. * Bits 23:20
  11618. * Purpose: Carry the type of the capture
  11619. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11620. * - vdev_id
  11621. * Bits 31:24
  11622. * Purpose: Carry the virtual device id
  11623. * Value: vdev ID
  11624. *
  11625. * Word 3
  11626. * - mac_addr31to0
  11627. * Bits 31:0
  11628. * Purpose: Contain the bits 31:0 of the peer MAC address
  11629. * Value: Bits 31:0 of the peer MAC address
  11630. *
  11631. * Word 4
  11632. * - mac_addr47to32
  11633. * Bits 15:0
  11634. * Purpose: Contain the bits 47:32 of the peer MAC address
  11635. * Value: Bits 47:32 of the peer MAC address
  11636. *
  11637. * Word 5
  11638. * - index
  11639. * Bits 31:0
  11640. * Purpose: Contain the index at which this CFR dump was written in the Host
  11641. * allocated memory. This index is the number of bytes from the base address.
  11642. * Value: Index position
  11643. *
  11644. * Word 6
  11645. * - length
  11646. * Bits 31:0
  11647. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11648. * Value: Length of the CFR capture of the peer
  11649. *
  11650. * Word 7
  11651. * - timestamp
  11652. * Bits 31:0
  11653. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11654. * clock used for this timestamp is private to the target and not visible to
  11655. * the host i.e., Host can interpret only the relative timestamp deltas from
  11656. * one message to the next, but can't interpret the absolute timestamp from a
  11657. * single message.
  11658. * Value: Timestamp in microseconds
  11659. *
  11660. * Word 8
  11661. * - counter
  11662. * Bits 31:0
  11663. * Purpose: Carry the count of the current CFR capture from FW. This is
  11664. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11665. * in host memory)
  11666. * Value: Count of the current CFR capture
  11667. *
  11668. * Word 9
  11669. * - chan_mhz
  11670. * Bits 31:0
  11671. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11672. * Value: Primary 20 channel frequency
  11673. *
  11674. * Word 10
  11675. * - band_center_freq1
  11676. * Bits 31:0
  11677. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11678. * Value: Center frequency 1 in MHz
  11679. *
  11680. * Word 11
  11681. * - band_center_freq2
  11682. * Bits 31:0
  11683. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11684. * the VDEV
  11685. * 80plus80 mode
  11686. * Value: Center frequency 2 in MHz
  11687. *
  11688. * Word 12
  11689. * - chan_phy_mode
  11690. * Bits 31:0
  11691. * Purpose: Carry the phy mode of the channel, of the VDEV
  11692. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11693. */
  11694. PREPACK struct htt_cfr_dump_ind_type_1 {
  11695. A_UINT32 mem_req_id:7,
  11696. status:1,
  11697. capture_bw:3,
  11698. mode:3,
  11699. sts_count:3,
  11700. channel_bw:3,
  11701. cap_type:4,
  11702. vdev_id:8;
  11703. htt_mac_addr addr;
  11704. A_UINT32 index;
  11705. A_UINT32 length;
  11706. A_UINT32 timestamp;
  11707. A_UINT32 counter;
  11708. struct htt_chan_change_msg chan;
  11709. } POSTPACK;
  11710. PREPACK struct htt_cfr_dump_compl_ind {
  11711. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11712. union {
  11713. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11714. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11715. /* If there is a need to change the memory layout and its associated
  11716. * HTT indication format, a new CFR capture message type can be
  11717. * introduced and added into this union.
  11718. */
  11719. };
  11720. } POSTPACK;
  11721. /*
  11722. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11723. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11724. */
  11725. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11726. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11727. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11728. do { \
  11729. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11730. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11731. } while(0)
  11732. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  11733. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  11734. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  11735. /*
  11736. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  11737. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11738. */
  11739. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  11740. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  11741. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  11742. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  11743. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  11744. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11745. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11746. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11747. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11748. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11749. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11750. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11751. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11752. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11753. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11754. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11755. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11758. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11759. } while (0)
  11760. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11761. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  11762. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  11763. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  11764. do { \
  11765. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  11766. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  11767. } while (0)
  11768. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  11769. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  11770. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  11771. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  11772. do { \
  11773. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  11774. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  11775. } while (0)
  11776. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  11777. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  11778. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  11779. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  11780. do { \
  11781. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  11782. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  11783. } while (0)
  11784. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  11785. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  11786. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  11787. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  11788. do { \
  11789. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  11790. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  11791. } while (0)
  11792. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  11793. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  11794. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  11795. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  11796. do { \
  11797. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  11798. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  11799. } while (0)
  11800. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  11801. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  11802. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  11803. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  11806. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  11807. } while (0)
  11808. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  11809. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  11810. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  11811. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  11814. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  11815. } while (0)
  11816. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  11817. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  11818. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  11819. /**
  11820. * @brief target -> host peer (PPDU) stats message
  11821. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11822. * @details
  11823. * This message is generated by FW when FW is sending stats to host
  11824. * about one or more PPDUs that the FW has transmitted to one or more peers.
  11825. * This message is sent autonomously by the target rather than upon request
  11826. * by the host.
  11827. * The following field definitions describe the format of the HTT target
  11828. * to host peer stats indication message.
  11829. *
  11830. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  11831. * or more PPDU stats records.
  11832. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  11833. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  11834. * then the message would start with the
  11835. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  11836. * below.
  11837. *
  11838. * |31 16|15|14|13 11|10 9|8|7 0|
  11839. * |-------------------------------------------------------------|
  11840. * | reserved |MSG_TYPE |
  11841. * |-------------------------------------------------------------|
  11842. * rec 0 | TLV header |
  11843. * rec 0 |-------------------------------------------------------------|
  11844. * rec 0 | ppdu successful bytes |
  11845. * rec 0 |-------------------------------------------------------------|
  11846. * rec 0 | ppdu retry bytes |
  11847. * rec 0 |-------------------------------------------------------------|
  11848. * rec 0 | ppdu failed bytes |
  11849. * rec 0 |-------------------------------------------------------------|
  11850. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  11851. * rec 0 |-------------------------------------------------------------|
  11852. * rec 0 | retried MSDUs | successful MSDUs |
  11853. * rec 0 |-------------------------------------------------------------|
  11854. * rec 0 | TX duration | failed MSDUs |
  11855. * rec 0 |-------------------------------------------------------------|
  11856. * ...
  11857. * |-------------------------------------------------------------|
  11858. * rec N | TLV header |
  11859. * rec N |-------------------------------------------------------------|
  11860. * rec N | ppdu successful bytes |
  11861. * rec N |-------------------------------------------------------------|
  11862. * rec N | ppdu retry bytes |
  11863. * rec N |-------------------------------------------------------------|
  11864. * rec N | ppdu failed bytes |
  11865. * rec N |-------------------------------------------------------------|
  11866. * rec N | peer id | S|SG| BW | BA |A|rate code|
  11867. * rec N |-------------------------------------------------------------|
  11868. * rec N | retried MSDUs | successful MSDUs |
  11869. * rec N |-------------------------------------------------------------|
  11870. * rec N | TX duration | failed MSDUs |
  11871. * rec N |-------------------------------------------------------------|
  11872. *
  11873. * where:
  11874. * A = is A-MPDU flag
  11875. * BA = block-ack failure flags
  11876. * BW = bandwidth spec
  11877. * SG = SGI enabled spec
  11878. * S = skipped rate ctrl
  11879. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  11880. *
  11881. * Header
  11882. * ------
  11883. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11884. * dword0 - b'8:31 - reserved : Reserved for future use
  11885. *
  11886. * payload include below peer_stats information
  11887. * --------------------------------------------
  11888. * @TLV : HTT_PPDU_STATS_INFO_TLV
  11889. * @tx_success_bytes : total successful bytes in the PPDU.
  11890. * @tx_retry_bytes : total retried bytes in the PPDU.
  11891. * @tx_failed_bytes : total failed bytes in the PPDU.
  11892. * @tx_ratecode : rate code used for the PPDU.
  11893. * @is_ampdu : Indicates PPDU is AMPDU or not.
  11894. * @ba_ack_failed : BA/ACK failed for this PPDU
  11895. * b00 -> BA received
  11896. * b01 -> BA failed once
  11897. * b10 -> BA failed twice, when HW retry is enabled.
  11898. * @bw : BW
  11899. * b00 -> 20 MHz
  11900. * b01 -> 40 MHz
  11901. * b10 -> 80 MHz
  11902. * b11 -> 160 MHz (or 80+80)
  11903. * @sg : SGI enabled
  11904. * @s : skipped ratectrl
  11905. * @peer_id : peer id
  11906. * @tx_success_msdus : successful MSDUs
  11907. * @tx_retry_msdus : retried MSDUs
  11908. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11909. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11910. */
  11911. /**
  11912. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11913. *
  11914. * @details
  11915. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11916. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11917. * This message will only be sent if the backpressure condition has existed
  11918. * continuously for an initial period (100 ms).
  11919. * Repeat messages with updated information will be sent after each
  11920. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11921. * This message indicates the ring id along with current head and tail index
  11922. * locations (i.e. write and read indices).
  11923. * The backpressure time indicates the time in ms for which continous
  11924. * backpressure has been observed in the ring.
  11925. *
  11926. * The message format is as follows:
  11927. *
  11928. * |31 24|23 16|15 8|7 0|
  11929. * |----------------+----------------+----------------+----------------|
  11930. * | ring_id | ring_type | pdev_id | msg_type |
  11931. * |-------------------------------------------------------------------|
  11932. * | tail_idx | head_idx |
  11933. * |-------------------------------------------------------------------|
  11934. * | backpressure_time_ms |
  11935. * |-------------------------------------------------------------------|
  11936. *
  11937. * The message is interpreted as follows:
  11938. * dword0 - b'0:7 - msg_type: This will be set to
  11939. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11940. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11941. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11942. the msg is for LMAC ring.
  11943. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11944. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11945. * htt_backpressure_lmac_ring_id. This represents
  11946. * the ring id for which continous backpressure is seen
  11947. *
  11948. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11949. * the ring indicated by the ring_id
  11950. *
  11951. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11952. * the ring indicated by the ring id
  11953. *
  11954. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11955. * backpressure has been seen in the ring
  11956. * indicated by the ring_id.
  11957. * Units = milliseconds
  11958. */
  11959. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11960. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11961. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11962. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11963. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11964. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11965. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11966. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11967. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11968. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11969. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11970. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11971. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11972. do { \
  11973. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11974. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11975. } while (0)
  11976. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11977. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11978. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11979. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11982. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11983. } while (0)
  11984. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11985. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11986. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11987. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11988. do { \
  11989. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11990. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11991. } while (0)
  11992. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11993. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11994. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11995. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11996. do { \
  11997. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11998. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11999. } while (0)
  12000. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12001. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12002. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12003. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12004. do { \
  12005. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12006. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12007. } while (0)
  12008. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12009. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12010. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12011. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12012. do { \
  12013. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12014. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12015. } while (0)
  12016. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12017. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12018. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12019. enum htt_backpressure_ring_type {
  12020. HTT_SW_RING_TYPE_UMAC,
  12021. HTT_SW_RING_TYPE_LMAC,
  12022. HTT_SW_RING_TYPE_MAX,
  12023. };
  12024. /* Ring id for which the message is sent to host */
  12025. enum htt_backpressure_umac_ringid {
  12026. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12027. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12028. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12029. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12030. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12031. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12032. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12033. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12034. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12035. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12036. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12037. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12038. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12039. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12040. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12041. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12042. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12043. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12044. HTT_SW_UMAC_RING_IDX_MAX,
  12045. };
  12046. enum htt_backpressure_lmac_ringid {
  12047. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12048. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12049. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12050. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12051. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12052. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12053. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12054. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12055. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12056. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12057. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12058. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12059. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12060. HTT_SW_LMAC_RING_IDX_MAX,
  12061. };
  12062. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12063. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12064. pdev_id: 8,
  12065. ring_type: 8, /* htt_backpressure_ring_type */
  12066. /*
  12067. * ring_id holds an enum value from either
  12068. * htt_backpressure_umac_ringid or
  12069. * htt_backpressure_lmac_ringid, based on
  12070. * the ring_type setting.
  12071. */
  12072. ring_id: 8;
  12073. A_UINT16 head_idx;
  12074. A_UINT16 tail_idx;
  12075. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12076. } POSTPACK;
  12077. /*
  12078. * Defines two 32 bit words that can be used by the target to indicate a per
  12079. * user RU allocation and rate information.
  12080. *
  12081. * This information is currently provided in the "sw_response_reference_ptr"
  12082. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12083. * "rx_ppdu_end_user_stats" TLV.
  12084. *
  12085. * VALID:
  12086. * The consumer of these words must explicitly check the valid bit,
  12087. * and only attempt interpretation of any of the remaining fields if
  12088. * the valid bit is set to 1.
  12089. *
  12090. * VERSION:
  12091. * The consumer of these words must also explicitly check the version bit,
  12092. * and only use the V0 definition if the VERSION field is set to 0.
  12093. *
  12094. * Version 1 is currently undefined, with the exception of the VALID and
  12095. * VERSION fields.
  12096. *
  12097. * Version 0:
  12098. *
  12099. * The fields below are duplicated per BW.
  12100. *
  12101. * The consumer must determine which BW field to use, based on the UL OFDMA
  12102. * PPDU BW indicated by HW.
  12103. *
  12104. * RU_START: RU26 start index for the user.
  12105. * Note that this is always using the RU26 index, regardless
  12106. * of the actual RU assigned to the user
  12107. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12108. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12109. *
  12110. * For example, 20MHz (the value in the top row is RU_START)
  12111. *
  12112. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12113. * RU Size 1 (52): | | | | | |
  12114. * RU Size 2 (106): | | | |
  12115. * RU Size 3 (242): | |
  12116. *
  12117. * RU_SIZE: Indicates the RU size, as defined by enum
  12118. * htt_ul_ofdma_user_info_ru_size.
  12119. *
  12120. * LDPC: LDPC enabled (if 0, BCC is used)
  12121. *
  12122. * DCM: DCM enabled
  12123. *
  12124. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12125. * |---------------------------------+--------------------------------|
  12126. * |Ver|Valid| FW internal |
  12127. * |---------------------------------+--------------------------------|
  12128. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12129. * |---------------------------------+--------------------------------|
  12130. */
  12131. enum htt_ul_ofdma_user_info_ru_size {
  12132. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12133. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12134. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12135. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12136. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12137. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12138. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12139. };
  12140. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12141. struct htt_ul_ofdma_user_info_v0 {
  12142. A_UINT32 word0;
  12143. A_UINT32 word1;
  12144. };
  12145. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12146. A_UINT32 w0_fw_rsvd:30; \
  12147. A_UINT32 w0_valid:1; \
  12148. A_UINT32 w0_version:1;
  12149. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12150. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12151. };
  12152. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12153. A_UINT32 w1_nss:3; \
  12154. A_UINT32 w1_mcs:4; \
  12155. A_UINT32 w1_ldpc:1; \
  12156. A_UINT32 w1_dcm:1; \
  12157. A_UINT32 w1_ru_start:7; \
  12158. A_UINT32 w1_ru_size:3; \
  12159. A_UINT32 w1_trig_type:4; \
  12160. A_UINT32 w1_unused:9;
  12161. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12162. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12163. };
  12164. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12165. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12166. union {
  12167. A_UINT32 word0;
  12168. struct {
  12169. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12170. };
  12171. };
  12172. union {
  12173. A_UINT32 word1;
  12174. struct {
  12175. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12176. };
  12177. };
  12178. } POSTPACK;
  12179. enum HTT_UL_OFDMA_TRIG_TYPE {
  12180. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12181. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12182. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12183. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12184. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12185. };
  12186. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12187. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12188. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12189. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12190. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12191. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12192. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12193. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12194. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12195. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12196. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12197. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12198. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12199. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12200. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12201. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12202. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12203. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12204. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12205. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12206. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12207. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12208. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12209. /*--- word 0 ---*/
  12210. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12211. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12212. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12213. do { \
  12214. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12215. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12216. } while (0)
  12217. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12218. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12219. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12220. do { \
  12221. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12222. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12223. } while (0)
  12224. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12225. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12226. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12227. do { \
  12228. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12229. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12230. } while (0)
  12231. /*--- word 1 ---*/
  12232. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12233. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12234. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12235. do { \
  12236. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12237. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12238. } while (0)
  12239. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12240. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12241. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12242. do { \
  12243. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12244. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12245. } while (0)
  12246. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12247. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12248. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12249. do { \
  12250. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12251. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12252. } while (0)
  12253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12254. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12256. do { \
  12257. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12258. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12259. } while (0)
  12260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12261. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12263. do { \
  12264. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12265. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12266. } while (0)
  12267. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12268. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12269. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12270. do { \
  12271. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12272. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12273. } while (0)
  12274. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12275. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12276. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12279. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12280. } while (0)
  12281. /**
  12282. * @brief target -> host channel calibration data message
  12283. * @brief host -> target channel calibration data message
  12284. *
  12285. * @details
  12286. * The following field definitions describe the format of the channel
  12287. * calibration data message sent from the target to the host when
  12288. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12289. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12290. * The message is defined as htt_chan_caldata_msg followed by a variable
  12291. * number of 32-bit character values.
  12292. *
  12293. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12294. * |------------------------------------------------------------------|
  12295. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12296. * |------------------------------------------------------------------|
  12297. * | payload size | mhz |
  12298. * |------------------------------------------------------------------|
  12299. * | center frequency 2 | center frequency 1 |
  12300. * |------------------------------------------------------------------|
  12301. * | check sum |
  12302. * |------------------------------------------------------------------|
  12303. * | payload |
  12304. * |------------------------------------------------------------------|
  12305. * message info field:
  12306. * - MSG_TYPE
  12307. * Bits 7:0
  12308. * Purpose: identifies this as a channel calibration data message
  12309. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12310. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12311. * - SUB_TYPE
  12312. * Bits 11:8
  12313. * Purpose: T2H: indicates whether target is providing chan cal data
  12314. * to the host to store, or requesting that the host
  12315. * download previously-stored data.
  12316. * H2T: indicates whether the host is providing the requested
  12317. * channel cal data, or if it is rejecting the data
  12318. * request because it does not have the requested data.
  12319. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12320. * - CHKSUM_VALID
  12321. * Bit 12
  12322. * Purpose: indicates if the checksum field is valid
  12323. * value:
  12324. * - FRAG
  12325. * Bit 19:16
  12326. * Purpose: indicates the fragment index for message
  12327. * value: 0 for first fragment, 1 for second fragment, ...
  12328. * - APPEND
  12329. * Bit 20
  12330. * Purpose: indicates if this is the last fragment
  12331. * value: 0 = final fragment, 1 = more fragments will be appended
  12332. *
  12333. * channel and payload size field
  12334. * - MHZ
  12335. * Bits 15:0
  12336. * Purpose: indicates the channel primary frequency
  12337. * Value:
  12338. * - PAYLOAD_SIZE
  12339. * Bits 31:16
  12340. * Purpose: indicates the bytes of calibration data in payload
  12341. * Value:
  12342. *
  12343. * center frequency field
  12344. * - CENTER FREQUENCY 1
  12345. * Bits 15:0
  12346. * Purpose: indicates the channel center frequency
  12347. * Value: channel center frequency, in MHz units
  12348. * - CENTER FREQUENCY 2
  12349. * Bits 31:16
  12350. * Purpose: indicates the secondary channel center frequency,
  12351. * only for 11acvht 80plus80 mode
  12352. * Value: secondary channel center frequeny, in MHz units, if applicable
  12353. *
  12354. * checksum field
  12355. * - CHECK_SUM
  12356. * Bits 31:0
  12357. * Purpose: check the payload data, it is just for this fragment.
  12358. * This is intended for the target to check that the channel
  12359. * calibration data returned by the host is the unmodified data
  12360. * that was previously provided to the host by the target.
  12361. * value: checksum of fragment payload
  12362. */
  12363. PREPACK struct htt_chan_caldata_msg {
  12364. /* DWORD 0: message info */
  12365. A_UINT32
  12366. msg_type: 8,
  12367. sub_type: 4 ,
  12368. chksum_valid: 1, /** 1:valid, 0:invalid */
  12369. reserved1: 3,
  12370. frag_idx: 4, /** fragment index for calibration data */
  12371. appending: 1, /** 0: no fragment appending,
  12372. * 1: extra fragment appending */
  12373. reserved2: 11;
  12374. /* DWORD 1: channel and payload size */
  12375. A_UINT32
  12376. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12377. payload_size: 16; /** unit: bytes */
  12378. /* DWORD 2: center frequency */
  12379. A_UINT32
  12380. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12381. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12382. * valid only for 11acvht 80plus80 mode */
  12383. /* DWORD 3: check sum */
  12384. A_UINT32 chksum;
  12385. /* variable length for calibration data */
  12386. A_UINT32 payload[1/* or more */];
  12387. } POSTPACK;
  12388. /* T2H SUBTYPE */
  12389. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12390. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12391. /* H2T SUBTYPE */
  12392. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12393. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12394. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12395. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12396. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12397. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12398. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12399. do { \
  12400. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12401. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12402. } while (0)
  12403. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12404. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12405. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12406. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12407. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12408. do { \
  12409. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12410. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12411. } while (0)
  12412. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12413. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12414. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12415. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12416. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12417. do { \
  12418. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12419. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12420. } while (0)
  12421. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12422. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12423. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12424. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12425. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12426. do { \
  12427. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12428. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12429. } while (0)
  12430. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12431. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12432. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12433. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12434. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12437. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12438. } while (0)
  12439. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12440. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12441. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12442. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12443. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12444. do { \
  12445. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12446. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12447. } while (0)
  12448. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12449. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12450. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12451. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12452. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12453. do { \
  12454. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12455. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12456. } while (0)
  12457. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12458. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12459. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12460. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12461. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12462. do { \
  12463. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12464. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12465. } while (0)
  12466. #endif