htt.h 466 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295
  1. /*
  2. * Copyright (c) 2011-2017 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_MSG_TYPE_PACKETLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. */
  158. #define HTT_CURRENT_VERSION_MAJOR 3
  159. #define HTT_CURRENT_VERSION_MINOR 47
  160. #define HTT_NUM_TX_FRAG_DESC 1024
  161. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  162. #define HTT_CHECK_SET_VAL(field, val) \
  163. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  164. /* macros to assist in sign-extending fields from HTT messages */
  165. #define HTT_SIGN_BIT_MASK(field) \
  166. ((field ## _M + (1 << field ## _S)) >> 1)
  167. #define HTT_SIGN_BIT(_val, field) \
  168. (_val & HTT_SIGN_BIT_MASK(field))
  169. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  170. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  171. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  172. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  173. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  174. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  175. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  176. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  177. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  178. /*
  179. * TEMPORARY:
  180. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  181. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  182. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  183. * updated.
  184. */
  185. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  186. /*
  187. * TEMPORARY:
  188. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  189. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  190. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  191. * updated.
  192. */
  193. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  194. /* HTT Access Category values */
  195. enum HTT_AC_WMM {
  196. /* WMM Access Categories */
  197. HTT_AC_WMM_BE = 0x0,
  198. HTT_AC_WMM_BK = 0x1,
  199. HTT_AC_WMM_VI = 0x2,
  200. HTT_AC_WMM_VO = 0x3,
  201. /* extension Access Categories */
  202. HTT_AC_EXT_NON_QOS = 0x4,
  203. HTT_AC_EXT_UCAST_MGMT = 0x5,
  204. HTT_AC_EXT_MCAST_DATA = 0x6,
  205. HTT_AC_EXT_MCAST_MGMT = 0x7,
  206. };
  207. enum HTT_AC_WMM_MASK {
  208. /* WMM Access Categories */
  209. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  210. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  211. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  212. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  213. /* extension Access Categories */
  214. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  215. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  216. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  217. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  218. };
  219. #define HTT_AC_MASK_WMM \
  220. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  221. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  222. #define HTT_AC_MASK_EXT \
  223. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  224. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  225. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  226. /*
  227. * htt_dbg_stats_type -
  228. * bit positions for each stats type within a stats type bitmask
  229. * The bitmask contains 24 bits.
  230. */
  231. enum htt_dbg_stats_type {
  232. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  233. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  234. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  235. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  236. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  237. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  238. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  239. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  240. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  241. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  242. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  243. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  244. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  245. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  246. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  247. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  248. /* bits 16-23 currently reserved */
  249. /* keep this last */
  250. HTT_DBG_NUM_STATS
  251. };
  252. /*=== HTT option selection TLVs ===
  253. * Certain HTT messages have alternatives or options.
  254. * For such cases, the host and target need to agree on which option to use.
  255. * Option specification TLVs can be appended to the VERSION_REQ and
  256. * VERSION_CONF messages to select options other than the default.
  257. * These TLVs are entirely optional - if they are not provided, there is a
  258. * well-defined default for each option. If they are provided, they can be
  259. * provided in any order. Each TLV can be present or absent independent of
  260. * the presence / absence of other TLVs.
  261. *
  262. * The HTT option selection TLVs use the following format:
  263. * |31 16|15 8|7 0|
  264. * |---------------------------------+----------------+----------------|
  265. * | value (payload) | length | tag |
  266. * |-------------------------------------------------------------------|
  267. * The value portion need not be only 2 bytes; it can be extended by any
  268. * integer number of 4-byte units. The total length of the TLV, including
  269. * the tag and length fields, must be a multiple of 4 bytes. The length
  270. * field specifies the total TLV size in 4-byte units. Thus, the typical
  271. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  272. * field, would store 0x1 in its length field, to show that the TLV occupies
  273. * a single 4-byte unit.
  274. */
  275. /*--- TLV header format - applies to all HTT option TLVs ---*/
  276. enum HTT_OPTION_TLV_TAGS {
  277. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  278. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  279. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  280. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  281. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  282. };
  283. PREPACK struct htt_option_tlv_header_t {
  284. A_UINT8 tag;
  285. A_UINT8 length;
  286. } POSTPACK;
  287. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  288. #define HTT_OPTION_TLV_TAG_S 0
  289. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  290. #define HTT_OPTION_TLV_LENGTH_S 8
  291. /*
  292. * value0 - 16 bit value field stored in word0
  293. * The TLV's value field may be longer than 2 bytes, in which case
  294. * the remainder of the value is stored in word1, word2, etc.
  295. */
  296. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  297. #define HTT_OPTION_TLV_VALUE0_S 16
  298. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  299. do { \
  300. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  301. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  302. } while (0)
  303. #define HTT_OPTION_TLV_TAG_GET(word) \
  304. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  305. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  306. do { \
  307. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  308. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  309. } while (0)
  310. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  311. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  312. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  313. do { \
  314. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  315. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  316. } while (0)
  317. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  318. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  319. /*--- format of specific HTT option TLVs ---*/
  320. /*
  321. * HTT option TLV for specifying LL bus address size
  322. * Some chips require bus addresses used by the target to access buffers
  323. * within the host's memory to be 32 bits; others require bus addresses
  324. * used by the target to access buffers within the host's memory to be
  325. * 64 bits.
  326. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  327. * a suffix to the VERSION_CONF message to specify which bus address format
  328. * the target requires.
  329. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  330. * default to providing bus addresses to the target in 32-bit format.
  331. */
  332. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  333. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  334. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  335. };
  336. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  337. struct htt_option_tlv_header_t hdr;
  338. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  339. } POSTPACK;
  340. /*
  341. * HTT option TLV for specifying whether HL systems should indicate
  342. * over-the-air tx completion for individual frames, or should instead
  343. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  344. * requests an OTA tx completion for a particular tx frame.
  345. * This option does not apply to LL systems, where the TX_COMPL_IND
  346. * is mandatory.
  347. * This option is primarily intended for HL systems in which the tx frame
  348. * downloads over the host --> target bus are as slow as or slower than
  349. * the transmissions over the WLAN PHY. For cases where the bus is faster
  350. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  351. * and consquently will send one TX_COMPL_IND message that covers several
  352. * tx frames. For cases where the WLAN PHY is faster than the bus,
  353. * the target will end up transmitting very short A-MPDUs, and consequently
  354. * sending many TX_COMPL_IND messages, which each cover a very small number
  355. * of tx frames.
  356. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  357. * a suffix to the VERSION_REQ message to request whether the host desires to
  358. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  359. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  360. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  361. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  362. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  363. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  364. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  365. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  366. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  367. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  368. * TLV.
  369. */
  370. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  371. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  372. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  373. };
  374. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  375. struct htt_option_tlv_header_t hdr;
  376. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  377. } POSTPACK;
  378. /*
  379. * HTT option TLV for specifying how many tx queue groups the target
  380. * may establish.
  381. * This TLV specifies the maximum value the target may send in the
  382. * txq_group_id field of any TXQ_GROUP information elements sent by
  383. * the target to the host. This allows the host to pre-allocate an
  384. * appropriate number of tx queue group structs.
  385. *
  386. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  387. * a suffix to the VERSION_REQ message to specify whether the host supports
  388. * tx queue groups at all, and if so if there is any limit on the number of
  389. * tx queue groups that the host supports.
  390. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  391. * a suffix to the VERSION_CONF message. If the host has specified in the
  392. * VER_REQ message a limit on the number of tx queue groups the host can
  393. * supprt, the target shall limit its specification of the maximum tx groups
  394. * to be no larger than this host-specified limit.
  395. *
  396. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  397. * shall preallocate 4 tx queue group structs, and the target shall not
  398. * specify a txq_group_id larger than 3.
  399. */
  400. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  401. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  402. /*
  403. * values 1 through N specify the max number of tx queue groups
  404. * the sender supports
  405. */
  406. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  407. };
  408. /* TEMPORARY backwards-compatibility alias for a typo fix -
  409. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  410. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  411. * to support the old name (with the typo) until all references to the
  412. * old name are replaced with the new name.
  413. */
  414. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  415. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  416. struct htt_option_tlv_header_t hdr;
  417. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  418. } POSTPACK;
  419. /*
  420. * HTT option TLV for specifying whether the target supports an extended
  421. * version of the HTT tx descriptor. If the target provides this TLV
  422. * and specifies in the TLV that the target supports an extended version
  423. * of the HTT tx descriptor, the target must check the "extension" bit in
  424. * the HTT tx descriptor, and if the extension bit is set, to expect a
  425. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  426. * descriptor. Furthermore, the target must provide room for the HTT
  427. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  428. * This option is intended for systems where the host needs to explicitly
  429. * control the transmission parameters such as tx power for individual
  430. * tx frames.
  431. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  432. * as a suffix to the VERSION_CONF message to explicitly specify whether
  433. * the target supports the HTT tx MSDU extension descriptor.
  434. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  435. * by the host as lack of target support for the HTT tx MSDU extension
  436. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  437. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  438. * the HTT tx MSDU extension descriptor.
  439. * The host is not required to provide the HTT tx MSDU extension descriptor
  440. * just because the target supports it; the target must check the
  441. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  442. * extension descriptor is present.
  443. */
  444. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  445. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  446. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  447. };
  448. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  449. struct htt_option_tlv_header_t hdr;
  450. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  451. } POSTPACK;
  452. /*=== host -> target messages ===============================================*/
  453. enum htt_h2t_msg_type {
  454. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  455. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  456. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  457. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  458. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  459. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  460. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  461. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  462. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  463. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  464. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  465. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  466. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  467. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  468. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  469. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  470. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  471. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  472. /* keep this last */
  473. HTT_H2T_NUM_MSGS
  474. };
  475. /*
  476. * HTT host to target message type -
  477. * stored in bits 7:0 of the first word of the message
  478. */
  479. #define HTT_H2T_MSG_TYPE_M 0xff
  480. #define HTT_H2T_MSG_TYPE_S 0
  481. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  482. do { \
  483. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  484. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  485. } while (0)
  486. #define HTT_H2T_MSG_TYPE_GET(word) \
  487. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  488. /**
  489. * @brief host -> target version number request message definition
  490. *
  491. * |31 24|23 16|15 8|7 0|
  492. * |----------------+----------------+----------------+----------------|
  493. * | reserved | msg type |
  494. * |-------------------------------------------------------------------|
  495. * : option request TLV (optional) |
  496. * :...................................................................:
  497. *
  498. * The VER_REQ message may consist of a single 4-byte word, or may be
  499. * extended with TLVs that specify which HTT options the host is requesting
  500. * from the target.
  501. * The following option TLVs may be appended to the VER_REQ message:
  502. * - HL_SUPPRESS_TX_COMPL_IND
  503. * - HL_MAX_TX_QUEUE_GROUPS
  504. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  505. * may be appended to the VER_REQ message (but only one TLV of each type).
  506. *
  507. * Header fields:
  508. * - MSG_TYPE
  509. * Bits 7:0
  510. * Purpose: identifies this as a version number request message
  511. * Value: 0x0
  512. */
  513. #define HTT_VER_REQ_BYTES 4
  514. /* TBDXXX: figure out a reasonable number */
  515. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  516. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  517. /**
  518. * @brief HTT tx MSDU descriptor
  519. *
  520. * @details
  521. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  522. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  523. * the target firmware needs for the FW's tx processing, particularly
  524. * for creating the HW msdu descriptor.
  525. * The same HTT tx descriptor is used for HL and LL systems, though
  526. * a few fields within the tx descriptor are used only by LL or
  527. * only by HL.
  528. * The HTT tx descriptor is defined in two manners: by a struct with
  529. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  530. * definitions.
  531. * The target should use the struct def, for simplicitly and clarity,
  532. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  533. * neutral. Specifically, the host shall use the get/set macros built
  534. * around the mask + shift defs.
  535. */
  536. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  537. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  538. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  539. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  544. #define HTT_TX_VDEV_ID_WORD 0
  545. #define HTT_TX_VDEV_ID_MASK 0x3f
  546. #define HTT_TX_VDEV_ID_SHIFT 16
  547. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  548. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  549. #define HTT_TX_MSDU_LEN_DWORD 1
  550. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  551. /*
  552. * HTT_VAR_PADDR macros
  553. * Allow physical / bus addresses to be either a single 32-bit value,
  554. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  555. */
  556. #define HTT_VAR_PADDR32(var_name) \
  557. A_UINT32 var_name
  558. #define HTT_VAR_PADDR64_LE(var_name) \
  559. struct { \
  560. /* little-endian: lo precedes hi */ \
  561. A_UINT32 lo; \
  562. A_UINT32 hi; \
  563. } var_name
  564. /*
  565. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  566. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  567. * addresses are stored in a XXX-bit field.
  568. * This macro is used to define both htt_tx_msdu_desc32_t and
  569. * htt_tx_msdu_desc64_t structs.
  570. */
  571. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  572. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  573. { \
  574. /* DWORD 0: flags and meta-data */ \
  575. A_UINT32 \
  576. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  577. \
  578. /* pkt_subtype - \
  579. * Detailed specification of the tx frame contents, extending the \
  580. * general specification provided by pkt_type. \
  581. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  582. * pkt_type | pkt_subtype \
  583. * ============================================================== \
  584. * 802.3 | bit 0:3 - Reserved \
  585. * | bit 4: 0x0 - Copy-Engine Classification Results \
  586. * | not appended to the HTT message \
  587. * | 0x1 - Copy-Engine Classification Results \
  588. * | appended to the HTT message in the \
  589. * | format: \
  590. * | [HTT tx desc, frame header, \
  591. * | CE classification results] \
  592. * | The CE classification results begin \
  593. * | at the next 4-byte boundary after \
  594. * | the frame header. \
  595. * ------------+------------------------------------------------- \
  596. * Eth2 | bit 0:3 - Reserved \
  597. * | bit 4: 0x0 - Copy-Engine Classification Results \
  598. * | not appended to the HTT message \
  599. * | 0x1 - Copy-Engine Classification Results \
  600. * | appended to the HTT message. \
  601. * | See the above specification of the \
  602. * | CE classification results location. \
  603. * ------------+------------------------------------------------- \
  604. * native WiFi | bit 0:3 - Reserved \
  605. * | bit 4: 0x0 - Copy-Engine Classification Results \
  606. * | not appended to the HTT message \
  607. * | 0x1 - Copy-Engine Classification Results \
  608. * | appended to the HTT message. \
  609. * | See the above specification of the \
  610. * | CE classification results location. \
  611. * ------------+------------------------------------------------- \
  612. * mgmt | 0x0 - 802.11 MAC header absent \
  613. * | 0x1 - 802.11 MAC header present \
  614. * ------------+------------------------------------------------- \
  615. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  616. * | 0x1 - 802.11 MAC header present \
  617. * | bit 1: 0x0 - allow aggregation \
  618. * | 0x1 - don't allow aggregation \
  619. * | bit 2: 0x0 - perform encryption \
  620. * | 0x1 - don't perform encryption \
  621. * | bit 3: 0x0 - perform tx classification / queuing \
  622. * | 0x1 - don't perform tx classification; \
  623. * | insert the frame into the "misc" \
  624. * | tx queue \
  625. * | bit 4: 0x0 - Copy-Engine Classification Results \
  626. * | not appended to the HTT message \
  627. * | 0x1 - Copy-Engine Classification Results \
  628. * | appended to the HTT message. \
  629. * | See the above specification of the \
  630. * | CE classification results location. \
  631. */ \
  632. pkt_subtype: 5, \
  633. \
  634. /* pkt_type - \
  635. * General specification of the tx frame contents. \
  636. * The htt_pkt_type enum should be used to specify and check the \
  637. * value of this field. \
  638. */ \
  639. pkt_type: 3, \
  640. \
  641. /* vdev_id - \
  642. * ID for the vdev that is sending this tx frame. \
  643. * For certain non-standard packet types, e.g. pkt_type == raw \
  644. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  645. * This field is used primarily for determining where to queue \
  646. * broadcast and multicast frames. \
  647. */ \
  648. vdev_id: 6, \
  649. /* ext_tid - \
  650. * The extended traffic ID. \
  651. * If the TID is unknown, the extended TID is set to \
  652. * HTT_TX_EXT_TID_INVALID. \
  653. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  654. * value of the QoS TID. \
  655. * If the tx frame is non-QoS data, then the extended TID is set to \
  656. * HTT_TX_EXT_TID_NON_QOS. \
  657. * If the tx frame is multicast or broadcast, then the extended TID \
  658. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  659. */ \
  660. ext_tid: 5, \
  661. \
  662. /* postponed - \
  663. * This flag indicates whether the tx frame has been downloaded to \
  664. * the target before but discarded by the target, and now is being \
  665. * downloaded again; or if this is a new frame that is being \
  666. * downloaded for the first time. \
  667. * This flag allows the target to determine the correct order for \
  668. * transmitting new vs. old frames. \
  669. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  670. * This flag only applies to HL systems, since in LL systems, \
  671. * the tx flow control is handled entirely within the target. \
  672. */ \
  673. postponed: 1, \
  674. \
  675. /* extension - \
  676. * This flag indicates whether a HTT tx MSDU extension descriptor \
  677. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  678. * \
  679. * 0x0 - no extension MSDU descriptor is present \
  680. * 0x1 - an extension MSDU descriptor immediately follows the \
  681. * regular MSDU descriptor \
  682. */ \
  683. extension: 1, \
  684. \
  685. /* cksum_offload - \
  686. * This flag indicates whether checksum offload is enabled or not \
  687. * for this frame. Target FW use this flag to turn on HW checksumming \
  688. * 0x0 - No checksum offload \
  689. * 0x1 - L3 header checksum only \
  690. * 0x2 - L4 checksum only \
  691. * 0x3 - L3 header checksum + L4 checksum \
  692. */ \
  693. cksum_offload: 2, \
  694. \
  695. /* tx_comp_req - \
  696. * This flag indicates whether Tx Completion \
  697. * from fw is required or not. \
  698. * This flag is only relevant if tx completion is not \
  699. * universally enabled. \
  700. * For all LL systems, tx completion is mandatory, \
  701. * so this flag will be irrelevant. \
  702. * For HL systems tx completion is optional, but HL systems in which \
  703. * the bus throughput exceeds the WLAN throughput will \
  704. * probably want to always use tx completion, and thus \
  705. * would not check this flag. \
  706. * This flag is required when tx completions are not used universally, \
  707. * but are still required for certain tx frames for which \
  708. * an OTA delivery acknowledgment is needed by the host. \
  709. * In practice, this would be for HL systems in which the \
  710. * bus throughput is less than the WLAN throughput. \
  711. * \
  712. * 0x0 - Tx Completion Indication from Fw not required \
  713. * 0x1 - Tx Completion Indication from Fw is required \
  714. */ \
  715. tx_compl_req: 1; \
  716. \
  717. \
  718. /* DWORD 1: MSDU length and ID */ \
  719. A_UINT32 \
  720. len: 16, /* MSDU length, in bytes */ \
  721. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  722. * and this id is used to calculate fragmentation \
  723. * descriptor pointer inside the target based on \
  724. * the base address, configured inside the target. \
  725. */ \
  726. \
  727. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  728. /* frags_desc_ptr - \
  729. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  730. * where the tx frame's fragments reside in memory. \
  731. * This field only applies to LL systems, since in HL systems the \
  732. * (degenerate single-fragment) fragmentation descriptor is created \
  733. * within the target. \
  734. */ \
  735. _paddr__frags_desc_ptr_; \
  736. \
  737. /* DWORD 3 (or 4): peerid, chanfreq */ \
  738. /* \
  739. * Peer ID : Target can use this value to know which peer-id packet \
  740. * destined to. \
  741. * It's intended to be specified by host in case of NAWDS. \
  742. */ \
  743. A_UINT16 peerid; \
  744. \
  745. /* \
  746. * Channel frequency: This identifies the desired channel \
  747. * frequency (in mhz) for tx frames. This is used by FW to help \
  748. * determine when it is safe to transmit or drop frames for \
  749. * off-channel operation. \
  750. * The default value of zero indicates to FW that the corresponding \
  751. * VDEV's home channel (if there is one) is the desired channel \
  752. * frequency. \
  753. */ \
  754. A_UINT16 chanfreq; \
  755. \
  756. /* Reason reserved is commented is increasing the htt structure size \
  757. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  758. * A_UINT32 reserved_dword3_bits0_31; \
  759. */ \
  760. } POSTPACK
  761. /* define a htt_tx_msdu_desc32_t type */
  762. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  763. /* define a htt_tx_msdu_desc64_t type */
  764. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  765. /*
  766. * Make htt_tx_msdu_desc_t be an alias for either
  767. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  768. */
  769. #if HTT_PADDR64
  770. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  771. #else
  772. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  773. #endif
  774. /* decriptor information for Management frame*/
  775. /*
  776. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  777. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  778. */
  779. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  780. extern A_UINT32 mgmt_hdr_len;
  781. PREPACK struct htt_mgmt_tx_desc_t {
  782. A_UINT32 msg_type;
  783. #if HTT_PADDR64
  784. A_UINT64 frag_paddr; /* DMAble address of the data */
  785. #else
  786. A_UINT32 frag_paddr; /* DMAble address of the data */
  787. #endif
  788. A_UINT32 desc_id; /* returned to host during completion
  789. * to free the meory*/
  790. A_UINT32 len; /* Fragment length */
  791. A_UINT32 vdev_id; /* virtual device ID*/
  792. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  793. } POSTPACK;
  794. PREPACK struct htt_mgmt_tx_compl_ind {
  795. A_UINT32 desc_id;
  796. A_UINT32 status;
  797. } POSTPACK;
  798. /*
  799. * This SDU header size comes from the summation of the following:
  800. * 1. Max of:
  801. * a. Native WiFi header, for native WiFi frames: 24 bytes
  802. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  803. * b. 802.11 header, for raw frames: 36 bytes
  804. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  805. * QoS header, HT header)
  806. * c. 802.3 header, for ethernet frames: 14 bytes
  807. * (destination address, source address, ethertype / length)
  808. * 2. Max of:
  809. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  810. * b. IPv6 header, up through the Traffic Class: 2 bytes
  811. * 3. 802.1Q VLAN header: 4 bytes
  812. * 4. LLC/SNAP header: 8 bytes
  813. */
  814. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  815. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  816. #define HTT_TX_HDR_SIZE_ETHERNET 14
  817. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  818. A_COMPILE_TIME_ASSERT(
  819. htt_encap_hdr_size_max_check_nwifi,
  820. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  821. A_COMPILE_TIME_ASSERT(
  822. htt_encap_hdr_size_max_check_enet,
  823. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  824. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  825. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  826. #define HTT_TX_HDR_SIZE_802_1Q 4
  827. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  828. #define HTT_COMMON_TX_FRM_HDR_LEN \
  829. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  830. HTT_TX_HDR_SIZE_802_1Q + \
  831. HTT_TX_HDR_SIZE_LLC_SNAP)
  832. #define HTT_HL_TX_FRM_HDR_LEN \
  833. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  834. #define HTT_LL_TX_FRM_HDR_LEN \
  835. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  836. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  837. /* dword 0 */
  838. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  839. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  840. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  841. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  842. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  843. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  844. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  845. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  846. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  847. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  848. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  849. #define HTT_TX_DESC_PKT_TYPE_S 13
  850. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  851. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  852. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  853. #define HTT_TX_DESC_VDEV_ID_S 16
  854. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  855. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  856. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  857. #define HTT_TX_DESC_EXT_TID_S 22
  858. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  859. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  860. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  861. #define HTT_TX_DESC_POSTPONED_S 27
  862. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  863. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  865. #define HTT_TX_DESC_EXTENSION_S 28
  866. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  869. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  870. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  873. #define HTT_TX_DESC_TX_COMP_S 31
  874. /* dword 1 */
  875. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  876. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  877. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  878. #define HTT_TX_DESC_FRM_LEN_S 0
  879. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  880. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  881. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  882. #define HTT_TX_DESC_FRM_ID_S 16
  883. /* dword 2 */
  884. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  885. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  886. /* for systems using 64-bit format for bus addresses */
  887. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  888. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  889. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  891. /* for systems using 32-bit format for bus addresses */
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  894. /* dword 3 */
  895. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  896. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  897. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  898. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  899. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  900. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  901. #if HTT_PADDR64
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  904. #else
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  907. #endif
  908. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  909. #define HTT_TX_DESC_PEER_ID_S 0
  910. /*
  911. * TEMPORARY:
  912. * The original definitions for the PEER_ID fields contained typos
  913. * (with _DESC_PADDR appended to this PEER_ID field name).
  914. * Retain deprecated original names for PEER_ID fields until all code that
  915. * refers to them has been updated.
  916. */
  917. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  918. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  919. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  920. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  921. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  922. HTT_TX_DESC_PEER_ID_M
  923. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  924. HTT_TX_DESC_PEER_ID_S
  925. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  926. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  927. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  928. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  929. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  930. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  931. #if HTT_PADDR64
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  934. #else
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  937. #endif
  938. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  939. #define HTT_TX_DESC_CHAN_FREQ_S 16
  940. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  941. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  942. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  943. do { \
  944. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  945. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  946. } while (0)
  947. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  948. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  949. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  950. do { \
  951. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  952. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  953. } while (0)
  954. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  955. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  956. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  957. do { \
  958. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  959. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  960. } while (0)
  961. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  962. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  963. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  964. do { \
  965. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  966. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  967. } while (0)
  968. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  969. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  970. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  971. do { \
  972. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  973. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  974. } while (0)
  975. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  976. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  977. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  983. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  984. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  990. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  991. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  997. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  998. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1005. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1012. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1019. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1026. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1030. } while (0)
  1031. /* enums used in the HTT tx MSDU extension descriptor */
  1032. enum {
  1033. htt_tx_guard_interval_regular = 0,
  1034. htt_tx_guard_interval_short = 1,
  1035. };
  1036. enum {
  1037. htt_tx_preamble_type_ofdm = 0,
  1038. htt_tx_preamble_type_cck = 1,
  1039. htt_tx_preamble_type_ht = 2,
  1040. htt_tx_preamble_type_vht = 3,
  1041. };
  1042. enum {
  1043. htt_tx_bandwidth_5MHz = 0,
  1044. htt_tx_bandwidth_10MHz = 1,
  1045. htt_tx_bandwidth_20MHz = 2,
  1046. htt_tx_bandwidth_40MHz = 3,
  1047. htt_tx_bandwidth_80MHz = 4,
  1048. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1049. };
  1050. /**
  1051. * @brief HTT tx MSDU extension descriptor
  1052. * @details
  1053. * If the target supports HTT tx MSDU extension descriptors, the host has
  1054. * the option of appending the following struct following the regular
  1055. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1056. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1057. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1058. * tx specs for each frame.
  1059. */
  1060. PREPACK struct htt_tx_msdu_desc_ext_t {
  1061. /* DWORD 0: flags */
  1062. A_UINT32
  1063. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1064. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1065. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1066. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1067. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1068. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1069. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1070. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1071. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1072. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1073. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1074. /* DWORD 1: tx power, tx rate, tx BW */
  1075. A_UINT32
  1076. /* pwr -
  1077. * Specify what power the tx frame needs to be transmitted at.
  1078. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1079. * The value needs to be appropriately sign-extended when extracting
  1080. * the value from the message and storing it in a variable that is
  1081. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1082. * automatically handles this sign-extension.)
  1083. * If the transmission uses multiple tx chains, this power spec is
  1084. * the total transmit power, assuming incoherent combination of
  1085. * per-chain power to produce the total power.
  1086. */
  1087. pwr: 8,
  1088. /* mcs_mask -
  1089. * Specify the allowable values for MCS index (modulation and coding)
  1090. * to use for transmitting the frame.
  1091. *
  1092. * For HT / VHT preamble types, this mask directly corresponds to
  1093. * the HT or VHT MCS indices that are allowed. For each bit N set
  1094. * within the mask, MCS index N is allowed for transmitting the frame.
  1095. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1096. * rates versus OFDM rates, so the host has the option of specifying
  1097. * that the target must transmit the frame with CCK or OFDM rates
  1098. * (not HT or VHT), but leaving the decision to the target whether
  1099. * to use CCK or OFDM.
  1100. *
  1101. * For CCK and OFDM, the bits within this mask are interpreted as
  1102. * follows:
  1103. * bit 0 -> CCK 1 Mbps rate is allowed
  1104. * bit 1 -> CCK 2 Mbps rate is allowed
  1105. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1106. * bit 3 -> CCK 11 Mbps rate is allowed
  1107. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1108. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1109. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1110. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1111. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1112. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1113. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1114. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1115. *
  1116. * The MCS index specification needs to be compatible with the
  1117. * bandwidth mask specification. For example, a MCS index == 9
  1118. * specification is inconsistent with a preamble type == VHT,
  1119. * Nss == 1, and channel bandwidth == 20 MHz.
  1120. *
  1121. * Furthermore, the host has only a limited ability to specify to
  1122. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1123. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1124. */
  1125. mcs_mask: 12,
  1126. /* nss_mask -
  1127. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1128. * Each bit in this mask corresponds to a Nss value:
  1129. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1130. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1131. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1132. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1133. * The values in the Nss mask must be suitable for the recipient, e.g.
  1134. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1135. * recipient which only supports 2x2 MIMO.
  1136. */
  1137. nss_mask: 4,
  1138. /* guard_interval -
  1139. * Specify a htt_tx_guard_interval enum value to indicate whether
  1140. * the transmission should use a regular guard interval or a
  1141. * short guard interval.
  1142. */
  1143. guard_interval: 1,
  1144. /* preamble_type_mask -
  1145. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1146. * may choose from for transmitting this frame.
  1147. * The bits in this mask correspond to the values in the
  1148. * htt_tx_preamble_type enum. For example, to allow the target
  1149. * to transmit the frame as either CCK or OFDM, this field would
  1150. * be set to
  1151. * (1 << htt_tx_preamble_type_ofdm) |
  1152. * (1 << htt_tx_preamble_type_cck)
  1153. */
  1154. preamble_type_mask: 4,
  1155. reserved1_31_29: 3; /* unused, set to 0x0 */
  1156. /* DWORD 2: tx chain mask, tx retries */
  1157. A_UINT32
  1158. /* chain_mask - specify which chains to transmit from */
  1159. chain_mask: 4,
  1160. /* retry_limit -
  1161. * Specify the maximum number of transmissions, including the
  1162. * initial transmission, to attempt before giving up if no ack
  1163. * is received.
  1164. * If the tx rate is specified, then all retries shall use the
  1165. * same rate as the initial transmission.
  1166. * If no tx rate is specified, the target can choose whether to
  1167. * retain the original rate during the retransmissions, or to
  1168. * fall back to a more robust rate.
  1169. */
  1170. retry_limit: 4,
  1171. /* bandwidth_mask -
  1172. * Specify what channel widths may be used for the transmission.
  1173. * A value of zero indicates "don't care" - the target may choose
  1174. * the transmission bandwidth.
  1175. * The bits within this mask correspond to the htt_tx_bandwidth
  1176. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1177. * The bandwidth_mask must be consistent with the preamble_type_mask
  1178. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1179. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1180. */
  1181. bandwidth_mask: 6,
  1182. reserved2_31_14: 18; /* unused, set to 0x0 */
  1183. /* DWORD 3: tx expiry time (TSF) LSBs */
  1184. A_UINT32 expire_tsf_lo;
  1185. /* DWORD 4: tx expiry time (TSF) MSBs */
  1186. A_UINT32 expire_tsf_hi;
  1187. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1188. } POSTPACK;
  1189. /* DWORD 0 */
  1190. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1191. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1210. /* DWORD 1 */
  1211. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1212. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1213. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1214. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1215. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1216. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1217. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1218. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1219. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1220. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1221. /* DWORD 2 */
  1222. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1223. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1224. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1225. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1226. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1227. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1228. /* DWORD 0 */
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1230. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1231. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1233. do { \
  1234. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1235. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1236. } while (0)
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1238. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1239. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL( \
  1251. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1252. ((_var) |= ((_val) \
  1253. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1254. } while (0)
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1256. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1257. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL( \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1262. ((_var) |= ((_val) \
  1263. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1264. } while (0)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1266. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1269. do { \
  1270. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1271. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1272. } while (0)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1274. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1279. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1280. } while (0)
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1304. } while (0)
  1305. /* DWORD 1 */
  1306. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1310. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1311. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1312. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1313. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1314. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1315. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1322. } while (0)
  1323. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1330. } while (0)
  1331. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1346. } while (0)
  1347. /* DWORD 2 */
  1348. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1355. } while (0)
  1356. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1363. } while (0)
  1364. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1371. } while (0)
  1372. typedef enum {
  1373. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1374. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1375. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1376. } htt_11ax_ltf_subtype_t;
  1377. typedef enum {
  1378. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1379. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1380. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1381. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1382. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1383. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1384. } htt_tx_ext2_preamble_type_t;
  1385. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1386. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1387. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1388. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1390. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1397. /**
  1398. * @brief HTT tx MSDU extension descriptor v2
  1399. * @details
  1400. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1401. * is received as tcl_exit_base->host_meta_info in firmware.
  1402. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1403. * are already part of tcl_exit_base.
  1404. */
  1405. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1406. /* DWORD 0: flags */
  1407. A_UINT32
  1408. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1409. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1410. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1411. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1412. valid_retries : 1, /* if set, tx retries spec is valid */
  1413. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1414. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1415. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1416. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1417. valid_key_flags : 1, /* if set, key flags is valid */
  1418. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1419. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1420. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1421. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1422. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1423. 1 = ENCRYPT,
  1424. 2 ~ 3 - Reserved */
  1425. /* retry_limit -
  1426. * Specify the maximum number of transmissions, including the
  1427. * initial transmission, to attempt before giving up if no ack
  1428. * is received.
  1429. * If the tx rate is specified, then all retries shall use the
  1430. * same rate as the initial transmission.
  1431. * If no tx rate is specified, the target can choose whether to
  1432. * retain the original rate during the retransmissions, or to
  1433. * fall back to a more robust rate.
  1434. */
  1435. retry_limit : 4,
  1436. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1437. * Valid only for 11ax preamble types HE_SU
  1438. * and HE_EXT_SU
  1439. */
  1440. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1441. * Valid only for 11ax preamble types HE_SU
  1442. * and HE_EXT_SU
  1443. */
  1444. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1445. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1446. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1447. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1448. */
  1449. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1450. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1451. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1452. * Use cases:
  1453. * Any time firmware uses TQM-BYPASS for Data
  1454. * TID, firmware expect host to set this bit.
  1455. */
  1456. /* DWORD 1: tx power, tx rate */
  1457. A_UINT32
  1458. power : 8, /* unit of the power field is 0.5 dbm
  1459. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1460. * signed value ranging from -64dbm to 63.5 dbm
  1461. */
  1462. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1463. * Setting more than one MCS isn't currently
  1464. * supported by the target (but is supported
  1465. * in the interface in case in the future
  1466. * the target supports specifications of
  1467. * a limited set of MCS values.
  1468. */
  1469. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1470. * Setting more than one Nss isn't currently
  1471. * supported by the target (but is supported
  1472. * in the interface in case in the future
  1473. * the target supports specifications of
  1474. * a limited set of Nss values.
  1475. */
  1476. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1477. update_peer_cache : 1; /* When set these custom values will be
  1478. * used for all packets, until the next
  1479. * update via this ext header.
  1480. * This is to make sure not all packets
  1481. * need to include this header.
  1482. */
  1483. /* DWORD 2: tx chain mask, tx retries */
  1484. A_UINT32
  1485. /* chain_mask - specify which chains to transmit from */
  1486. chain_mask : 8,
  1487. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1488. * TODO: Update Enum values for key_flags
  1489. */
  1490. /*
  1491. * Channel frequency: This identifies the desired channel
  1492. * frequency (in MHz) for tx frames. This is used by FW to help
  1493. * determine when it is safe to transmit or drop frames for
  1494. * off-channel operation.
  1495. * The default value of zero indicates to FW that the corresponding
  1496. * VDEV's home channel (if there is one) is the desired channel
  1497. * frequency.
  1498. */
  1499. chanfreq : 16;
  1500. /* DWORD 3: tx expiry time (TSF) LSBs */
  1501. A_UINT32 expire_tsf_lo;
  1502. /* DWORD 4: tx expiry time (TSF) MSBs */
  1503. A_UINT32 expire_tsf_hi;
  1504. /* DWORD 5: reserved
  1505. * This structure can be expanded further up to 60 bytes
  1506. * by adding further DWORDs as needed.
  1507. */
  1508. A_UINT32 rsvd0;
  1509. } POSTPACK;
  1510. /* DWORD 0 */
  1511. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1512. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1513. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1537. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1538. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1539. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1540. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1541. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1542. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1543. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1544. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1545. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1546. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1547. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1548. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1549. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1550. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1551. /* DWORD 1 */
  1552. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1553. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1554. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1555. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1556. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1557. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1558. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1559. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1560. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1561. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1562. /* DWORD 2 */
  1563. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1564. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1565. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1566. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1567. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1568. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1569. /* DWORD 0 */
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1572. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1576. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1580. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1584. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1585. } while (0)
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1588. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1590. do { \
  1591. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1592. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1596. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL( \
  1600. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1601. ((_var) |= ((_val) \
  1602. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1606. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1614. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1618. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1622. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL( \
  1626. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1627. ((_var) |= ((_val) \
  1628. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1632. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1640. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1648. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1652. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1653. } while (0)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1655. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1656. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1658. do { \
  1659. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1660. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1664. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1672. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1680. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1681. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1696. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1697. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1709. } while (0)
  1710. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1711. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1712. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1713. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1714. do { \
  1715. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1716. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1717. } while (0)
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1719. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1720. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1722. do { \
  1723. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1724. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1725. } while (0)
  1726. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1727. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1728. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1729. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1730. do { \
  1731. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1732. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1733. } while (0)
  1734. /* DWORD 1 */
  1735. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1739. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1740. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1741. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1742. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1743. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1744. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1759. } while (0)
  1760. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1766. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1767. } while (0)
  1768. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1769. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1770. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1771. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1774. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1775. } while (0)
  1776. /* DWORD 2 */
  1777. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1792. } while (0)
  1793. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1795. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1796. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1800. } while (0)
  1801. typedef enum {
  1802. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1803. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1804. } htt_tcl_metadata_type;
  1805. /**
  1806. * @brief HTT TCL command number format
  1807. * @details
  1808. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1809. * available to firmware as tcl_exit_base->tcl_status_number.
  1810. * For regular / multicast packets host will send vdev and mac id and for
  1811. * NAWDS packets, host will send peer id.
  1812. * A_UINT32 is used to avoid endianness conversion problems.
  1813. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1814. */
  1815. typedef struct {
  1816. A_UINT32
  1817. type: 1, /* vdev_id based or peer_id based */
  1818. rsvd: 31;
  1819. } htt_tx_tcl_vdev_or_peer_t;
  1820. typedef struct {
  1821. A_UINT32
  1822. type: 1, /* vdev_id based or peer_id based */
  1823. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1824. vdev_id: 8,
  1825. pdev_id: 2,
  1826. host_inspected:1,
  1827. rsvd: 19;
  1828. } htt_tx_tcl_vdev_metadata;
  1829. typedef struct {
  1830. A_UINT32
  1831. type: 1, /* vdev_id based or peer_id based */
  1832. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1833. peer_id: 14,
  1834. rsvd: 16;
  1835. } htt_tx_tcl_peer_metadata;
  1836. PREPACK struct htt_tx_tcl_metadata {
  1837. union {
  1838. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1839. htt_tx_tcl_vdev_metadata vdev_meta;
  1840. htt_tx_tcl_peer_metadata peer_meta;
  1841. };
  1842. } POSTPACK;
  1843. /* DWORD 0 */
  1844. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1845. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1846. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1847. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1848. /* VDEV metadata */
  1849. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1850. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1851. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1852. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1853. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1854. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1855. /* PEER metadata */
  1856. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1857. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1858. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1859. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1860. HTT_TX_TCL_METADATA_TYPE_S)
  1861. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1865. } while (0)
  1866. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1867. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1868. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1869. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1872. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1873. } while (0)
  1874. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1875. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1876. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1877. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1878. do { \
  1879. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1880. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1881. } while (0)
  1882. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1883. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1884. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1885. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1889. } while (0)
  1890. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1891. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1892. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1893. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1897. } while (0)
  1898. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1899. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1900. HTT_TX_TCL_METADATA_PEER_ID_S)
  1901. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1905. } while (0)
  1906. typedef enum {
  1907. HTT_TX_FW2WBM_TX_STATUS_OK,
  1908. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1909. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1910. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1911. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1912. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1913. HTT_TX_FW2WBM_TX_STATUS_MAX
  1914. } htt_tx_fw2wbm_tx_status_t;
  1915. typedef enum {
  1916. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1917. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1918. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1919. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1920. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1921. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1922. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1923. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1924. } htt_tx_fw2wbm_reinject_reason_t;
  1925. /**
  1926. * @brief HTT TX WBM Completion from firmware to host
  1927. * @details
  1928. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1929. * DWORD 3 and 4 for software based completions (Exception frames and
  1930. * TQM bypass frames)
  1931. * For software based completions, wbm_release_ring->release_source_module will
  1932. * be set to release_source_fw
  1933. */
  1934. PREPACK struct htt_tx_wbm_completion {
  1935. A_UINT32
  1936. sch_cmd_id: 24,
  1937. exception_frame: 1, /* If set, this packet was queued via exception path */
  1938. rsvd0_31_25: 7;
  1939. A_UINT32
  1940. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1941. * reception of an ACK or BA, this field indicates
  1942. * the RSSI of the received ACK or BA frame.
  1943. * When the frame is removed as result of a direct
  1944. * remove command from the SW, this field is set
  1945. * to 0x0 (which is never a valid value when real
  1946. * RSSI is available).
  1947. * Units: dB w.r.t noise floor
  1948. */
  1949. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1950. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1951. rsvd1_31_16: 16;
  1952. } POSTPACK;
  1953. /* DWORD 0 */
  1954. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1955. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1956. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1957. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1958. /* DWORD 1 */
  1959. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1960. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1961. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1962. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1963. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1964. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1965. /* DWORD 0 */
  1966. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1967. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1968. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1969. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1973. } while (0)
  1974. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1975. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1976. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1977. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  1981. } while (0)
  1982. /* DWORD 1 */
  1983. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1984. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1985. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1986. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  1990. } while (0)
  1991. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1992. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1993. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1994. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  1998. } while (0)
  1999. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2000. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2001. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2002. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2006. } while (0)
  2007. /**
  2008. * @brief HTT TX WBM Completion from firmware to host
  2009. * @details
  2010. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2011. * (WBM) offload HW.
  2012. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2013. * For software based completions, release_source_module will
  2014. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2015. * struct wbm_release_ring and then switch to this after looking at
  2016. * release_source_module.
  2017. */
  2018. PREPACK struct htt_tx_wbm_completion_v2 {
  2019. A_UINT32
  2020. used_by_hw0; /* Refer to struct wbm_release_ring */
  2021. A_UINT32
  2022. used_by_hw1; /* Refer to struct wbm_release_ring */
  2023. A_UINT32
  2024. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2025. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2026. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2027. exception_frame: 1,
  2028. rsvd0: 12, /* For future use */
  2029. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2030. rsvd1: 1; /* For future use */
  2031. A_UINT32
  2032. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2033. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2034. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2035. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2036. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2037. */
  2038. A_UINT32
  2039. data1: 32;
  2040. A_UINT32
  2041. data2: 32;
  2042. A_UINT32
  2043. used_by_hw3; /* Refer to struct wbm_release_ring */
  2044. } POSTPACK;
  2045. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2046. /* DWORD 3 */
  2047. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2048. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2049. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2050. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2051. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2052. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2053. /* DWORD 3 */
  2054. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2055. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2056. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2057. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2061. } while (0)
  2062. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2063. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2064. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2065. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2069. } while (0)
  2070. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2071. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2072. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2073. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2077. } while (0)
  2078. /**
  2079. * @brief HTT TX WBM transmit status from firmware to host
  2080. * @details
  2081. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2082. * (WBM) offload HW.
  2083. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2084. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2085. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2086. */
  2087. PREPACK struct htt_tx_wbm_transmit_status {
  2088. A_UINT32
  2089. sch_cmd_id: 24,
  2090. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2091. * reception of an ACK or BA, this field indicates
  2092. * the RSSI of the received ACK or BA frame.
  2093. * When the frame is removed as result of a direct
  2094. * remove command from the SW, this field is set
  2095. * to 0x0 (which is never a valid value when real
  2096. * RSSI is available).
  2097. * Units: dB w.r.t noise floor
  2098. */
  2099. A_UINT32
  2100. reserved0: 32;
  2101. A_UINT32
  2102. reserved1: 32;
  2103. } POSTPACK;
  2104. /* DWORD 4 */
  2105. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2106. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2107. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2108. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2109. /* DWORD 4 */
  2110. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2111. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2112. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2113. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2117. } while (0)
  2118. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2119. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2120. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2121. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2125. } while (0)
  2126. /**
  2127. * @brief HTT TX WBM reinject status from firmware to host
  2128. * @details
  2129. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2130. * (WBM) offload HW.
  2131. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2132. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2133. */
  2134. PREPACK struct htt_tx_wbm_reinject_status {
  2135. A_UINT32
  2136. reserved0: 32;
  2137. A_UINT32
  2138. reserved1: 32;
  2139. A_UINT32
  2140. reserved2: 32;
  2141. } POSTPACK;
  2142. /**
  2143. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2144. * @details
  2145. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2146. * (WBM) offload HW.
  2147. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2148. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2149. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2150. * STA side.
  2151. */
  2152. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2153. A_UINT32
  2154. mec_sa_addr_31_0;
  2155. A_UINT32
  2156. mec_sa_addr_47_32: 16,
  2157. sa_ast_index: 16;
  2158. A_UINT32
  2159. vdev_id: 8,
  2160. reserved0: 24;
  2161. } POSTPACK;
  2162. /* DWORD 4 - mec_sa_addr_31_0 */
  2163. /* DWORD 5 */
  2164. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2165. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2166. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2167. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2168. /* DWORD 6 */
  2169. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2170. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2171. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2172. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2173. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2174. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2178. } while (0)
  2179. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2180. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2181. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2182. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2186. } while (0)
  2187. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2188. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2189. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2190. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2191. do { \
  2192. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2193. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2194. } while (0)
  2195. typedef enum {
  2196. TX_FLOW_PRIORITY_BE,
  2197. TX_FLOW_PRIORITY_HIGH,
  2198. TX_FLOW_PRIORITY_LOW,
  2199. } htt_tx_flow_priority_t;
  2200. typedef enum {
  2201. TX_FLOW_LATENCY_SENSITIVE,
  2202. TX_FLOW_LATENCY_INSENSITIVE,
  2203. } htt_tx_flow_latency_t;
  2204. typedef enum {
  2205. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2206. TX_FLOW_INTERACTIVE_TRAFFIC,
  2207. TX_FLOW_PERIODIC_TRAFFIC,
  2208. TX_FLOW_BURSTY_TRAFFIC,
  2209. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2210. } htt_tx_flow_traffic_pattern_t;
  2211. /**
  2212. * @brief HTT TX Flow search metadata format
  2213. * @details
  2214. * Host will set this metadata in flow table's flow search entry along with
  2215. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2216. * firmware and TQM ring if the flow search entry wins.
  2217. * This metadata is available to firmware in that first MSDU's
  2218. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2219. * to one of the available flows for specific tid and returns the tqm flow
  2220. * pointer as part of htt_tx_map_flow_info message.
  2221. */
  2222. PREPACK struct htt_tx_flow_metadata {
  2223. A_UINT32
  2224. rsvd0_1_0: 2,
  2225. tid: 4,
  2226. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2227. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2228. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2229. * Else choose final tid based on latency, priority.
  2230. */
  2231. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2232. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2233. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2234. } POSTPACK;
  2235. /* DWORD 0 */
  2236. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2237. #define HTT_TX_FLOW_METADATA_TID_S 2
  2238. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2239. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2240. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2241. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2242. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2243. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2244. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2245. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2246. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2247. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2248. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2249. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2250. /* DWORD 0 */
  2251. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2252. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2253. HTT_TX_FLOW_METADATA_TID_S)
  2254. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2258. } while (0)
  2259. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2260. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2261. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2262. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2266. } while (0)
  2267. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2268. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2269. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2270. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2274. } while (0)
  2275. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2276. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2277. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2278. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2282. } while (0)
  2283. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2284. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2285. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2286. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2290. } while (0)
  2291. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2292. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2293. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2294. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2298. } while (0)
  2299. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2300. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2301. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2302. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2303. do { \
  2304. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2305. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2306. } while (0)
  2307. /**
  2308. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2309. *
  2310. * @details
  2311. * HTT wds entry from source port learning
  2312. * Host will learn wds entries from rx and send this message to firmware
  2313. * to enable firmware to configure/delete AST entries for wds clients.
  2314. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2315. * and when SA's entry is deleted, firmware removes this AST entry
  2316. *
  2317. * The message would appear as follows:
  2318. *
  2319. * |31 30|29 |17 16|15 8|7 0|
  2320. * |----------------+----------------+----------------+----------------|
  2321. * | rsvd0 |PDVID| vdev_id | msg_type |
  2322. * |-------------------------------------------------------------------|
  2323. * | sa_addr_31_0 |
  2324. * |-------------------------------------------------------------------|
  2325. * | | ta_peer_id | sa_addr_47_32 |
  2326. * |-------------------------------------------------------------------|
  2327. * Where PDVID = pdev_id
  2328. *
  2329. * The message is interpreted as follows:
  2330. *
  2331. * dword0 - b'0:7 - msg_type: This will be set to
  2332. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2333. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2334. *
  2335. * dword0 - b'8:15 - vdev_id
  2336. *
  2337. * dword0 - b'16:17 - pdev_id
  2338. *
  2339. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2340. *
  2341. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2342. *
  2343. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2344. *
  2345. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2346. */
  2347. PREPACK struct htt_wds_entry {
  2348. A_UINT32
  2349. msg_type: 8,
  2350. vdev_id: 8,
  2351. pdev_id: 2,
  2352. rsvd0: 14;
  2353. A_UINT32 sa_addr_31_0;
  2354. A_UINT32
  2355. sa_addr_47_32: 16,
  2356. ta_peer_id: 14,
  2357. rsvd2: 2;
  2358. } POSTPACK;
  2359. /* DWORD 0 */
  2360. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2361. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2362. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2363. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2364. /* DWORD 2 */
  2365. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2366. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2367. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2368. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2369. /* DWORD 0 */
  2370. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2371. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2372. HTT_WDS_ENTRY_VDEV_ID_S)
  2373. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2374. do { \
  2375. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2376. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2377. } while (0)
  2378. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2379. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2380. HTT_WDS_ENTRY_PDEV_ID_S)
  2381. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2382. do { \
  2383. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2384. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2385. } while (0)
  2386. /* DWORD 2 */
  2387. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2388. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2389. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2390. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2391. do { \
  2392. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2393. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2394. } while (0)
  2395. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2396. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2397. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2398. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2399. do { \
  2400. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2401. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2402. } while (0)
  2403. /**
  2404. * @brief MAC DMA rx ring setup specification
  2405. * @details
  2406. * To allow for dynamic rx ring reconfiguration and to avoid race
  2407. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2408. * it uses. Instead, it sends this message to the target, indicating how
  2409. * the rx ring used by the host should be set up and maintained.
  2410. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2411. * specifications.
  2412. *
  2413. * |31 16|15 8|7 0|
  2414. * |---------------------------------------------------------------|
  2415. * header: | reserved | num rings | msg type |
  2416. * |---------------------------------------------------------------|
  2417. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2418. #if HTT_PADDR64
  2419. * | FW_IDX shadow register physical address (bits 63:32) |
  2420. #endif
  2421. * |---------------------------------------------------------------|
  2422. * | rx ring base physical address (bits 31:0) |
  2423. #if HTT_PADDR64
  2424. * | rx ring base physical address (bits 63:32) |
  2425. #endif
  2426. * |---------------------------------------------------------------|
  2427. * | rx ring buffer size | rx ring length |
  2428. * |---------------------------------------------------------------|
  2429. * | FW_IDX initial value | enabled flags |
  2430. * |---------------------------------------------------------------|
  2431. * | MSDU payload offset | 802.11 header offset |
  2432. * |---------------------------------------------------------------|
  2433. * | PPDU end offset | PPDU start offset |
  2434. * |---------------------------------------------------------------|
  2435. * | MPDU end offset | MPDU start offset |
  2436. * |---------------------------------------------------------------|
  2437. * | MSDU end offset | MSDU start offset |
  2438. * |---------------------------------------------------------------|
  2439. * | frag info offset | rx attention offset |
  2440. * |---------------------------------------------------------------|
  2441. * payload 2, if present, has the same format as payload 1
  2442. * Header fields:
  2443. * - MSG_TYPE
  2444. * Bits 7:0
  2445. * Purpose: identifies this as an rx ring configuration message
  2446. * Value: 0x2
  2447. * - NUM_RINGS
  2448. * Bits 15:8
  2449. * Purpose: indicates whether the host is setting up one rx ring or two
  2450. * Value: 1 or 2
  2451. * Payload:
  2452. * for systems using 64-bit format for bus addresses:
  2453. * - IDX_SHADOW_REG_PADDR_LO
  2454. * Bits 31:0
  2455. * Value: lower 4 bytes of physical address of the host's
  2456. * FW_IDX shadow register
  2457. * - IDX_SHADOW_REG_PADDR_HI
  2458. * Bits 31:0
  2459. * Value: upper 4 bytes of physical address of the host's
  2460. * FW_IDX shadow register
  2461. * - RING_BASE_PADDR_LO
  2462. * Bits 31:0
  2463. * Value: lower 4 bytes of physical address of the host's rx ring
  2464. * - RING_BASE_PADDR_HI
  2465. * Bits 31:0
  2466. * Value: uppper 4 bytes of physical address of the host's rx ring
  2467. * for systems using 32-bit format for bus addresses:
  2468. * - IDX_SHADOW_REG_PADDR
  2469. * Bits 31:0
  2470. * Value: physical address of the host's FW_IDX shadow register
  2471. * - RING_BASE_PADDR
  2472. * Bits 31:0
  2473. * Value: physical address of the host's rx ring
  2474. * - RING_LEN
  2475. * Bits 15:0
  2476. * Value: number of elements in the rx ring
  2477. * - RING_BUF_SZ
  2478. * Bits 31:16
  2479. * Value: size of the buffers referenced by the rx ring, in byte units
  2480. * - ENABLED_FLAGS
  2481. * Bits 15:0
  2482. * Value: 1-bit flags to show whether different rx fields are enabled
  2483. * bit 0: 802.11 header enabled (1) or disabled (0)
  2484. * bit 1: MSDU payload enabled (1) or disabled (0)
  2485. * bit 2: PPDU start enabled (1) or disabled (0)
  2486. * bit 3: PPDU end enabled (1) or disabled (0)
  2487. * bit 4: MPDU start enabled (1) or disabled (0)
  2488. * bit 5: MPDU end enabled (1) or disabled (0)
  2489. * bit 6: MSDU start enabled (1) or disabled (0)
  2490. * bit 7: MSDU end enabled (1) or disabled (0)
  2491. * bit 8: rx attention enabled (1) or disabled (0)
  2492. * bit 9: frag info enabled (1) or disabled (0)
  2493. * bit 10: unicast rx enabled (1) or disabled (0)
  2494. * bit 11: multicast rx enabled (1) or disabled (0)
  2495. * bit 12: ctrl rx enabled (1) or disabled (0)
  2496. * bit 13: mgmt rx enabled (1) or disabled (0)
  2497. * bit 14: null rx enabled (1) or disabled (0)
  2498. * bit 15: phy data rx enabled (1) or disabled (0)
  2499. * - IDX_INIT_VAL
  2500. * Bits 31:16
  2501. * Purpose: Specify the initial value for the FW_IDX.
  2502. * Value: the number of buffers initially present in the host's rx ring
  2503. * - OFFSET_802_11_HDR
  2504. * Bits 15:0
  2505. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2506. * - OFFSET_MSDU_PAYLOAD
  2507. * Bits 31:16
  2508. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2509. * - OFFSET_PPDU_START
  2510. * Bits 15:0
  2511. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2512. * - OFFSET_PPDU_END
  2513. * Bits 31:16
  2514. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2515. * - OFFSET_MPDU_START
  2516. * Bits 15:0
  2517. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2518. * - OFFSET_MPDU_END
  2519. * Bits 31:16
  2520. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2521. * - OFFSET_MSDU_START
  2522. * Bits 15:0
  2523. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2524. * - OFFSET_MSDU_END
  2525. * Bits 31:16
  2526. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2527. * - OFFSET_RX_ATTN
  2528. * Bits 15:0
  2529. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2530. * - OFFSET_FRAG_INFO
  2531. * Bits 31:16
  2532. * Value: offset in QUAD-bytes of frag info table
  2533. */
  2534. /* header fields */
  2535. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2536. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2537. /* payload fields */
  2538. /* for systems using a 64-bit format for bus addresses */
  2539. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2540. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2541. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2542. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2543. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2544. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2545. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2546. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2547. /* for systems using a 32-bit format for bus addresses */
  2548. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2549. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2550. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2551. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2552. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2553. #define HTT_RX_RING_CFG_LEN_S 0
  2554. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2555. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2556. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2557. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2558. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2559. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2560. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2561. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2562. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2563. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2564. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2565. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2566. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2567. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2568. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2569. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2570. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2571. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2572. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2573. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2574. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2575. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2576. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2577. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2578. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2579. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2580. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2581. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2582. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2583. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2584. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2585. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2586. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2587. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2588. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2589. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2590. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2591. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2592. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2593. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2594. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2595. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2596. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2597. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2598. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2599. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2600. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2601. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2602. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2603. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2604. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2605. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2606. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2607. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2608. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2609. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2610. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2611. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2612. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2613. #if HTT_PADDR64
  2614. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2615. #else
  2616. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2617. #endif
  2618. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2619. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2620. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2621. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2622. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2623. do { \
  2624. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2625. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2626. } while (0)
  2627. /* degenerate case for 32-bit fields */
  2628. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2629. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2630. ((_var) = (_val))
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2633. ((_var) = (_val))
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2635. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2636. ((_var) = (_val))
  2637. /* degenerate case for 32-bit fields */
  2638. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2639. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2640. ((_var) = (_val))
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2643. ((_var) = (_val))
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2645. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2646. ((_var) = (_val))
  2647. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2648. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2649. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2652. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2653. } while (0)
  2654. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2655. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2656. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2659. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2660. } while (0)
  2661. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2662. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2663. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2664. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2665. do { \
  2666. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2667. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2668. } while (0)
  2669. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2670. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2671. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2672. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2673. do { \
  2674. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2675. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2676. } while (0)
  2677. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2678. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2679. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2680. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2681. do { \
  2682. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2683. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2684. } while (0)
  2685. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2686. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2687. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2688. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2689. do { \
  2690. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2691. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2692. } while (0)
  2693. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2694. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2695. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2696. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2697. do { \
  2698. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2699. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2700. } while (0)
  2701. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2702. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2703. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2704. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2705. do { \
  2706. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2707. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2708. } while (0)
  2709. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2710. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2711. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2712. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2713. do { \
  2714. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2715. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2716. } while (0)
  2717. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2718. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2719. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2720. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2721. do { \
  2722. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2723. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2724. } while (0)
  2725. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2726. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2727. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2728. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2729. do { \
  2730. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2731. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2732. } while (0)
  2733. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2734. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2735. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2736. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2737. do { \
  2738. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2739. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2740. } while (0)
  2741. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2742. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2743. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2744. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2747. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2748. } while (0)
  2749. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2750. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2751. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2752. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2753. do { \
  2754. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2755. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2756. } while (0)
  2757. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2758. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2759. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2760. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2763. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2764. } while (0)
  2765. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2766. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2767. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2768. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2771. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2772. } while (0)
  2773. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2774. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2775. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2776. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2777. do { \
  2778. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2779. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2780. } while (0)
  2781. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2782. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2783. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2784. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2785. do { \
  2786. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2787. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2788. } while (0)
  2789. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2790. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2791. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2792. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2795. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2796. } while (0)
  2797. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2798. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2799. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2800. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2801. do { \
  2802. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2803. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2804. } while (0)
  2805. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2806. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2807. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2808. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2809. do { \
  2810. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2811. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2812. } while (0)
  2813. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2814. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2815. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2816. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2819. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2820. } while (0)
  2821. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2822. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2823. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2824. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2831. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2832. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2839. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2840. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2843. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2844. } while (0)
  2845. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2846. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2847. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2848. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2851. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2852. } while (0)
  2853. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2854. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2855. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2856. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2859. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2860. } while (0)
  2861. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2862. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2863. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2864. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2867. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2868. } while (0)
  2869. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2870. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2871. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2872. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2875. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2876. } while (0)
  2877. /**
  2878. * @brief host -> target FW statistics retrieve
  2879. *
  2880. * @details
  2881. * The following field definitions describe the format of the HTT host
  2882. * to target FW stats retrieve message. The message specifies the type of
  2883. * stats host wants to retrieve.
  2884. *
  2885. * |31 24|23 16|15 8|7 0|
  2886. * |-----------------------------------------------------------|
  2887. * | stats types request bitmask | msg type |
  2888. * |-----------------------------------------------------------|
  2889. * | stats types reset bitmask | reserved |
  2890. * |-----------------------------------------------------------|
  2891. * | stats type | config value |
  2892. * |-----------------------------------------------------------|
  2893. * | cookie LSBs |
  2894. * |-----------------------------------------------------------|
  2895. * | cookie MSBs |
  2896. * |-----------------------------------------------------------|
  2897. * Header fields:
  2898. * - MSG_TYPE
  2899. * Bits 7:0
  2900. * Purpose: identifies this is a stats upload request message
  2901. * Value: 0x3
  2902. * - UPLOAD_TYPES
  2903. * Bits 31:8
  2904. * Purpose: identifies which types of FW statistics to upload
  2905. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2906. * - RESET_TYPES
  2907. * Bits 31:8
  2908. * Purpose: identifies which types of FW statistics to reset
  2909. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2910. * - CFG_VAL
  2911. * Bits 23:0
  2912. * Purpose: give an opaque configuration value to the specified stats type
  2913. * Value: stats-type specific configuration value
  2914. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2915. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2916. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2917. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2918. * - CFG_STAT_TYPE
  2919. * Bits 31:24
  2920. * Purpose: specify which stats type (if any) the config value applies to
  2921. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2922. * a valid configuration specification
  2923. * - COOKIE_LSBS
  2924. * Bits 31:0
  2925. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2926. * message with its preceding host->target stats request message.
  2927. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2928. * - COOKIE_MSBS
  2929. * Bits 31:0
  2930. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2931. * message with its preceding host->target stats request message.
  2932. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2933. */
  2934. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2935. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2936. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2937. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2938. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2939. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2940. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2941. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2942. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2943. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2944. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2945. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2946. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2947. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2950. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2951. } while (0)
  2952. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2953. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2954. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2955. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2958. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2959. } while (0)
  2960. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2961. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2962. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2963. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2966. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2967. } while (0)
  2968. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2969. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2970. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2971. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2974. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2975. } while (0)
  2976. /**
  2977. * @brief host -> target HTT out-of-band sync request
  2978. *
  2979. * @details
  2980. * The HTT SYNC tells the target to suspend processing of subsequent
  2981. * HTT host-to-target messages until some other target agent locally
  2982. * informs the target HTT FW that the current sync counter is equal to
  2983. * or greater than (in a modulo sense) the sync counter specified in
  2984. * the SYNC message.
  2985. * This allows other host-target components to synchronize their operation
  2986. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2987. * security key has been downloaded to and activated by the target.
  2988. * In the absence of any explicit synchronization counter value
  2989. * specification, the target HTT FW will use zero as the default current
  2990. * sync value.
  2991. *
  2992. * |31 24|23 16|15 8|7 0|
  2993. * |-----------------------------------------------------------|
  2994. * | reserved | sync count | msg type |
  2995. * |-----------------------------------------------------------|
  2996. * Header fields:
  2997. * - MSG_TYPE
  2998. * Bits 7:0
  2999. * Purpose: identifies this as a sync message
  3000. * Value: 0x4
  3001. * - SYNC_COUNT
  3002. * Bits 15:8
  3003. * Purpose: specifies what sync value the HTT FW will wait for from
  3004. * an out-of-band specification to resume its operation
  3005. * Value: in-band sync counter value to compare against the out-of-band
  3006. * counter spec.
  3007. * The HTT target FW will suspend its host->target message processing
  3008. * as long as
  3009. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3010. */
  3011. #define HTT_H2T_SYNC_MSG_SZ 4
  3012. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3013. #define HTT_H2T_SYNC_COUNT_S 8
  3014. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3015. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3016. HTT_H2T_SYNC_COUNT_S)
  3017. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3020. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3021. } while (0)
  3022. /**
  3023. * @brief HTT aggregation configuration
  3024. */
  3025. #define HTT_AGGR_CFG_MSG_SZ 4
  3026. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3027. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3028. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3029. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3030. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3031. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3032. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3033. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3036. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3037. } while (0)
  3038. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3039. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3040. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3041. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3044. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3045. } while (0)
  3046. /**
  3047. * @brief host -> target HTT configure max amsdu info per vdev
  3048. *
  3049. * @details
  3050. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3051. *
  3052. * |31 21|20 16|15 8|7 0|
  3053. * |-----------------------------------------------------------|
  3054. * | reserved | vdev id | max amsdu | msg type |
  3055. * |-----------------------------------------------------------|
  3056. * Header fields:
  3057. * - MSG_TYPE
  3058. * Bits 7:0
  3059. * Purpose: identifies this as a aggr cfg ex message
  3060. * Value: 0xa
  3061. * - MAX_NUM_AMSDU_SUBFRM
  3062. * Bits 15:8
  3063. * Purpose: max MSDUs per A-MSDU
  3064. * - VDEV_ID
  3065. * Bits 20:16
  3066. * Purpose: ID of the vdev to which this limit is applied
  3067. */
  3068. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3069. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3070. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3071. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3072. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3073. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3074. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3075. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3076. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3077. do { \
  3078. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3079. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3080. } while (0)
  3081. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3082. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3083. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3084. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3085. do { \
  3086. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3087. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3088. } while (0)
  3089. /**
  3090. * @brief HTT WDI_IPA Config Message
  3091. *
  3092. * @details
  3093. * The HTT WDI_IPA config message is created/sent by host at driver
  3094. * init time. It contains information about data structures used on
  3095. * WDI_IPA TX and RX path.
  3096. * TX CE ring is used for pushing packet metadata from IPA uC
  3097. * to WLAN FW
  3098. * TX Completion ring is used for generating TX completions from
  3099. * WLAN FW to IPA uC
  3100. * RX Indication ring is used for indicating RX packets from FW
  3101. * to IPA uC
  3102. * RX Ring2 is used as either completion ring or as second
  3103. * indication ring. when Ring2 is used as completion ring, IPA uC
  3104. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3105. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3106. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3107. * indicated in RX Indication ring. Please see WDI_IPA specification
  3108. * for more details.
  3109. * |31 24|23 16|15 8|7 0|
  3110. * |----------------+----------------+----------------+----------------|
  3111. * | tx pkt pool size | Rsvd | msg_type |
  3112. * |-------------------------------------------------------------------|
  3113. * | tx comp ring base (bits 31:0) |
  3114. #if HTT_PADDR64
  3115. * | tx comp ring base (bits 63:32) |
  3116. #endif
  3117. * |-------------------------------------------------------------------|
  3118. * | tx comp ring size |
  3119. * |-------------------------------------------------------------------|
  3120. * | tx comp WR_IDX physical address (bits 31:0) |
  3121. #if HTT_PADDR64
  3122. * | tx comp WR_IDX physical address (bits 63:32) |
  3123. #endif
  3124. * |-------------------------------------------------------------------|
  3125. * | tx CE WR_IDX physical address (bits 31:0) |
  3126. #if HTT_PADDR64
  3127. * | tx CE WR_IDX physical address (bits 63:32) |
  3128. #endif
  3129. * |-------------------------------------------------------------------|
  3130. * | rx indication ring base (bits 31:0) |
  3131. #if HTT_PADDR64
  3132. * | rx indication ring base (bits 63:32) |
  3133. #endif
  3134. * |-------------------------------------------------------------------|
  3135. * | rx indication ring size |
  3136. * |-------------------------------------------------------------------|
  3137. * | rx ind RD_IDX physical address (bits 31:0) |
  3138. #if HTT_PADDR64
  3139. * | rx ind RD_IDX physical address (bits 63:32) |
  3140. #endif
  3141. * |-------------------------------------------------------------------|
  3142. * | rx ind WR_IDX physical address (bits 31:0) |
  3143. #if HTT_PADDR64
  3144. * | rx ind WR_IDX physical address (bits 63:32) |
  3145. #endif
  3146. * |-------------------------------------------------------------------|
  3147. * |-------------------------------------------------------------------|
  3148. * | rx ring2 base (bits 31:0) |
  3149. #if HTT_PADDR64
  3150. * | rx ring2 base (bits 63:32) |
  3151. #endif
  3152. * |-------------------------------------------------------------------|
  3153. * | rx ring2 size |
  3154. * |-------------------------------------------------------------------|
  3155. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3156. #if HTT_PADDR64
  3157. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3158. #endif
  3159. * |-------------------------------------------------------------------|
  3160. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3161. #if HTT_PADDR64
  3162. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3163. #endif
  3164. * |-------------------------------------------------------------------|
  3165. *
  3166. * Header fields:
  3167. * Header fields:
  3168. * - MSG_TYPE
  3169. * Bits 7:0
  3170. * Purpose: Identifies this as WDI_IPA config message
  3171. * value: = 0x8
  3172. * - TX_PKT_POOL_SIZE
  3173. * Bits 15:0
  3174. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3175. * WDI_IPA TX path
  3176. * For systems using 32-bit format for bus addresses:
  3177. * - TX_COMP_RING_BASE_ADDR
  3178. * Bits 31:0
  3179. * Purpose: TX Completion Ring base address in DDR
  3180. * - TX_COMP_RING_SIZE
  3181. * Bits 31:0
  3182. * Purpose: TX Completion Ring size (must be power of 2)
  3183. * - TX_COMP_WR_IDX_ADDR
  3184. * Bits 31:0
  3185. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3186. * updates the Write Index for WDI_IPA TX completion ring
  3187. * - TX_CE_WR_IDX_ADDR
  3188. * Bits 31:0
  3189. * Purpose: DDR address where IPA uC
  3190. * updates the WR Index for TX CE ring
  3191. * (needed for fusion platforms)
  3192. * - RX_IND_RING_BASE_ADDR
  3193. * Bits 31:0
  3194. * Purpose: RX Indication Ring base address in DDR
  3195. * - RX_IND_RING_SIZE
  3196. * Bits 31:0
  3197. * Purpose: RX Indication Ring size
  3198. * - RX_IND_RD_IDX_ADDR
  3199. * Bits 31:0
  3200. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3201. * RX indication ring
  3202. * - RX_IND_WR_IDX_ADDR
  3203. * Bits 31:0
  3204. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3205. * updates the Write Index for WDI_IPA RX indication ring
  3206. * - RX_RING2_BASE_ADDR
  3207. * Bits 31:0
  3208. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3209. * - RX_RING2_SIZE
  3210. * Bits 31:0
  3211. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3212. * - RX_RING2_RD_IDX_ADDR
  3213. * Bits 31:0
  3214. * Purpose: If Second RX ring is Indication ring, DDR address where
  3215. * IPA uC updates the Read Index for Ring2.
  3216. * If Second RX ring is completion ring, this is NOT used
  3217. * - RX_RING2_WR_IDX_ADDR
  3218. * Bits 31:0
  3219. * Purpose: If Second RX ring is Indication ring, DDR address where
  3220. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3221. * If second RX ring is completion ring, DDR address where
  3222. * IPA uC updates the Write Index for Ring 2.
  3223. * For systems using 64-bit format for bus addresses:
  3224. * - TX_COMP_RING_BASE_ADDR_LO
  3225. * Bits 31:0
  3226. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3227. * - TX_COMP_RING_BASE_ADDR_HI
  3228. * Bits 31:0
  3229. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3230. * - TX_COMP_RING_SIZE
  3231. * Bits 31:0
  3232. * Purpose: TX Completion Ring size (must be power of 2)
  3233. * - TX_COMP_WR_IDX_ADDR_LO
  3234. * Bits 31:0
  3235. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3236. * Lower 4 bytes of DDR address where WIFI FW
  3237. * updates the Write Index for WDI_IPA TX completion ring
  3238. * - TX_COMP_WR_IDX_ADDR_HI
  3239. * Bits 31:0
  3240. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3241. * Higher 4 bytes of DDR address where WIFI FW
  3242. * updates the Write Index for WDI_IPA TX completion ring
  3243. * - TX_CE_WR_IDX_ADDR_LO
  3244. * Bits 31:0
  3245. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3246. * updates the WR Index for TX CE ring
  3247. * (needed for fusion platforms)
  3248. * - TX_CE_WR_IDX_ADDR_HI
  3249. * Bits 31:0
  3250. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3251. * updates the WR Index for TX CE ring
  3252. * (needed for fusion platforms)
  3253. * - RX_IND_RING_BASE_ADDR_LO
  3254. * Bits 31:0
  3255. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3256. * - RX_IND_RING_BASE_ADDR_HI
  3257. * Bits 31:0
  3258. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3259. * - RX_IND_RING_SIZE
  3260. * Bits 31:0
  3261. * Purpose: RX Indication Ring size
  3262. * - RX_IND_RD_IDX_ADDR_LO
  3263. * Bits 31:0
  3264. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3265. * for WDI_IPA RX indication ring
  3266. * - RX_IND_RD_IDX_ADDR_HI
  3267. * Bits 31:0
  3268. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3269. * for WDI_IPA RX indication ring
  3270. * - RX_IND_WR_IDX_ADDR_LO
  3271. * Bits 31:0
  3272. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3273. * Lower 4 bytes of DDR address where WIFI FW
  3274. * updates the Write Index for WDI_IPA RX indication ring
  3275. * - RX_IND_WR_IDX_ADDR_HI
  3276. * Bits 31:0
  3277. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3278. * Higher 4 bytes of DDR address where WIFI FW
  3279. * updates the Write Index for WDI_IPA RX indication ring
  3280. * - RX_RING2_BASE_ADDR_LO
  3281. * Bits 31:0
  3282. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3283. * - RX_RING2_BASE_ADDR_HI
  3284. * Bits 31:0
  3285. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3286. * - RX_RING2_SIZE
  3287. * Bits 31:0
  3288. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3289. * - RX_RING2_RD_IDX_ADDR_LO
  3290. * Bits 31:0
  3291. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3292. * DDR address where IPA uC updates the Read Index for Ring2.
  3293. * If Second RX ring is completion ring, this is NOT used
  3294. * - RX_RING2_RD_IDX_ADDR_HI
  3295. * Bits 31:0
  3296. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3297. * DDR address where IPA uC updates the Read Index for Ring2.
  3298. * If Second RX ring is completion ring, this is NOT used
  3299. * - RX_RING2_WR_IDX_ADDR_LO
  3300. * Bits 31:0
  3301. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3302. * DDR address where WIFI FW updates the Write Index
  3303. * for WDI_IPA RX ring2
  3304. * If second RX ring is completion ring, lower 4 bytes of
  3305. * DDR address where IPA uC updates the Write Index for Ring 2.
  3306. * - RX_RING2_WR_IDX_ADDR_HI
  3307. * Bits 31:0
  3308. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3309. * DDR address where WIFI FW updates the Write Index
  3310. * for WDI_IPA RX ring2
  3311. * If second RX ring is completion ring, higher 4 bytes of
  3312. * DDR address where IPA uC updates the Write Index for Ring 2.
  3313. */
  3314. #if HTT_PADDR64
  3315. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3316. #else
  3317. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3318. #endif
  3319. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3320. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3321. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3322. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3323. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3324. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3325. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3326. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3327. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3328. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3329. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3330. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3331. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3332. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3333. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3334. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3335. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3336. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3337. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3338. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3339. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3340. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3341. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3342. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3343. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3344. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3345. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3346. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3347. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3348. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3349. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3350. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3351. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3352. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3353. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3354. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3355. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3356. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3357. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3358. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3359. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3360. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3361. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3362. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3363. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3364. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3365. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3366. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3367. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3368. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3369. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3370. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3371. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3372. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3373. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3374. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3375. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3376. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3377. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3378. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3379. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3380. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3381. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3382. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3383. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3384. do { \
  3385. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3386. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3387. } while (0)
  3388. /* for systems using 32-bit format for bus addr */
  3389. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3390. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3392. do { \
  3393. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3394. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3395. } while (0)
  3396. /* for systems using 64-bit format for bus addr */
  3397. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3398. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3399. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3400. do { \
  3401. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3402. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3403. } while (0)
  3404. /* for systems using 64-bit format for bus addr */
  3405. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3406. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3407. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3408. do { \
  3409. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3410. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3411. } while (0)
  3412. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3413. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3414. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3417. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3418. } while (0)
  3419. /* for systems using 32-bit format for bus addr */
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3421. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3425. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3426. } while (0)
  3427. /* for systems using 64-bit format for bus addr */
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3429. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3433. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3434. } while (0)
  3435. /* for systems using 64-bit format for bus addr */
  3436. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3437. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3438. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3441. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3442. } while (0)
  3443. /* for systems using 32-bit format for bus addr */
  3444. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3445. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3446. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3449. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3450. } while (0)
  3451. /* for systems using 64-bit format for bus addr */
  3452. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3453. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3454. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3457. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3458. } while (0)
  3459. /* for systems using 64-bit format for bus addr */
  3460. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3461. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3462. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3465. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3466. } while (0)
  3467. /* for systems using 32-bit format for bus addr */
  3468. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3469. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3470. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3473. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3474. } while (0)
  3475. /* for systems using 64-bit format for bus addr */
  3476. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3477. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3478. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3481. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3482. } while (0)
  3483. /* for systems using 64-bit format for bus addr */
  3484. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3485. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3486. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3489. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3490. } while (0)
  3491. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3492. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3493. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3496. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3497. } while (0)
  3498. /* for systems using 32-bit format for bus addr */
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3500. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3504. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3505. } while (0)
  3506. /* for systems using 64-bit format for bus addr */
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3508. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3512. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3513. } while (0)
  3514. /* for systems using 64-bit format for bus addr */
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3516. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3520. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3521. } while (0)
  3522. /* for systems using 32-bit format for bus addr */
  3523. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3524. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3525. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3528. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3529. } while (0)
  3530. /* for systems using 64-bit format for bus addr */
  3531. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3532. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3533. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3536. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3537. } while (0)
  3538. /* for systems using 64-bit format for bus addr */
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3540. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3544. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3545. } while (0)
  3546. /* for systems using 32-bit format for bus addr */
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3548. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3552. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3553. } while (0)
  3554. /* for systems using 64-bit format for bus addr */
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3556. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3560. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3561. } while (0)
  3562. /* for systems using 64-bit format for bus addr */
  3563. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3564. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3565. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3568. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3569. } while (0)
  3570. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3572. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3576. } while (0)
  3577. /* for systems using 32-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3580. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3584. } while (0)
  3585. /* for systems using 64-bit format for bus addr */
  3586. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3588. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3592. } while (0)
  3593. /* for systems using 64-bit format for bus addr */
  3594. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3595. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3596. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3599. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3600. } while (0)
  3601. /* for systems using 32-bit format for bus addr */
  3602. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3603. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3604. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3605. do { \
  3606. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3607. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3608. } while (0)
  3609. /* for systems using 64-bit format for bus addr */
  3610. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3611. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3612. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3616. } while (0)
  3617. /* for systems using 64-bit format for bus addr */
  3618. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3619. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3620. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3623. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3624. } while (0)
  3625. /*
  3626. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3627. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3628. * addresses are stored in a XXX-bit field.
  3629. * This macro is used to define both htt_wdi_ipa_config32_t and
  3630. * htt_wdi_ipa_config64_t structs.
  3631. */
  3632. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3633. _paddr__tx_comp_ring_base_addr_, \
  3634. _paddr__tx_comp_wr_idx_addr_, \
  3635. _paddr__tx_ce_wr_idx_addr_, \
  3636. _paddr__rx_ind_ring_base_addr_, \
  3637. _paddr__rx_ind_rd_idx_addr_, \
  3638. _paddr__rx_ind_wr_idx_addr_, \
  3639. _paddr__rx_ring2_base_addr_,\
  3640. _paddr__rx_ring2_rd_idx_addr_,\
  3641. _paddr__rx_ring2_wr_idx_addr_) \
  3642. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3643. { \
  3644. /* DWORD 0: flags and meta-data */ \
  3645. A_UINT32 \
  3646. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3647. reserved: 8, \
  3648. tx_pkt_pool_size: 16;\
  3649. /* DWORD 1 */\
  3650. _paddr__tx_comp_ring_base_addr_;\
  3651. /* DWORD 2 (or 3)*/\
  3652. A_UINT32 tx_comp_ring_size;\
  3653. /* DWORD 3 (or 4)*/\
  3654. _paddr__tx_comp_wr_idx_addr_;\
  3655. /* DWORD 4 (or 6)*/\
  3656. _paddr__tx_ce_wr_idx_addr_;\
  3657. /* DWORD 5 (or 8)*/\
  3658. _paddr__rx_ind_ring_base_addr_;\
  3659. /* DWORD 6 (or 10)*/\
  3660. A_UINT32 rx_ind_ring_size;\
  3661. /* DWORD 7 (or 11)*/\
  3662. _paddr__rx_ind_rd_idx_addr_;\
  3663. /* DWORD 8 (or 13)*/\
  3664. _paddr__rx_ind_wr_idx_addr_;\
  3665. /* DWORD 9 (or 15)*/\
  3666. _paddr__rx_ring2_base_addr_;\
  3667. /* DWORD 10 (or 17) */\
  3668. A_UINT32 rx_ring2_size;\
  3669. /* DWORD 11 (or 18) */\
  3670. _paddr__rx_ring2_rd_idx_addr_;\
  3671. /* DWORD 12 (or 20) */\
  3672. _paddr__rx_ring2_wr_idx_addr_;\
  3673. } POSTPACK
  3674. /* define a htt_wdi_ipa_config32_t type */
  3675. 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));
  3676. /* define a htt_wdi_ipa_config64_t type */
  3677. 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));
  3678. #if HTT_PADDR64
  3679. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3680. #else
  3681. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3682. #endif
  3683. enum htt_wdi_ipa_op_code {
  3684. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3685. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3686. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3687. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3688. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3689. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3690. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3691. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3692. /* keep this last */
  3693. HTT_WDI_IPA_OPCODE_MAX
  3694. };
  3695. /**
  3696. * @brief HTT WDI_IPA Operation Request Message
  3697. *
  3698. * @details
  3699. * HTT WDI_IPA Operation Request message is sent by host
  3700. * to either suspend or resume WDI_IPA TX or RX path.
  3701. * |31 24|23 16|15 8|7 0|
  3702. * |----------------+----------------+----------------+----------------|
  3703. * | op_code | Rsvd | msg_type |
  3704. * |-------------------------------------------------------------------|
  3705. *
  3706. * Header fields:
  3707. * - MSG_TYPE
  3708. * Bits 7:0
  3709. * Purpose: Identifies this as WDI_IPA Operation Request message
  3710. * value: = 0x9
  3711. * - OP_CODE
  3712. * Bits 31:16
  3713. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3714. * value: = enum htt_wdi_ipa_op_code
  3715. */
  3716. PREPACK struct htt_wdi_ipa_op_request_t
  3717. {
  3718. /* DWORD 0: flags and meta-data */
  3719. A_UINT32
  3720. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3721. reserved: 8,
  3722. op_code: 16;
  3723. } POSTPACK;
  3724. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3725. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3726. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3727. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3728. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3729. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3730. do { \
  3731. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3732. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3733. } while (0)
  3734. /*
  3735. * @brief host -> target HTT_SRING_SETUP message
  3736. *
  3737. * @details
  3738. * After target is booted up, Host can send SRING setup message for
  3739. * each host facing LMAC SRING. Target setups up HW registers based
  3740. * on setup message and confirms back to Host if response_required is set.
  3741. * Host should wait for confirmation message before sending new SRING
  3742. * setup message
  3743. *
  3744. * The message would appear as follows:
  3745. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3746. * |--------------- +-----------------+----------------+------------------|
  3747. * | ring_type | ring_id | pdev_id | msg_type |
  3748. * |----------------------------------------------------------------------|
  3749. * | ring_base_addr_lo |
  3750. * |----------------------------------------------------------------------|
  3751. * | ring_base_addr_hi |
  3752. * |----------------------------------------------------------------------|
  3753. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3754. * |----------------------------------------------------------------------|
  3755. * | ring_head_offset32_remote_addr_lo |
  3756. * |----------------------------------------------------------------------|
  3757. * | ring_head_offset32_remote_addr_hi |
  3758. * |----------------------------------------------------------------------|
  3759. * | ring_tail_offset32_remote_addr_lo |
  3760. * |----------------------------------------------------------------------|
  3761. * | ring_tail_offset32_remote_addr_hi |
  3762. * |----------------------------------------------------------------------|
  3763. * | ring_msi_addr_lo |
  3764. * |----------------------------------------------------------------------|
  3765. * | ring_msi_addr_hi |
  3766. * |----------------------------------------------------------------------|
  3767. * | ring_msi_data |
  3768. * |----------------------------------------------------------------------|
  3769. * | intr_timer_th |IM| intr_batch_counter_th |
  3770. * |----------------------------------------------------------------------|
  3771. * | reserved |RR|PTCF| intr_low_threshold |
  3772. * |----------------------------------------------------------------------|
  3773. * Where
  3774. * IM = sw_intr_mode
  3775. * RR = response_required
  3776. * PTCF = prefetch_timer_cfg
  3777. *
  3778. * The message is interpreted as follows:
  3779. * dword0 - b'0:7 - msg_type: This will be set to
  3780. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3781. * b'8:15 - pdev_id:
  3782. * 0 (for rings at SOC/UMAC level),
  3783. * 1/2/3 mac id (for rings at LMAC level)
  3784. * b'16:23 - ring_id: identify which ring is to setup,
  3785. * more details can be got from enum htt_srng_ring_id
  3786. * b'24:31 - ring_type: identify type of host rings,
  3787. * more details can be got from enum htt_srng_ring_type
  3788. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3789. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3790. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3791. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3792. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3793. * SW_TO_HW_RING.
  3794. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3795. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3796. * Lower 32 bits of memory address of the remote variable
  3797. * storing the 4-byte word offset that identifies the head
  3798. * element within the ring.
  3799. * (The head offset variable has type A_UINT32.)
  3800. * Valid for HW_TO_SW and SW_TO_SW rings.
  3801. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3802. * Upper 32 bits of memory address of the remote variable
  3803. * storing the 4-byte word offset that identifies the head
  3804. * element within the ring.
  3805. * (The head offset variable has type A_UINT32.)
  3806. * Valid for HW_TO_SW and SW_TO_SW rings.
  3807. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3808. * Lower 32 bits of memory address of the remote variable
  3809. * storing the 4-byte word offset that identifies the tail
  3810. * element within the ring.
  3811. * (The tail offset variable has type A_UINT32.)
  3812. * Valid for HW_TO_SW and SW_TO_SW rings.
  3813. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3814. * Upper 32 bits of memory address of the remote variable
  3815. * storing the 4-byte word offset that identifies the tail
  3816. * element within the ring.
  3817. * (The tail offset variable has type A_UINT32.)
  3818. * Valid for HW_TO_SW and SW_TO_SW rings.
  3819. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3820. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3821. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3822. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3823. * dword10 - b'0:31 - ring_msi_data: MSI data
  3824. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3825. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3826. * dword11 - b'0:14 - intr_batch_counter_th:
  3827. * batch counter threshold is in units of 4-byte words.
  3828. * HW internally maintains and increments batch count.
  3829. * (see SRING spec for detail description).
  3830. * When batch count reaches threshold value, an interrupt
  3831. * is generated by HW.
  3832. * b'15 - sw_intr_mode:
  3833. * This configuration shall be static.
  3834. * Only programmed at power up.
  3835. * 0: generate pulse style sw interrupts
  3836. * 1: generate level style sw interrupts
  3837. * b'16:31 - intr_timer_th:
  3838. * The timer init value when timer is idle or is
  3839. * initialized to start downcounting.
  3840. * In 8us units (to cover a range of 0 to 524 ms)
  3841. * dword12 - b'0:15 - intr_low_threshold:
  3842. * Used only by Consumer ring to generate ring_sw_int_p.
  3843. * Ring entries low threshold water mark, that is used
  3844. * in combination with the interrupt timer as well as
  3845. * the the clearing of the level interrupt.
  3846. * b'16:18 - prefetch_timer_cfg:
  3847. * Used only by Consumer ring to set timer mode to
  3848. * support Application prefetch handling.
  3849. * The external tail offset/pointer will be updated
  3850. * at following intervals:
  3851. * 3'b000: (Prefetch feature disabled; used only for debug)
  3852. * 3'b001: 1 usec
  3853. * 3'b010: 4 usec
  3854. * 3'b011: 8 usec (default)
  3855. * 3'b100: 16 usec
  3856. * Others: Reserverd
  3857. * b'19 - response_required:
  3858. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3859. * b'20:31 - reserved: reserved for future use
  3860. */
  3861. PREPACK struct htt_sring_setup_t {
  3862. A_UINT32 msg_type: 8,
  3863. pdev_id: 8,
  3864. ring_id: 8,
  3865. ring_type: 8;
  3866. A_UINT32 ring_base_addr_lo;
  3867. A_UINT32 ring_base_addr_hi;
  3868. A_UINT32 ring_size: 16,
  3869. ring_entry_size: 8,
  3870. ring_misc_cfg_flag: 8;
  3871. A_UINT32 ring_head_offset32_remote_addr_lo;
  3872. A_UINT32 ring_head_offset32_remote_addr_hi;
  3873. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3874. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3875. A_UINT32 ring_msi_addr_lo;
  3876. A_UINT32 ring_msi_addr_hi;
  3877. A_UINT32 ring_msi_data;
  3878. A_UINT32 intr_batch_counter_th: 15,
  3879. sw_intr_mode: 1,
  3880. intr_timer_th: 16;
  3881. A_UINT32 intr_low_threshold: 16,
  3882. prefetch_timer_cfg: 3,
  3883. response_required: 1,
  3884. reserved1: 12;
  3885. } POSTPACK;
  3886. enum htt_srng_ring_type {
  3887. HTT_HW_TO_SW_RING = 0,
  3888. HTT_SW_TO_HW_RING,
  3889. HTT_SW_TO_SW_RING,
  3890. /* Insert new ring types above this line */
  3891. };
  3892. enum htt_srng_ring_id {
  3893. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3894. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3895. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3896. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3897. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3898. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3899. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3900. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3901. /* Add Other SRING which can't be directly configured by host software above this line */
  3902. };
  3903. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3904. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3905. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3906. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3907. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3908. HTT_SRING_SETUP_PDEV_ID_S)
  3909. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3910. do { \
  3911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3912. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3913. } while (0)
  3914. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3915. #define HTT_SRING_SETUP_RING_ID_S 16
  3916. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3917. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3918. HTT_SRING_SETUP_RING_ID_S)
  3919. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3920. do { \
  3921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3922. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3923. } while (0)
  3924. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3925. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3926. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3927. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3928. HTT_SRING_SETUP_RING_TYPE_S)
  3929. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3930. do { \
  3931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3932. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3933. } while (0)
  3934. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3935. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3936. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3937. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3938. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3939. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3940. do { \
  3941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  3942. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  3943. } while (0)
  3944. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3945. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3946. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3947. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3948. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3949. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3950. do { \
  3951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  3952. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  3953. } while (0)
  3954. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3955. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3956. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3957. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3958. HTT_SRING_SETUP_RING_SIZE_S)
  3959. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3960. do { \
  3961. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3962. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3963. } while (0)
  3964. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3965. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3966. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3967. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3968. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3969. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3970. do { \
  3971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3972. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3973. } while (0)
  3974. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3975. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3976. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  3977. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3978. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3979. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3980. do { \
  3981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3982. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3983. } while (0)
  3984. /* This control bit is applicable to only Producer, which updates Ring ID field
  3985. * of each descriptor before pushing into the ring.
  3986. * 0: updates ring_id(default)
  3987. * 1: ring_id updating disabled */
  3988. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  3989. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  3990. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3991. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3992. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3993. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3994. do { \
  3995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  3996. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  3997. } while (0)
  3998. /* This control bit is applicable to only Producer, which updates Loopcnt field
  3999. * of each descriptor before pushing into the ring.
  4000. * 0: updates Loopcnt(default)
  4001. * 1: Loopcnt updating disabled */
  4002. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4003. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4004. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4005. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4006. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4007. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4008. do { \
  4009. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4010. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4011. } while (0)
  4012. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4013. * into security_id port of GXI/AXI. */
  4014. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4015. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4016. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4017. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4018. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4019. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4020. do { \
  4021. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4022. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4023. } while (0)
  4024. /* During MSI write operation, SRNG drives value of this register bit into
  4025. * swap bit of GXI/AXI. */
  4026. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4027. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4028. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4029. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4030. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4031. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4032. do { \
  4033. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4034. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4035. } while (0)
  4036. /* During Pointer write operation, SRNG drives value of this register bit into
  4037. * swap bit of GXI/AXI. */
  4038. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4039. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4040. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4041. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4042. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4043. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4044. do { \
  4045. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4046. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4047. } while (0)
  4048. /* During any data or TLV write operation, SRNG drives value of this register
  4049. * bit into swap bit of GXI/AXI. */
  4050. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4051. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4053. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4054. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4055. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4056. do { \
  4057. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4058. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4059. } while (0)
  4060. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4061. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4062. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4063. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4064. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4065. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4066. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4067. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4068. do { \
  4069. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4070. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4071. } while (0)
  4072. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4073. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4074. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4076. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4077. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4081. } while (0)
  4082. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4083. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4084. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4085. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4086. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4087. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4090. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4091. } while (0)
  4092. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4093. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4094. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4095. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4096. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4097. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4100. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4101. } while (0)
  4102. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4103. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4104. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4105. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4106. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4107. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4110. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4111. } while (0)
  4112. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4113. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4114. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4116. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4117. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4121. } while (0)
  4122. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4123. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4124. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4125. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4126. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4127. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4130. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4131. } while (0)
  4132. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4133. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4134. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4135. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4136. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4137. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4140. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4141. } while (0)
  4142. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4143. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4144. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4145. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4146. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4147. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4150. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4151. } while (0)
  4152. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4153. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4154. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4155. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4156. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4157. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4160. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4161. } while (0)
  4162. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4163. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4164. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4165. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4166. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4167. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4170. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4171. } while (0)
  4172. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4173. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4174. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4175. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4176. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4177. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4180. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4181. } while (0)
  4182. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4183. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4184. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4185. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4186. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4187. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4190. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4191. } while (0)
  4192. /**
  4193. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4194. *
  4195. * @details
  4196. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4197. * configure RXDMA rings.
  4198. * The configuration is per ring based and includes both packet subtypes
  4199. * and PPDU/MPDU TLVs.
  4200. *
  4201. * The message would appear as follows:
  4202. *
  4203. * |31 26|25|24|23 16|15 8|7 0|
  4204. * |-----------------+----------------+----------------+---------------|
  4205. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4206. * |-------------------------------------------------------------------|
  4207. * | rsvd2 | ring_buffer_size |
  4208. * |-------------------------------------------------------------------|
  4209. * | packet_type_enable_flags_0 |
  4210. * |-------------------------------------------------------------------|
  4211. * | packet_type_enable_flags_1 |
  4212. * |-------------------------------------------------------------------|
  4213. * | packet_type_enable_flags_2 |
  4214. * |-------------------------------------------------------------------|
  4215. * | packet_type_enable_flags_3 |
  4216. * |-------------------------------------------------------------------|
  4217. * | tlv_filter_in_flags |
  4218. * |-------------------------------------------------------------------|
  4219. * Where:
  4220. * PS = pkt_swap
  4221. * SS = status_swap
  4222. * The message is interpreted as follows:
  4223. * dword0 - b'0:7 - msg_type: This will be set to
  4224. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4225. * b'8:15 - pdev_id:
  4226. * 0 (for rings at SOC/UMAC level),
  4227. * 1/2/3 mac id (for rings at LMAC level)
  4228. * b'16:23 - ring_id : Identify the ring to configure.
  4229. * More details can be got from enum htt_srng_ring_id
  4230. * b'24 - status_swap: 1 is to swap status TLV
  4231. * b'25 - pkt_swap: 1 is to swap packet TLV
  4232. * b'26:31 - rsvd1: reserved for future use
  4233. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4234. * in byte units.
  4235. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4236. * - b'16:31 - rsvd2: Reserved for future use
  4237. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4238. * Enable MGMT packet from 0b0000 to 0b1001
  4239. * bits from low to high: FP, MD, MO - 3 bits
  4240. * FP: Filter_Pass
  4241. * MD: Monitor_Direct
  4242. * MO: Monitor_Other
  4243. * 10 mgmt subtypes * 3 bits -> 30 bits
  4244. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4245. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4246. * Enable MGMT packet from 0b1010 to 0b1111
  4247. * bits from low to high: FP, MD, MO - 3 bits
  4248. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4249. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4250. * Enable CTRL packet from 0b0000 to 0b1001
  4251. * bits from low to high: FP, MD, MO - 3 bits
  4252. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4253. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4254. * Enable CTRL packet from 0b1010 to 0b1111,
  4255. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4256. * bits from low to high: FP, MD, MO - 3 bits
  4257. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4258. * dword6 - b'0:31 - tlv_filter_in_flags:
  4259. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4260. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4261. */
  4262. PREPACK struct htt_rx_ring_selection_cfg_t {
  4263. A_UINT32 msg_type: 8,
  4264. pdev_id: 8,
  4265. ring_id: 8,
  4266. status_swap: 1,
  4267. pkt_swap: 1,
  4268. rsvd1: 6;
  4269. A_UINT32 ring_buffer_size: 16,
  4270. rsvd2: 16;
  4271. A_UINT32 packet_type_enable_flags_0;
  4272. A_UINT32 packet_type_enable_flags_1;
  4273. A_UINT32 packet_type_enable_flags_2;
  4274. A_UINT32 packet_type_enable_flags_3;
  4275. A_UINT32 tlv_filter_in_flags;
  4276. } POSTPACK;
  4277. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4278. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4279. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4280. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4281. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4282. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4283. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4286. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4287. } while (0)
  4288. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4289. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4290. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4291. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4292. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4293. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4296. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4297. } while (0)
  4298. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4299. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4300. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4301. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4302. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4303. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4306. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4307. } while (0)
  4308. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4309. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4310. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4311. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4312. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4313. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4316. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4317. } while (0)
  4318. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4319. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4320. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4321. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4322. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4323. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4326. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4327. } while (0)
  4328. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4329. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4331. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4332. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4336. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4337. } while (0)
  4338. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4341. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4342. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4346. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4347. } while (0)
  4348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4351. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4352. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4356. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4357. } while (0)
  4358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4361. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4362. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4364. do { \
  4365. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4366. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4367. } while (0)
  4368. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4369. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4370. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4371. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4372. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4373. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4376. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4377. } while (0)
  4378. /*
  4379. * Subtype based MGMT frames enable bits.
  4380. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4381. */
  4382. /* association request */
  4383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4389. /* association response */
  4390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4396. /* Reassociation request */
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4403. /* Reassociation response */
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4410. /* Probe request */
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4417. /* Probe response */
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4424. /* Timing Advertisement */
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4431. /* Reserved */
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4438. /* Beacon */
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4445. /* ATIM */
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4452. /* Disassociation */
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4459. /* Authentication */
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4466. /* Deauthentication */
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4473. /* Action */
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4480. /* Action No Ack */
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4487. /* Reserved */
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4494. /*
  4495. * Subtype based CTRL frames enable bits.
  4496. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4497. */
  4498. /* Reserved */
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4505. /* Reserved */
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4512. /* Reserved */
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4519. /* Reserved */
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4526. /* Reserved */
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4533. /* Reserved */
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4540. /* Reserved */
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4547. /* Control Wrapper */
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4554. /* Block Ack Request */
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000001
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000001
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x00000001
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4561. /* Block Ack*/
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x00000001
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x00000001
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x00000001
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4568. /* PS-POLL */
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4575. /* RTS */
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4582. /* CTS */
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4589. /* ACK */
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4596. /* CF-END */
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4603. /* CF-END + CF-ACK */
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4610. /* Multicast data */
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4617. /* Unicast data */
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4624. /* NULL data */
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4632. do { \
  4633. HTT_CHECK_SET_VAL(httsym, value); \
  4634. (word) |= (value) << httsym##_S; \
  4635. } while (0)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4637. (((word) & httsym##_M) >> httsym##_S)
  4638. #define htt_rx_ring_pkt_enable_subtype_set( \
  4639. word, flag, mode, type, subtype, val) \
  4640. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4641. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4642. #define htt_rx_ring_pkt_enable_subtype_get( \
  4643. word, flag, mode, type, subtype) \
  4644. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4645. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4646. /* Definition to filter in TLVs */
  4647. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4648. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4649. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4650. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4652. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4657. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4658. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4659. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4660. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4665. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4673. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4674. do { \
  4675. HTT_CHECK_SET_VAL(httsym, enable); \
  4676. (word) |= (enable) << httsym##_S; \
  4677. } while (0)
  4678. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4679. (((word) & httsym##_M) >> httsym##_S)
  4680. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4681. HTT_RX_RING_TLV_ENABLE_SET( \
  4682. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4683. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4684. HTT_RX_RING_TLV_ENABLE_GET( \
  4685. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4686. /**
  4687. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4688. * host --> target Receive Flow Steering configuration message definition.
  4689. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4690. * The reason for this is we want RFS to be configured and ready before MAC
  4691. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4692. *
  4693. * |31 24|23 16|15 9|8|7 0|
  4694. * |----------------+----------------+----------------+----------------|
  4695. * | reserved |E| msg type |
  4696. * |-------------------------------------------------------------------|
  4697. * Where E = RFS enable flag
  4698. *
  4699. * The RFS_CONFIG message consists of a single 4-byte word.
  4700. *
  4701. * Header fields:
  4702. * - MSG_TYPE
  4703. * Bits 7:0
  4704. * Purpose: identifies this as a RFS config msg
  4705. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4706. * - RFS_CONFIG
  4707. * Bit 8
  4708. * Purpose: Tells target whether to enable (1) or disable (0)
  4709. * flow steering feature when sending rx indication messages to host
  4710. */
  4711. #define HTT_H2T_RFS_CONFIG_M 0x100
  4712. #define HTT_H2T_RFS_CONFIG_S 8
  4713. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4714. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4715. HTT_H2T_RFS_CONFIG_S)
  4716. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4719. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4720. } while (0)
  4721. #define HTT_RFS_CFG_REQ_BYTES 4
  4722. /**
  4723. * @brief host -> target FW extended statistics retrieve
  4724. *
  4725. * @details
  4726. * The following field definitions describe the format of the HTT host
  4727. * to target FW extended stats retrieve message.
  4728. * The message specifies the type of stats the host wants to retrieve.
  4729. *
  4730. * |31 24|23 16|15 8|7 0|
  4731. * |-----------------------------------------------------------|
  4732. * | reserved | stats type | pdev_mask | msg type |
  4733. * |-----------------------------------------------------------|
  4734. * | config param [0] |
  4735. * |-----------------------------------------------------------|
  4736. * | config param [1] |
  4737. * |-----------------------------------------------------------|
  4738. * | config param [2] |
  4739. * |-----------------------------------------------------------|
  4740. * | config param [3] |
  4741. * |-----------------------------------------------------------|
  4742. * | reserved |
  4743. * |-----------------------------------------------------------|
  4744. * | cookie LSBs |
  4745. * |-----------------------------------------------------------|
  4746. * | cookie MSBs |
  4747. * |-----------------------------------------------------------|
  4748. * Header fields:
  4749. * - MSG_TYPE
  4750. * Bits 7:0
  4751. * Purpose: identifies this is a extended stats upload request message
  4752. * Value: 0x10
  4753. * - PDEV_MASK
  4754. * Bits 8:15
  4755. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4756. * Value: This is a overloaded field, refer to usage and interpretation of
  4757. * PDEV in interface document.
  4758. * Bit 8 : Reserved for SOC stats
  4759. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4760. * Indicates MACID_MASK in DBS
  4761. * - STATS_TYPE
  4762. * Bits 23:16
  4763. * Purpose: identifies which FW statistics to upload
  4764. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4765. * - Reserved
  4766. * Bits 31:24
  4767. * - CONFIG_PARAM [0]
  4768. * Bits 31:0
  4769. * Purpose: give an opaque configuration value to the specified stats type
  4770. * Value: stats-type specific configuration value
  4771. * Refer to htt_stats.h for interpretation for each stats sub_type
  4772. * - CONFIG_PARAM [1]
  4773. * Bits 31:0
  4774. * Purpose: give an opaque configuration value to the specified stats type
  4775. * Value: stats-type specific configuration value
  4776. * Refer to htt_stats.h for interpretation for each stats sub_type
  4777. * - CONFIG_PARAM [2]
  4778. * Bits 31:0
  4779. * Purpose: give an opaque configuration value to the specified stats type
  4780. * Value: stats-type specific configuration value
  4781. * Refer to htt_stats.h for interpretation for each stats sub_type
  4782. * - CONFIG_PARAM [3]
  4783. * Bits 31:0
  4784. * Purpose: give an opaque configuration value to the specified stats type
  4785. * Value: stats-type specific configuration value
  4786. * Refer to htt_stats.h for interpretation for each stats sub_type
  4787. * - Reserved [31:0] for future use.
  4788. * - COOKIE_LSBS
  4789. * Bits 31:0
  4790. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4791. * message with its preceding host->target stats request message.
  4792. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4793. * - COOKIE_MSBS
  4794. * Bits 31:0
  4795. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4796. * message with its preceding host->target stats request message.
  4797. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4798. */
  4799. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4800. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4801. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4802. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4803. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4804. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4805. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4806. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4807. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4808. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4809. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4810. do { \
  4811. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4812. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4813. } while (0)
  4814. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4815. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4816. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4817. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4818. do { \
  4819. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4820. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4821. } while (0)
  4822. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4823. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4824. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4825. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4826. do { \
  4827. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4828. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4829. } while (0)
  4830. /**
  4831. * @brief host -> target FW PPDU_STATS request message
  4832. *
  4833. * @details
  4834. * The following field definitions describe the format of the HTT host
  4835. * to target FW for PPDU_STATS_CFG msg.
  4836. * The message allows the host to configure the PPDU_STATS_IND messages
  4837. * produced by the target.
  4838. *
  4839. * |31 24|23 16|15 8|7 0|
  4840. * |-----------------------------------------------------------|
  4841. * | REQ bit mask | pdev_mask | msg type |
  4842. * |-----------------------------------------------------------|
  4843. * Header fields:
  4844. * - MSG_TYPE
  4845. * Bits 7:0
  4846. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4847. * Value: 0x11
  4848. * - PDEV_MASK
  4849. * Bits 8:15
  4850. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4851. * Value: This is a overloaded field, refer to usage and interpretation of
  4852. * PDEV in interface document.
  4853. * Bit 8 : Reserved for SOC stats
  4854. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4855. * Indicates MACID_MASK in DBS
  4856. * - REQ_TLV_BIT_MASK
  4857. * Bits 16:31
  4858. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4859. * needs to be included in the target's PPDU_STATS_IND messages.
  4860. * Value: refer htt_ppdu_stats_tlv_tag_t
  4861. *
  4862. */
  4863. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4864. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4865. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4866. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4867. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4868. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4869. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4870. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4871. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4874. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4875. } while (0)
  4876. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4877. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4878. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4879. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4880. do { \
  4881. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4882. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4883. } while (0)
  4884. /*=== target -> host messages ===============================================*/
  4885. enum htt_t2h_msg_type {
  4886. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4887. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4888. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4889. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4890. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4891. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4892. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4893. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4894. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4895. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4896. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4897. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4898. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4899. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4900. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4901. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4902. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4903. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4904. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4905. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4906. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4907. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4908. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4909. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4910. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4911. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4912. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4913. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4914. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4915. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4916. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4917. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4918. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4919. HTT_T2H_MSG_TYPE_TEST,
  4920. /* keep this last */
  4921. HTT_T2H_NUM_MSGS
  4922. };
  4923. /*
  4924. * HTT target to host message type -
  4925. * stored in bits 7:0 of the first word of the message
  4926. */
  4927. #define HTT_T2H_MSG_TYPE_M 0xff
  4928. #define HTT_T2H_MSG_TYPE_S 0
  4929. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4932. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4933. } while (0)
  4934. #define HTT_T2H_MSG_TYPE_GET(word) \
  4935. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4936. /**
  4937. * @brief target -> host version number confirmation message definition
  4938. *
  4939. * |31 24|23 16|15 8|7 0|
  4940. * |----------------+----------------+----------------+----------------|
  4941. * | reserved | major number | minor number | msg type |
  4942. * |-------------------------------------------------------------------|
  4943. * : option request TLV (optional) |
  4944. * :...................................................................:
  4945. *
  4946. * The VER_CONF message may consist of a single 4-byte word, or may be
  4947. * extended with TLVs that specify HTT options selected by the target.
  4948. * The following option TLVs may be appended to the VER_CONF message:
  4949. * - LL_BUS_ADDR_SIZE
  4950. * - HL_SUPPRESS_TX_COMPL_IND
  4951. * - MAX_TX_QUEUE_GROUPS
  4952. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4953. * may be appended to the VER_CONF message (but only one TLV of each type).
  4954. *
  4955. * Header fields:
  4956. * - MSG_TYPE
  4957. * Bits 7:0
  4958. * Purpose: identifies this as a version number confirmation message
  4959. * Value: 0x0
  4960. * - VER_MINOR
  4961. * Bits 15:8
  4962. * Purpose: Specify the minor number of the HTT message library version
  4963. * in use by the target firmware.
  4964. * The minor number specifies the specific revision within a range
  4965. * of fundamentally compatible HTT message definition revisions.
  4966. * Compatible revisions involve adding new messages or perhaps
  4967. * adding new fields to existing messages, in a backwards-compatible
  4968. * manner.
  4969. * Incompatible revisions involve changing the message type values,
  4970. * or redefining existing messages.
  4971. * Value: minor number
  4972. * - VER_MAJOR
  4973. * Bits 15:8
  4974. * Purpose: Specify the major number of the HTT message library version
  4975. * in use by the target firmware.
  4976. * The major number specifies the family of minor revisions that are
  4977. * fundamentally compatible with each other, but not with prior or
  4978. * later families.
  4979. * Value: major number
  4980. */
  4981. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4982. #define HTT_VER_CONF_MINOR_S 8
  4983. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4984. #define HTT_VER_CONF_MAJOR_S 16
  4985. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4986. do { \
  4987. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4988. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4989. } while (0)
  4990. #define HTT_VER_CONF_MINOR_GET(word) \
  4991. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4992. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4995. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  4996. } while (0)
  4997. #define HTT_VER_CONF_MAJOR_GET(word) \
  4998. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  4999. #define HTT_VER_CONF_BYTES 4
  5000. /**
  5001. * @brief - target -> host HTT Rx In order indication message
  5002. *
  5003. * @details
  5004. *
  5005. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5006. * |----------------+-------------------+---------------------+---------------|
  5007. * | peer ID | P| F| O| ext TID | msg type |
  5008. * |--------------------------------------------------------------------------|
  5009. * | MSDU count | Reserved | vdev id |
  5010. * |--------------------------------------------------------------------------|
  5011. * | MSDU 0 bus address (bits 31:0) |
  5012. #if HTT_PADDR64
  5013. * | MSDU 0 bus address (bits 63:32) |
  5014. #endif
  5015. * |--------------------------------------------------------------------------|
  5016. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5017. * |--------------------------------------------------------------------------|
  5018. * | MSDU 1 bus address (bits 31:0) |
  5019. #if HTT_PADDR64
  5020. * | MSDU 1 bus address (bits 63:32) |
  5021. #endif
  5022. * |--------------------------------------------------------------------------|
  5023. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5024. * |--------------------------------------------------------------------------|
  5025. */
  5026. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5027. *
  5028. * @details
  5029. * bits
  5030. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5031. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5032. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5033. * | | frag | | | | fail |chksum fail|
  5034. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5035. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5036. */
  5037. struct htt_rx_in_ord_paddr_ind_hdr_t
  5038. {
  5039. A_UINT32 /* word 0 */
  5040. msg_type: 8,
  5041. ext_tid: 5,
  5042. offload: 1,
  5043. frag: 1,
  5044. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5045. peer_id: 16;
  5046. A_UINT32 /* word 1 */
  5047. vap_id: 8,
  5048. reserved_1: 8,
  5049. msdu_cnt: 16;
  5050. };
  5051. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5052. {
  5053. A_UINT32 dma_addr;
  5054. A_UINT32
  5055. length: 16,
  5056. fw_desc: 8,
  5057. msdu_info:8;
  5058. };
  5059. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5060. {
  5061. A_UINT32 dma_addr_lo;
  5062. A_UINT32 dma_addr_hi;
  5063. A_UINT32
  5064. length: 16,
  5065. fw_desc: 8,
  5066. msdu_info:8;
  5067. };
  5068. #if HTT_PADDR64
  5069. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5070. #else
  5071. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5072. #endif
  5073. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5074. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5075. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5076. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5077. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5078. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5079. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5080. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5081. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5082. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5083. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5084. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5085. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5086. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5087. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5088. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5089. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5090. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5091. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5092. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5093. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5094. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5095. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5096. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5097. /* for systems using 64-bit format for bus addresses */
  5098. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5099. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5100. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5101. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5102. /* for systems using 32-bit format for bus addresses */
  5103. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5104. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5106. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5107. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5108. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5109. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5110. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5111. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5112. do { \
  5113. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5114. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5115. } while (0)
  5116. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5117. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5118. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5119. do { \
  5120. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5121. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5122. } while (0)
  5123. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5124. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5125. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5126. do { \
  5127. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5128. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5129. } while (0)
  5130. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5131. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5132. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5133. do { \
  5134. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5135. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5136. } while (0)
  5137. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5138. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5139. /* for systems using 64-bit format for bus addresses */
  5140. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5141. do { \
  5142. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5143. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5144. } while (0)
  5145. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5146. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5147. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5148. do { \
  5149. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5150. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5151. } while (0)
  5152. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5153. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5154. /* for systems using 32-bit format for bus addresses */
  5155. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5156. do { \
  5157. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5158. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5159. } while (0)
  5160. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5161. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5162. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5163. do { \
  5164. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5165. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5166. } while (0)
  5167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5168. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5169. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5170. do { \
  5171. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5172. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5173. } while (0)
  5174. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5175. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5177. do { \
  5178. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5179. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5180. } while (0)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5182. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5183. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5184. do { \
  5185. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5186. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5187. } while (0)
  5188. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5189. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5190. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5193. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5194. } while (0)
  5195. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5196. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5197. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5198. do { \
  5199. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5200. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5201. } while (0)
  5202. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5203. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5204. /* definitions used within target -> host rx indication message */
  5205. PREPACK struct htt_rx_ind_hdr_prefix_t
  5206. {
  5207. A_UINT32 /* word 0 */
  5208. msg_type: 8,
  5209. ext_tid: 5,
  5210. release_valid: 1,
  5211. flush_valid: 1,
  5212. reserved0: 1,
  5213. peer_id: 16;
  5214. A_UINT32 /* word 1 */
  5215. flush_start_seq_num: 6,
  5216. flush_end_seq_num: 6,
  5217. release_start_seq_num: 6,
  5218. release_end_seq_num: 6,
  5219. num_mpdu_ranges: 8;
  5220. } POSTPACK;
  5221. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5222. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5223. #define HTT_TGT_RSSI_INVALID 0x80
  5224. PREPACK struct htt_rx_ppdu_desc_t
  5225. {
  5226. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5227. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5228. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5229. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5230. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5231. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5232. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5233. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5234. A_UINT32 /* word 0 */
  5235. rssi_cmb: 8,
  5236. timestamp_submicrosec: 8,
  5237. phy_err_code: 8,
  5238. phy_err: 1,
  5239. legacy_rate: 4,
  5240. legacy_rate_sel: 1,
  5241. end_valid: 1,
  5242. start_valid: 1;
  5243. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5244. union {
  5245. A_UINT32 /* word 1 */
  5246. rssi0_pri20: 8,
  5247. rssi0_ext20: 8,
  5248. rssi0_ext40: 8,
  5249. rssi0_ext80: 8;
  5250. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5251. } u0;
  5252. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5253. union {
  5254. A_UINT32 /* word 2 */
  5255. rssi1_pri20: 8,
  5256. rssi1_ext20: 8,
  5257. rssi1_ext40: 8,
  5258. rssi1_ext80: 8;
  5259. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5260. } u1;
  5261. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5262. union {
  5263. A_UINT32 /* word 3 */
  5264. rssi2_pri20: 8,
  5265. rssi2_ext20: 8,
  5266. rssi2_ext40: 8,
  5267. rssi2_ext80: 8;
  5268. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5269. } u2;
  5270. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5271. union {
  5272. A_UINT32 /* word 4 */
  5273. rssi3_pri20: 8,
  5274. rssi3_ext20: 8,
  5275. rssi3_ext40: 8,
  5276. rssi3_ext80: 8;
  5277. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5278. } u3;
  5279. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5280. A_UINT32 tsf32; /* word 5 */
  5281. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5282. A_UINT32 timestamp_microsec; /* word 6 */
  5283. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5284. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5285. A_UINT32 /* word 7 */
  5286. vht_sig_a1: 24,
  5287. preamble_type: 8;
  5288. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5289. A_UINT32 /* word 8 */
  5290. vht_sig_a2: 24,
  5291. reserved0: 8;
  5292. } POSTPACK;
  5293. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5294. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5295. PREPACK struct htt_rx_ind_hdr_suffix_t
  5296. {
  5297. A_UINT32 /* word 0 */
  5298. fw_rx_desc_bytes: 16,
  5299. reserved0: 16;
  5300. } POSTPACK;
  5301. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5302. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5303. PREPACK struct htt_rx_ind_hdr_t
  5304. {
  5305. struct htt_rx_ind_hdr_prefix_t prefix;
  5306. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5307. struct htt_rx_ind_hdr_suffix_t suffix;
  5308. } POSTPACK;
  5309. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5310. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5311. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5312. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5313. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5314. /*
  5315. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5316. * the offset into the HTT rx indication message at which the
  5317. * FW rx PPDU descriptor resides
  5318. */
  5319. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5320. /*
  5321. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5322. * the offset into the HTT rx indication message at which the
  5323. * header suffix (FW rx MSDU byte count) resides
  5324. */
  5325. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5326. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5327. /*
  5328. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5329. * the offset into the HTT rx indication message at which the per-MSDU
  5330. * information starts
  5331. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5332. * per-MSDU information portion of the message. The per-MSDU info itself
  5333. * starts at byte 12.
  5334. */
  5335. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5336. /**
  5337. * @brief target -> host rx indication message definition
  5338. *
  5339. * @details
  5340. * The following field definitions describe the format of the rx indication
  5341. * message sent from the target to the host.
  5342. * The message consists of three major sections:
  5343. * 1. a fixed-length header
  5344. * 2. a variable-length list of firmware rx MSDU descriptors
  5345. * 3. one or more 4-octet MPDU range information elements
  5346. * The fixed length header itself has two sub-sections
  5347. * 1. the message meta-information, including identification of the
  5348. * sender and type of the received data, and a 4-octet flush/release IE
  5349. * 2. the firmware rx PPDU descriptor
  5350. *
  5351. * The format of the message is depicted below.
  5352. * in this depiction, the following abbreviations are used for information
  5353. * elements within the message:
  5354. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5355. * elements associated with the PPDU start are valid.
  5356. * Specifically, the following fields are valid only if SV is set:
  5357. * RSSI (all variants), L, legacy rate, preamble type, service,
  5358. * VHT-SIG-A
  5359. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5360. * elements associated with the PPDU end are valid.
  5361. * Specifically, the following fields are valid only if EV is set:
  5362. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5363. * - L - Legacy rate selector - if legacy rates are used, this flag
  5364. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5365. * (L == 0) PHY.
  5366. * - P - PHY error flag - boolean indication of whether the rx frame had
  5367. * a PHY error
  5368. *
  5369. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5370. * |----------------+-------------------+---------------------+---------------|
  5371. * | peer ID | |RV|FV| ext TID | msg type |
  5372. * |--------------------------------------------------------------------------|
  5373. * | num | release | release | flush | flush |
  5374. * | MPDU | end | start | end | start |
  5375. * | ranges | seq num | seq num | seq num | seq num |
  5376. * |==========================================================================|
  5377. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5378. * |V|V| | rate | | | timestamp | RSSI |
  5379. * |--------------------------------------------------------------------------|
  5380. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5381. * |--------------------------------------------------------------------------|
  5382. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5383. * |--------------------------------------------------------------------------|
  5384. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5385. * |--------------------------------------------------------------------------|
  5386. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5387. * |--------------------------------------------------------------------------|
  5388. * | TSF LSBs |
  5389. * |--------------------------------------------------------------------------|
  5390. * | microsec timestamp |
  5391. * |--------------------------------------------------------------------------|
  5392. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5393. * |--------------------------------------------------------------------------|
  5394. * | service | HT-SIG / VHT-SIG-A2 |
  5395. * |==========================================================================|
  5396. * | reserved | FW rx desc bytes |
  5397. * |--------------------------------------------------------------------------|
  5398. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5399. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5400. * |--------------------------------------------------------------------------|
  5401. * : : :
  5402. * |--------------------------------------------------------------------------|
  5403. * | alignment | MSDU Rx |
  5404. * | padding | desc Bn |
  5405. * |--------------------------------------------------------------------------|
  5406. * | reserved | MPDU range status | MPDU count |
  5407. * |--------------------------------------------------------------------------|
  5408. * : reserved : MPDU range status : MPDU count :
  5409. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5410. *
  5411. * Header fields:
  5412. * - MSG_TYPE
  5413. * Bits 7:0
  5414. * Purpose: identifies this as an rx indication message
  5415. * Value: 0x1
  5416. * - EXT_TID
  5417. * Bits 12:8
  5418. * Purpose: identify the traffic ID of the rx data, including
  5419. * special "extended" TID values for multicast, broadcast, and
  5420. * non-QoS data frames
  5421. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5422. * - FLUSH_VALID (FV)
  5423. * Bit 13
  5424. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5425. * is valid
  5426. * Value:
  5427. * 1 -> flush IE is valid and needs to be processed
  5428. * 0 -> flush IE is not valid and should be ignored
  5429. * - REL_VALID (RV)
  5430. * Bit 13
  5431. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5432. * is valid
  5433. * Value:
  5434. * 1 -> release IE is valid and needs to be processed
  5435. * 0 -> release IE is not valid and should be ignored
  5436. * - PEER_ID
  5437. * Bits 31:16
  5438. * Purpose: Identify, by ID, which peer sent the rx data
  5439. * Value: ID of the peer who sent the rx data
  5440. * - FLUSH_SEQ_NUM_START
  5441. * Bits 5:0
  5442. * Purpose: Indicate the start of a series of MPDUs to flush
  5443. * Not all MPDUs within this series are necessarily valid - the host
  5444. * must check each sequence number within this range to see if the
  5445. * corresponding MPDU is actually present.
  5446. * This field is only valid if the FV bit is set.
  5447. * Value:
  5448. * The sequence number for the first MPDUs to check to flush.
  5449. * The sequence number is masked by 0x3f.
  5450. * - FLUSH_SEQ_NUM_END
  5451. * Bits 11:6
  5452. * Purpose: Indicate the end of a series of MPDUs to flush
  5453. * Value:
  5454. * The sequence number one larger than the sequence number of the
  5455. * last MPDU to check to flush.
  5456. * The sequence number is masked by 0x3f.
  5457. * Not all MPDUs within this series are necessarily valid - the host
  5458. * must check each sequence number within this range to see if the
  5459. * corresponding MPDU is actually present.
  5460. * This field is only valid if the FV bit is set.
  5461. * - REL_SEQ_NUM_START
  5462. * Bits 17:12
  5463. * Purpose: Indicate the start of a series of MPDUs to release.
  5464. * All MPDUs within this series are present and valid - the host
  5465. * need not check each sequence number within this range to see if
  5466. * the corresponding MPDU is actually present.
  5467. * This field is only valid if the RV bit is set.
  5468. * Value:
  5469. * The sequence number for the first MPDUs to check to release.
  5470. * The sequence number is masked by 0x3f.
  5471. * - REL_SEQ_NUM_END
  5472. * Bits 23:18
  5473. * Purpose: Indicate the end of a series of MPDUs to release.
  5474. * Value:
  5475. * The sequence number one larger than the sequence number of the
  5476. * last MPDU to check to release.
  5477. * The sequence number is masked by 0x3f.
  5478. * All MPDUs within this series are present and valid - the host
  5479. * need not check each sequence number within this range to see if
  5480. * the corresponding MPDU is actually present.
  5481. * This field is only valid if the RV bit is set.
  5482. * - NUM_MPDU_RANGES
  5483. * Bits 31:24
  5484. * Purpose: Indicate how many ranges of MPDUs are present.
  5485. * Each MPDU range consists of a series of contiguous MPDUs within the
  5486. * rx frame sequence which all have the same MPDU status.
  5487. * Value: 1-63 (typically a small number, like 1-3)
  5488. *
  5489. * Rx PPDU descriptor fields:
  5490. * - RSSI_CMB
  5491. * Bits 7:0
  5492. * Purpose: Combined RSSI from all active rx chains, across the active
  5493. * bandwidth.
  5494. * Value: RSSI dB units w.r.t. noise floor
  5495. * - TIMESTAMP_SUBMICROSEC
  5496. * Bits 15:8
  5497. * Purpose: high-resolution timestamp
  5498. * Value:
  5499. * Sub-microsecond time of PPDU reception.
  5500. * This timestamp ranges from [0,MAC clock MHz).
  5501. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5502. * to form a high-resolution, large range rx timestamp.
  5503. * - PHY_ERR_CODE
  5504. * Bits 23:16
  5505. * Purpose:
  5506. * If the rx frame processing resulted in a PHY error, indicate what
  5507. * type of rx PHY error occurred.
  5508. * Value:
  5509. * This field is valid if the "P" (PHY_ERR) flag is set.
  5510. * TBD: document/specify the values for this field
  5511. * - PHY_ERR
  5512. * Bit 24
  5513. * Purpose: indicate whether the rx PPDU had a PHY error
  5514. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5515. * - LEGACY_RATE
  5516. * Bits 28:25
  5517. * Purpose:
  5518. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5519. * specify which rate was used.
  5520. * Value:
  5521. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5522. * flag.
  5523. * If LEGACY_RATE_SEL is 0:
  5524. * 0x8: OFDM 48 Mbps
  5525. * 0x9: OFDM 24 Mbps
  5526. * 0xA: OFDM 12 Mbps
  5527. * 0xB: OFDM 6 Mbps
  5528. * 0xC: OFDM 54 Mbps
  5529. * 0xD: OFDM 36 Mbps
  5530. * 0xE: OFDM 18 Mbps
  5531. * 0xF: OFDM 9 Mbps
  5532. * If LEGACY_RATE_SEL is 1:
  5533. * 0x8: CCK 11 Mbps long preamble
  5534. * 0x9: CCK 5.5 Mbps long preamble
  5535. * 0xA: CCK 2 Mbps long preamble
  5536. * 0xB: CCK 1 Mbps long preamble
  5537. * 0xC: CCK 11 Mbps short preamble
  5538. * 0xD: CCK 5.5 Mbps short preamble
  5539. * 0xE: CCK 2 Mbps short preamble
  5540. * - LEGACY_RATE_SEL
  5541. * Bit 29
  5542. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5543. * Value:
  5544. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5545. * used a legacy rate.
  5546. * 0 -> OFDM, 1 -> CCK
  5547. * - END_VALID
  5548. * Bit 30
  5549. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5550. * the start of the PPDU are valid. Specifically, the following
  5551. * fields are only valid if END_VALID is set:
  5552. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5553. * TIMESTAMP_SUBMICROSEC
  5554. * Value:
  5555. * 0 -> rx PPDU desc end fields are not valid
  5556. * 1 -> rx PPDU desc end fields are valid
  5557. * - START_VALID
  5558. * Bit 31
  5559. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5560. * the end of the PPDU are valid. Specifically, the following
  5561. * fields are only valid if START_VALID is set:
  5562. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5563. * VHT-SIG-A
  5564. * Value:
  5565. * 0 -> rx PPDU desc start fields are not valid
  5566. * 1 -> rx PPDU desc start fields are valid
  5567. * - RSSI0_PRI20
  5568. * Bits 7:0
  5569. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5570. * Value: RSSI dB units w.r.t. noise floor
  5571. *
  5572. * - RSSI0_EXT20
  5573. * Bits 7:0
  5574. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5575. * (if the rx bandwidth was >= 40 MHz)
  5576. * Value: RSSI dB units w.r.t. noise floor
  5577. * - RSSI0_EXT40
  5578. * Bits 7:0
  5579. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5580. * (if the rx bandwidth was >= 80 MHz)
  5581. * Value: RSSI dB units w.r.t. noise floor
  5582. * - RSSI0_EXT80
  5583. * Bits 7:0
  5584. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5585. * (if the rx bandwidth was >= 160 MHz)
  5586. * Value: RSSI dB units w.r.t. noise floor
  5587. *
  5588. * - RSSI1_PRI20
  5589. * Bits 7:0
  5590. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5591. * Value: RSSI dB units w.r.t. noise floor
  5592. * - RSSI1_EXT20
  5593. * Bits 7:0
  5594. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5595. * (if the rx bandwidth was >= 40 MHz)
  5596. * Value: RSSI dB units w.r.t. noise floor
  5597. * - RSSI1_EXT40
  5598. * Bits 7:0
  5599. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5600. * (if the rx bandwidth was >= 80 MHz)
  5601. * Value: RSSI dB units w.r.t. noise floor
  5602. * - RSSI1_EXT80
  5603. * Bits 7:0
  5604. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5605. * (if the rx bandwidth was >= 160 MHz)
  5606. * Value: RSSI dB units w.r.t. noise floor
  5607. *
  5608. * - RSSI2_PRI20
  5609. * Bits 7:0
  5610. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5611. * Value: RSSI dB units w.r.t. noise floor
  5612. * - RSSI2_EXT20
  5613. * Bits 7:0
  5614. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5615. * (if the rx bandwidth was >= 40 MHz)
  5616. * Value: RSSI dB units w.r.t. noise floor
  5617. * - RSSI2_EXT40
  5618. * Bits 7:0
  5619. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5620. * (if the rx bandwidth was >= 80 MHz)
  5621. * Value: RSSI dB units w.r.t. noise floor
  5622. * - RSSI2_EXT80
  5623. * Bits 7:0
  5624. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5625. * (if the rx bandwidth was >= 160 MHz)
  5626. * Value: RSSI dB units w.r.t. noise floor
  5627. *
  5628. * - RSSI3_PRI20
  5629. * Bits 7:0
  5630. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5631. * Value: RSSI dB units w.r.t. noise floor
  5632. * - RSSI3_EXT20
  5633. * Bits 7:0
  5634. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5635. * (if the rx bandwidth was >= 40 MHz)
  5636. * Value: RSSI dB units w.r.t. noise floor
  5637. * - RSSI3_EXT40
  5638. * Bits 7:0
  5639. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5640. * (if the rx bandwidth was >= 80 MHz)
  5641. * Value: RSSI dB units w.r.t. noise floor
  5642. * - RSSI3_EXT80
  5643. * Bits 7:0
  5644. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5645. * (if the rx bandwidth was >= 160 MHz)
  5646. * Value: RSSI dB units w.r.t. noise floor
  5647. *
  5648. * - TSF32
  5649. * Bits 31:0
  5650. * Purpose: specify the time the rx PPDU was received, in TSF units
  5651. * Value: 32 LSBs of the TSF
  5652. * - TIMESTAMP_MICROSEC
  5653. * Bits 31:0
  5654. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5655. * Value: PPDU rx time, in microseconds
  5656. * - VHT_SIG_A1
  5657. * Bits 23:0
  5658. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5659. * from the rx PPDU
  5660. * Value:
  5661. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5662. * VHT-SIG-A1 data.
  5663. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5664. * first 24 bits of the HT-SIG data.
  5665. * Otherwise, this field is invalid.
  5666. * Refer to the the 802.11 protocol for the definition of the
  5667. * HT-SIG and VHT-SIG-A1 fields
  5668. * - VHT_SIG_A2
  5669. * Bits 23:0
  5670. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5671. * from the rx PPDU
  5672. * Value:
  5673. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5674. * VHT-SIG-A2 data.
  5675. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5676. * last 24 bits of the HT-SIG data.
  5677. * Otherwise, this field is invalid.
  5678. * Refer to the the 802.11 protocol for the definition of the
  5679. * HT-SIG and VHT-SIG-A2 fields
  5680. * - PREAMBLE_TYPE
  5681. * Bits 31:24
  5682. * Purpose: indicate the PHY format of the received burst
  5683. * Value:
  5684. * 0x4: Legacy (OFDM/CCK)
  5685. * 0x8: HT
  5686. * 0x9: HT with TxBF
  5687. * 0xC: VHT
  5688. * 0xD: VHT with TxBF
  5689. * - SERVICE
  5690. * Bits 31:24
  5691. * Purpose: TBD
  5692. * Value: TBD
  5693. *
  5694. * Rx MSDU descriptor fields:
  5695. * - FW_RX_DESC_BYTES
  5696. * Bits 15:0
  5697. * Purpose: Indicate how many bytes in the Rx indication are used for
  5698. * FW Rx descriptors
  5699. *
  5700. * Payload fields:
  5701. * - MPDU_COUNT
  5702. * Bits 7:0
  5703. * Purpose: Indicate how many sequential MPDUs share the same status.
  5704. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5705. * - MPDU_STATUS
  5706. * Bits 15:8
  5707. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5708. * received successfully.
  5709. * Value:
  5710. * 0x1: success
  5711. * 0x2: FCS error
  5712. * 0x3: duplicate error
  5713. * 0x4: replay error
  5714. * 0x5: invalid peer
  5715. */
  5716. /* header fields */
  5717. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5718. #define HTT_RX_IND_EXT_TID_S 8
  5719. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5720. #define HTT_RX_IND_FLUSH_VALID_S 13
  5721. #define HTT_RX_IND_REL_VALID_M 0x4000
  5722. #define HTT_RX_IND_REL_VALID_S 14
  5723. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5724. #define HTT_RX_IND_PEER_ID_S 16
  5725. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5726. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5727. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5728. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5729. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5730. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5731. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5732. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5733. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5734. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5735. /* rx PPDU descriptor fields */
  5736. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5737. #define HTT_RX_IND_RSSI_CMB_S 0
  5738. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5739. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5740. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5741. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5742. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5743. #define HTT_RX_IND_PHY_ERR_S 24
  5744. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5745. #define HTT_RX_IND_LEGACY_RATE_S 25
  5746. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5747. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5748. #define HTT_RX_IND_END_VALID_M 0x40000000
  5749. #define HTT_RX_IND_END_VALID_S 30
  5750. #define HTT_RX_IND_START_VALID_M 0x80000000
  5751. #define HTT_RX_IND_START_VALID_S 31
  5752. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5753. #define HTT_RX_IND_RSSI_PRI20_S 0
  5754. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5755. #define HTT_RX_IND_RSSI_EXT20_S 8
  5756. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5757. #define HTT_RX_IND_RSSI_EXT40_S 16
  5758. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5759. #define HTT_RX_IND_RSSI_EXT80_S 24
  5760. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5761. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5762. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5763. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5764. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5765. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5766. #define HTT_RX_IND_SERVICE_M 0xff000000
  5767. #define HTT_RX_IND_SERVICE_S 24
  5768. /* rx MSDU descriptor fields */
  5769. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5770. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5771. /* payload fields */
  5772. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5773. #define HTT_RX_IND_MPDU_COUNT_S 0
  5774. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5775. #define HTT_RX_IND_MPDU_STATUS_S 8
  5776. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5777. do { \
  5778. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5779. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5780. } while (0)
  5781. #define HTT_RX_IND_EXT_TID_GET(word) \
  5782. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5783. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5784. do { \
  5785. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5786. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5787. } while (0)
  5788. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5789. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5790. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5791. do { \
  5792. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5793. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5794. } while (0)
  5795. #define HTT_RX_IND_REL_VALID_GET(word) \
  5796. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5797. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5798. do { \
  5799. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5800. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5801. } while (0)
  5802. #define HTT_RX_IND_PEER_ID_GET(word) \
  5803. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5804. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5805. do { \
  5806. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5807. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5808. } while (0)
  5809. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5810. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5811. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5812. do { \
  5813. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5814. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5815. } while (0)
  5816. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5817. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5818. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5819. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5820. do { \
  5821. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5822. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5823. } while (0)
  5824. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5825. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5826. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5827. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5828. do { \
  5829. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5830. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5831. } while (0)
  5832. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5833. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5834. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5835. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5836. do { \
  5837. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5838. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5839. } while (0)
  5840. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5841. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5842. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5843. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5844. do { \
  5845. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5846. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5847. } while (0)
  5848. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5849. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5850. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5851. /* FW rx PPDU descriptor fields */
  5852. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5853. do { \
  5854. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5855. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5856. } while (0)
  5857. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5858. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5859. HTT_RX_IND_RSSI_CMB_S)
  5860. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5861. do { \
  5862. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5863. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5864. } while (0)
  5865. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5866. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5867. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5868. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5869. do { \
  5870. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5871. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5872. } while (0)
  5873. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5874. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5875. HTT_RX_IND_PHY_ERR_CODE_S)
  5876. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5879. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5880. } while (0)
  5881. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5882. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5883. HTT_RX_IND_PHY_ERR_S)
  5884. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5885. do { \
  5886. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5887. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5888. } while (0)
  5889. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5890. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5891. HTT_RX_IND_LEGACY_RATE_S)
  5892. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5893. do { \
  5894. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5895. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5896. } while (0)
  5897. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5898. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5899. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5900. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5901. do { \
  5902. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5903. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5904. } while (0)
  5905. #define HTT_RX_IND_END_VALID_GET(word) \
  5906. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5907. HTT_RX_IND_END_VALID_S)
  5908. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5909. do { \
  5910. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5911. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5912. } while (0)
  5913. #define HTT_RX_IND_START_VALID_GET(word) \
  5914. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5915. HTT_RX_IND_START_VALID_S)
  5916. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5917. do { \
  5918. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5919. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5920. } while (0)
  5921. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5922. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5923. HTT_RX_IND_RSSI_PRI20_S)
  5924. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5925. do { \
  5926. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5927. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5928. } while (0)
  5929. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5930. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5931. HTT_RX_IND_RSSI_EXT20_S)
  5932. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5933. do { \
  5934. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5935. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5936. } while (0)
  5937. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5938. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5939. HTT_RX_IND_RSSI_EXT40_S)
  5940. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5941. do { \
  5942. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5943. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5944. } while (0)
  5945. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5946. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5947. HTT_RX_IND_RSSI_EXT80_S)
  5948. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5949. do { \
  5950. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5951. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5952. } while (0)
  5953. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5954. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5955. HTT_RX_IND_VHT_SIG_A1_S)
  5956. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5957. do { \
  5958. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5959. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5960. } while (0)
  5961. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5962. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5963. HTT_RX_IND_VHT_SIG_A2_S)
  5964. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5965. do { \
  5966. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5967. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5968. } while (0)
  5969. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5970. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5971. HTT_RX_IND_PREAMBLE_TYPE_S)
  5972. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5973. do { \
  5974. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5975. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5976. } while (0)
  5977. #define HTT_RX_IND_SERVICE_GET(word) \
  5978. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5979. HTT_RX_IND_SERVICE_S)
  5980. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5981. do { \
  5982. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5983. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5984. } while (0)
  5985. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5986. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5987. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5990. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5991. } while (0)
  5992. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5993. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5994. #define HTT_RX_IND_HL_BYTES \
  5995. (HTT_RX_IND_HDR_BYTES + \
  5996. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  5997. 4 /* single MPDU range information element */)
  5998. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  5999. /* Could we use one macro entry? */
  6000. #define HTT_WORD_SET(word, field, value) \
  6001. do { \
  6002. HTT_CHECK_SET_VAL(field, value); \
  6003. (word) |= ((value) << field ## _S); \
  6004. } while (0)
  6005. #define HTT_WORD_GET(word, field) \
  6006. (((word) & field ## _M) >> field ## _S)
  6007. PREPACK struct hl_htt_rx_ind_base {
  6008. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6009. } POSTPACK;
  6010. /*
  6011. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6012. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6013. * HL host needed info. The field is just after the msdu fw rx desc.
  6014. */
  6015. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6016. struct htt_rx_ind_hl_rx_desc_t {
  6017. A_UINT8 ver;
  6018. A_UINT8 len;
  6019. struct {
  6020. A_UINT8
  6021. first_msdu: 1,
  6022. last_msdu: 1,
  6023. c3_failed: 1,
  6024. c4_failed: 1,
  6025. ipv6: 1,
  6026. tcp: 1,
  6027. udp: 1,
  6028. reserved: 1;
  6029. } flags;
  6030. };
  6031. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6032. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6033. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6034. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6035. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6036. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6037. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6038. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6039. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6040. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6041. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6042. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6043. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6044. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6045. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6046. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6047. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6048. /* This structure is used in HL, the basic descriptor information
  6049. * used by host. the structure is translated by FW from HW desc
  6050. * or generated by FW. But in HL monitor mode, the host would use
  6051. * the same structure with LL.
  6052. */
  6053. PREPACK struct hl_htt_rx_desc_base {
  6054. A_UINT32
  6055. seq_num:12,
  6056. encrypted:1,
  6057. chan_info_present:1,
  6058. resv0:2,
  6059. mcast_bcast:1,
  6060. fragment:1,
  6061. key_id_oct:8,
  6062. resv1:6;
  6063. A_UINT32
  6064. pn_31_0;
  6065. union {
  6066. struct {
  6067. A_UINT16 pn_47_32;
  6068. A_UINT16 pn_63_48;
  6069. } pn16;
  6070. A_UINT32 pn_63_32;
  6071. } u0;
  6072. A_UINT32
  6073. pn_95_64;
  6074. A_UINT32
  6075. pn_127_96;
  6076. } POSTPACK;
  6077. /*
  6078. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6079. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6080. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6081. * Please see htt_chan_change_t for description of the fields.
  6082. */
  6083. PREPACK struct htt_chan_info_t
  6084. {
  6085. A_UINT32 primary_chan_center_freq_mhz: 16,
  6086. contig_chan1_center_freq_mhz: 16;
  6087. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6088. phy_mode: 8,
  6089. reserved: 8;
  6090. } POSTPACK;
  6091. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6092. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6093. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6094. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6095. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6096. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6097. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6098. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6099. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6100. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6101. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6102. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6103. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6104. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6105. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6106. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6107. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6108. /* Channel information */
  6109. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6110. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6111. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6112. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6113. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6114. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6115. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6116. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6117. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6118. do { \
  6119. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6120. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6121. } while (0)
  6122. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6123. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6124. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6127. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6128. } while (0)
  6129. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6130. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6131. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6132. do { \
  6133. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6134. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6135. } while (0)
  6136. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6137. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6138. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6139. do { \
  6140. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6141. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6142. } while (0)
  6143. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6144. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6145. /*
  6146. * @brief target -> host rx reorder flush message definition
  6147. *
  6148. * @details
  6149. * The following field definitions describe the format of the rx flush
  6150. * message sent from the target to the host.
  6151. * The message consists of a 4-octet header, followed by one or more
  6152. * 4-octet payload information elements.
  6153. *
  6154. * |31 24|23 8|7 0|
  6155. * |--------------------------------------------------------------|
  6156. * | TID | peer ID | msg type |
  6157. * |--------------------------------------------------------------|
  6158. * | seq num end | seq num start | MPDU status | reserved |
  6159. * |--------------------------------------------------------------|
  6160. * First DWORD:
  6161. * - MSG_TYPE
  6162. * Bits 7:0
  6163. * Purpose: identifies this as an rx flush message
  6164. * Value: 0x2
  6165. * - PEER_ID
  6166. * Bits 23:8 (only bits 18:8 actually used)
  6167. * Purpose: identify which peer's rx data is being flushed
  6168. * Value: (rx) peer ID
  6169. * - TID
  6170. * Bits 31:24 (only bits 27:24 actually used)
  6171. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6172. * Value: traffic identifier
  6173. * Second DWORD:
  6174. * - MPDU_STATUS
  6175. * Bits 15:8
  6176. * Purpose:
  6177. * Indicate whether the flushed MPDUs should be discarded or processed.
  6178. * Value:
  6179. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6180. * stages of rx processing
  6181. * other: discard the MPDUs
  6182. * It is anticipated that flush messages will always have
  6183. * MPDU status == 1, but the status flag is included for
  6184. * flexibility.
  6185. * - SEQ_NUM_START
  6186. * Bits 23:16
  6187. * Purpose:
  6188. * Indicate the start of a series of consecutive MPDUs being flushed.
  6189. * Not all MPDUs within this range are necessarily valid - the host
  6190. * must check each sequence number within this range to see if the
  6191. * corresponding MPDU is actually present.
  6192. * Value:
  6193. * The sequence number for the first MPDU in the sequence.
  6194. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6195. * - SEQ_NUM_END
  6196. * Bits 30:24
  6197. * Purpose:
  6198. * Indicate the end of a series of consecutive MPDUs being flushed.
  6199. * Value:
  6200. * The sequence number one larger than the sequence number of the
  6201. * last MPDU being flushed.
  6202. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6203. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6204. * are to be released for further rx processing.
  6205. * Not all MPDUs within this range are necessarily valid - the host
  6206. * must check each sequence number within this range to see if the
  6207. * corresponding MPDU is actually present.
  6208. */
  6209. /* first DWORD */
  6210. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6211. #define HTT_RX_FLUSH_PEER_ID_S 8
  6212. #define HTT_RX_FLUSH_TID_M 0xff000000
  6213. #define HTT_RX_FLUSH_TID_S 24
  6214. /* second DWORD */
  6215. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6216. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6217. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6218. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6219. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6220. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6221. #define HTT_RX_FLUSH_BYTES 8
  6222. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6225. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6226. } while (0)
  6227. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6228. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6229. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6232. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6233. } while (0)
  6234. #define HTT_RX_FLUSH_TID_GET(word) \
  6235. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6236. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6237. do { \
  6238. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6239. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6240. } while (0)
  6241. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6242. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6243. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6246. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6247. } while (0)
  6248. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6249. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6250. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6251. do { \
  6252. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6253. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6254. } while (0)
  6255. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6256. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6257. /*
  6258. * @brief target -> host rx pn check indication message
  6259. *
  6260. * @details
  6261. * The following field definitions describe the format of the Rx PN check
  6262. * indication message sent from the target to the host.
  6263. * The message consists of a 4-octet header, followed by the start and
  6264. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6265. * IE is one octet containing the sequence number that failed the PN
  6266. * check.
  6267. *
  6268. * |31 24|23 8|7 0|
  6269. * |--------------------------------------------------------------|
  6270. * | TID | peer ID | msg type |
  6271. * |--------------------------------------------------------------|
  6272. * | Reserved | PN IE count | seq num end | seq num start|
  6273. * |--------------------------------------------------------------|
  6274. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6275. * |--------------------------------------------------------------|
  6276. * First DWORD:
  6277. * - MSG_TYPE
  6278. * Bits 7:0
  6279. * Purpose: Identifies this as an rx pn check indication message
  6280. * Value: 0x2
  6281. * - PEER_ID
  6282. * Bits 23:8 (only bits 18:8 actually used)
  6283. * Purpose: identify which peer
  6284. * Value: (rx) peer ID
  6285. * - TID
  6286. * Bits 31:24 (only bits 27:24 actually used)
  6287. * Purpose: identify traffic identifier
  6288. * Value: traffic identifier
  6289. * Second DWORD:
  6290. * - SEQ_NUM_START
  6291. * Bits 7:0
  6292. * Purpose:
  6293. * Indicates the starting sequence number of the MPDU in this
  6294. * series of MPDUs that went though PN check.
  6295. * Value:
  6296. * The sequence number for the first MPDU in the sequence.
  6297. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6298. * - SEQ_NUM_END
  6299. * Bits 15:8
  6300. * Purpose:
  6301. * Indicates the ending sequence number of the MPDU in this
  6302. * series of MPDUs that went though PN check.
  6303. * Value:
  6304. * The sequence number one larger then the sequence number of the last
  6305. * MPDU being flushed.
  6306. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6307. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6308. * for invalid PN numbers and are ready to be released for further processing.
  6309. * Not all MPDUs within this range are necessarily valid - the host
  6310. * must check each sequence number within this range to see if the
  6311. * corresponding MPDU is actually present.
  6312. * - PN_IE_COUNT
  6313. * Bits 23:16
  6314. * Purpose:
  6315. * Used to determine the variable number of PN information elements in this
  6316. * message
  6317. *
  6318. * PN information elements:
  6319. * - PN_IE_x-
  6320. * Purpose:
  6321. * Each PN information element contains the sequence number of the MPDU that
  6322. * has failed the target PN check.
  6323. * Value:
  6324. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6325. * that failed the PN check.
  6326. */
  6327. /* first DWORD */
  6328. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6329. #define HTT_RX_PN_IND_PEER_ID_S 8
  6330. #define HTT_RX_PN_IND_TID_M 0xff000000
  6331. #define HTT_RX_PN_IND_TID_S 24
  6332. /* second DWORD */
  6333. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6334. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6335. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6336. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6337. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6338. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6339. #define HTT_RX_PN_IND_BYTES 8
  6340. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6341. do { \
  6342. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6343. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6344. } while (0)
  6345. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6346. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6347. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6350. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6351. } while (0)
  6352. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6353. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6354. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6355. do { \
  6356. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6357. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6358. } while (0)
  6359. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6360. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6361. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6364. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6365. } while (0)
  6366. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6367. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6368. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6369. do { \
  6370. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6371. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6372. } while (0)
  6373. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6374. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6375. /*
  6376. * @brief target -> host rx offload deliver message for LL system
  6377. *
  6378. * @details
  6379. * In a low latency system this message is sent whenever the offload
  6380. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6381. * The DMA of the actual packets into host memory is done before sending out
  6382. * this message. This message indicates only how many MSDUs to reap. The
  6383. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6384. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6385. * DMA'd by the MAC directly into host memory these packets do not contain
  6386. * the MAC descriptors in the header portion of the packet. Instead they contain
  6387. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6388. * message, the packets are delivered directly to the NW stack without going
  6389. * through the regular reorder buffering and PN checking path since it has
  6390. * already been done in target.
  6391. *
  6392. * |31 24|23 16|15 8|7 0|
  6393. * |-----------------------------------------------------------------------|
  6394. * | Total MSDU count | reserved | msg type |
  6395. * |-----------------------------------------------------------------------|
  6396. *
  6397. * @brief target -> host rx offload deliver message for HL system
  6398. *
  6399. * @details
  6400. * In a high latency system this message is sent whenever the offload manager
  6401. * flushes out the packets it has coalesced in its coalescing buffer. The
  6402. * actual packets are also carried along with this message. When the host
  6403. * receives this message, it is expected to deliver these packets to the NW
  6404. * stack directly instead of routing them through the reorder buffering and
  6405. * PN checking path since it has already been done in target.
  6406. *
  6407. * |31 24|23 16|15 8|7 0|
  6408. * |-----------------------------------------------------------------------|
  6409. * | Total MSDU count | reserved | msg type |
  6410. * |-----------------------------------------------------------------------|
  6411. * | peer ID | MSDU length |
  6412. * |-----------------------------------------------------------------------|
  6413. * | MSDU payload | FW Desc | tid | vdev ID |
  6414. * |-----------------------------------------------------------------------|
  6415. * | MSDU payload contd. |
  6416. * |-----------------------------------------------------------------------|
  6417. * | peer ID | MSDU length |
  6418. * |-----------------------------------------------------------------------|
  6419. * | MSDU payload | FW Desc | tid | vdev ID |
  6420. * |-----------------------------------------------------------------------|
  6421. * | MSDU payload contd. |
  6422. * |-----------------------------------------------------------------------|
  6423. *
  6424. */
  6425. /* first DWORD */
  6426. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6427. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6439. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6441. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6442. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6445. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6446. } while (0)
  6447. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6448. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6449. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6450. do { \
  6451. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6452. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6453. } while (0)
  6454. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6455. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6456. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6457. do { \
  6458. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6459. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6460. } while (0)
  6461. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6462. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6463. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6464. do { \
  6465. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6466. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6467. } while (0)
  6468. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6469. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6470. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6473. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6474. } while (0)
  6475. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6476. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6477. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6478. do { \
  6479. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6480. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6481. } while (0)
  6482. /**
  6483. * @brief target -> host rx peer map/unmap message definition
  6484. *
  6485. * @details
  6486. * The following diagram shows the format of the rx peer map message sent
  6487. * from the target to the host. This layout assumes the target operates
  6488. * as little-endian.
  6489. *
  6490. * This message always contains a SW peer ID. The main purpose of the
  6491. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6492. * with, so that the host can use that peer ID to determine which peer
  6493. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6494. * other purposes, such as identifying during tx completions which peer
  6495. * the tx frames in question were transmitted to.
  6496. *
  6497. * In certain generations of chips, the peer map message also contains
  6498. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6499. * to identify which peer the frame needs to be forwarded to (i.e. the
  6500. * peer assocated with the Destination MAC Address within the packet),
  6501. * and particularly which vdev needs to transmit the frame (for cases
  6502. * of inter-vdev rx --> tx forwarding).
  6503. * This DA-based peer ID that is provided for certain rx frames
  6504. * (the rx frames that need to be re-transmitted as tx frames)
  6505. * is the ID that the HW uses for referring to the peer in question,
  6506. * rather than the peer ID that the SW+FW use to refer to the peer.
  6507. *
  6508. *
  6509. * |31 24|23 16|15 8|7 0|
  6510. * |-----------------------------------------------------------------------|
  6511. * | SW peer ID | VDEV ID | msg type |
  6512. * |-----------------------------------------------------------------------|
  6513. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6514. * |-----------------------------------------------------------------------|
  6515. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6516. * |-----------------------------------------------------------------------|
  6517. *
  6518. *
  6519. * The following diagram shows the format of the rx peer unmap message sent
  6520. * from the target to the host.
  6521. *
  6522. * |31 24|23 16|15 8|7 0|
  6523. * |-----------------------------------------------------------------------|
  6524. * | SW peer ID | VDEV ID | msg type |
  6525. * |-----------------------------------------------------------------------|
  6526. *
  6527. * The following field definitions describe the format of the rx peer map
  6528. * and peer unmap messages sent from the target to the host.
  6529. * - MSG_TYPE
  6530. * Bits 7:0
  6531. * Purpose: identifies this as an rx peer map or peer unmap message
  6532. * Value: peer map -> 0x3, peer unmap -> 0x4
  6533. * - VDEV_ID
  6534. * Bits 15:8
  6535. * Purpose: Indicates which virtual device the peer is associated
  6536. * with.
  6537. * Value: vdev ID (used in the host to look up the vdev object)
  6538. * - PEER_ID (a.k.a. SW_PEER_ID)
  6539. * Bits 31:16
  6540. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6541. * freeing (unmap)
  6542. * Value: (rx) peer ID
  6543. * - MAC_ADDR_L32 (peer map only)
  6544. * Bits 31:0
  6545. * Purpose: Identifies which peer node the peer ID is for.
  6546. * Value: lower 4 bytes of peer node's MAC address
  6547. * - MAC_ADDR_U16 (peer map only)
  6548. * Bits 15:0
  6549. * Purpose: Identifies which peer node the peer ID is for.
  6550. * Value: upper 2 bytes of peer node's MAC address
  6551. * - HW_PEER_ID
  6552. * Bits 31:16
  6553. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6554. * address, so for rx frames marked for rx --> tx forwarding, the
  6555. * host can determine from the HW peer ID provided as meta-data with
  6556. * the rx frame which peer the frame is supposed to be forwarded to.
  6557. * Value: ID used by the MAC HW to identify the peer
  6558. */
  6559. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6560. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6561. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6562. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6563. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6564. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6565. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6566. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6567. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6568. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6569. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6570. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6571. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6572. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6573. do { \
  6574. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6575. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6576. } while (0)
  6577. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6578. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6579. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6580. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6583. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6584. } while (0)
  6585. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6586. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6587. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6588. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6589. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6590. do { \
  6591. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6592. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6593. } while (0)
  6594. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6595. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6596. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6597. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6598. #define HTT_RX_PEER_MAP_BYTES 12
  6599. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6600. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6601. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6602. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6603. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6604. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6605. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6606. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6607. #define HTT_RX_PEER_UNMAP_BYTES 4
  6608. /**
  6609. * @brief target -> host rx peer map V2 message definition
  6610. *
  6611. * @details
  6612. * The following diagram shows the format of the rx peer map v2 message sent
  6613. * from the target to the host. This layout assumes the target operates
  6614. * as little-endian.
  6615. *
  6616. * This message always contains a SW peer ID. The main purpose of the
  6617. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6618. * with, so that the host can use that peer ID to determine which peer
  6619. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6620. * other purposes, such as identifying during tx completions which peer
  6621. * the tx frames in question were transmitted to.
  6622. *
  6623. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6624. * is used during rx --> tx frame forwarding to identify which peer the
  6625. * frame needs to be forwarded to (i.e. the peer assocated with the
  6626. * Destination MAC Address within the packet), and particularly which vdev
  6627. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6628. * This DA-based peer ID that is provided for certain rx frames
  6629. * (the rx frames that need to be re-transmitted as tx frames)
  6630. * is the ID that the HW uses for referring to the peer in question,
  6631. * rather than the peer ID that the SW+FW use to refer to the peer.
  6632. *
  6633. *
  6634. * |31 24|23 16|15 8|7 0|
  6635. * |-----------------------------------------------------------------------|
  6636. * | SW peer ID | VDEV ID | msg type |
  6637. * |-----------------------------------------------------------------------|
  6638. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6639. * |-----------------------------------------------------------------------|
  6640. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6641. * |-----------------------------------------------------------------------|
  6642. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6643. * |-----------------------------------------------------------------------|
  6644. * | Reserved_0 |
  6645. * |-----------------------------------------------------------------------|
  6646. * | Reserved_1 |
  6647. * |-----------------------------------------------------------------------|
  6648. * | Reserved_2 |
  6649. * |-----------------------------------------------------------------------|
  6650. * | Reserved_3 |
  6651. * |-----------------------------------------------------------------------|
  6652. *
  6653. *
  6654. * The following field definitions describe the format of the rx peer map v2
  6655. * messages sent from the target to the host.
  6656. * - MSG_TYPE
  6657. * Bits 7:0
  6658. * Purpose: identifies this as an rx peer map v2 message
  6659. * Value: peer map v2 -> 0x1e
  6660. * - VDEV_ID
  6661. * Bits 15:8
  6662. * Purpose: Indicates which virtual device the peer is associated with.
  6663. * Value: vdev ID (used in the host to look up the vdev object)
  6664. * - SW_PEER_ID
  6665. * Bits 31:16
  6666. * Purpose: The peer ID (index) that WAL is allocating
  6667. * Value: (rx) peer ID
  6668. * - MAC_ADDR_L32
  6669. * Bits 31:0
  6670. * Purpose: Identifies which peer node the peer ID is for.
  6671. * Value: lower 4 bytes of peer node's MAC address
  6672. * - MAC_ADDR_U16
  6673. * Bits 15:0
  6674. * Purpose: Identifies which peer node the peer ID is for.
  6675. * Value: upper 2 bytes of peer node's MAC address
  6676. * - HW_PEER_ID
  6677. * Bits 31:16
  6678. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6679. * address, so for rx frames marked for rx --> tx forwarding, the
  6680. * host can determine from the HW peer ID provided as meta-data with
  6681. * the rx frame which peer the frame is supposed to be forwarded to.
  6682. * Value: ID used by the MAC HW to identify the peer
  6683. * - AST_HASH_VALUE
  6684. * Bits 15:0
  6685. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6686. * override feature.
  6687. * - NEXT_HOP
  6688. * Bit 16
  6689. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6690. * (Wireless Distribution System).
  6691. */
  6692. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6693. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6694. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6695. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6696. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6697. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6698. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6699. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6700. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6701. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6702. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6703. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6704. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6705. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6706. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6707. do { \
  6708. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6709. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6710. } while (0)
  6711. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6712. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6713. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6716. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6717. } while (0)
  6718. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6719. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6720. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6723. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6724. } while (0)
  6725. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6726. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6727. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6728. do { \
  6729. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6730. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6731. } while (0)
  6732. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6733. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6734. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6735. do { \
  6736. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6737. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6738. } while (0)
  6739. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6740. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6741. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6742. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6743. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6744. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6745. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6746. /**
  6747. * @brief target -> host rx peer unmap V2 message definition
  6748. *
  6749. *
  6750. * The following diagram shows the format of the rx peer unmap message sent
  6751. * from the target to the host.
  6752. *
  6753. * |31 24|23 16|15 8|7 0|
  6754. * |-----------------------------------------------------------------------|
  6755. * | SW peer ID | VDEV ID | msg type |
  6756. * |-----------------------------------------------------------------------|
  6757. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6758. * |-----------------------------------------------------------------------|
  6759. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6760. * |-----------------------------------------------------------------------|
  6761. * | Peer Delete Duration |
  6762. * |-----------------------------------------------------------------------|
  6763. * | Reserved_0 |
  6764. * |-----------------------------------------------------------------------|
  6765. * | Reserved_1 |
  6766. * |-----------------------------------------------------------------------|
  6767. * | Reserved_2 |
  6768. * |-----------------------------------------------------------------------|
  6769. *
  6770. *
  6771. * The following field definitions describe the format of the rx peer unmap
  6772. * messages sent from the target to the host.
  6773. * - MSG_TYPE
  6774. * Bits 7:0
  6775. * Purpose: identifies this as an rx peer unmap v2 message
  6776. * Value: peer unmap v2 -> 0x1f
  6777. * - VDEV_ID
  6778. * Bits 15:8
  6779. * Purpose: Indicates which virtual device the peer is associated
  6780. * with.
  6781. * Value: vdev ID (used in the host to look up the vdev object)
  6782. * - SW_PEER_ID
  6783. * Bits 31:16
  6784. * Purpose: The peer ID (index) that WAL is freeing
  6785. * Value: (rx) peer ID
  6786. * - MAC_ADDR_L32
  6787. * Bits 31:0
  6788. * Purpose: Identifies which peer node the peer ID is for.
  6789. * Value: lower 4 bytes of peer node's MAC address
  6790. * - MAC_ADDR_U16
  6791. * Bits 15:0
  6792. * Purpose: Identifies which peer node the peer ID is for.
  6793. * Value: upper 2 bytes of peer node's MAC address
  6794. * - NEXT_HOP
  6795. * Bits 16
  6796. * Purpose: Bit indicates next_hop AST entry used for WDS
  6797. * (Wireless Distribution System).
  6798. * - PEER_DELETE_DURATION
  6799. * Bits 31:0
  6800. * Purpose: Time taken to delete peer, in msec,
  6801. * Used for monitoring / debugging PEER delete response delay
  6802. */
  6803. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6804. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6805. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6806. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6807. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6808. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6809. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6810. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6811. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6812. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6813. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6814. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6815. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6816. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6817. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6818. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6819. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6820. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6821. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6822. do { \
  6823. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6824. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6825. } while (0)
  6826. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6827. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6828. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6829. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6830. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6831. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6832. /**
  6833. * @brief target -> host message specifying security parameters
  6834. *
  6835. * @details
  6836. * The following diagram shows the format of the security specification
  6837. * message sent from the target to the host.
  6838. * This security specification message tells the host whether a PN check is
  6839. * necessary on rx data frames, and if so, how large the PN counter is.
  6840. * This message also tells the host about the security processing to apply
  6841. * to defragmented rx frames - specifically, whether a Message Integrity
  6842. * Check is required, and the Michael key to use.
  6843. *
  6844. * |31 24|23 16|15|14 8|7 0|
  6845. * |-----------------------------------------------------------------------|
  6846. * | peer ID | U| security type | msg type |
  6847. * |-----------------------------------------------------------------------|
  6848. * | Michael Key K0 |
  6849. * |-----------------------------------------------------------------------|
  6850. * | Michael Key K1 |
  6851. * |-----------------------------------------------------------------------|
  6852. * | WAPI RSC Low0 |
  6853. * |-----------------------------------------------------------------------|
  6854. * | WAPI RSC Low1 |
  6855. * |-----------------------------------------------------------------------|
  6856. * | WAPI RSC Hi0 |
  6857. * |-----------------------------------------------------------------------|
  6858. * | WAPI RSC Hi1 |
  6859. * |-----------------------------------------------------------------------|
  6860. *
  6861. * The following field definitions describe the format of the security
  6862. * indication message sent from the target to the host.
  6863. * - MSG_TYPE
  6864. * Bits 7:0
  6865. * Purpose: identifies this as a security specification message
  6866. * Value: 0xb
  6867. * - SEC_TYPE
  6868. * Bits 14:8
  6869. * Purpose: specifies which type of security applies to the peer
  6870. * Value: htt_sec_type enum value
  6871. * - UNICAST
  6872. * Bit 15
  6873. * Purpose: whether this security is applied to unicast or multicast data
  6874. * Value: 1 -> unicast, 0 -> multicast
  6875. * - PEER_ID
  6876. * Bits 31:16
  6877. * Purpose: The ID number for the peer the security specification is for
  6878. * Value: peer ID
  6879. * - MICHAEL_KEY_K0
  6880. * Bits 31:0
  6881. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6882. * Value: Michael Key K0 (if security type is TKIP)
  6883. * - MICHAEL_KEY_K1
  6884. * Bits 31:0
  6885. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6886. * Value: Michael Key K1 (if security type is TKIP)
  6887. * - WAPI_RSC_LOW0
  6888. * Bits 31:0
  6889. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6890. * Value: WAPI RSC Low0 (if security type is WAPI)
  6891. * - WAPI_RSC_LOW1
  6892. * Bits 31:0
  6893. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6894. * Value: WAPI RSC Low1 (if security type is WAPI)
  6895. * - WAPI_RSC_HI0
  6896. * Bits 31:0
  6897. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6898. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6899. * - WAPI_RSC_HI1
  6900. * Bits 31:0
  6901. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6902. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6903. */
  6904. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6905. #define HTT_SEC_IND_SEC_TYPE_S 8
  6906. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6907. #define HTT_SEC_IND_UNICAST_S 15
  6908. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6909. #define HTT_SEC_IND_PEER_ID_S 16
  6910. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6911. do { \
  6912. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6913. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6914. } while (0)
  6915. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6916. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6917. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6918. do { \
  6919. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6920. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6921. } while (0)
  6922. #define HTT_SEC_IND_UNICAST_GET(word) \
  6923. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6924. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6925. do { \
  6926. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6927. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6928. } while (0)
  6929. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6930. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6931. #define HTT_SEC_IND_BYTES 28
  6932. /**
  6933. * @brief target -> host rx ADDBA / DELBA message definitions
  6934. *
  6935. * @details
  6936. * The following diagram shows the format of the rx ADDBA message sent
  6937. * from the target to the host:
  6938. *
  6939. * |31 20|19 16|15 8|7 0|
  6940. * |---------------------------------------------------------------------|
  6941. * | peer ID | TID | window size | msg type |
  6942. * |---------------------------------------------------------------------|
  6943. *
  6944. * The following diagram shows the format of the rx DELBA message sent
  6945. * from the target to the host:
  6946. *
  6947. * |31 20|19 16|15 8|7 0|
  6948. * |---------------------------------------------------------------------|
  6949. * | peer ID | TID | reserved | msg type |
  6950. * |---------------------------------------------------------------------|
  6951. *
  6952. * The following field definitions describe the format of the rx ADDBA
  6953. * and DELBA messages sent from the target to the host.
  6954. * - MSG_TYPE
  6955. * Bits 7:0
  6956. * Purpose: identifies this as an rx ADDBA or DELBA message
  6957. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6958. * - WIN_SIZE
  6959. * Bits 15:8 (ADDBA only)
  6960. * Purpose: Specifies the length of the block ack window (max = 64).
  6961. * Value:
  6962. * block ack window length specified by the received ADDBA
  6963. * management message.
  6964. * - TID
  6965. * Bits 19:16
  6966. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6967. * Value:
  6968. * TID specified by the received ADDBA or DELBA management message.
  6969. * - PEER_ID
  6970. * Bits 31:20
  6971. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6972. * Value:
  6973. * ID (hash value) used by the host for fast, direct lookup of
  6974. * host SW peer info, including rx reorder states.
  6975. */
  6976. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6977. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6978. #define HTT_RX_ADDBA_TID_M 0xf0000
  6979. #define HTT_RX_ADDBA_TID_S 16
  6980. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6981. #define HTT_RX_ADDBA_PEER_ID_S 20
  6982. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6983. do { \
  6984. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6985. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6986. } while (0)
  6987. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6988. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6989. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6990. do { \
  6991. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6992. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6993. } while (0)
  6994. #define HTT_RX_ADDBA_TID_GET(word) \
  6995. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6996. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6997. do { \
  6998. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  6999. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7000. } while (0)
  7001. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7002. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7003. #define HTT_RX_ADDBA_BYTES 4
  7004. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7005. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7006. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7007. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7008. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7009. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7010. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7011. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7012. #define HTT_RX_DELBA_BYTES 4
  7013. /**
  7014. * @brief tx queue group information element definition
  7015. *
  7016. * @details
  7017. * The following diagram shows the format of the tx queue group
  7018. * information element, which can be included in target --> host
  7019. * messages to specify the number of tx "credits" (tx descriptors
  7020. * for LL, or tx buffers for HL) available to a particular group
  7021. * of host-side tx queues, and which host-side tx queues belong to
  7022. * the group.
  7023. *
  7024. * |31|30 24|23 16|15|14|13 0|
  7025. * |------------------------------------------------------------------------|
  7026. * | X| reserved | tx queue grp ID | A| S| credit count |
  7027. * |------------------------------------------------------------------------|
  7028. * | vdev ID mask | AC mask |
  7029. * |------------------------------------------------------------------------|
  7030. *
  7031. * The following definitions describe the fields within the tx queue group
  7032. * information element:
  7033. * - credit_count
  7034. * Bits 13:1
  7035. * Purpose: specify how many tx credits are available to the tx queue group
  7036. * Value: An absolute or relative, positive or negative credit value
  7037. * The 'A' bit specifies whether the value is absolute or relative.
  7038. * The 'S' bit specifies whether the value is positive or negative.
  7039. * A negative value can only be relative, not absolute.
  7040. * An absolute value replaces any prior credit value the host has for
  7041. * the tx queue group in question.
  7042. * A relative value is added to the prior credit value the host has for
  7043. * the tx queue group in question.
  7044. * - sign
  7045. * Bit 14
  7046. * Purpose: specify whether the credit count is positive or negative
  7047. * Value: 0 -> positive, 1 -> negative
  7048. * - absolute
  7049. * Bit 15
  7050. * Purpose: specify whether the credit count is absolute or relative
  7051. * Value: 0 -> relative, 1 -> absolute
  7052. * - txq_group_id
  7053. * Bits 23:16
  7054. * Purpose: indicate which tx queue group's credit and/or membership are
  7055. * being specified
  7056. * Value: 0 to max_tx_queue_groups-1
  7057. * - reserved
  7058. * Bits 30:16
  7059. * Value: 0x0
  7060. * - eXtension
  7061. * Bit 31
  7062. * Purpose: specify whether another tx queue group info element follows
  7063. * Value: 0 -> no more tx queue group information elements
  7064. * 1 -> another tx queue group information element immediately follows
  7065. * - ac_mask
  7066. * Bits 15:0
  7067. * Purpose: specify which Access Categories belong to the tx queue group
  7068. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7069. * the tx queue group.
  7070. * The AC bit-mask values are obtained by left-shifting by the
  7071. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7072. * - vdev_id_mask
  7073. * Bits 31:16
  7074. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7075. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7076. * belong to the tx queue group.
  7077. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7078. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7079. */
  7080. PREPACK struct htt_txq_group {
  7081. A_UINT32
  7082. credit_count: 14,
  7083. sign: 1,
  7084. absolute: 1,
  7085. tx_queue_group_id: 8,
  7086. reserved0: 7,
  7087. extension: 1;
  7088. A_UINT32
  7089. ac_mask: 16,
  7090. vdev_id_mask: 16;
  7091. } POSTPACK;
  7092. /* first word */
  7093. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7094. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7095. #define HTT_TXQ_GROUP_SIGN_S 14
  7096. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7097. #define HTT_TXQ_GROUP_ABS_S 15
  7098. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7099. #define HTT_TXQ_GROUP_ID_S 16
  7100. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7101. #define HTT_TXQ_GROUP_EXT_S 31
  7102. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7103. /* second word */
  7104. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7105. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7106. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7107. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7108. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7109. do { \
  7110. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7111. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7112. } while (0)
  7113. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7114. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7115. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7116. do { \
  7117. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7118. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7119. } while (0)
  7120. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7121. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7122. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7123. do { \
  7124. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7125. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7126. } while (0)
  7127. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7128. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7129. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7130. do { \
  7131. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7132. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7133. } while (0)
  7134. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7135. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7136. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7137. do { \
  7138. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7139. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7140. } while (0)
  7141. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7142. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7143. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7144. do { \
  7145. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7146. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7147. } while (0)
  7148. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7149. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7150. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7151. do { \
  7152. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7153. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7154. } while (0)
  7155. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7156. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7157. /**
  7158. * @brief target -> host TX completion indication message definition
  7159. *
  7160. * @details
  7161. * The following diagram shows the format of the TX completion indication sent
  7162. * from the target to the host
  7163. *
  7164. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7165. * |------------------------------------------------------------|
  7166. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7167. * |------------------------------------------------------------|
  7168. * payload: | MSDU1 ID | MSDU0 ID |
  7169. * |------------------------------------------------------------|
  7170. * : MSDU3 ID : MSDU2 ID :
  7171. * |------------------------------------------------------------|
  7172. * | struct htt_tx_compl_ind_append_retries |
  7173. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7174. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7175. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7176. * Where:
  7177. * A0 = append (a.k.a. append0)
  7178. * A1 = append1
  7179. * TP = MSDU tx power presence
  7180. *
  7181. * The following field definitions describe the format of the TX completion
  7182. * indication sent from the target to the host
  7183. * Header fields:
  7184. * - msg_type
  7185. * Bits 7:0
  7186. * Purpose: identifies this as HTT TX completion indication
  7187. * Value: 0x7
  7188. * - status
  7189. * Bits 10:8
  7190. * Purpose: the TX completion status of payload fragmentations descriptors
  7191. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7192. * - tid
  7193. * Bits 14:11
  7194. * Purpose: the tid associated with those fragmentation descriptors. It is
  7195. * valid or not, depending on the tid_invalid bit.
  7196. * Value: 0 to 15
  7197. * - tid_invalid
  7198. * Bits 15:15
  7199. * Purpose: this bit indicates whether the tid field is valid or not
  7200. * Value: 0 indicates valid; 1 indicates invalid
  7201. * - num
  7202. * Bits 23:16
  7203. * Purpose: the number of payload in this indication
  7204. * Value: 1 to 255
  7205. * - append (a.k.a. append0)
  7206. * Bits 24:24
  7207. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7208. * the number of tx retries for one MSDU at the end of this message
  7209. * Value: 0 indicates no appending; 1 indicates appending
  7210. * - append1
  7211. * Bits 25:25
  7212. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7213. * contains the timestamp info for each TX msdu id in payload.
  7214. * The order of the timestamps matches the order of the MSDU IDs.
  7215. * Note that a big-endian host needs to account for the reordering
  7216. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7217. * conversion) when determining which tx timestamp corresponds to
  7218. * which MSDU ID.
  7219. * Value: 0 indicates no appending; 1 indicates appending
  7220. * - msdu_tx_power_presence
  7221. * Bits 26:26
  7222. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7223. * for each MSDU referenced by the TX_COMPL_IND message.
  7224. * The tx power is reported in 0.5 dBm units.
  7225. * The order of the per-MSDU tx power reports matches the order
  7226. * of the MSDU IDs.
  7227. * Note that a big-endian host needs to account for the reordering
  7228. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7229. * conversion) when determining which Tx Power corresponds to
  7230. * which MSDU ID.
  7231. * Value: 0 indicates MSDU tx power reports are not appended,
  7232. * 1 indicates MSDU tx power reports are appended
  7233. * Payload fields:
  7234. * - hmsdu_id
  7235. * Bits 15:0
  7236. * Purpose: this ID is used to track the Tx buffer in host
  7237. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7238. */
  7239. #define HTT_TX_COMPL_IND_STATUS_S 8
  7240. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7241. #define HTT_TX_COMPL_IND_TID_S 11
  7242. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7243. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7244. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7245. #define HTT_TX_COMPL_IND_NUM_S 16
  7246. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7247. #define HTT_TX_COMPL_IND_APPEND_S 24
  7248. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7249. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7250. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7251. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7252. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7253. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7254. do { \
  7255. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7256. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7257. } while (0)
  7258. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7259. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7260. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7261. do { \
  7262. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7263. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7264. } while (0)
  7265. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7266. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7267. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7268. do { \
  7269. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7270. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7271. } while (0)
  7272. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7273. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7274. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7275. do { \
  7276. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7277. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7278. } while (0)
  7279. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7280. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7281. HTT_TX_COMPL_IND_TID_INV_S)
  7282. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7283. do { \
  7284. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7285. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7286. } while (0)
  7287. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7288. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7289. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7290. do { \
  7291. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7292. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7293. } while (0)
  7294. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7295. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7296. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7299. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7300. } while (0)
  7301. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7302. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7303. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7304. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7305. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7306. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7307. #define HTT_TX_COMPL_IND_STAT_OK 0
  7308. /* DISCARD:
  7309. * current meaning:
  7310. * MSDUs were queued for transmission but filtered by HW or SW
  7311. * without any over the air attempts
  7312. * legacy meaning (HL Rome):
  7313. * MSDUs were discarded by the target FW without any over the air
  7314. * attempts due to lack of space
  7315. */
  7316. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7317. /* NO_ACK:
  7318. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7319. */
  7320. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7321. /* POSTPONE:
  7322. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7323. * be downloaded again later (in the appropriate order), when they are
  7324. * deliverable.
  7325. */
  7326. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7327. /*
  7328. * The PEER_DEL tx completion status is used for HL cases
  7329. * where the peer the frame is for has been deleted.
  7330. * The host has already discarded its copy of the frame, but
  7331. * it still needs the tx completion to restore its credit.
  7332. */
  7333. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7334. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7335. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7336. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7337. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7338. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7339. PREPACK struct htt_tx_compl_ind_base {
  7340. A_UINT32 hdr;
  7341. A_UINT16 payload[1/*or more*/];
  7342. } POSTPACK;
  7343. PREPACK struct htt_tx_compl_ind_append_retries {
  7344. A_UINT16 msdu_id;
  7345. A_UINT8 tx_retries;
  7346. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7347. 0: this is the last append_retries struct */
  7348. } POSTPACK;
  7349. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7350. A_UINT32 timestamp[1/*or more*/];
  7351. } POSTPACK;
  7352. /**
  7353. * @brief target -> host rate-control update indication message
  7354. *
  7355. * @details
  7356. * The following diagram shows the format of the RC Update message
  7357. * sent from the target to the host, while processing the tx-completion
  7358. * of a transmitted PPDU.
  7359. *
  7360. * |31 24|23 16|15 8|7 0|
  7361. * |-------------------------------------------------------------|
  7362. * | peer ID | vdev ID | msg_type |
  7363. * |-------------------------------------------------------------|
  7364. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7365. * |-------------------------------------------------------------|
  7366. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7367. * |-------------------------------------------------------------|
  7368. * | : |
  7369. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7370. * | : |
  7371. * |-------------------------------------------------------------|
  7372. * | : |
  7373. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7374. * | : |
  7375. * |-------------------------------------------------------------|
  7376. * : :
  7377. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7378. *
  7379. */
  7380. typedef struct {
  7381. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7382. A_UINT32 rate_code_flags;
  7383. A_UINT32 flags; /* Encodes information such as excessive
  7384. retransmission, aggregate, some info
  7385. from .11 frame control,
  7386. STBC, LDPC, (SGI and Tx Chain Mask
  7387. are encoded in ptx_rc->flags field),
  7388. AMPDU truncation (BT/time based etc.),
  7389. RTS/CTS attempt */
  7390. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7391. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7392. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7393. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7394. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7395. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7396. } HTT_RC_TX_DONE_PARAMS;
  7397. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7398. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7399. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7400. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7401. #define HTT_RC_UPDATE_VDEVID_S 8
  7402. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7403. #define HTT_RC_UPDATE_PEERID_S 16
  7404. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7405. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7406. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7407. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7408. do { \
  7409. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7410. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7411. } while (0)
  7412. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7413. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7414. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7415. do { \
  7416. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7417. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7418. } while (0)
  7419. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7420. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7421. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7422. do { \
  7423. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7424. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7425. } while (0)
  7426. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7427. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7428. /**
  7429. * @brief target -> host rx fragment indication message definition
  7430. *
  7431. * @details
  7432. * The following field definitions describe the format of the rx fragment
  7433. * indication message sent from the target to the host.
  7434. * The rx fragment indication message shares the format of the
  7435. * rx indication message, but not all fields from the rx indication message
  7436. * are relevant to the rx fragment indication message.
  7437. *
  7438. *
  7439. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7440. * |-----------+-------------------+---------------------+-------------|
  7441. * | peer ID | |FV| ext TID | msg type |
  7442. * |-------------------------------------------------------------------|
  7443. * | | flush | flush |
  7444. * | | end | start |
  7445. * | | seq num | seq num |
  7446. * |-------------------------------------------------------------------|
  7447. * | reserved | FW rx desc bytes |
  7448. * |-------------------------------------------------------------------|
  7449. * | | FW MSDU Rx |
  7450. * | | desc B0 |
  7451. * |-------------------------------------------------------------------|
  7452. * Header fields:
  7453. * - MSG_TYPE
  7454. * Bits 7:0
  7455. * Purpose: identifies this as an rx fragment indication message
  7456. * Value: 0xa
  7457. * - EXT_TID
  7458. * Bits 12:8
  7459. * Purpose: identify the traffic ID of the rx data, including
  7460. * special "extended" TID values for multicast, broadcast, and
  7461. * non-QoS data frames
  7462. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7463. * - FLUSH_VALID (FV)
  7464. * Bit 13
  7465. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7466. * is valid
  7467. * Value:
  7468. * 1 -> flush IE is valid and needs to be processed
  7469. * 0 -> flush IE is not valid and should be ignored
  7470. * - PEER_ID
  7471. * Bits 31:16
  7472. * Purpose: Identify, by ID, which peer sent the rx data
  7473. * Value: ID of the peer who sent the rx data
  7474. * - FLUSH_SEQ_NUM_START
  7475. * Bits 5:0
  7476. * Purpose: Indicate the start of a series of MPDUs to flush
  7477. * Not all MPDUs within this series are necessarily valid - the host
  7478. * must check each sequence number within this range to see if the
  7479. * corresponding MPDU is actually present.
  7480. * This field is only valid if the FV bit is set.
  7481. * Value:
  7482. * The sequence number for the first MPDUs to check to flush.
  7483. * The sequence number is masked by 0x3f.
  7484. * - FLUSH_SEQ_NUM_END
  7485. * Bits 11:6
  7486. * Purpose: Indicate the end of a series of MPDUs to flush
  7487. * Value:
  7488. * The sequence number one larger than the sequence number of the
  7489. * last MPDU to check to flush.
  7490. * The sequence number is masked by 0x3f.
  7491. * Not all MPDUs within this series are necessarily valid - the host
  7492. * must check each sequence number within this range to see if the
  7493. * corresponding MPDU is actually present.
  7494. * This field is only valid if the FV bit is set.
  7495. * Rx descriptor fields:
  7496. * - FW_RX_DESC_BYTES
  7497. * Bits 15:0
  7498. * Purpose: Indicate how many bytes in the Rx indication are used for
  7499. * FW Rx descriptors
  7500. * Value: 1
  7501. */
  7502. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7503. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7504. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7505. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7506. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7507. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7508. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7509. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7510. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7511. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7512. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7513. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7514. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7515. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7516. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7517. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7518. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7519. #define HTT_RX_FRAG_IND_BYTES \
  7520. (4 /* msg hdr */ + \
  7521. 4 /* flush spec */ + \
  7522. 4 /* (unused) FW rx desc bytes spec */ + \
  7523. 4 /* FW rx desc */)
  7524. /**
  7525. * @brief target -> host test message definition
  7526. *
  7527. * @details
  7528. * The following field definitions describe the format of the test
  7529. * message sent from the target to the host.
  7530. * The message consists of a 4-octet header, followed by a variable
  7531. * number of 32-bit integer values, followed by a variable number
  7532. * of 8-bit character values.
  7533. *
  7534. * |31 16|15 8|7 0|
  7535. * |-----------------------------------------------------------|
  7536. * | num chars | num ints | msg type |
  7537. * |-----------------------------------------------------------|
  7538. * | int 0 |
  7539. * |-----------------------------------------------------------|
  7540. * | int 1 |
  7541. * |-----------------------------------------------------------|
  7542. * | ... |
  7543. * |-----------------------------------------------------------|
  7544. * | char 3 | char 2 | char 1 | char 0 |
  7545. * |-----------------------------------------------------------|
  7546. * | | | ... | char 4 |
  7547. * |-----------------------------------------------------------|
  7548. * - MSG_TYPE
  7549. * Bits 7:0
  7550. * Purpose: identifies this as a test message
  7551. * Value: HTT_MSG_TYPE_TEST
  7552. * - NUM_INTS
  7553. * Bits 15:8
  7554. * Purpose: indicate how many 32-bit integers follow the message header
  7555. * - NUM_CHARS
  7556. * Bits 31:16
  7557. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7558. */
  7559. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7560. #define HTT_RX_TEST_NUM_INTS_S 8
  7561. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7562. #define HTT_RX_TEST_NUM_CHARS_S 16
  7563. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7564. do { \
  7565. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7566. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7567. } while (0)
  7568. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7569. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7570. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7571. do { \
  7572. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7573. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7574. } while (0)
  7575. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7576. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7577. /**
  7578. * @brief target -> host packet log message
  7579. *
  7580. * @details
  7581. * The following field definitions describe the format of the packet log
  7582. * message sent from the target to the host.
  7583. * The message consists of a 4-octet header,followed by a variable number
  7584. * of 32-bit character values.
  7585. *
  7586. * |31 16|15 10|9 8|7 0|
  7587. * |-----------------------------------------------------------|
  7588. * | payload_size | rsvd |mac_id| msg type |
  7589. * |-----------------------------------------------------------|
  7590. * | payload |
  7591. * |-----------------------------------------------------------|
  7592. * - MSG_TYPE
  7593. * Bits 7:0
  7594. * Purpose: identifies this as a pktlog message
  7595. * Value: HTT_MSG_TYPE_PACKETLOG
  7596. * - mac_id
  7597. * Bits 9:8
  7598. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7599. * Value: 0-3
  7600. * - payload_size
  7601. * Bits 31:16
  7602. * Purpose: explicitly specify the payload size
  7603. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7604. */
  7605. PREPACK struct htt_pktlog_msg {
  7606. A_UINT32 header;
  7607. A_UINT32 payload[1/* or more */];
  7608. } POSTPACK;
  7609. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7610. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7611. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7612. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7613. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7614. do { \
  7615. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7616. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7617. } while (0)
  7618. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7619. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7620. HTT_T2H_PKTLOG_MAC_ID_S)
  7621. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7622. do { \
  7623. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7624. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7625. } while (0)
  7626. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7627. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7628. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7629. /*
  7630. * Rx reorder statistics
  7631. * NB: all the fields must be defined in 4 octets size.
  7632. */
  7633. struct rx_reorder_stats {
  7634. /* Non QoS MPDUs received */
  7635. A_UINT32 deliver_non_qos;
  7636. /* MPDUs received in-order */
  7637. A_UINT32 deliver_in_order;
  7638. /* Flush due to reorder timer expired */
  7639. A_UINT32 deliver_flush_timeout;
  7640. /* Flush due to move out of window */
  7641. A_UINT32 deliver_flush_oow;
  7642. /* Flush due to DELBA */
  7643. A_UINT32 deliver_flush_delba;
  7644. /* MPDUs dropped due to FCS error */
  7645. A_UINT32 fcs_error;
  7646. /* MPDUs dropped due to monitor mode non-data packet */
  7647. A_UINT32 mgmt_ctrl;
  7648. /* Unicast-data MPDUs dropped due to invalid peer */
  7649. A_UINT32 invalid_peer;
  7650. /* MPDUs dropped due to duplication (non aggregation) */
  7651. A_UINT32 dup_non_aggr;
  7652. /* MPDUs dropped due to processed before */
  7653. A_UINT32 dup_past;
  7654. /* MPDUs dropped due to duplicate in reorder queue */
  7655. A_UINT32 dup_in_reorder;
  7656. /* Reorder timeout happened */
  7657. A_UINT32 reorder_timeout;
  7658. /* invalid bar ssn */
  7659. A_UINT32 invalid_bar_ssn;
  7660. /* reorder reset due to bar ssn */
  7661. A_UINT32 ssn_reset;
  7662. /* Flush due to delete peer */
  7663. A_UINT32 deliver_flush_delpeer;
  7664. /* Flush due to offload*/
  7665. A_UINT32 deliver_flush_offload;
  7666. /* Flush due to out of buffer*/
  7667. A_UINT32 deliver_flush_oob;
  7668. /* MPDUs dropped due to PN check fail */
  7669. A_UINT32 pn_fail;
  7670. /* MPDUs dropped due to unable to allocate memory */
  7671. A_UINT32 store_fail;
  7672. /* Number of times the tid pool alloc succeeded */
  7673. A_UINT32 tid_pool_alloc_succ;
  7674. /* Number of times the MPDU pool alloc succeeded */
  7675. A_UINT32 mpdu_pool_alloc_succ;
  7676. /* Number of times the MSDU pool alloc succeeded */
  7677. A_UINT32 msdu_pool_alloc_succ;
  7678. /* Number of times the tid pool alloc failed */
  7679. A_UINT32 tid_pool_alloc_fail;
  7680. /* Number of times the MPDU pool alloc failed */
  7681. A_UINT32 mpdu_pool_alloc_fail;
  7682. /* Number of times the MSDU pool alloc failed */
  7683. A_UINT32 msdu_pool_alloc_fail;
  7684. /* Number of times the tid pool freed */
  7685. A_UINT32 tid_pool_free;
  7686. /* Number of times the MPDU pool freed */
  7687. A_UINT32 mpdu_pool_free;
  7688. /* Number of times the MSDU pool freed */
  7689. A_UINT32 msdu_pool_free;
  7690. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7691. A_UINT32 msdu_queued;
  7692. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7693. A_UINT32 msdu_recycled;
  7694. /* Number of MPDUs with invalid peer but A2 found in AST */
  7695. A_UINT32 invalid_peer_a2_in_ast;
  7696. /* Number of MPDUs with invalid peer but A3 found in AST */
  7697. A_UINT32 invalid_peer_a3_in_ast;
  7698. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7699. A_UINT32 invalid_peer_bmc_mpdus;
  7700. /* Number of MSDUs with err attention word */
  7701. A_UINT32 rxdesc_err_att;
  7702. /* Number of MSDUs with flag of peer_idx_invalid */
  7703. A_UINT32 rxdesc_err_peer_idx_inv;
  7704. /* Number of MSDUs with flag of peer_idx_timeout */
  7705. A_UINT32 rxdesc_err_peer_idx_to;
  7706. /* Number of MSDUs with flag of overflow */
  7707. A_UINT32 rxdesc_err_ov;
  7708. /* Number of MSDUs with flag of msdu_length_err */
  7709. A_UINT32 rxdesc_err_msdu_len;
  7710. /* Number of MSDUs with flag of mpdu_length_err */
  7711. A_UINT32 rxdesc_err_mpdu_len;
  7712. /* Number of MSDUs with flag of tkip_mic_err */
  7713. A_UINT32 rxdesc_err_tkip_mic;
  7714. /* Number of MSDUs with flag of decrypt_err */
  7715. A_UINT32 rxdesc_err_decrypt;
  7716. /* Number of MSDUs with flag of fcs_err */
  7717. A_UINT32 rxdesc_err_fcs;
  7718. /* Number of Unicast (bc_mc bit is not set in attention word)
  7719. * frames with invalid peer handler
  7720. */
  7721. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7722. /* Number of unicast frame directly (direct bit is set in attention word)
  7723. * to DUT with invalid peer handler
  7724. */
  7725. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7726. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7727. * frames with invalid peer handler
  7728. */
  7729. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7730. /* Number of MSDUs dropped due to no first MSDU flag */
  7731. A_UINT32 rxdesc_no_1st_msdu;
  7732. /* Number of MSDUs droped due to ring overflow */
  7733. A_UINT32 msdu_drop_ring_ov;
  7734. /* Number of MSDUs dropped due to FC mismatch */
  7735. A_UINT32 msdu_drop_fc_mismatch;
  7736. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7737. A_UINT32 msdu_drop_mgmt_remote_ring;
  7738. /* Number of MSDUs dropped due to errors not reported in attention word */
  7739. A_UINT32 msdu_drop_misc;
  7740. /* Number of MSDUs go to offload before reorder */
  7741. A_UINT32 offload_msdu_wal;
  7742. /* Number of data frame dropped by offload after reorder */
  7743. A_UINT32 offload_msdu_reorder;
  7744. /* Number of MPDUs with sequence number in the past and within the BA window */
  7745. A_UINT32 dup_past_within_window;
  7746. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7747. A_UINT32 dup_past_outside_window;
  7748. /* Number of MSDUs with decrypt/MIC error */
  7749. A_UINT32 rxdesc_err_decrypt_mic;
  7750. /* Number of data MSDUs received on both local and remote rings */
  7751. A_UINT32 data_msdus_on_both_rings;
  7752. /* MPDUs never filled */
  7753. A_UINT32 holes_not_filled;
  7754. };
  7755. /*
  7756. * Rx Remote buffer statistics
  7757. * NB: all the fields must be defined in 4 octets size.
  7758. */
  7759. struct rx_remote_buffer_mgmt_stats {
  7760. /* Total number of MSDUs reaped for Rx processing */
  7761. A_UINT32 remote_reaped;
  7762. /* MSDUs recycled within firmware */
  7763. A_UINT32 remote_recycled;
  7764. /* MSDUs stored by Data Rx */
  7765. A_UINT32 data_rx_msdus_stored;
  7766. /* Number of HTT indications from WAL Rx MSDU */
  7767. A_UINT32 wal_rx_ind;
  7768. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7769. A_UINT32 wal_rx_ind_unconsumed;
  7770. /* Number of HTT indications from Data Rx MSDU */
  7771. A_UINT32 data_rx_ind;
  7772. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7773. A_UINT32 data_rx_ind_unconsumed;
  7774. /* Number of HTT indications from ATHBUF */
  7775. A_UINT32 athbuf_rx_ind;
  7776. /* Number of remote buffers requested for refill */
  7777. A_UINT32 refill_buf_req;
  7778. /* Number of remote buffers filled by the host */
  7779. A_UINT32 refill_buf_rsp;
  7780. /* Number of times MAC hw_index = f/w write_index */
  7781. A_INT32 mac_no_bufs;
  7782. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7783. A_INT32 fw_indices_equal;
  7784. /* Number of times f/w finds no buffers to post */
  7785. A_INT32 host_no_bufs;
  7786. };
  7787. /*
  7788. * TXBF MU/SU packets and NDPA statistics
  7789. * NB: all the fields must be defined in 4 octets size.
  7790. */
  7791. struct rx_txbf_musu_ndpa_pkts_stats {
  7792. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7793. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7794. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7795. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7796. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7797. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7798. };
  7799. /*
  7800. * htt_dbg_stats_status -
  7801. * present - The requested stats have been delivered in full.
  7802. * This indicates that either the stats information was contained
  7803. * in its entirety within this message, or else this message
  7804. * completes the delivery of the requested stats info that was
  7805. * partially delivered through earlier STATS_CONF messages.
  7806. * partial - The requested stats have been delivered in part.
  7807. * One or more subsequent STATS_CONF messages with the same
  7808. * cookie value will be sent to deliver the remainder of the
  7809. * information.
  7810. * error - The requested stats could not be delivered, for example due
  7811. * to a shortage of memory to construct a message holding the
  7812. * requested stats.
  7813. * invalid - The requested stat type is either not recognized, or the
  7814. * target is configured to not gather the stats type in question.
  7815. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7816. * series_done - This special value indicates that no further stats info
  7817. * elements are present within a series of stats info elems
  7818. * (within a stats upload confirmation message).
  7819. */
  7820. enum htt_dbg_stats_status {
  7821. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7822. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7823. HTT_DBG_STATS_STATUS_ERROR = 2,
  7824. HTT_DBG_STATS_STATUS_INVALID = 3,
  7825. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7826. };
  7827. /**
  7828. * @brief target -> host statistics upload
  7829. *
  7830. * @details
  7831. * The following field definitions describe the format of the HTT target
  7832. * to host stats upload confirmation message.
  7833. * The message contains a cookie echoed from the HTT host->target stats
  7834. * upload request, which identifies which request the confirmation is
  7835. * for, and a series of tag-length-value stats information elements.
  7836. * The tag-length header for each stats info element also includes a
  7837. * status field, to indicate whether the request for the stat type in
  7838. * question was fully met, partially met, unable to be met, or invalid
  7839. * (if the stat type in question is disabled in the target).
  7840. * A special value of all 1's in this status field is used to indicate
  7841. * the end of the series of stats info elements.
  7842. *
  7843. *
  7844. * |31 16|15 8|7 5|4 0|
  7845. * |------------------------------------------------------------|
  7846. * | reserved | msg type |
  7847. * |------------------------------------------------------------|
  7848. * | cookie LSBs |
  7849. * |------------------------------------------------------------|
  7850. * | cookie MSBs |
  7851. * |------------------------------------------------------------|
  7852. * | stats entry length | reserved | S |stat type|
  7853. * |------------------------------------------------------------|
  7854. * | |
  7855. * | type-specific stats info |
  7856. * | |
  7857. * |------------------------------------------------------------|
  7858. * | stats entry length | reserved | S |stat type|
  7859. * |------------------------------------------------------------|
  7860. * | |
  7861. * | type-specific stats info |
  7862. * | |
  7863. * |------------------------------------------------------------|
  7864. * | n/a | reserved | 111 | n/a |
  7865. * |------------------------------------------------------------|
  7866. * Header fields:
  7867. * - MSG_TYPE
  7868. * Bits 7:0
  7869. * Purpose: identifies this is a statistics upload confirmation message
  7870. * Value: 0x9
  7871. * - COOKIE_LSBS
  7872. * Bits 31:0
  7873. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7874. * message with its preceding host->target stats request message.
  7875. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7876. * - COOKIE_MSBS
  7877. * Bits 31:0
  7878. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7879. * message with its preceding host->target stats request message.
  7880. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7881. *
  7882. * Stats Information Element tag-length header fields:
  7883. * - STAT_TYPE
  7884. * Bits 4:0
  7885. * Purpose: identifies the type of statistics info held in the
  7886. * following information element
  7887. * Value: htt_dbg_stats_type
  7888. * - STATUS
  7889. * Bits 7:5
  7890. * Purpose: indicate whether the requested stats are present
  7891. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7892. * the completion of the stats entry series
  7893. * - LENGTH
  7894. * Bits 31:16
  7895. * Purpose: indicate the stats information size
  7896. * Value: This field specifies the number of bytes of stats information
  7897. * that follows the element tag-length header.
  7898. * It is expected but not required that this length is a multiple of
  7899. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7900. * subsequent stats entry header will begin on a 4-byte aligned
  7901. * boundary.
  7902. */
  7903. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7904. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7905. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7906. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7907. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7908. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7909. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7910. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7911. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7912. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7913. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7914. do { \
  7915. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7916. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7917. } while (0)
  7918. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7919. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7920. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7921. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7922. do { \
  7923. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7924. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7925. } while (0)
  7926. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7927. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7928. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7929. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7930. do { \
  7931. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7932. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7933. } while (0)
  7934. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7935. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7936. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7937. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7938. #define HTT_MAX_AGGR 64
  7939. #define HTT_HL_MAX_AGGR 18
  7940. /**
  7941. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7942. *
  7943. * @details
  7944. * The following field definitions describe the format of the HTT host
  7945. * to target frag_desc/msdu_ext bank configuration message.
  7946. * The message contains the based address and the min and max id of the
  7947. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7948. * MSDU_EXT/FRAG_DESC.
  7949. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7950. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7951. * the hardware does the mapping/translation.
  7952. *
  7953. * Total banks that can be configured is configured to 16.
  7954. *
  7955. * This should be called before any TX has be initiated by the HTT
  7956. *
  7957. * |31 16|15 8|7 5|4 0|
  7958. * |------------------------------------------------------------|
  7959. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7960. * |------------------------------------------------------------|
  7961. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7962. #if HTT_PADDR64
  7963. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7964. #endif
  7965. * |------------------------------------------------------------|
  7966. * | ... |
  7967. * |------------------------------------------------------------|
  7968. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7969. #if HTT_PADDR64
  7970. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7971. #endif
  7972. * |------------------------------------------------------------|
  7973. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7974. * |------------------------------------------------------------|
  7975. * | ... |
  7976. * |------------------------------------------------------------|
  7977. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7978. * |------------------------------------------------------------|
  7979. * Header fields:
  7980. * - MSG_TYPE
  7981. * Bits 7:0
  7982. * Value: 0x6
  7983. * for systems with 64-bit format for bus addresses:
  7984. * - BANKx_BASE_ADDRESS_LO
  7985. * Bits 31:0
  7986. * Purpose: Provide a mechanism to specify the base address of the
  7987. * MSDU_EXT bank physical/bus address.
  7988. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  7989. * - BANKx_BASE_ADDRESS_HI
  7990. * Bits 31:0
  7991. * Purpose: Provide a mechanism to specify the base address of the
  7992. * MSDU_EXT bank physical/bus address.
  7993. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  7994. * for systems with 32-bit format for bus addresses:
  7995. * - BANKx_BASE_ADDRESS
  7996. * Bits 31:0
  7997. * Purpose: Provide a mechanism to specify the base address of the
  7998. * MSDU_EXT bank physical/bus address.
  7999. * Value: MSDU_EXT bank physical / bus address
  8000. * - BANKx_MIN_ID
  8001. * Bits 15:0
  8002. * Purpose: Provide a mechanism to specify the min index that needs to
  8003. * mapped.
  8004. * - BANKx_MAX_ID
  8005. * Bits 31:16
  8006. * Purpose: Provide a mechanism to specify the max index that needs to
  8007. * mapped.
  8008. *
  8009. */
  8010. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8011. * safe value.
  8012. * @note MAX supported banks is 16.
  8013. */
  8014. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8015. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8016. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8017. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8018. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8019. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8020. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8021. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8022. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8023. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8024. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8025. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8026. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8027. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8030. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8031. } while (0)
  8032. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8033. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8034. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8035. do { \
  8036. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8037. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8038. } while (0)
  8039. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8040. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8041. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8042. do { \
  8043. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8044. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8045. } while (0)
  8046. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8047. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8048. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8049. do { \
  8050. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8051. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8052. } while (0)
  8053. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8054. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8055. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8056. do { \
  8057. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8058. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8059. } while (0)
  8060. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8061. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8062. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8065. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8066. } while (0)
  8067. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8068. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8069. /*
  8070. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8071. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8072. * addresses are stored in a XXX-bit field.
  8073. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8074. * htt_tx_frag_desc64_bank_cfg_t structs.
  8075. */
  8076. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8077. _paddr_bits_, \
  8078. _paddr__bank_base_address_) \
  8079. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8080. /** word 0 \
  8081. * msg_type: 8, \
  8082. * pdev_id: 2, \
  8083. * swap: 1, \
  8084. * reserved0: 5, \
  8085. * num_banks: 8, \
  8086. * desc_size: 8; \
  8087. */ \
  8088. A_UINT32 word0; \
  8089. /* \
  8090. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8091. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8092. * the second A_UINT32). \
  8093. */ \
  8094. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8095. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8096. } POSTPACK
  8097. /* define htt_tx_frag_desc32_bank_cfg_t */
  8098. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8099. /* define htt_tx_frag_desc64_bank_cfg_t */
  8100. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8101. /*
  8102. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8103. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8104. */
  8105. #if HTT_PADDR64
  8106. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8107. #else
  8108. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8109. #endif
  8110. /**
  8111. * @brief target -> host HTT TX Credit total count update message definition
  8112. *
  8113. *|31 16|15|14 9| 8 |7 0 |
  8114. *|---------------------+--+----------+-------+----------|
  8115. *|cur htt credit delta | Q| reserved | sign | msg type |
  8116. *|------------------------------------------------------|
  8117. *
  8118. * Header fields:
  8119. * - MSG_TYPE
  8120. * Bits 7:0
  8121. * Purpose: identifies this as a htt tx credit delta update message
  8122. * Value: 0xe
  8123. * - SIGN
  8124. * Bits 8
  8125. * identifies whether credit delta is positive or negative
  8126. * Value:
  8127. * - 0x0: credit delta is positive, rebalance in some buffers
  8128. * - 0x1: credit delta is negative, rebalance out some buffers
  8129. * - reserved
  8130. * Bits 14:9
  8131. * Value: 0x0
  8132. * - TXQ_GRP
  8133. * Bit 15
  8134. * Purpose: indicates whether any tx queue group information elements
  8135. * are appended to the tx credit update message
  8136. * Value: 0 -> no tx queue group information element is present
  8137. * 1 -> a tx queue group information element immediately follows
  8138. * - DELTA_COUNT
  8139. * Bits 31:16
  8140. * Purpose: Specify current htt credit delta absolute count
  8141. */
  8142. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8143. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8144. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8145. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8146. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8147. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8148. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8149. do { \
  8150. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8151. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8152. } while (0)
  8153. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8154. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8155. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8156. do { \
  8157. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8158. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8159. } while (0)
  8160. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8161. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8162. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8165. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8166. } while (0)
  8167. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8168. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8169. #define HTT_TX_CREDIT_MSG_BYTES 4
  8170. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8171. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8172. /**
  8173. * @brief HTT WDI_IPA Operation Response Message
  8174. *
  8175. * @details
  8176. * HTT WDI_IPA Operation Response message is sent by target
  8177. * to host confirming suspend or resume operation.
  8178. * |31 24|23 16|15 8|7 0|
  8179. * |----------------+----------------+----------------+----------------|
  8180. * | op_code | Rsvd | msg_type |
  8181. * |-------------------------------------------------------------------|
  8182. * | Rsvd | Response len |
  8183. * |-------------------------------------------------------------------|
  8184. * | |
  8185. * | Response-type specific info |
  8186. * | |
  8187. * | |
  8188. * |-------------------------------------------------------------------|
  8189. * Header fields:
  8190. * - MSG_TYPE
  8191. * Bits 7:0
  8192. * Purpose: Identifies this as WDI_IPA Operation Response message
  8193. * value: = 0x13
  8194. * - OP_CODE
  8195. * Bits 31:16
  8196. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8197. * value: = enum htt_wdi_ipa_op_code
  8198. * - RSP_LEN
  8199. * Bits 16:0
  8200. * Purpose: length for the response-type specific info
  8201. * value: = length in bytes for response-type specific info
  8202. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8203. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8204. */
  8205. PREPACK struct htt_wdi_ipa_op_response_t
  8206. {
  8207. /* DWORD 0: flags and meta-data */
  8208. A_UINT32
  8209. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8210. reserved1: 8,
  8211. op_code: 16;
  8212. A_UINT32
  8213. rsp_len: 16,
  8214. reserved2: 16;
  8215. } POSTPACK;
  8216. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8217. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8218. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8219. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8220. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8221. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8222. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8223. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8224. do { \
  8225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8226. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8227. } while (0)
  8228. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8229. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8230. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8231. do { \
  8232. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8233. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8234. } while (0)
  8235. enum htt_phy_mode {
  8236. htt_phy_mode_11a = 0,
  8237. htt_phy_mode_11g = 1,
  8238. htt_phy_mode_11b = 2,
  8239. htt_phy_mode_11g_only = 3,
  8240. htt_phy_mode_11na_ht20 = 4,
  8241. htt_phy_mode_11ng_ht20 = 5,
  8242. htt_phy_mode_11na_ht40 = 6,
  8243. htt_phy_mode_11ng_ht40 = 7,
  8244. htt_phy_mode_11ac_vht20 = 8,
  8245. htt_phy_mode_11ac_vht40 = 9,
  8246. htt_phy_mode_11ac_vht80 = 10,
  8247. htt_phy_mode_11ac_vht20_2g = 11,
  8248. htt_phy_mode_11ac_vht40_2g = 12,
  8249. htt_phy_mode_11ac_vht80_2g = 13,
  8250. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8251. htt_phy_mode_11ac_vht160 = 15,
  8252. htt_phy_mode_max,
  8253. };
  8254. /**
  8255. * @brief target -> host HTT channel change indication
  8256. * @details
  8257. * Specify when a channel change occurs.
  8258. * This allows the host to precisely determine which rx frames arrived
  8259. * on the old channel and which rx frames arrived on the new channel.
  8260. *
  8261. *|31 |7 0 |
  8262. *|-------------------------------------------+----------|
  8263. *| reserved | msg type |
  8264. *|------------------------------------------------------|
  8265. *| primary_chan_center_freq_mhz |
  8266. *|------------------------------------------------------|
  8267. *| contiguous_chan1_center_freq_mhz |
  8268. *|------------------------------------------------------|
  8269. *| contiguous_chan2_center_freq_mhz |
  8270. *|------------------------------------------------------|
  8271. *| phy_mode |
  8272. *|------------------------------------------------------|
  8273. *
  8274. * Header fields:
  8275. * - MSG_TYPE
  8276. * Bits 7:0
  8277. * Purpose: identifies this as a htt channel change indication message
  8278. * Value: 0x15
  8279. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8280. * Bits 31:0
  8281. * Purpose: identify the (center of the) new 20 MHz primary channel
  8282. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8283. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8284. * Bits 31:0
  8285. * Purpose: identify the (center of the) contiguous frequency range
  8286. * comprising the new channel.
  8287. * For example, if the new channel is a 80 MHz channel extending
  8288. * 60 MHz beyond the primary channel, this field would be 30 larger
  8289. * than the primary channel center frequency field.
  8290. * Value: center frequency of the contiguous frequency range comprising
  8291. * the full channel in MHz units
  8292. * (80+80 channels also use the CONTIG_CHAN2 field)
  8293. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8294. * Bits 31:0
  8295. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8296. * within a VHT 80+80 channel.
  8297. * This field is only relevant for VHT 80+80 channels.
  8298. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8299. * channel (arbitrary value for cases besides VHT 80+80)
  8300. * - PHY_MODE
  8301. * Bits 31:0
  8302. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8303. * and band
  8304. * Value: htt_phy_mode enum value
  8305. */
  8306. PREPACK struct htt_chan_change_t
  8307. {
  8308. /* DWORD 0: flags and meta-data */
  8309. A_UINT32
  8310. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8311. reserved1: 24;
  8312. A_UINT32 primary_chan_center_freq_mhz;
  8313. A_UINT32 contig_chan1_center_freq_mhz;
  8314. A_UINT32 contig_chan2_center_freq_mhz;
  8315. A_UINT32 phy_mode;
  8316. } POSTPACK;
  8317. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8318. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8319. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8320. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8321. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8322. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8323. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8324. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8325. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8326. do { \
  8327. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8328. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8329. } while (0)
  8330. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8331. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8332. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8333. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8334. do { \
  8335. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8336. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8337. } while (0)
  8338. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8339. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8340. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8341. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8342. do { \
  8343. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8344. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8345. } while (0)
  8346. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8347. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8348. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8349. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8352. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8353. } while (0)
  8354. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8355. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8356. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8357. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8358. /**
  8359. * @brief rx offload packet error message
  8360. *
  8361. * @details
  8362. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8363. * of target payload like mic err.
  8364. *
  8365. * |31 24|23 16|15 8|7 0|
  8366. * |----------------+----------------+----------------+----------------|
  8367. * | tid | vdev_id | msg_sub_type | msg_type |
  8368. * |-------------------------------------------------------------------|
  8369. * : (sub-type dependent content) :
  8370. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8371. * Header fields:
  8372. * - msg_type
  8373. * Bits 7:0
  8374. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8375. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8376. * - msg_sub_type
  8377. * Bits 15:8
  8378. * Purpose: Identifies which type of rx error is reported by this message
  8379. * value: htt_rx_ofld_pkt_err_type
  8380. * - vdev_id
  8381. * Bits 23:16
  8382. * Purpose: Identifies which vdev received the erroneous rx frame
  8383. * value:
  8384. * - tid
  8385. * Bits 31:24
  8386. * Purpose: Identifies the traffic type of the rx frame
  8387. * value:
  8388. *
  8389. * - The payload fields used if the sub-type == MIC error are shown below.
  8390. * Note - MIC err is per MSDU, while PN is per MPDU.
  8391. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8392. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8393. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8394. * instead of sending separate HTT messages for each wrong MSDU within
  8395. * the MPDU.
  8396. *
  8397. * |31 24|23 16|15 8|7 0|
  8398. * |----------------+----------------+----------------+----------------|
  8399. * | Rsvd | key_id | peer_id |
  8400. * |-------------------------------------------------------------------|
  8401. * | receiver MAC addr 31:0 |
  8402. * |-------------------------------------------------------------------|
  8403. * | Rsvd | receiver MAC addr 47:32 |
  8404. * |-------------------------------------------------------------------|
  8405. * | transmitter MAC addr 31:0 |
  8406. * |-------------------------------------------------------------------|
  8407. * | Rsvd | transmitter MAC addr 47:32 |
  8408. * |-------------------------------------------------------------------|
  8409. * | PN 31:0 |
  8410. * |-------------------------------------------------------------------|
  8411. * | Rsvd | PN 47:32 |
  8412. * |-------------------------------------------------------------------|
  8413. * - peer_id
  8414. * Bits 15:0
  8415. * Purpose: identifies which peer is frame is from
  8416. * value:
  8417. * - key_id
  8418. * Bits 23:16
  8419. * Purpose: identifies key_id of rx frame
  8420. * value:
  8421. * - RA_31_0 (receiver MAC addr 31:0)
  8422. * Bits 31:0
  8423. * Purpose: identifies by MAC address which vdev received the frame
  8424. * value: MAC address lower 4 bytes
  8425. * - RA_47_32 (receiver MAC addr 47:32)
  8426. * Bits 15:0
  8427. * Purpose: identifies by MAC address which vdev received the frame
  8428. * value: MAC address upper 2 bytes
  8429. * - TA_31_0 (transmitter MAC addr 31:0)
  8430. * Bits 31:0
  8431. * Purpose: identifies by MAC address which peer transmitted the frame
  8432. * value: MAC address lower 4 bytes
  8433. * - TA_47_32 (transmitter MAC addr 47:32)
  8434. * Bits 15:0
  8435. * Purpose: identifies by MAC address which peer transmitted the frame
  8436. * value: MAC address upper 2 bytes
  8437. * - PN_31_0
  8438. * Bits 31:0
  8439. * Purpose: Identifies pn of rx frame
  8440. * value: PN lower 4 bytes
  8441. * - PN_47_32
  8442. * Bits 15:0
  8443. * Purpose: Identifies pn of rx frame
  8444. * value:
  8445. * TKIP or CCMP: PN upper 2 bytes
  8446. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8447. */
  8448. enum htt_rx_ofld_pkt_err_type {
  8449. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8450. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8451. };
  8452. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8453. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8454. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8455. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8456. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8457. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8458. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8459. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8460. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8461. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8462. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8463. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8464. do { \
  8465. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8466. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8467. } while (0)
  8468. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8469. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8470. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8471. do { \
  8472. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8473. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8474. } while (0)
  8475. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8476. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8477. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8478. do { \
  8479. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8480. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8481. } while (0)
  8482. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8483. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8484. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8485. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8486. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8488. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8489. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8490. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8491. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8492. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8493. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8494. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8496. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8497. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8498. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8499. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8501. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8502. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8504. do { \
  8505. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8506. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8507. } while (0)
  8508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8509. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8510. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8512. do { \
  8513. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8514. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8515. } while (0)
  8516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8517. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8518. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8520. do { \
  8521. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8522. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8523. } while (0)
  8524. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8525. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8526. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8528. do { \
  8529. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8530. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8531. } while (0)
  8532. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8533. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8534. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8536. do { \
  8537. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8538. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8539. } while (0)
  8540. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8541. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8542. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8543. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8544. do { \
  8545. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8546. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8547. } while (0)
  8548. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8549. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8550. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8551. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8552. do { \
  8553. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8554. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8555. } while (0)
  8556. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8557. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8558. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8562. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8563. } while (0)
  8564. /**
  8565. * @brief peer rate report message
  8566. *
  8567. * @details
  8568. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8569. * justified rate of all the peers.
  8570. *
  8571. * |31 24|23 16|15 8|7 0|
  8572. * |----------------+----------------+----------------+----------------|
  8573. * | peer_count | | msg_type |
  8574. * |-------------------------------------------------------------------|
  8575. * : Payload (variant number of peer rate report) :
  8576. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8577. * Header fields:
  8578. * - msg_type
  8579. * Bits 7:0
  8580. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8581. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8582. * - reserved
  8583. * Bits 15:8
  8584. * Purpose:
  8585. * value:
  8586. * - peer_count
  8587. * Bits 31:16
  8588. * Purpose: Specify how many peer rate report elements are present in the payload.
  8589. * value:
  8590. *
  8591. * Payload:
  8592. * There are variant number of peer rate report follow the first 32 bits.
  8593. * The peer rate report is defined as follows.
  8594. *
  8595. * |31 20|19 16|15 0|
  8596. * |-----------------------+---------+---------------------------------|-
  8597. * | reserved | phy | peer_id | \
  8598. * |-------------------------------------------------------------------| -> report #0
  8599. * | rate | /
  8600. * |-----------------------+---------+---------------------------------|-
  8601. * | reserved | phy | peer_id | \
  8602. * |-------------------------------------------------------------------| -> report #1
  8603. * | rate | /
  8604. * |-----------------------+---------+---------------------------------|-
  8605. * | reserved | phy | peer_id | \
  8606. * |-------------------------------------------------------------------| -> report #2
  8607. * | rate | /
  8608. * |-------------------------------------------------------------------|-
  8609. * : :
  8610. * : :
  8611. * : :
  8612. * :-------------------------------------------------------------------:
  8613. *
  8614. * - peer_id
  8615. * Bits 15:0
  8616. * Purpose: identify the peer
  8617. * value:
  8618. * - phy
  8619. * Bits 19:16
  8620. * Purpose: identify which phy is in use
  8621. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8622. * Please see enum htt_peer_report_phy_type for detail.
  8623. * - reserved
  8624. * Bits 31:20
  8625. * Purpose:
  8626. * value:
  8627. * - rate
  8628. * Bits 31:0
  8629. * Purpose: represent the justified rate of the peer specified by peer_id
  8630. * value:
  8631. */
  8632. enum htt_peer_rate_report_phy_type {
  8633. HTT_PEER_RATE_REPORT_11B = 0,
  8634. HTT_PEER_RATE_REPORT_11A_G,
  8635. HTT_PEER_RATE_REPORT_11N,
  8636. HTT_PEER_RATE_REPORT_11AC,
  8637. };
  8638. #define HTT_PEER_RATE_REPORT_SIZE 8
  8639. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8640. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8641. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8642. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8643. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8644. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8645. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8646. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8647. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8648. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8649. do { \
  8650. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8651. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8652. } while (0)
  8653. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8654. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8655. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8656. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8657. do { \
  8658. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8659. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8660. } while (0)
  8661. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8662. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8663. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8664. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8665. do { \
  8666. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8667. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8668. } while (0)
  8669. /**
  8670. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8671. *
  8672. * @details
  8673. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8674. * a flow of descriptors.
  8675. *
  8676. * This message is in TLV format and indicates the parameters to be setup a
  8677. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8678. * receive descriptors from a specified pool.
  8679. *
  8680. * The message would appear as follows:
  8681. *
  8682. * |31 24|23 16|15 8|7 0|
  8683. * |----------------+----------------+----------------+----------------|
  8684. * header | reserved | num_flows | msg_type |
  8685. * |-------------------------------------------------------------------|
  8686. * | |
  8687. * : payload :
  8688. * | |
  8689. * |-------------------------------------------------------------------|
  8690. *
  8691. * The header field is one DWORD long and is interpreted as follows:
  8692. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8693. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8694. * this message
  8695. * b'16-31 - reserved: These bits are reserved for future use
  8696. *
  8697. * Payload:
  8698. * The payload would contain multiple objects of the following structure. Each
  8699. * object represents a flow.
  8700. *
  8701. * |31 24|23 16|15 8|7 0|
  8702. * |----------------+----------------+----------------+----------------|
  8703. * header | reserved | num_flows | msg_type |
  8704. * |-------------------------------------------------------------------|
  8705. * payload0| flow_type |
  8706. * |-------------------------------------------------------------------|
  8707. * | flow_id |
  8708. * |-------------------------------------------------------------------|
  8709. * | reserved0 | flow_pool_id |
  8710. * |-------------------------------------------------------------------|
  8711. * | reserved1 | flow_pool_size |
  8712. * |-------------------------------------------------------------------|
  8713. * | reserved2 |
  8714. * |-------------------------------------------------------------------|
  8715. * payload1| flow_type |
  8716. * |-------------------------------------------------------------------|
  8717. * | flow_id |
  8718. * |-------------------------------------------------------------------|
  8719. * | reserved0 | flow_pool_id |
  8720. * |-------------------------------------------------------------------|
  8721. * | reserved1 | flow_pool_size |
  8722. * |-------------------------------------------------------------------|
  8723. * | reserved2 |
  8724. * |-------------------------------------------------------------------|
  8725. * | . |
  8726. * | . |
  8727. * | . |
  8728. * |-------------------------------------------------------------------|
  8729. *
  8730. * Each payload is 5 DWORDS long and is interpreted as follows:
  8731. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8732. * this flow is associated. It can be VDEV, peer,
  8733. * or tid (AC). Based on enum htt_flow_type.
  8734. *
  8735. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8736. * object. For flow_type vdev it is set to the
  8737. * vdevid, for peer it is peerid and for tid, it is
  8738. * tid_num.
  8739. *
  8740. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8741. * in the host for this flow
  8742. * b'16:31 - reserved0: This field in reserved for the future. In case
  8743. * we have a hierarchical implementation (HCM) of
  8744. * pools, it can be used to indicate the ID of the
  8745. * parent-pool.
  8746. *
  8747. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8748. * Descriptors for this flow will be
  8749. * allocated from this pool in the host.
  8750. * b'16:31 - reserved1: This field in reserved for the future. In case
  8751. * we have a hierarchical implementation of pools,
  8752. * it can be used to indicate the max number of
  8753. * descriptors in the pool. The b'0:15 can be used
  8754. * to indicate min number of descriptors in the
  8755. * HCM scheme.
  8756. *
  8757. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8758. * we have a hierarchical implementation of pools,
  8759. * b'0:15 can be used to indicate the
  8760. * priority-based borrowing (PBB) threshold of
  8761. * the flow's pool. The b'16:31 are still left
  8762. * reserved.
  8763. */
  8764. enum htt_flow_type {
  8765. FLOW_TYPE_VDEV = 0,
  8766. /* Insert new flow types above this line */
  8767. };
  8768. PREPACK struct htt_flow_pool_map_payload_t {
  8769. A_UINT32 flow_type;
  8770. A_UINT32 flow_id;
  8771. A_UINT32 flow_pool_id:16,
  8772. reserved0:16;
  8773. A_UINT32 flow_pool_size:16,
  8774. reserved1:16;
  8775. A_UINT32 reserved2;
  8776. } POSTPACK;
  8777. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8778. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8779. (sizeof(struct htt_flow_pool_map_payload_t))
  8780. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8781. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8782. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8783. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8784. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8785. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8786. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8787. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8788. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8789. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8790. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8791. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8792. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8793. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8794. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8795. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8796. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8797. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8798. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8799. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8800. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8801. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8802. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8803. do { \
  8804. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8805. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8806. } while (0)
  8807. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8810. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8811. } while (0)
  8812. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8815. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8816. } while (0)
  8817. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8820. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8821. } while (0)
  8822. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8823. do { \
  8824. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8825. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8826. } while (0)
  8827. /**
  8828. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8829. *
  8830. * @details
  8831. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8832. * down a flow of descriptors.
  8833. * This message indicates that for the flow (whose ID is provided) is wanting
  8834. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8835. * pool of descriptors from where descriptors are being allocated for this
  8836. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8837. * be unmapped by the host.
  8838. *
  8839. * The message would appear as follows:
  8840. *
  8841. * |31 24|23 16|15 8|7 0|
  8842. * |----------------+----------------+----------------+----------------|
  8843. * | reserved0 | msg_type |
  8844. * |-------------------------------------------------------------------|
  8845. * | flow_type |
  8846. * |-------------------------------------------------------------------|
  8847. * | flow_id |
  8848. * |-------------------------------------------------------------------|
  8849. * | reserved1 | flow_pool_id |
  8850. * |-------------------------------------------------------------------|
  8851. *
  8852. * The message is interpreted as follows:
  8853. * dword0 - b'0:7 - msg_type: This will be set to
  8854. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8855. * b'8:31 - reserved0: Reserved for future use
  8856. *
  8857. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8858. * this flow is associated. It can be VDEV, peer,
  8859. * or tid (AC). Based on enum htt_flow_type.
  8860. *
  8861. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8862. * object. For flow_type vdev it is set to the
  8863. * vdevid, for peer it is peerid and for tid, it is
  8864. * tid_num.
  8865. *
  8866. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8867. * used in the host for this flow
  8868. * b'16:31 - reserved0: This field in reserved for the future.
  8869. *
  8870. */
  8871. PREPACK struct htt_flow_pool_unmap_t {
  8872. A_UINT32 msg_type:8,
  8873. reserved0:24;
  8874. A_UINT32 flow_type;
  8875. A_UINT32 flow_id;
  8876. A_UINT32 flow_pool_id:16,
  8877. reserved1:16;
  8878. } POSTPACK;
  8879. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8880. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8881. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8882. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8883. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8884. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8885. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8886. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8887. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8888. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8889. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8890. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8891. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8892. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8893. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8894. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8895. do { \
  8896. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8897. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8898. } while (0)
  8899. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8900. do { \
  8901. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8902. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8903. } while (0)
  8904. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8907. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8908. } while (0)
  8909. /**
  8910. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8911. *
  8912. * @details
  8913. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8914. * SRNG ring setup is done
  8915. *
  8916. * This message indicates whether the last setup operation is successful.
  8917. * It will be sent to host when host set respose_required bit in
  8918. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8919. * The message would appear as follows:
  8920. *
  8921. * |31 24|23 16|15 8|7 0|
  8922. * |--------------- +----------------+----------------+----------------|
  8923. * | setup_status | ring_id | pdev_id | msg_type |
  8924. * |-------------------------------------------------------------------|
  8925. *
  8926. * The message is interpreted as follows:
  8927. * dword0 - b'0:7 - msg_type: This will be set to
  8928. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8929. * b'8:15 - pdev_id:
  8930. * 0 (for rings at SOC/UMAC level),
  8931. * 1/2/3 mac id (for rings at LMAC level)
  8932. * b'16:23 - ring_id: Identify the ring which is set up
  8933. * More details can be got from enum htt_srng_ring_id
  8934. * b'24:31 - setup_status: Indicate status of setup operation
  8935. * Refer to htt_ring_setup_status
  8936. */
  8937. PREPACK struct htt_sring_setup_done_t {
  8938. A_UINT32 msg_type: 8,
  8939. pdev_id: 8,
  8940. ring_id: 8,
  8941. setup_status: 8;
  8942. } POSTPACK;
  8943. enum htt_ring_setup_status {
  8944. htt_ring_setup_status_ok = 0,
  8945. htt_ring_setup_status_error,
  8946. };
  8947. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8948. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8949. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8950. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8951. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8952. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8953. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8954. do { \
  8955. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8956. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8957. } while (0)
  8958. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8959. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8960. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8961. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8962. HTT_SRING_SETUP_DONE_RING_ID_S)
  8963. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8964. do { \
  8965. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8966. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8967. } while (0)
  8968. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8969. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8970. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8971. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8972. HTT_SRING_SETUP_DONE_STATUS_S)
  8973. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8976. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8977. } while (0)
  8978. /**
  8979. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8980. *
  8981. * @details
  8982. * HTT TX map flow entry with tqm flow pointer
  8983. * Sent from firmware to host to add tqm flow pointer in corresponding
  8984. * flow search entry. Flow metadata is replayed back to host as part of this
  8985. * struct to enable host to find the specific flow search entry
  8986. *
  8987. * The message would appear as follows:
  8988. *
  8989. * |31 28|27 18|17 14|13 8|7 0|
  8990. * |-------+------------------------------------------+----------------|
  8991. * | rsvd0 | fse_hsh_idx | msg_type |
  8992. * |-------------------------------------------------------------------|
  8993. * | rsvd1 | tid | peer_id |
  8994. * |-------------------------------------------------------------------|
  8995. * | tqm_flow_pntr_lo |
  8996. * |-------------------------------------------------------------------|
  8997. * | tqm_flow_pntr_hi |
  8998. * |-------------------------------------------------------------------|
  8999. * | fse_meta_data |
  9000. * |-------------------------------------------------------------------|
  9001. *
  9002. * The message is interpreted as follows:
  9003. *
  9004. * dword0 - b'0:7 - msg_type: This will be set to
  9005. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9006. *
  9007. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9008. * for this flow entry
  9009. *
  9010. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9011. *
  9012. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9013. *
  9014. * dword1 - b'14:17 - tid
  9015. *
  9016. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9017. *
  9018. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9019. *
  9020. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9021. *
  9022. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9023. * given by host
  9024. */
  9025. PREPACK struct htt_tx_map_flow_info {
  9026. A_UINT32
  9027. msg_type: 8,
  9028. fse_hsh_idx: 20,
  9029. rsvd0: 4;
  9030. A_UINT32
  9031. peer_id: 14,
  9032. tid: 4,
  9033. rsvd1: 14;
  9034. A_UINT32 tqm_flow_pntr_lo;
  9035. A_UINT32 tqm_flow_pntr_hi;
  9036. struct htt_tx_flow_metadata fse_meta_data;
  9037. } POSTPACK;
  9038. /* DWORD 0 */
  9039. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9040. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9041. /* DWORD 1 */
  9042. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9043. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9044. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9045. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9046. /* DWORD 0 */
  9047. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9048. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9049. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9050. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9051. do { \
  9052. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9053. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9054. } while (0)
  9055. /* DWORD 1 */
  9056. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9057. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9058. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9059. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9060. do { \
  9061. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9062. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9063. } while (0)
  9064. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9065. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9066. HTT_TX_MAP_FLOW_INFO_TID_S)
  9067. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9068. do { \
  9069. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9070. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9071. } while (0)
  9072. /*
  9073. * htt_dbg_ext_stats_status -
  9074. * present - The requested stats have been delivered in full.
  9075. * This indicates that either the stats information was contained
  9076. * in its entirety within this message, or else this message
  9077. * completes the delivery of the requested stats info that was
  9078. * partially delivered through earlier STATS_CONF messages.
  9079. * partial - The requested stats have been delivered in part.
  9080. * One or more subsequent STATS_CONF messages with the same
  9081. * cookie value will be sent to deliver the remainder of the
  9082. * information.
  9083. * error - The requested stats could not be delivered, for example due
  9084. * to a shortage of memory to construct a message holding the
  9085. * requested stats.
  9086. * invalid - The requested stat type is either not recognized, or the
  9087. * target is configured to not gather the stats type in question.
  9088. */
  9089. enum htt_dbg_ext_stats_status {
  9090. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9091. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9092. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9093. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9094. };
  9095. /**
  9096. * @brief target -> host ppdu stats upload
  9097. *
  9098. * @details
  9099. * The following field definitions describe the format of the HTT target
  9100. * to host ppdu stats indication message.
  9101. *
  9102. *
  9103. * |31 16|15 10|9 8|7 0 |
  9104. * |----------------------------------------------------------------------|
  9105. * | payload_size | rsvd bits |mac_id | msg type |
  9106. * |----------------------------------------------------------------------|
  9107. * | ppdu_id |
  9108. * |----------------------------------------------------------------------|
  9109. * | Timestamp in us |
  9110. * |----------------------------------------------------------------------|
  9111. * | reserved |
  9112. * |----------------------------------------------------------------------|
  9113. * | type-specific stats info |
  9114. * | (see htt_ppdu_stats.h) |
  9115. * |----------------------------------------------------------------------|
  9116. * Header fields:
  9117. * - MSG_TYPE
  9118. * Bits 7:0
  9119. * Purpose: Identifies this is a PPDU STATS indication
  9120. * message.
  9121. * Value: 0x1d
  9122. * - mac_id
  9123. * Bits 2
  9124. * Purpose: mac_id of this ppdu_id
  9125. * Value: 0-3
  9126. * - payload_size
  9127. * Bits 31:16
  9128. * Purpose: total tlv size
  9129. * Value: payload_size in bytes
  9130. */
  9131. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9132. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9133. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9134. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9135. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9136. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9137. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9138. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9141. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9142. } while (0)
  9143. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9144. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9145. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9146. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9149. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9150. } while (0)
  9151. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9152. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9153. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9154. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9157. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9158. } while (0)
  9159. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9160. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9161. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9162. /**
  9163. * @brief target -> host extended statistics upload
  9164. *
  9165. * @details
  9166. * The following field definitions describe the format of the HTT target
  9167. * to host stats upload confirmation message.
  9168. * The message contains a cookie echoed from the HTT host->target stats
  9169. * upload request, which identifies which request the confirmation is
  9170. * for, and a single stats can span over multiple HTT stats indication
  9171. * due to the HTT message size limitation so every HTT ext stats indication
  9172. * will have tag-length-value stats information elements.
  9173. * The tag-length header for each HTT stats IND message also includes a
  9174. * status field, to indicate whether the request for the stat type in
  9175. * question was fully met, partially met, unable to be met, or invalid
  9176. * (if the stat type in question is disabled in the target).
  9177. * A Done bit 1's indicate the end of the of stats info elements.
  9178. *
  9179. *
  9180. * |31 16|15 12|11|10 8|7 5|4 0|
  9181. * |--------------------------------------------------------------|
  9182. * | reserved | msg type |
  9183. * |--------------------------------------------------------------|
  9184. * | cookie LSBs |
  9185. * |--------------------------------------------------------------|
  9186. * | cookie MSBs |
  9187. * |--------------------------------------------------------------|
  9188. * | stats entry length | rsvd | D| S | stat type |
  9189. * |--------------------------------------------------------------|
  9190. * | type-specific stats info |
  9191. * | (see htt_stats.h) |
  9192. * |--------------------------------------------------------------|
  9193. * Header fields:
  9194. * - MSG_TYPE
  9195. * Bits 7:0
  9196. * Purpose: Identifies this is a extended statistics upload confirmation
  9197. * message.
  9198. * Value: 0x1c
  9199. * - COOKIE_LSBS
  9200. * Bits 31:0
  9201. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9202. * message with its preceding host->target stats request message.
  9203. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9204. * - COOKIE_MSBS
  9205. * Bits 31:0
  9206. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9207. * message with its preceding host->target stats request message.
  9208. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9209. *
  9210. * Stats Information Element tag-length header fields:
  9211. * - STAT_TYPE
  9212. * Bits 7:0
  9213. * Purpose: identifies the type of statistics info held in the
  9214. * following information element
  9215. * Value: htt_dbg_ext_stats_type
  9216. * - STATUS
  9217. * Bits 10:8
  9218. * Purpose: indicate whether the requested stats are present
  9219. * Value: htt_dbg_ext_stats_status
  9220. * - DONE
  9221. * Bits 11
  9222. * Purpose:
  9223. * Indicates the completion of the stats entry, this will be the last
  9224. * stats conf HTT segment for the requested stats type.
  9225. * Value:
  9226. * 0 -> the stats retrieval is ongoing
  9227. * 1 -> the stats retrieval is complete
  9228. * - LENGTH
  9229. * Bits 31:16
  9230. * Purpose: indicate the stats information size
  9231. * Value: This field specifies the number of bytes of stats information
  9232. * that follows the element tag-length header.
  9233. * It is expected but not required that this length is a multiple of
  9234. * 4 bytes.
  9235. */
  9236. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9237. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9238. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9239. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9240. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9241. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9242. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9243. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9244. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9245. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9246. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9247. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9248. do { \
  9249. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9250. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9251. } while (0)
  9252. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9253. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9254. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9255. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9256. do { \
  9257. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9258. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9259. } while (0)
  9260. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9261. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9262. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9263. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9266. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9267. } while (0)
  9268. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9269. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9270. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9271. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9272. do { \
  9273. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9274. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9275. } while (0)
  9276. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9277. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9278. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9279. typedef enum {
  9280. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9281. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9282. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9283. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9284. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9285. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9286. /* Reserved from 128 - 255 for target internal use.*/
  9287. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9288. } HTT_PEER_TYPE;
  9289. /** 2 word representation of MAC addr */
  9290. typedef struct {
  9291. /** upper 4 bytes of MAC address */
  9292. A_UINT32 mac_addr31to0;
  9293. /** lower 2 bytes of MAC address */
  9294. A_UINT32 mac_addr47to32;
  9295. } htt_mac_addr;
  9296. /** macro to convert MAC address from char array to HTT word format */
  9297. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9298. (phtt_mac_addr)->mac_addr31to0 = \
  9299. (((c_macaddr)[0] << 0) | \
  9300. ((c_macaddr)[1] << 8) | \
  9301. ((c_macaddr)[2] << 16) | \
  9302. ((c_macaddr)[3] << 24)); \
  9303. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9304. } while (0)
  9305. #endif