htt.h 637 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186
  1. /*
  2. * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. */
  203. #define HTT_CURRENT_VERSION_MAJOR 3
  204. #define HTT_CURRENT_VERSION_MINOR 84
  205. #define HTT_NUM_TX_FRAG_DESC 1024
  206. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  207. #define HTT_CHECK_SET_VAL(field, val) \
  208. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  209. /* macros to assist in sign-extending fields from HTT messages */
  210. #define HTT_SIGN_BIT_MASK(field) \
  211. ((field ## _M + (1 << field ## _S)) >> 1)
  212. #define HTT_SIGN_BIT(_val, field) \
  213. (_val & HTT_SIGN_BIT_MASK(field))
  214. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  215. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  216. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  217. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  218. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  219. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  220. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  221. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  222. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  223. /*
  224. * TEMPORARY:
  225. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  226. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  227. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  228. * updated.
  229. */
  230. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  231. /*
  232. * TEMPORARY:
  233. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  234. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  235. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  236. * updated.
  237. */
  238. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  239. /* HTT Access Category values */
  240. enum HTT_AC_WMM {
  241. /* WMM Access Categories */
  242. HTT_AC_WMM_BE = 0x0,
  243. HTT_AC_WMM_BK = 0x1,
  244. HTT_AC_WMM_VI = 0x2,
  245. HTT_AC_WMM_VO = 0x3,
  246. HTT_NUM_AC_WMM = 0x4,
  247. /* extension Access Categories */
  248. HTT_AC_EXT_NON_QOS = 0x4,
  249. HTT_AC_EXT_UCAST_MGMT = 0x5,
  250. HTT_AC_EXT_MCAST_DATA = 0x6,
  251. HTT_AC_EXT_MCAST_MGMT = 0x7,
  252. };
  253. enum HTT_AC_WMM_MASK {
  254. /* WMM Access Categories */
  255. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  256. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  257. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  258. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  259. /* extension Access Categories */
  260. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  261. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  262. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  263. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  264. };
  265. #define HTT_AC_MASK_WMM \
  266. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  267. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  268. #define HTT_AC_MASK_EXT \
  269. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  270. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  271. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  272. /*
  273. * htt_dbg_stats_type -
  274. * bit positions for each stats type within a stats type bitmask
  275. * The bitmask contains 24 bits.
  276. */
  277. enum htt_dbg_stats_type {
  278. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  279. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  280. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  281. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  282. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  283. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  284. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  285. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  286. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  287. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  288. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  289. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  290. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  291. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  292. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  293. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  294. /* bits 16-23 currently reserved */
  295. /* keep this last */
  296. HTT_DBG_NUM_STATS
  297. };
  298. /*=== HTT option selection TLVs ===
  299. * Certain HTT messages have alternatives or options.
  300. * For such cases, the host and target need to agree on which option to use.
  301. * Option specification TLVs can be appended to the VERSION_REQ and
  302. * VERSION_CONF messages to select options other than the default.
  303. * These TLVs are entirely optional - if they are not provided, there is a
  304. * well-defined default for each option. If they are provided, they can be
  305. * provided in any order. Each TLV can be present or absent independent of
  306. * the presence / absence of other TLVs.
  307. *
  308. * The HTT option selection TLVs use the following format:
  309. * |31 16|15 8|7 0|
  310. * |---------------------------------+----------------+----------------|
  311. * | value (payload) | length | tag |
  312. * |-------------------------------------------------------------------|
  313. * The value portion need not be only 2 bytes; it can be extended by any
  314. * integer number of 4-byte units. The total length of the TLV, including
  315. * the tag and length fields, must be a multiple of 4 bytes. The length
  316. * field specifies the total TLV size in 4-byte units. Thus, the typical
  317. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  318. * field, would store 0x1 in its length field, to show that the TLV occupies
  319. * a single 4-byte unit.
  320. */
  321. /*--- TLV header format - applies to all HTT option TLVs ---*/
  322. enum HTT_OPTION_TLV_TAGS {
  323. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  324. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  325. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  326. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  327. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  328. };
  329. PREPACK struct htt_option_tlv_header_t {
  330. A_UINT8 tag;
  331. A_UINT8 length;
  332. } POSTPACK;
  333. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  334. #define HTT_OPTION_TLV_TAG_S 0
  335. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  336. #define HTT_OPTION_TLV_LENGTH_S 8
  337. /*
  338. * value0 - 16 bit value field stored in word0
  339. * The TLV's value field may be longer than 2 bytes, in which case
  340. * the remainder of the value is stored in word1, word2, etc.
  341. */
  342. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  343. #define HTT_OPTION_TLV_VALUE0_S 16
  344. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  345. do { \
  346. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  347. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  348. } while (0)
  349. #define HTT_OPTION_TLV_TAG_GET(word) \
  350. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  351. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  352. do { \
  353. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  354. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  355. } while (0)
  356. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  357. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  358. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  361. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  362. } while (0)
  363. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  364. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  365. /*--- format of specific HTT option TLVs ---*/
  366. /*
  367. * HTT option TLV for specifying LL bus address size
  368. * Some chips require bus addresses used by the target to access buffers
  369. * within the host's memory to be 32 bits; others require bus addresses
  370. * used by the target to access buffers within the host's memory to be
  371. * 64 bits.
  372. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  373. * a suffix to the VERSION_CONF message to specify which bus address format
  374. * the target requires.
  375. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  376. * default to providing bus addresses to the target in 32-bit format.
  377. */
  378. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  379. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  380. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  381. };
  382. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  383. struct htt_option_tlv_header_t hdr;
  384. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  385. } POSTPACK;
  386. /*
  387. * HTT option TLV for specifying whether HL systems should indicate
  388. * over-the-air tx completion for individual frames, or should instead
  389. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  390. * requests an OTA tx completion for a particular tx frame.
  391. * This option does not apply to LL systems, where the TX_COMPL_IND
  392. * is mandatory.
  393. * This option is primarily intended for HL systems in which the tx frame
  394. * downloads over the host --> target bus are as slow as or slower than
  395. * the transmissions over the WLAN PHY. For cases where the bus is faster
  396. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  397. * and consquently will send one TX_COMPL_IND message that covers several
  398. * tx frames. For cases where the WLAN PHY is faster than the bus,
  399. * the target will end up transmitting very short A-MPDUs, and consequently
  400. * sending many TX_COMPL_IND messages, which each cover a very small number
  401. * of tx frames.
  402. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  403. * a suffix to the VERSION_REQ message to request whether the host desires to
  404. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  405. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  406. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  407. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  408. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  409. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  410. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  411. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  412. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  413. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  414. * TLV.
  415. */
  416. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  417. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  418. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  419. };
  420. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  421. struct htt_option_tlv_header_t hdr;
  422. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  423. } POSTPACK;
  424. /*
  425. * HTT option TLV for specifying how many tx queue groups the target
  426. * may establish.
  427. * This TLV specifies the maximum value the target may send in the
  428. * txq_group_id field of any TXQ_GROUP information elements sent by
  429. * the target to the host. This allows the host to pre-allocate an
  430. * appropriate number of tx queue group structs.
  431. *
  432. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  433. * a suffix to the VERSION_REQ message to specify whether the host supports
  434. * tx queue groups at all, and if so if there is any limit on the number of
  435. * tx queue groups that the host supports.
  436. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  437. * a suffix to the VERSION_CONF message. If the host has specified in the
  438. * VER_REQ message a limit on the number of tx queue groups the host can
  439. * supprt, the target shall limit its specification of the maximum tx groups
  440. * to be no larger than this host-specified limit.
  441. *
  442. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  443. * shall preallocate 4 tx queue group structs, and the target shall not
  444. * specify a txq_group_id larger than 3.
  445. */
  446. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  447. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  448. /*
  449. * values 1 through N specify the max number of tx queue groups
  450. * the sender supports
  451. */
  452. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  453. };
  454. /* TEMPORARY backwards-compatibility alias for a typo fix -
  455. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  456. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  457. * to support the old name (with the typo) until all references to the
  458. * old name are replaced with the new name.
  459. */
  460. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  461. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  462. struct htt_option_tlv_header_t hdr;
  463. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  464. } POSTPACK;
  465. /*
  466. * HTT option TLV for specifying whether the target supports an extended
  467. * version of the HTT tx descriptor. If the target provides this TLV
  468. * and specifies in the TLV that the target supports an extended version
  469. * of the HTT tx descriptor, the target must check the "extension" bit in
  470. * the HTT tx descriptor, and if the extension bit is set, to expect a
  471. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  472. * descriptor. Furthermore, the target must provide room for the HTT
  473. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  474. * This option is intended for systems where the host needs to explicitly
  475. * control the transmission parameters such as tx power for individual
  476. * tx frames.
  477. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  478. * as a suffix to the VERSION_CONF message to explicitly specify whether
  479. * the target supports the HTT tx MSDU extension descriptor.
  480. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  481. * by the host as lack of target support for the HTT tx MSDU extension
  482. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  483. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  484. * the HTT tx MSDU extension descriptor.
  485. * The host is not required to provide the HTT tx MSDU extension descriptor
  486. * just because the target supports it; the target must check the
  487. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  488. * extension descriptor is present.
  489. */
  490. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  491. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  492. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  493. };
  494. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  495. struct htt_option_tlv_header_t hdr;
  496. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  497. } POSTPACK;
  498. /*=== host -> target messages ===============================================*/
  499. enum htt_h2t_msg_type {
  500. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  501. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  502. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  503. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  504. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  505. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  506. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  507. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  508. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  509. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  510. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  511. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  512. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  513. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  514. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  515. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  516. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  517. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  518. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  519. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  520. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  521. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  522. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  523. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  524. /* keep this last */
  525. HTT_H2T_NUM_MSGS
  526. };
  527. /*
  528. * HTT host to target message type -
  529. * stored in bits 7:0 of the first word of the message
  530. */
  531. #define HTT_H2T_MSG_TYPE_M 0xff
  532. #define HTT_H2T_MSG_TYPE_S 0
  533. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  534. do { \
  535. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  536. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  537. } while (0)
  538. #define HTT_H2T_MSG_TYPE_GET(word) \
  539. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  540. /**
  541. * @brief host -> target version number request message definition
  542. *
  543. * |31 24|23 16|15 8|7 0|
  544. * |----------------+----------------+----------------+----------------|
  545. * | reserved | msg type |
  546. * |-------------------------------------------------------------------|
  547. * : option request TLV (optional) |
  548. * :...................................................................:
  549. *
  550. * The VER_REQ message may consist of a single 4-byte word, or may be
  551. * extended with TLVs that specify which HTT options the host is requesting
  552. * from the target.
  553. * The following option TLVs may be appended to the VER_REQ message:
  554. * - HL_SUPPRESS_TX_COMPL_IND
  555. * - HL_MAX_TX_QUEUE_GROUPS
  556. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  557. * may be appended to the VER_REQ message (but only one TLV of each type).
  558. *
  559. * Header fields:
  560. * - MSG_TYPE
  561. * Bits 7:0
  562. * Purpose: identifies this as a version number request message
  563. * Value: 0x0
  564. */
  565. #define HTT_VER_REQ_BYTES 4
  566. /* TBDXXX: figure out a reasonable number */
  567. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  568. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  569. /**
  570. * @brief HTT tx MSDU descriptor
  571. *
  572. * @details
  573. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  574. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  575. * the target firmware needs for the FW's tx processing, particularly
  576. * for creating the HW msdu descriptor.
  577. * The same HTT tx descriptor is used for HL and LL systems, though
  578. * a few fields within the tx descriptor are used only by LL or
  579. * only by HL.
  580. * The HTT tx descriptor is defined in two manners: by a struct with
  581. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  582. * definitions.
  583. * The target should use the struct def, for simplicitly and clarity,
  584. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  585. * neutral. Specifically, the host shall use the get/set macros built
  586. * around the mask + shift defs.
  587. */
  588. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  589. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  590. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  591. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  592. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  593. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  594. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  595. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  596. #define HTT_TX_VDEV_ID_WORD 0
  597. #define HTT_TX_VDEV_ID_MASK 0x3f
  598. #define HTT_TX_VDEV_ID_SHIFT 16
  599. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  600. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  601. #define HTT_TX_MSDU_LEN_DWORD 1
  602. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  603. /*
  604. * HTT_VAR_PADDR macros
  605. * Allow physical / bus addresses to be either a single 32-bit value,
  606. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  607. */
  608. #define HTT_VAR_PADDR32(var_name) \
  609. A_UINT32 var_name
  610. #define HTT_VAR_PADDR64_LE(var_name) \
  611. struct { \
  612. /* little-endian: lo precedes hi */ \
  613. A_UINT32 lo; \
  614. A_UINT32 hi; \
  615. } var_name
  616. /*
  617. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  618. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  619. * addresses are stored in a XXX-bit field.
  620. * This macro is used to define both htt_tx_msdu_desc32_t and
  621. * htt_tx_msdu_desc64_t structs.
  622. */
  623. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  624. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  625. { \
  626. /* DWORD 0: flags and meta-data */ \
  627. A_UINT32 \
  628. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  629. \
  630. /* pkt_subtype - \
  631. * Detailed specification of the tx frame contents, extending the \
  632. * general specification provided by pkt_type. \
  633. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  634. * pkt_type | pkt_subtype \
  635. * ============================================================== \
  636. * 802.3 | bit 0:3 - Reserved \
  637. * | bit 4: 0x0 - Copy-Engine Classification Results \
  638. * | not appended to the HTT message \
  639. * | 0x1 - Copy-Engine Classification Results \
  640. * | appended to the HTT message in the \
  641. * | format: \
  642. * | [HTT tx desc, frame header, \
  643. * | CE classification results] \
  644. * | The CE classification results begin \
  645. * | at the next 4-byte boundary after \
  646. * | the frame header. \
  647. * ------------+------------------------------------------------- \
  648. * Eth2 | bit 0:3 - Reserved \
  649. * | bit 4: 0x0 - Copy-Engine Classification Results \
  650. * | not appended to the HTT message \
  651. * | 0x1 - Copy-Engine Classification Results \
  652. * | appended to the HTT message. \
  653. * | See the above specification of the \
  654. * | CE classification results location. \
  655. * ------------+------------------------------------------------- \
  656. * native WiFi | bit 0:3 - Reserved \
  657. * | bit 4: 0x0 - Copy-Engine Classification Results \
  658. * | not appended to the HTT message \
  659. * | 0x1 - Copy-Engine Classification Results \
  660. * | appended to the HTT message. \
  661. * | See the above specification of the \
  662. * | CE classification results location. \
  663. * ------------+------------------------------------------------- \
  664. * mgmt | 0x0 - 802.11 MAC header absent \
  665. * | 0x1 - 802.11 MAC header present \
  666. * ------------+------------------------------------------------- \
  667. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  668. * | 0x1 - 802.11 MAC header present \
  669. * | bit 1: 0x0 - allow aggregation \
  670. * | 0x1 - don't allow aggregation \
  671. * | bit 2: 0x0 - perform encryption \
  672. * | 0x1 - don't perform encryption \
  673. * | bit 3: 0x0 - perform tx classification / queuing \
  674. * | 0x1 - don't perform tx classification; \
  675. * | insert the frame into the "misc" \
  676. * | tx queue \
  677. * | bit 4: 0x0 - Copy-Engine Classification Results \
  678. * | not appended to the HTT message \
  679. * | 0x1 - Copy-Engine Classification Results \
  680. * | appended to the HTT message. \
  681. * | See the above specification of the \
  682. * | CE classification results location. \
  683. */ \
  684. pkt_subtype: 5, \
  685. \
  686. /* pkt_type - \
  687. * General specification of the tx frame contents. \
  688. * The htt_pkt_type enum should be used to specify and check the \
  689. * value of this field. \
  690. */ \
  691. pkt_type: 3, \
  692. \
  693. /* vdev_id - \
  694. * ID for the vdev that is sending this tx frame. \
  695. * For certain non-standard packet types, e.g. pkt_type == raw \
  696. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  697. * This field is used primarily for determining where to queue \
  698. * broadcast and multicast frames. \
  699. */ \
  700. vdev_id: 6, \
  701. /* ext_tid - \
  702. * The extended traffic ID. \
  703. * If the TID is unknown, the extended TID is set to \
  704. * HTT_TX_EXT_TID_INVALID. \
  705. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  706. * value of the QoS TID. \
  707. * If the tx frame is non-QoS data, then the extended TID is set to \
  708. * HTT_TX_EXT_TID_NON_QOS. \
  709. * If the tx frame is multicast or broadcast, then the extended TID \
  710. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  711. */ \
  712. ext_tid: 5, \
  713. \
  714. /* postponed - \
  715. * This flag indicates whether the tx frame has been downloaded to \
  716. * the target before but discarded by the target, and now is being \
  717. * downloaded again; or if this is a new frame that is being \
  718. * downloaded for the first time. \
  719. * This flag allows the target to determine the correct order for \
  720. * transmitting new vs. old frames. \
  721. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  722. * This flag only applies to HL systems, since in LL systems, \
  723. * the tx flow control is handled entirely within the target. \
  724. */ \
  725. postponed: 1, \
  726. \
  727. /* extension - \
  728. * This flag indicates whether a HTT tx MSDU extension descriptor \
  729. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  730. * \
  731. * 0x0 - no extension MSDU descriptor is present \
  732. * 0x1 - an extension MSDU descriptor immediately follows the \
  733. * regular MSDU descriptor \
  734. */ \
  735. extension: 1, \
  736. \
  737. /* cksum_offload - \
  738. * This flag indicates whether checksum offload is enabled or not \
  739. * for this frame. Target FW use this flag to turn on HW checksumming \
  740. * 0x0 - No checksum offload \
  741. * 0x1 - L3 header checksum only \
  742. * 0x2 - L4 checksum only \
  743. * 0x3 - L3 header checksum + L4 checksum \
  744. */ \
  745. cksum_offload: 2, \
  746. \
  747. /* tx_comp_req - \
  748. * This flag indicates whether Tx Completion \
  749. * from fw is required or not. \
  750. * This flag is only relevant if tx completion is not \
  751. * universally enabled. \
  752. * For all LL systems, tx completion is mandatory, \
  753. * so this flag will be irrelevant. \
  754. * For HL systems tx completion is optional, but HL systems in which \
  755. * the bus throughput exceeds the WLAN throughput will \
  756. * probably want to always use tx completion, and thus \
  757. * would not check this flag. \
  758. * This flag is required when tx completions are not used universally, \
  759. * but are still required for certain tx frames for which \
  760. * an OTA delivery acknowledgment is needed by the host. \
  761. * In practice, this would be for HL systems in which the \
  762. * bus throughput is less than the WLAN throughput. \
  763. * \
  764. * 0x0 - Tx Completion Indication from Fw not required \
  765. * 0x1 - Tx Completion Indication from Fw is required \
  766. */ \
  767. tx_compl_req: 1; \
  768. \
  769. \
  770. /* DWORD 1: MSDU length and ID */ \
  771. A_UINT32 \
  772. len: 16, /* MSDU length, in bytes */ \
  773. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  774. * and this id is used to calculate fragmentation \
  775. * descriptor pointer inside the target based on \
  776. * the base address, configured inside the target. \
  777. */ \
  778. \
  779. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  780. /* frags_desc_ptr - \
  781. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  782. * where the tx frame's fragments reside in memory. \
  783. * This field only applies to LL systems, since in HL systems the \
  784. * (degenerate single-fragment) fragmentation descriptor is created \
  785. * within the target. \
  786. */ \
  787. _paddr__frags_desc_ptr_; \
  788. \
  789. /* DWORD 3 (or 4): peerid, chanfreq */ \
  790. /* \
  791. * Peer ID : Target can use this value to know which peer-id packet \
  792. * destined to. \
  793. * It's intended to be specified by host in case of NAWDS. \
  794. */ \
  795. A_UINT16 peerid; \
  796. \
  797. /* \
  798. * Channel frequency: This identifies the desired channel \
  799. * frequency (in mhz) for tx frames. This is used by FW to help \
  800. * determine when it is safe to transmit or drop frames for \
  801. * off-channel operation. \
  802. * The default value of zero indicates to FW that the corresponding \
  803. * VDEV's home channel (if there is one) is the desired channel \
  804. * frequency. \
  805. */ \
  806. A_UINT16 chanfreq; \
  807. \
  808. /* Reason reserved is commented is increasing the htt structure size \
  809. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  810. * A_UINT32 reserved_dword3_bits0_31; \
  811. */ \
  812. } POSTPACK
  813. /* define a htt_tx_msdu_desc32_t type */
  814. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  815. /* define a htt_tx_msdu_desc64_t type */
  816. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  817. /*
  818. * Make htt_tx_msdu_desc_t be an alias for either
  819. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  820. */
  821. #if HTT_PADDR64
  822. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  823. #else
  824. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  825. #endif
  826. /* decriptor information for Management frame*/
  827. /*
  828. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  829. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  830. */
  831. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  832. extern A_UINT32 mgmt_hdr_len;
  833. PREPACK struct htt_mgmt_tx_desc_t {
  834. A_UINT32 msg_type;
  835. #if HTT_PADDR64
  836. A_UINT64 frag_paddr; /* DMAble address of the data */
  837. #else
  838. A_UINT32 frag_paddr; /* DMAble address of the data */
  839. #endif
  840. A_UINT32 desc_id; /* returned to host during completion
  841. * to free the meory*/
  842. A_UINT32 len; /* Fragment length */
  843. A_UINT32 vdev_id; /* virtual device ID*/
  844. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  845. } POSTPACK;
  846. PREPACK struct htt_mgmt_tx_compl_ind {
  847. A_UINT32 desc_id;
  848. A_UINT32 status;
  849. } POSTPACK;
  850. /*
  851. * This SDU header size comes from the summation of the following:
  852. * 1. Max of:
  853. * a. Native WiFi header, for native WiFi frames: 24 bytes
  854. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  855. * b. 802.11 header, for raw frames: 36 bytes
  856. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  857. * QoS header, HT header)
  858. * c. 802.3 header, for ethernet frames: 14 bytes
  859. * (destination address, source address, ethertype / length)
  860. * 2. Max of:
  861. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  862. * b. IPv6 header, up through the Traffic Class: 2 bytes
  863. * 3. 802.1Q VLAN header: 4 bytes
  864. * 4. LLC/SNAP header: 8 bytes
  865. */
  866. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  867. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  868. #define HTT_TX_HDR_SIZE_ETHERNET 14
  869. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  870. A_COMPILE_TIME_ASSERT(
  871. htt_encap_hdr_size_max_check_nwifi,
  872. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  873. A_COMPILE_TIME_ASSERT(
  874. htt_encap_hdr_size_max_check_enet,
  875. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  876. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  877. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  878. #define HTT_TX_HDR_SIZE_802_1Q 4
  879. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  880. #define HTT_COMMON_TX_FRM_HDR_LEN \
  881. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  882. HTT_TX_HDR_SIZE_802_1Q + \
  883. HTT_TX_HDR_SIZE_LLC_SNAP)
  884. #define HTT_HL_TX_FRM_HDR_LEN \
  885. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  886. #define HTT_LL_TX_FRM_HDR_LEN \
  887. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  888. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  889. /* dword 0 */
  890. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  893. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  894. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  897. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  898. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  899. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  900. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  901. #define HTT_TX_DESC_PKT_TYPE_S 13
  902. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  903. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  904. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  905. #define HTT_TX_DESC_VDEV_ID_S 16
  906. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  907. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  908. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  909. #define HTT_TX_DESC_EXT_TID_S 22
  910. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  911. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  912. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  913. #define HTT_TX_DESC_POSTPONED_S 27
  914. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  915. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  916. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  917. #define HTT_TX_DESC_EXTENSION_S 28
  918. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  919. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  920. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  921. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  922. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  923. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  924. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  925. #define HTT_TX_DESC_TX_COMP_S 31
  926. /* dword 1 */
  927. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  928. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  929. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  930. #define HTT_TX_DESC_FRM_LEN_S 0
  931. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  932. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  933. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  934. #define HTT_TX_DESC_FRM_ID_S 16
  935. /* dword 2 */
  936. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  937. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  938. /* for systems using 64-bit format for bus addresses */
  939. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  940. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  941. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  942. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  943. /* for systems using 32-bit format for bus addresses */
  944. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  945. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  946. /* dword 3 */
  947. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  948. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  949. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  950. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  951. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  952. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  953. #if HTT_PADDR64
  954. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  955. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  956. #else
  957. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  958. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  959. #endif
  960. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  961. #define HTT_TX_DESC_PEER_ID_S 0
  962. /*
  963. * TEMPORARY:
  964. * The original definitions for the PEER_ID fields contained typos
  965. * (with _DESC_PADDR appended to this PEER_ID field name).
  966. * Retain deprecated original names for PEER_ID fields until all code that
  967. * refers to them has been updated.
  968. */
  969. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  970. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  971. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  972. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  973. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  974. HTT_TX_DESC_PEER_ID_M
  975. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  976. HTT_TX_DESC_PEER_ID_S
  977. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  978. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  979. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  980. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  981. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  982. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  983. #if HTT_PADDR64
  984. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  985. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  986. #else
  987. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  988. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  989. #endif
  990. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  991. #define HTT_TX_DESC_CHAN_FREQ_S 16
  992. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  993. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  994. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1001. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1008. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1015. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1022. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1029. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1036. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1040. } while (0)
  1041. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1042. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1043. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1044. do { \
  1045. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1046. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1047. } while (0)
  1048. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1049. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1050. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1051. do { \
  1052. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1053. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1054. } while (0)
  1055. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1056. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1057. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1058. do { \
  1059. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1060. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1061. } while (0)
  1062. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1063. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1064. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1065. do { \
  1066. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1067. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1068. } while (0)
  1069. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1070. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1071. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1072. do { \
  1073. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1074. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1075. } while (0)
  1076. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1077. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1078. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1079. do { \
  1080. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1081. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1082. } while (0)
  1083. /* enums used in the HTT tx MSDU extension descriptor */
  1084. enum {
  1085. htt_tx_guard_interval_regular = 0,
  1086. htt_tx_guard_interval_short = 1,
  1087. };
  1088. enum {
  1089. htt_tx_preamble_type_ofdm = 0,
  1090. htt_tx_preamble_type_cck = 1,
  1091. htt_tx_preamble_type_ht = 2,
  1092. htt_tx_preamble_type_vht = 3,
  1093. };
  1094. enum {
  1095. htt_tx_bandwidth_5MHz = 0,
  1096. htt_tx_bandwidth_10MHz = 1,
  1097. htt_tx_bandwidth_20MHz = 2,
  1098. htt_tx_bandwidth_40MHz = 3,
  1099. htt_tx_bandwidth_80MHz = 4,
  1100. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1101. };
  1102. /**
  1103. * @brief HTT tx MSDU extension descriptor
  1104. * @details
  1105. * If the target supports HTT tx MSDU extension descriptors, the host has
  1106. * the option of appending the following struct following the regular
  1107. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1108. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1109. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1110. * tx specs for each frame.
  1111. */
  1112. PREPACK struct htt_tx_msdu_desc_ext_t {
  1113. /* DWORD 0: flags */
  1114. A_UINT32
  1115. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1116. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1117. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1118. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1119. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1120. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1121. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1122. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1123. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1124. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1125. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1126. /* DWORD 1: tx power, tx rate, tx BW */
  1127. A_UINT32
  1128. /* pwr -
  1129. * Specify what power the tx frame needs to be transmitted at.
  1130. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1131. * The value needs to be appropriately sign-extended when extracting
  1132. * the value from the message and storing it in a variable that is
  1133. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1134. * automatically handles this sign-extension.)
  1135. * If the transmission uses multiple tx chains, this power spec is
  1136. * the total transmit power, assuming incoherent combination of
  1137. * per-chain power to produce the total power.
  1138. */
  1139. pwr: 8,
  1140. /* mcs_mask -
  1141. * Specify the allowable values for MCS index (modulation and coding)
  1142. * to use for transmitting the frame.
  1143. *
  1144. * For HT / VHT preamble types, this mask directly corresponds to
  1145. * the HT or VHT MCS indices that are allowed. For each bit N set
  1146. * within the mask, MCS index N is allowed for transmitting the frame.
  1147. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1148. * rates versus OFDM rates, so the host has the option of specifying
  1149. * that the target must transmit the frame with CCK or OFDM rates
  1150. * (not HT or VHT), but leaving the decision to the target whether
  1151. * to use CCK or OFDM.
  1152. *
  1153. * For CCK and OFDM, the bits within this mask are interpreted as
  1154. * follows:
  1155. * bit 0 -> CCK 1 Mbps rate is allowed
  1156. * bit 1 -> CCK 2 Mbps rate is allowed
  1157. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1158. * bit 3 -> CCK 11 Mbps rate is allowed
  1159. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1160. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1161. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1162. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1163. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1164. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1165. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1166. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1167. *
  1168. * The MCS index specification needs to be compatible with the
  1169. * bandwidth mask specification. For example, a MCS index == 9
  1170. * specification is inconsistent with a preamble type == VHT,
  1171. * Nss == 1, and channel bandwidth == 20 MHz.
  1172. *
  1173. * Furthermore, the host has only a limited ability to specify to
  1174. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1175. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1176. */
  1177. mcs_mask: 12,
  1178. /* nss_mask -
  1179. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1180. * Each bit in this mask corresponds to a Nss value:
  1181. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1182. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1183. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1184. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1185. * The values in the Nss mask must be suitable for the recipient, e.g.
  1186. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1187. * recipient which only supports 2x2 MIMO.
  1188. */
  1189. nss_mask: 4,
  1190. /* guard_interval -
  1191. * Specify a htt_tx_guard_interval enum value to indicate whether
  1192. * the transmission should use a regular guard interval or a
  1193. * short guard interval.
  1194. */
  1195. guard_interval: 1,
  1196. /* preamble_type_mask -
  1197. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1198. * may choose from for transmitting this frame.
  1199. * The bits in this mask correspond to the values in the
  1200. * htt_tx_preamble_type enum. For example, to allow the target
  1201. * to transmit the frame as either CCK or OFDM, this field would
  1202. * be set to
  1203. * (1 << htt_tx_preamble_type_ofdm) |
  1204. * (1 << htt_tx_preamble_type_cck)
  1205. */
  1206. preamble_type_mask: 4,
  1207. reserved1_31_29: 3; /* unused, set to 0x0 */
  1208. /* DWORD 2: tx chain mask, tx retries */
  1209. A_UINT32
  1210. /* chain_mask - specify which chains to transmit from */
  1211. chain_mask: 4,
  1212. /* retry_limit -
  1213. * Specify the maximum number of transmissions, including the
  1214. * initial transmission, to attempt before giving up if no ack
  1215. * is received.
  1216. * If the tx rate is specified, then all retries shall use the
  1217. * same rate as the initial transmission.
  1218. * If no tx rate is specified, the target can choose whether to
  1219. * retain the original rate during the retransmissions, or to
  1220. * fall back to a more robust rate.
  1221. */
  1222. retry_limit: 4,
  1223. /* bandwidth_mask -
  1224. * Specify what channel widths may be used for the transmission.
  1225. * A value of zero indicates "don't care" - the target may choose
  1226. * the transmission bandwidth.
  1227. * The bits within this mask correspond to the htt_tx_bandwidth
  1228. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1229. * The bandwidth_mask must be consistent with the preamble_type_mask
  1230. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1231. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1232. */
  1233. bandwidth_mask: 6,
  1234. reserved2_31_14: 18; /* unused, set to 0x0 */
  1235. /* DWORD 3: tx expiry time (TSF) LSBs */
  1236. A_UINT32 expire_tsf_lo;
  1237. /* DWORD 4: tx expiry time (TSF) MSBs */
  1238. A_UINT32 expire_tsf_hi;
  1239. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1240. } POSTPACK;
  1241. /* DWORD 0 */
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1262. /* DWORD 1 */
  1263. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1264. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1265. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1266. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1267. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1268. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1269. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1270. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1271. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1272. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1273. /* DWORD 2 */
  1274. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1275. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1276. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1277. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1278. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1279. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1280. /* DWORD 0 */
  1281. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1282. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL( \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1304. ((_var) |= ((_val) \
  1305. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1306. } while (0)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1308. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1309. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1310. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL( \
  1313. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1314. ((_var) |= ((_val) \
  1315. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1316. } while (0)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1318. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1319. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1320. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1324. } while (0)
  1325. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1332. } while (0)
  1333. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1334. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1335. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1336. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1340. } while (0)
  1341. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1348. } while (0)
  1349. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1350. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1351. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1352. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1356. } while (0)
  1357. /* DWORD 1 */
  1358. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1362. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1363. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1364. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1365. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1366. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1367. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1374. } while (0)
  1375. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1382. } while (0)
  1383. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1384. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1385. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1386. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1390. } while (0)
  1391. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1392. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1393. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1394. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1395. do { \
  1396. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1397. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1398. } while (0)
  1399. /* DWORD 2 */
  1400. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1401. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1402. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1403. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1404. do { \
  1405. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1406. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1407. } while (0)
  1408. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1409. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1410. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1411. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1412. do { \
  1413. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1414. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1415. } while (0)
  1416. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1417. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1418. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1419. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1420. do { \
  1421. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1422. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1423. } while (0)
  1424. typedef enum {
  1425. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1426. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1427. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1428. } htt_11ax_ltf_subtype_t;
  1429. typedef enum {
  1430. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1431. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1432. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1433. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1434. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1435. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1436. } htt_tx_ext2_preamble_type_t;
  1437. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1438. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1439. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1440. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1441. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1442. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1443. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1444. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1445. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1446. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1447. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1448. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1449. /**
  1450. * @brief HTT tx MSDU extension descriptor v2
  1451. * @details
  1452. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1453. * is received as tcl_exit_base->host_meta_info in firmware.
  1454. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1455. * are already part of tcl_exit_base.
  1456. */
  1457. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1458. /* DWORD 0: flags */
  1459. A_UINT32
  1460. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1461. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1462. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1463. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1464. valid_retries : 1, /* if set, tx retries spec is valid */
  1465. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1466. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1467. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1468. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1469. valid_key_flags : 1, /* if set, key flags is valid */
  1470. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1471. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1472. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1473. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1474. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1475. 1 = ENCRYPT,
  1476. 2 ~ 3 - Reserved */
  1477. /* retry_limit -
  1478. * Specify the maximum number of transmissions, including the
  1479. * initial transmission, to attempt before giving up if no ack
  1480. * is received.
  1481. * If the tx rate is specified, then all retries shall use the
  1482. * same rate as the initial transmission.
  1483. * If no tx rate is specified, the target can choose whether to
  1484. * retain the original rate during the retransmissions, or to
  1485. * fall back to a more robust rate.
  1486. */
  1487. retry_limit : 4,
  1488. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1489. * Valid only for 11ax preamble types HE_SU
  1490. * and HE_EXT_SU
  1491. */
  1492. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1493. * Valid only for 11ax preamble types HE_SU
  1494. * and HE_EXT_SU
  1495. */
  1496. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1497. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1498. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1499. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1500. */
  1501. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1502. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1503. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1504. * Use cases:
  1505. * Any time firmware uses TQM-BYPASS for Data
  1506. * TID, firmware expect host to set this bit.
  1507. */
  1508. /* DWORD 1: tx power, tx rate */
  1509. A_UINT32
  1510. power : 8, /* unit of the power field is 0.5 dbm
  1511. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1512. * signed value ranging from -64dbm to 63.5 dbm
  1513. */
  1514. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1515. * Setting more than one MCS isn't currently
  1516. * supported by the target (but is supported
  1517. * in the interface in case in the future
  1518. * the target supports specifications of
  1519. * a limited set of MCS values.
  1520. */
  1521. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1522. * Setting more than one Nss isn't currently
  1523. * supported by the target (but is supported
  1524. * in the interface in case in the future
  1525. * the target supports specifications of
  1526. * a limited set of Nss values.
  1527. */
  1528. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1529. update_peer_cache : 1; /* When set these custom values will be
  1530. * used for all packets, until the next
  1531. * update via this ext header.
  1532. * This is to make sure not all packets
  1533. * need to include this header.
  1534. */
  1535. /* DWORD 2: tx chain mask, tx retries */
  1536. A_UINT32
  1537. /* chain_mask - specify which chains to transmit from */
  1538. chain_mask : 8,
  1539. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1540. * TODO: Update Enum values for key_flags
  1541. */
  1542. /*
  1543. * Channel frequency: This identifies the desired channel
  1544. * frequency (in MHz) for tx frames. This is used by FW to help
  1545. * determine when it is safe to transmit or drop frames for
  1546. * off-channel operation.
  1547. * The default value of zero indicates to FW that the corresponding
  1548. * VDEV's home channel (if there is one) is the desired channel
  1549. * frequency.
  1550. */
  1551. chanfreq : 16;
  1552. /* DWORD 3: tx expiry time (TSF) LSBs */
  1553. A_UINT32 expire_tsf_lo;
  1554. /* DWORD 4: tx expiry time (TSF) MSBs */
  1555. A_UINT32 expire_tsf_hi;
  1556. /* DWORD 5: flags to control routing / processing of the MSDU */
  1557. A_UINT32
  1558. /* learning_frame
  1559. * When this flag is set, this frame will be dropped by FW
  1560. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1561. */
  1562. learning_frame : 1,
  1563. /* send_as_standalone
  1564. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1565. * i.e. with no A-MSDU or A-MPDU aggregation.
  1566. * The scope is extended to other use-cases.
  1567. */
  1568. send_as_standalone : 1,
  1569. /* is_host_opaque_valid
  1570. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1571. * with valid information.
  1572. */
  1573. is_host_opaque_valid : 1,
  1574. rsvd0 : 29;
  1575. /* DWORD 6 : Host opaque cookie for special frames */
  1576. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1577. rsvd1 : 16;
  1578. /*
  1579. * This structure can be expanded further up to 40 bytes
  1580. * by adding further DWORDs as needed.
  1581. */
  1582. } POSTPACK;
  1583. /* DWORD 0 */
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1608. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1610. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1611. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1612. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1613. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1614. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1615. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1616. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1617. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1618. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1619. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1620. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1621. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1622. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1623. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1624. /* DWORD 1 */
  1625. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1626. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1627. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1628. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1629. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1630. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1631. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1632. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1633. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1634. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1635. /* DWORD 2 */
  1636. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1637. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1638. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1639. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1640. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1641. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1642. /* DWORD 5 */
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1649. /* DWORD 6 */
  1650. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1651. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1652. /* DWORD 0 */
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL( \
  1683. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1684. ((_var) |= ((_val) \
  1685. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL( \
  1709. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1710. ((_var) |= ((_val) \
  1711. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1712. } while (0)
  1713. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1714. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1715. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1716. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1719. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1735. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1736. } while (0)
  1737. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1738. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1739. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1740. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1743. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1744. } while (0)
  1745. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1746. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1747. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1749. do { \
  1750. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1751. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1752. } while (0)
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1754. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1755. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1757. do { \
  1758. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1759. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1760. } while (0)
  1761. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1762. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1763. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1764. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1765. do { \
  1766. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1767. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1768. } while (0)
  1769. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1792. } while (0)
  1793. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1795. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1796. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1800. } while (0)
  1801. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1802. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1803. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1804. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1805. do { \
  1806. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1807. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1808. } while (0)
  1809. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1810. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1811. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1812. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1813. do { \
  1814. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1815. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1816. } while (0)
  1817. /* DWORD 1 */
  1818. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1822. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1823. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1824. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1825. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1826. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1827. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1829. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1830. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1834. } while (0)
  1835. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1836. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1837. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1838. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1841. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1842. } while (0)
  1843. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1844. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1845. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1846. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1849. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1850. } while (0)
  1851. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1852. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1853. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1854. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1857. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1858. } while (0)
  1859. /* DWORD 2 */
  1860. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1861. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1862. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1863. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1866. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1867. } while (0)
  1868. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1869. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1870. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1871. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1875. } while (0)
  1876. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1877. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1878. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1879. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1882. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1883. } while (0)
  1884. /* DWORD 5 */
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1892. } while (0)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1900. } while (0)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1902. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1903. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1908. } while (0)
  1909. /* DWORD 6 */
  1910. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1911. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1912. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1913. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1914. do { \
  1915. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1916. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1917. } while (0)
  1918. typedef enum {
  1919. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1920. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1921. } htt_tcl_metadata_type;
  1922. /**
  1923. * @brief HTT TCL command number format
  1924. * @details
  1925. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1926. * available to firmware as tcl_exit_base->tcl_status_number.
  1927. * For regular / multicast packets host will send vdev and mac id and for
  1928. * NAWDS packets, host will send peer id.
  1929. * A_UINT32 is used to avoid endianness conversion problems.
  1930. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1931. */
  1932. typedef struct {
  1933. A_UINT32
  1934. type: 1, /* vdev_id based or peer_id based */
  1935. rsvd: 31;
  1936. } htt_tx_tcl_vdev_or_peer_t;
  1937. typedef struct {
  1938. A_UINT32
  1939. type: 1, /* vdev_id based or peer_id based */
  1940. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1941. vdev_id: 8,
  1942. pdev_id: 2,
  1943. host_inspected:1,
  1944. rsvd: 19;
  1945. } htt_tx_tcl_vdev_metadata;
  1946. typedef struct {
  1947. A_UINT32
  1948. type: 1, /* vdev_id based or peer_id based */
  1949. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1950. peer_id: 14,
  1951. rsvd: 16;
  1952. } htt_tx_tcl_peer_metadata;
  1953. PREPACK struct htt_tx_tcl_metadata {
  1954. union {
  1955. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1956. htt_tx_tcl_vdev_metadata vdev_meta;
  1957. htt_tx_tcl_peer_metadata peer_meta;
  1958. };
  1959. } POSTPACK;
  1960. /* DWORD 0 */
  1961. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1962. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1963. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1964. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1965. /* VDEV metadata */
  1966. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1967. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1968. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1969. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1970. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1971. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1972. /* PEER metadata */
  1973. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1974. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1975. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1976. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1977. HTT_TX_TCL_METADATA_TYPE_S)
  1978. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1982. } while (0)
  1983. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1984. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1985. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1986. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1990. } while (0)
  1991. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1992. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1993. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1994. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1998. } while (0)
  1999. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2000. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2001. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2002. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2006. } while (0)
  2007. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2008. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2009. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2010. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2014. } while (0)
  2015. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2016. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2017. HTT_TX_TCL_METADATA_PEER_ID_S)
  2018. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2022. } while (0)
  2023. typedef enum {
  2024. HTT_TX_FW2WBM_TX_STATUS_OK,
  2025. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2026. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2027. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2028. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2029. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2030. HTT_TX_FW2WBM_TX_STATUS_MAX
  2031. } htt_tx_fw2wbm_tx_status_t;
  2032. typedef enum {
  2033. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2034. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2035. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2036. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2037. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2038. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2039. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2040. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2041. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2042. } htt_tx_fw2wbm_reinject_reason_t;
  2043. /**
  2044. * @brief HTT TX WBM Completion from firmware to host
  2045. * @details
  2046. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2047. * DWORD 3 and 4 for software based completions (Exception frames and
  2048. * TQM bypass frames)
  2049. * For software based completions, wbm_release_ring->release_source_module will
  2050. * be set to release_source_fw
  2051. */
  2052. PREPACK struct htt_tx_wbm_completion {
  2053. A_UINT32
  2054. sch_cmd_id: 24,
  2055. exception_frame: 1, /* If set, this packet was queued via exception path */
  2056. rsvd0_31_25: 7;
  2057. A_UINT32
  2058. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2059. * reception of an ACK or BA, this field indicates
  2060. * the RSSI of the received ACK or BA frame.
  2061. * When the frame is removed as result of a direct
  2062. * remove command from the SW, this field is set
  2063. * to 0x0 (which is never a valid value when real
  2064. * RSSI is available).
  2065. * Units: dB w.r.t noise floor
  2066. */
  2067. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2068. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2069. rsvd1_31_16: 16;
  2070. } POSTPACK;
  2071. /* DWORD 0 */
  2072. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2073. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2074. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2075. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2076. /* DWORD 1 */
  2077. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2078. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2079. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2080. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2081. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2082. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2083. /* DWORD 0 */
  2084. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2086. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2087. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2091. } while (0)
  2092. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2093. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2094. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2095. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2099. } while (0)
  2100. /* DWORD 1 */
  2101. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2102. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2103. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2104. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2108. } while (0)
  2109. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2110. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2111. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2112. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2113. do { \
  2114. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2115. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2116. } while (0)
  2117. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2118. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2119. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2120. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2121. do { \
  2122. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2123. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2124. } while (0)
  2125. /**
  2126. * @brief HTT TX WBM Completion from firmware to host
  2127. * @details
  2128. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2129. * (WBM) offload HW.
  2130. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2131. * For software based completions, release_source_module will
  2132. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2133. * struct wbm_release_ring and then switch to this after looking at
  2134. * release_source_module.
  2135. */
  2136. PREPACK struct htt_tx_wbm_completion_v2 {
  2137. A_UINT32
  2138. used_by_hw0; /* Refer to struct wbm_release_ring */
  2139. A_UINT32
  2140. used_by_hw1; /* Refer to struct wbm_release_ring */
  2141. A_UINT32
  2142. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2143. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2144. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2145. exception_frame: 1,
  2146. rsvd0: 12, /* For future use */
  2147. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2148. rsvd1: 1; /* For future use */
  2149. A_UINT32
  2150. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2151. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2152. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2153. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2154. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2155. */
  2156. A_UINT32
  2157. data1: 32;
  2158. A_UINT32
  2159. data2: 32;
  2160. A_UINT32
  2161. used_by_hw3; /* Refer to struct wbm_release_ring */
  2162. } POSTPACK;
  2163. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2164. /* DWORD 3 */
  2165. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2166. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2167. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2168. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2169. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2170. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2171. /* DWORD 3 */
  2172. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2173. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2174. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2175. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2179. } while (0)
  2180. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2181. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2182. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2183. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2187. } while (0)
  2188. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2189. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2190. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2191. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2192. do { \
  2193. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2194. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2195. } while (0)
  2196. /**
  2197. * @brief HTT TX WBM transmit status from firmware to host
  2198. * @details
  2199. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2200. * (WBM) offload HW.
  2201. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2202. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2203. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2204. */
  2205. PREPACK struct htt_tx_wbm_transmit_status {
  2206. A_UINT32
  2207. sch_cmd_id: 24,
  2208. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2209. * reception of an ACK or BA, this field indicates
  2210. * the RSSI of the received ACK or BA frame.
  2211. * When the frame is removed as result of a direct
  2212. * remove command from the SW, this field is set
  2213. * to 0x0 (which is never a valid value when real
  2214. * RSSI is available).
  2215. * Units: dB w.r.t noise floor
  2216. */
  2217. A_UINT32
  2218. sw_peer_id: 16,
  2219. tid_num: 5,
  2220. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2221. * and tid_num fields contain valid data.
  2222. * If this "valid" flag is not set, the
  2223. * sw_peer_id and tid_num fields must be ignored.
  2224. */
  2225. mcast: 1,
  2226. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2227. * contains valid data.
  2228. */
  2229. reserved0: 8;
  2230. A_UINT32
  2231. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2232. * packets in the wbm completion path
  2233. */
  2234. } POSTPACK;
  2235. /* DWORD 4 */
  2236. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2237. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2238. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2239. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2240. /* DWORD 5 */
  2241. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2242. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2243. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2244. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2245. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2246. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2247. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2248. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2249. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2250. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2251. /* DWORD 4 */
  2252. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2253. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2254. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2255. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2258. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2259. } while (0)
  2260. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2261. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2262. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2263. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2267. } while (0)
  2268. /* DWORD 5 */
  2269. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2270. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2271. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2272. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2276. } while (0)
  2277. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2278. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2279. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2280. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2284. } while (0)
  2285. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2286. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2287. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2288. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2292. } while (0)
  2293. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2294. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2295. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2296. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2297. do { \
  2298. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2299. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2300. } while (0)
  2301. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2302. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2303. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2304. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2305. do { \
  2306. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2307. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2308. } while (0)
  2309. /**
  2310. * @brief HTT TX WBM reinject status from firmware to host
  2311. * @details
  2312. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2313. * (WBM) offload HW.
  2314. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2315. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2316. */
  2317. PREPACK struct htt_tx_wbm_reinject_status {
  2318. A_UINT32
  2319. reserved0: 32;
  2320. A_UINT32
  2321. reserved1: 32;
  2322. A_UINT32
  2323. reserved2: 32;
  2324. } POSTPACK;
  2325. /**
  2326. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2327. * @details
  2328. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2329. * (WBM) offload HW.
  2330. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2331. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2332. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2333. * STA side.
  2334. */
  2335. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2336. A_UINT32
  2337. mec_sa_addr_31_0;
  2338. A_UINT32
  2339. mec_sa_addr_47_32: 16,
  2340. sa_ast_index: 16;
  2341. A_UINT32
  2342. vdev_id: 8,
  2343. reserved0: 24;
  2344. } POSTPACK;
  2345. /* DWORD 4 - mec_sa_addr_31_0 */
  2346. /* DWORD 5 */
  2347. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2348. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2349. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2350. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2351. /* DWORD 6 */
  2352. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2353. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2354. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2355. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2356. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2357. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2358. do { \
  2359. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2360. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2361. } while (0)
  2362. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2363. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2364. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2365. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2369. } while (0)
  2370. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2371. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2372. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2373. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2374. do { \
  2375. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2376. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2377. } while (0)
  2378. typedef enum {
  2379. TX_FLOW_PRIORITY_BE,
  2380. TX_FLOW_PRIORITY_HIGH,
  2381. TX_FLOW_PRIORITY_LOW,
  2382. } htt_tx_flow_priority_t;
  2383. typedef enum {
  2384. TX_FLOW_LATENCY_SENSITIVE,
  2385. TX_FLOW_LATENCY_INSENSITIVE,
  2386. } htt_tx_flow_latency_t;
  2387. typedef enum {
  2388. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2389. TX_FLOW_INTERACTIVE_TRAFFIC,
  2390. TX_FLOW_PERIODIC_TRAFFIC,
  2391. TX_FLOW_BURSTY_TRAFFIC,
  2392. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2393. } htt_tx_flow_traffic_pattern_t;
  2394. /**
  2395. * @brief HTT TX Flow search metadata format
  2396. * @details
  2397. * Host will set this metadata in flow table's flow search entry along with
  2398. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2399. * firmware and TQM ring if the flow search entry wins.
  2400. * This metadata is available to firmware in that first MSDU's
  2401. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2402. * to one of the available flows for specific tid and returns the tqm flow
  2403. * pointer as part of htt_tx_map_flow_info message.
  2404. */
  2405. PREPACK struct htt_tx_flow_metadata {
  2406. A_UINT32
  2407. rsvd0_1_0: 2,
  2408. tid: 4,
  2409. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2410. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2411. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2412. * Else choose final tid based on latency, priority.
  2413. */
  2414. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2415. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2416. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2417. } POSTPACK;
  2418. /* DWORD 0 */
  2419. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2420. #define HTT_TX_FLOW_METADATA_TID_S 2
  2421. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2422. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2424. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2425. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2426. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2427. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2428. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2429. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2430. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2431. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2432. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2433. /* DWORD 0 */
  2434. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2435. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2436. HTT_TX_FLOW_METADATA_TID_S)
  2437. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2440. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2441. } while (0)
  2442. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2443. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2444. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2445. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2448. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2449. } while (0)
  2450. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2451. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2452. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2453. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2457. } while (0)
  2458. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2459. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2460. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2461. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2464. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2465. } while (0)
  2466. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2467. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2468. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2469. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2470. do { \
  2471. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2472. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2473. } while (0)
  2474. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2475. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2476. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2477. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2478. do { \
  2479. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2480. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2481. } while (0)
  2482. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2483. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2484. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2485. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2486. do { \
  2487. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2488. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2489. } while (0)
  2490. /**
  2491. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2492. *
  2493. * @details
  2494. * HTT wds entry from source port learning
  2495. * Host will learn wds entries from rx and send this message to firmware
  2496. * to enable firmware to configure/delete AST entries for wds clients.
  2497. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2498. * and when SA's entry is deleted, firmware removes this AST entry
  2499. *
  2500. * The message would appear as follows:
  2501. *
  2502. * |31 30|29 |17 16|15 8|7 0|
  2503. * |----------------+----------------+----------------+----------------|
  2504. * | rsvd0 |PDVID| vdev_id | msg_type |
  2505. * |-------------------------------------------------------------------|
  2506. * | sa_addr_31_0 |
  2507. * |-------------------------------------------------------------------|
  2508. * | | ta_peer_id | sa_addr_47_32 |
  2509. * |-------------------------------------------------------------------|
  2510. * Where PDVID = pdev_id
  2511. *
  2512. * The message is interpreted as follows:
  2513. *
  2514. * dword0 - b'0:7 - msg_type: This will be set to
  2515. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2516. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2517. *
  2518. * dword0 - b'8:15 - vdev_id
  2519. *
  2520. * dword0 - b'16:17 - pdev_id
  2521. *
  2522. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2523. *
  2524. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2525. *
  2526. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2527. *
  2528. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2529. */
  2530. PREPACK struct htt_wds_entry {
  2531. A_UINT32
  2532. msg_type: 8,
  2533. vdev_id: 8,
  2534. pdev_id: 2,
  2535. rsvd0: 14;
  2536. A_UINT32 sa_addr_31_0;
  2537. A_UINT32
  2538. sa_addr_47_32: 16,
  2539. ta_peer_id: 14,
  2540. rsvd2: 2;
  2541. } POSTPACK;
  2542. /* DWORD 0 */
  2543. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2544. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2545. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2546. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2547. /* DWORD 2 */
  2548. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2549. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2550. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2551. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2552. /* DWORD 0 */
  2553. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2554. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2555. HTT_WDS_ENTRY_VDEV_ID_S)
  2556. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2557. do { \
  2558. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2559. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2560. } while (0)
  2561. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2562. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2563. HTT_WDS_ENTRY_PDEV_ID_S)
  2564. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2565. do { \
  2566. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2567. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2568. } while (0)
  2569. /* DWORD 2 */
  2570. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2571. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2572. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2573. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2574. do { \
  2575. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2576. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2577. } while (0)
  2578. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2579. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2580. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2581. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2582. do { \
  2583. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2584. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2585. } while (0)
  2586. /**
  2587. * @brief MAC DMA rx ring setup specification
  2588. * @details
  2589. * To allow for dynamic rx ring reconfiguration and to avoid race
  2590. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2591. * it uses. Instead, it sends this message to the target, indicating how
  2592. * the rx ring used by the host should be set up and maintained.
  2593. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2594. * specifications.
  2595. *
  2596. * |31 16|15 8|7 0|
  2597. * |---------------------------------------------------------------|
  2598. * header: | reserved | num rings | msg type |
  2599. * |---------------------------------------------------------------|
  2600. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2601. #if HTT_PADDR64
  2602. * | FW_IDX shadow register physical address (bits 63:32) |
  2603. #endif
  2604. * |---------------------------------------------------------------|
  2605. * | rx ring base physical address (bits 31:0) |
  2606. #if HTT_PADDR64
  2607. * | rx ring base physical address (bits 63:32) |
  2608. #endif
  2609. * |---------------------------------------------------------------|
  2610. * | rx ring buffer size | rx ring length |
  2611. * |---------------------------------------------------------------|
  2612. * | FW_IDX initial value | enabled flags |
  2613. * |---------------------------------------------------------------|
  2614. * | MSDU payload offset | 802.11 header offset |
  2615. * |---------------------------------------------------------------|
  2616. * | PPDU end offset | PPDU start offset |
  2617. * |---------------------------------------------------------------|
  2618. * | MPDU end offset | MPDU start offset |
  2619. * |---------------------------------------------------------------|
  2620. * | MSDU end offset | MSDU start offset |
  2621. * |---------------------------------------------------------------|
  2622. * | frag info offset | rx attention offset |
  2623. * |---------------------------------------------------------------|
  2624. * payload 2, if present, has the same format as payload 1
  2625. * Header fields:
  2626. * - MSG_TYPE
  2627. * Bits 7:0
  2628. * Purpose: identifies this as an rx ring configuration message
  2629. * Value: 0x2
  2630. * - NUM_RINGS
  2631. * Bits 15:8
  2632. * Purpose: indicates whether the host is setting up one rx ring or two
  2633. * Value: 1 or 2
  2634. * Payload:
  2635. * for systems using 64-bit format for bus addresses:
  2636. * - IDX_SHADOW_REG_PADDR_LO
  2637. * Bits 31:0
  2638. * Value: lower 4 bytes of physical address of the host's
  2639. * FW_IDX shadow register
  2640. * - IDX_SHADOW_REG_PADDR_HI
  2641. * Bits 31:0
  2642. * Value: upper 4 bytes of physical address of the host's
  2643. * FW_IDX shadow register
  2644. * - RING_BASE_PADDR_LO
  2645. * Bits 31:0
  2646. * Value: lower 4 bytes of physical address of the host's rx ring
  2647. * - RING_BASE_PADDR_HI
  2648. * Bits 31:0
  2649. * Value: uppper 4 bytes of physical address of the host's rx ring
  2650. * for systems using 32-bit format for bus addresses:
  2651. * - IDX_SHADOW_REG_PADDR
  2652. * Bits 31:0
  2653. * Value: physical address of the host's FW_IDX shadow register
  2654. * - RING_BASE_PADDR
  2655. * Bits 31:0
  2656. * Value: physical address of the host's rx ring
  2657. * - RING_LEN
  2658. * Bits 15:0
  2659. * Value: number of elements in the rx ring
  2660. * - RING_BUF_SZ
  2661. * Bits 31:16
  2662. * Value: size of the buffers referenced by the rx ring, in byte units
  2663. * - ENABLED_FLAGS
  2664. * Bits 15:0
  2665. * Value: 1-bit flags to show whether different rx fields are enabled
  2666. * bit 0: 802.11 header enabled (1) or disabled (0)
  2667. * bit 1: MSDU payload enabled (1) or disabled (0)
  2668. * bit 2: PPDU start enabled (1) or disabled (0)
  2669. * bit 3: PPDU end enabled (1) or disabled (0)
  2670. * bit 4: MPDU start enabled (1) or disabled (0)
  2671. * bit 5: MPDU end enabled (1) or disabled (0)
  2672. * bit 6: MSDU start enabled (1) or disabled (0)
  2673. * bit 7: MSDU end enabled (1) or disabled (0)
  2674. * bit 8: rx attention enabled (1) or disabled (0)
  2675. * bit 9: frag info enabled (1) or disabled (0)
  2676. * bit 10: unicast rx enabled (1) or disabled (0)
  2677. * bit 11: multicast rx enabled (1) or disabled (0)
  2678. * bit 12: ctrl rx enabled (1) or disabled (0)
  2679. * bit 13: mgmt rx enabled (1) or disabled (0)
  2680. * bit 14: null rx enabled (1) or disabled (0)
  2681. * bit 15: phy data rx enabled (1) or disabled (0)
  2682. * - IDX_INIT_VAL
  2683. * Bits 31:16
  2684. * Purpose: Specify the initial value for the FW_IDX.
  2685. * Value: the number of buffers initially present in the host's rx ring
  2686. * - OFFSET_802_11_HDR
  2687. * Bits 15:0
  2688. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2689. * - OFFSET_MSDU_PAYLOAD
  2690. * Bits 31:16
  2691. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2692. * - OFFSET_PPDU_START
  2693. * Bits 15:0
  2694. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2695. * - OFFSET_PPDU_END
  2696. * Bits 31:16
  2697. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2698. * - OFFSET_MPDU_START
  2699. * Bits 15:0
  2700. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2701. * - OFFSET_MPDU_END
  2702. * Bits 31:16
  2703. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2704. * - OFFSET_MSDU_START
  2705. * Bits 15:0
  2706. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2707. * - OFFSET_MSDU_END
  2708. * Bits 31:16
  2709. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2710. * - OFFSET_RX_ATTN
  2711. * Bits 15:0
  2712. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2713. * - OFFSET_FRAG_INFO
  2714. * Bits 31:16
  2715. * Value: offset in QUAD-bytes of frag info table
  2716. */
  2717. /* header fields */
  2718. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2719. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2720. /* payload fields */
  2721. /* for systems using a 64-bit format for bus addresses */
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2725. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2726. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2727. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2728. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2729. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2730. /* for systems using a 32-bit format for bus addresses */
  2731. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2732. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2734. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2735. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2736. #define HTT_RX_RING_CFG_LEN_S 0
  2737. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2738. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2739. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2740. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2743. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2744. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2745. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2746. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2747. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2748. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2749. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2750. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2751. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2752. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2753. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2754. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2755. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2756. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2757. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2758. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2759. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2760. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2761. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2762. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2763. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2764. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2765. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2766. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2767. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2768. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2769. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2770. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2771. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2772. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2773. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2774. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2776. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2777. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2778. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2779. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2780. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2781. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2782. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2783. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2784. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2785. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2786. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2787. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2788. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2789. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2790. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2791. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2792. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2793. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2794. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2795. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2796. #if HTT_PADDR64
  2797. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2798. #else
  2799. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2800. #endif
  2801. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2802. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2803. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2805. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2808. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2809. } while (0)
  2810. /* degenerate case for 32-bit fields */
  2811. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2812. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2813. ((_var) = (_val))
  2814. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2815. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2816. ((_var) = (_val))
  2817. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2818. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2819. ((_var) = (_val))
  2820. /* degenerate case for 32-bit fields */
  2821. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2822. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2823. ((_var) = (_val))
  2824. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2825. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2826. ((_var) = (_val))
  2827. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2828. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2829. ((_var) = (_val))
  2830. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2832. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2839. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2840. do { \
  2841. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2842. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2843. } while (0)
  2844. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2845. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2846. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2847. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2848. do { \
  2849. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2850. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2851. } while (0)
  2852. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2853. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2854. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2855. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2858. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2859. } while (0)
  2860. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2861. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2862. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2863. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2866. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2867. } while (0)
  2868. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2869. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2870. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2871. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2874. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2875. } while (0)
  2876. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2877. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2878. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2879. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2882. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2883. } while (0)
  2884. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2885. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2886. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2887. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2890. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2891. } while (0)
  2892. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2893. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2894. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2895. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2898. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2899. } while (0)
  2900. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2901. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2902. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2903. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2906. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2907. } while (0)
  2908. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2909. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2910. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2911. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2914. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2915. } while (0)
  2916. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2917. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2918. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2919. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2920. do { \
  2921. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2922. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2923. } while (0)
  2924. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2925. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2926. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2927. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2928. do { \
  2929. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2930. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2931. } while (0)
  2932. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2933. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2934. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2935. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2936. do { \
  2937. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2938. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2939. } while (0)
  2940. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2941. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2942. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2943. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2944. do { \
  2945. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2946. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2947. } while (0)
  2948. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2949. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2950. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2951. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2952. do { \
  2953. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2954. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2955. } while (0)
  2956. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2957. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2958. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2959. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2960. do { \
  2961. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2962. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2963. } while (0)
  2964. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2965. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2966. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2967. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2970. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2971. } while (0)
  2972. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2973. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2974. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2975. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2978. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2979. } while (0)
  2980. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2981. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2982. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2983. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2986. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2987. } while (0)
  2988. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2989. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2990. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2991. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2992. do { \
  2993. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2994. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2995. } while (0)
  2996. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2997. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2998. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2999. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3000. do { \
  3001. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3002. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3003. } while (0)
  3004. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3005. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3006. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3007. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3008. do { \
  3009. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3010. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3011. } while (0)
  3012. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3013. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3014. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3015. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3016. do { \
  3017. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3018. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3019. } while (0)
  3020. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3021. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3022. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3023. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3024. do { \
  3025. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3026. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3027. } while (0)
  3028. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3029. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3030. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3031. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3032. do { \
  3033. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3034. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3035. } while (0)
  3036. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3037. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3038. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3039. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3042. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3043. } while (0)
  3044. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3045. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3046. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3047. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3050. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3051. } while (0)
  3052. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3053. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3054. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3055. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3056. do { \
  3057. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3058. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3059. } while (0)
  3060. /**
  3061. * @brief host -> target FW statistics retrieve
  3062. *
  3063. * @details
  3064. * The following field definitions describe the format of the HTT host
  3065. * to target FW stats retrieve message. The message specifies the type of
  3066. * stats host wants to retrieve.
  3067. *
  3068. * |31 24|23 16|15 8|7 0|
  3069. * |-----------------------------------------------------------|
  3070. * | stats types request bitmask | msg type |
  3071. * |-----------------------------------------------------------|
  3072. * | stats types reset bitmask | reserved |
  3073. * |-----------------------------------------------------------|
  3074. * | stats type | config value |
  3075. * |-----------------------------------------------------------|
  3076. * | cookie LSBs |
  3077. * |-----------------------------------------------------------|
  3078. * | cookie MSBs |
  3079. * |-----------------------------------------------------------|
  3080. * Header fields:
  3081. * - MSG_TYPE
  3082. * Bits 7:0
  3083. * Purpose: identifies this is a stats upload request message
  3084. * Value: 0x3
  3085. * - UPLOAD_TYPES
  3086. * Bits 31:8
  3087. * Purpose: identifies which types of FW statistics to upload
  3088. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3089. * - RESET_TYPES
  3090. * Bits 31:8
  3091. * Purpose: identifies which types of FW statistics to reset
  3092. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3093. * - CFG_VAL
  3094. * Bits 23:0
  3095. * Purpose: give an opaque configuration value to the specified stats type
  3096. * Value: stats-type specific configuration value
  3097. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3098. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3099. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3100. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3101. * - CFG_STAT_TYPE
  3102. * Bits 31:24
  3103. * Purpose: specify which stats type (if any) the config value applies to
  3104. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3105. * a valid configuration specification
  3106. * - COOKIE_LSBS
  3107. * Bits 31:0
  3108. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3109. * message with its preceding host->target stats request message.
  3110. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3111. * - COOKIE_MSBS
  3112. * Bits 31:0
  3113. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3114. * message with its preceding host->target stats request message.
  3115. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3116. */
  3117. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3118. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3119. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3120. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3121. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3122. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3123. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3124. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3125. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3126. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3127. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3128. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3129. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3130. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3133. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3134. } while (0)
  3135. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3136. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3137. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3138. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3141. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3142. } while (0)
  3143. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3144. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3145. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3146. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3147. do { \
  3148. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3149. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3150. } while (0)
  3151. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3152. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3153. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3154. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3155. do { \
  3156. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3157. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3158. } while (0)
  3159. /**
  3160. * @brief host -> target HTT out-of-band sync request
  3161. *
  3162. * @details
  3163. * The HTT SYNC tells the target to suspend processing of subsequent
  3164. * HTT host-to-target messages until some other target agent locally
  3165. * informs the target HTT FW that the current sync counter is equal to
  3166. * or greater than (in a modulo sense) the sync counter specified in
  3167. * the SYNC message.
  3168. * This allows other host-target components to synchronize their operation
  3169. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3170. * security key has been downloaded to and activated by the target.
  3171. * In the absence of any explicit synchronization counter value
  3172. * specification, the target HTT FW will use zero as the default current
  3173. * sync value.
  3174. *
  3175. * |31 24|23 16|15 8|7 0|
  3176. * |-----------------------------------------------------------|
  3177. * | reserved | sync count | msg type |
  3178. * |-----------------------------------------------------------|
  3179. * Header fields:
  3180. * - MSG_TYPE
  3181. * Bits 7:0
  3182. * Purpose: identifies this as a sync message
  3183. * Value: 0x4
  3184. * - SYNC_COUNT
  3185. * Bits 15:8
  3186. * Purpose: specifies what sync value the HTT FW will wait for from
  3187. * an out-of-band specification to resume its operation
  3188. * Value: in-band sync counter value to compare against the out-of-band
  3189. * counter spec.
  3190. * The HTT target FW will suspend its host->target message processing
  3191. * as long as
  3192. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3193. */
  3194. #define HTT_H2T_SYNC_MSG_SZ 4
  3195. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3196. #define HTT_H2T_SYNC_COUNT_S 8
  3197. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3198. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3199. HTT_H2T_SYNC_COUNT_S)
  3200. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3201. do { \
  3202. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3203. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3204. } while (0)
  3205. /**
  3206. * @brief HTT aggregation configuration
  3207. */
  3208. #define HTT_AGGR_CFG_MSG_SZ 4
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3211. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3212. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3213. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3214. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3215. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3216. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3217. do { \
  3218. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3219. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3220. } while (0)
  3221. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3222. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3223. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3224. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3225. do { \
  3226. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3227. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3228. } while (0)
  3229. /**
  3230. * @brief host -> target HTT configure max amsdu info per vdev
  3231. *
  3232. * @details
  3233. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3234. *
  3235. * |31 21|20 16|15 8|7 0|
  3236. * |-----------------------------------------------------------|
  3237. * | reserved | vdev id | max amsdu | msg type |
  3238. * |-----------------------------------------------------------|
  3239. * Header fields:
  3240. * - MSG_TYPE
  3241. * Bits 7:0
  3242. * Purpose: identifies this as a aggr cfg ex message
  3243. * Value: 0xa
  3244. * - MAX_NUM_AMSDU_SUBFRM
  3245. * Bits 15:8
  3246. * Purpose: max MSDUs per A-MSDU
  3247. * - VDEV_ID
  3248. * Bits 20:16
  3249. * Purpose: ID of the vdev to which this limit is applied
  3250. */
  3251. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3252. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3253. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3254. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3255. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3256. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3257. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3258. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3259. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3260. do { \
  3261. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3262. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3263. } while (0)
  3264. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3265. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3266. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3267. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3268. do { \
  3269. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3270. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3271. } while (0)
  3272. /**
  3273. * @brief HTT WDI_IPA Config Message
  3274. *
  3275. * @details
  3276. * The HTT WDI_IPA config message is created/sent by host at driver
  3277. * init time. It contains information about data structures used on
  3278. * WDI_IPA TX and RX path.
  3279. * TX CE ring is used for pushing packet metadata from IPA uC
  3280. * to WLAN FW
  3281. * TX Completion ring is used for generating TX completions from
  3282. * WLAN FW to IPA uC
  3283. * RX Indication ring is used for indicating RX packets from FW
  3284. * to IPA uC
  3285. * RX Ring2 is used as either completion ring or as second
  3286. * indication ring. when Ring2 is used as completion ring, IPA uC
  3287. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3288. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3289. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3290. * indicated in RX Indication ring. Please see WDI_IPA specification
  3291. * for more details.
  3292. * |31 24|23 16|15 8|7 0|
  3293. * |----------------+----------------+----------------+----------------|
  3294. * | tx pkt pool size | Rsvd | msg_type |
  3295. * |-------------------------------------------------------------------|
  3296. * | tx comp ring base (bits 31:0) |
  3297. #if HTT_PADDR64
  3298. * | tx comp ring base (bits 63:32) |
  3299. #endif
  3300. * |-------------------------------------------------------------------|
  3301. * | tx comp ring size |
  3302. * |-------------------------------------------------------------------|
  3303. * | tx comp WR_IDX physical address (bits 31:0) |
  3304. #if HTT_PADDR64
  3305. * | tx comp WR_IDX physical address (bits 63:32) |
  3306. #endif
  3307. * |-------------------------------------------------------------------|
  3308. * | tx CE WR_IDX physical address (bits 31:0) |
  3309. #if HTT_PADDR64
  3310. * | tx CE WR_IDX physical address (bits 63:32) |
  3311. #endif
  3312. * |-------------------------------------------------------------------|
  3313. * | rx indication ring base (bits 31:0) |
  3314. #if HTT_PADDR64
  3315. * | rx indication ring base (bits 63:32) |
  3316. #endif
  3317. * |-------------------------------------------------------------------|
  3318. * | rx indication ring size |
  3319. * |-------------------------------------------------------------------|
  3320. * | rx ind RD_IDX physical address (bits 31:0) |
  3321. #if HTT_PADDR64
  3322. * | rx ind RD_IDX physical address (bits 63:32) |
  3323. #endif
  3324. * |-------------------------------------------------------------------|
  3325. * | rx ind WR_IDX physical address (bits 31:0) |
  3326. #if HTT_PADDR64
  3327. * | rx ind WR_IDX physical address (bits 63:32) |
  3328. #endif
  3329. * |-------------------------------------------------------------------|
  3330. * |-------------------------------------------------------------------|
  3331. * | rx ring2 base (bits 31:0) |
  3332. #if HTT_PADDR64
  3333. * | rx ring2 base (bits 63:32) |
  3334. #endif
  3335. * |-------------------------------------------------------------------|
  3336. * | rx ring2 size |
  3337. * |-------------------------------------------------------------------|
  3338. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3339. #if HTT_PADDR64
  3340. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3341. #endif
  3342. * |-------------------------------------------------------------------|
  3343. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3344. #if HTT_PADDR64
  3345. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3346. #endif
  3347. * |-------------------------------------------------------------------|
  3348. *
  3349. * Header fields:
  3350. * Header fields:
  3351. * - MSG_TYPE
  3352. * Bits 7:0
  3353. * Purpose: Identifies this as WDI_IPA config message
  3354. * value: = 0x8
  3355. * - TX_PKT_POOL_SIZE
  3356. * Bits 15:0
  3357. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3358. * WDI_IPA TX path
  3359. * For systems using 32-bit format for bus addresses:
  3360. * - TX_COMP_RING_BASE_ADDR
  3361. * Bits 31:0
  3362. * Purpose: TX Completion Ring base address in DDR
  3363. * - TX_COMP_RING_SIZE
  3364. * Bits 31:0
  3365. * Purpose: TX Completion Ring size (must be power of 2)
  3366. * - TX_COMP_WR_IDX_ADDR
  3367. * Bits 31:0
  3368. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3369. * updates the Write Index for WDI_IPA TX completion ring
  3370. * - TX_CE_WR_IDX_ADDR
  3371. * Bits 31:0
  3372. * Purpose: DDR address where IPA uC
  3373. * updates the WR Index for TX CE ring
  3374. * (needed for fusion platforms)
  3375. * - RX_IND_RING_BASE_ADDR
  3376. * Bits 31:0
  3377. * Purpose: RX Indication Ring base address in DDR
  3378. * - RX_IND_RING_SIZE
  3379. * Bits 31:0
  3380. * Purpose: RX Indication Ring size
  3381. * - RX_IND_RD_IDX_ADDR
  3382. * Bits 31:0
  3383. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3384. * RX indication ring
  3385. * - RX_IND_WR_IDX_ADDR
  3386. * Bits 31:0
  3387. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3388. * updates the Write Index for WDI_IPA RX indication ring
  3389. * - RX_RING2_BASE_ADDR
  3390. * Bits 31:0
  3391. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3392. * - RX_RING2_SIZE
  3393. * Bits 31:0
  3394. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3395. * - RX_RING2_RD_IDX_ADDR
  3396. * Bits 31:0
  3397. * Purpose: If Second RX ring is Indication ring, DDR address where
  3398. * IPA uC updates the Read Index for Ring2.
  3399. * If Second RX ring is completion ring, this is NOT used
  3400. * - RX_RING2_WR_IDX_ADDR
  3401. * Bits 31:0
  3402. * Purpose: If Second RX ring is Indication ring, DDR address where
  3403. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3404. * If second RX ring is completion ring, DDR address where
  3405. * IPA uC updates the Write Index for Ring 2.
  3406. * For systems using 64-bit format for bus addresses:
  3407. * - TX_COMP_RING_BASE_ADDR_LO
  3408. * Bits 31:0
  3409. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3410. * - TX_COMP_RING_BASE_ADDR_HI
  3411. * Bits 31:0
  3412. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3413. * - TX_COMP_RING_SIZE
  3414. * Bits 31:0
  3415. * Purpose: TX Completion Ring size (must be power of 2)
  3416. * - TX_COMP_WR_IDX_ADDR_LO
  3417. * Bits 31:0
  3418. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3419. * Lower 4 bytes of DDR address where WIFI FW
  3420. * updates the Write Index for WDI_IPA TX completion ring
  3421. * - TX_COMP_WR_IDX_ADDR_HI
  3422. * Bits 31:0
  3423. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3424. * Higher 4 bytes of DDR address where WIFI FW
  3425. * updates the Write Index for WDI_IPA TX completion ring
  3426. * - TX_CE_WR_IDX_ADDR_LO
  3427. * Bits 31:0
  3428. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3429. * updates the WR Index for TX CE ring
  3430. * (needed for fusion platforms)
  3431. * - TX_CE_WR_IDX_ADDR_HI
  3432. * Bits 31:0
  3433. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3434. * updates the WR Index for TX CE ring
  3435. * (needed for fusion platforms)
  3436. * - RX_IND_RING_BASE_ADDR_LO
  3437. * Bits 31:0
  3438. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3439. * - RX_IND_RING_BASE_ADDR_HI
  3440. * Bits 31:0
  3441. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3442. * - RX_IND_RING_SIZE
  3443. * Bits 31:0
  3444. * Purpose: RX Indication Ring size
  3445. * - RX_IND_RD_IDX_ADDR_LO
  3446. * Bits 31:0
  3447. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3448. * for WDI_IPA RX indication ring
  3449. * - RX_IND_RD_IDX_ADDR_HI
  3450. * Bits 31:0
  3451. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3452. * for WDI_IPA RX indication ring
  3453. * - RX_IND_WR_IDX_ADDR_LO
  3454. * Bits 31:0
  3455. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3456. * Lower 4 bytes of DDR address where WIFI FW
  3457. * updates the Write Index for WDI_IPA RX indication ring
  3458. * - RX_IND_WR_IDX_ADDR_HI
  3459. * Bits 31:0
  3460. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3461. * Higher 4 bytes of DDR address where WIFI FW
  3462. * updates the Write Index for WDI_IPA RX indication ring
  3463. * - RX_RING2_BASE_ADDR_LO
  3464. * Bits 31:0
  3465. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3466. * - RX_RING2_BASE_ADDR_HI
  3467. * Bits 31:0
  3468. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3469. * - RX_RING2_SIZE
  3470. * Bits 31:0
  3471. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3472. * - RX_RING2_RD_IDX_ADDR_LO
  3473. * Bits 31:0
  3474. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3475. * DDR address where IPA uC updates the Read Index for Ring2.
  3476. * If Second RX ring is completion ring, this is NOT used
  3477. * - RX_RING2_RD_IDX_ADDR_HI
  3478. * Bits 31:0
  3479. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3480. * DDR address where IPA uC updates the Read Index for Ring2.
  3481. * If Second RX ring is completion ring, this is NOT used
  3482. * - RX_RING2_WR_IDX_ADDR_LO
  3483. * Bits 31:0
  3484. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3485. * DDR address where WIFI FW updates the Write Index
  3486. * for WDI_IPA RX ring2
  3487. * If second RX ring is completion ring, lower 4 bytes of
  3488. * DDR address where IPA uC updates the Write Index for Ring 2.
  3489. * - RX_RING2_WR_IDX_ADDR_HI
  3490. * Bits 31:0
  3491. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3492. * DDR address where WIFI FW updates the Write Index
  3493. * for WDI_IPA RX ring2
  3494. * If second RX ring is completion ring, higher 4 bytes of
  3495. * DDR address where IPA uC updates the Write Index for Ring 2.
  3496. */
  3497. #if HTT_PADDR64
  3498. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3499. #else
  3500. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3501. #endif
  3502. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3503. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3516. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3522. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3562. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3563. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3564. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3565. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3566. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3567. do { \
  3568. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3569. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3570. } while (0)
  3571. /* for systems using 32-bit format for bus addr */
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3573. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3574. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3577. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3578. } while (0)
  3579. /* for systems using 64-bit format for bus addr */
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3582. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3586. } while (0)
  3587. /* for systems using 64-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3590. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3594. } while (0)
  3595. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3596. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3597. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3598. do { \
  3599. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3600. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3601. } while (0)
  3602. /* for systems using 32-bit format for bus addr */
  3603. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3604. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3605. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3606. do { \
  3607. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3608. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3609. } while (0)
  3610. /* for systems using 64-bit format for bus addr */
  3611. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3612. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3613. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3614. do { \
  3615. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3616. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3617. } while (0)
  3618. /* for systems using 64-bit format for bus addr */
  3619. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3620. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3621. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3622. do { \
  3623. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3624. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3625. } while (0)
  3626. /* for systems using 32-bit format for bus addr */
  3627. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3628. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3629. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3630. do { \
  3631. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3632. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3633. } while (0)
  3634. /* for systems using 64-bit format for bus addr */
  3635. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3636. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3637. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3638. do { \
  3639. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3640. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3641. } while (0)
  3642. /* for systems using 64-bit format for bus addr */
  3643. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3644. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3645. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3646. do { \
  3647. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3648. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3649. } while (0)
  3650. /* for systems using 32-bit format for bus addr */
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3652. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3653. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3656. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3657. } while (0)
  3658. /* for systems using 64-bit format for bus addr */
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3660. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3661. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3665. } while (0)
  3666. /* for systems using 64-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3669. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3673. } while (0)
  3674. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3675. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3676. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3679. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3680. } while (0)
  3681. /* for systems using 32-bit format for bus addr */
  3682. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3683. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3684. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3685. do { \
  3686. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3687. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3688. } while (0)
  3689. /* for systems using 64-bit format for bus addr */
  3690. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3691. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3692. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3693. do { \
  3694. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3695. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3696. } while (0)
  3697. /* for systems using 64-bit format for bus addr */
  3698. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3699. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3700. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3701. do { \
  3702. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3703. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3704. } while (0)
  3705. /* for systems using 32-bit format for bus addr */
  3706. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3707. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3708. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3709. do { \
  3710. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3711. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3712. } while (0)
  3713. /* for systems using 64-bit format for bus addr */
  3714. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3715. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3716. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3717. do { \
  3718. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3719. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3720. } while (0)
  3721. /* for systems using 64-bit format for bus addr */
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3723. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3724. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3725. do { \
  3726. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3727. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3728. } while (0)
  3729. /* for systems using 32-bit format for bus addr */
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3731. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3733. do { \
  3734. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3735. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3736. } while (0)
  3737. /* for systems using 64-bit format for bus addr */
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3739. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3741. do { \
  3742. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3743. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3744. } while (0)
  3745. /* for systems using 64-bit format for bus addr */
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3747. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3751. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3752. } while (0)
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3754. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3756. do { \
  3757. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3758. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3759. } while (0)
  3760. /* for systems using 32-bit format for bus addr */
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3762. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3763. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3764. do { \
  3765. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3766. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3767. } while (0)
  3768. /* for systems using 64-bit format for bus addr */
  3769. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3770. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3771. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3772. do { \
  3773. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3774. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3775. } while (0)
  3776. /* for systems using 64-bit format for bus addr */
  3777. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3778. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3779. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3780. do { \
  3781. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3782. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3783. } while (0)
  3784. /* for systems using 32-bit format for bus addr */
  3785. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3786. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3787. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3788. do { \
  3789. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3790. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3791. } while (0)
  3792. /* for systems using 64-bit format for bus addr */
  3793. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3794. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3795. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3796. do { \
  3797. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3798. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3799. } while (0)
  3800. /* for systems using 64-bit format for bus addr */
  3801. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3802. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3803. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3804. do { \
  3805. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3806. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3807. } while (0)
  3808. /*
  3809. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3810. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3811. * addresses are stored in a XXX-bit field.
  3812. * This macro is used to define both htt_wdi_ipa_config32_t and
  3813. * htt_wdi_ipa_config64_t structs.
  3814. */
  3815. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3816. _paddr__tx_comp_ring_base_addr_, \
  3817. _paddr__tx_comp_wr_idx_addr_, \
  3818. _paddr__tx_ce_wr_idx_addr_, \
  3819. _paddr__rx_ind_ring_base_addr_, \
  3820. _paddr__rx_ind_rd_idx_addr_, \
  3821. _paddr__rx_ind_wr_idx_addr_, \
  3822. _paddr__rx_ring2_base_addr_,\
  3823. _paddr__rx_ring2_rd_idx_addr_,\
  3824. _paddr__rx_ring2_wr_idx_addr_) \
  3825. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3826. { \
  3827. /* DWORD 0: flags and meta-data */ \
  3828. A_UINT32 \
  3829. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3830. reserved: 8, \
  3831. tx_pkt_pool_size: 16;\
  3832. /* DWORD 1 */\
  3833. _paddr__tx_comp_ring_base_addr_;\
  3834. /* DWORD 2 (or 3)*/\
  3835. A_UINT32 tx_comp_ring_size;\
  3836. /* DWORD 3 (or 4)*/\
  3837. _paddr__tx_comp_wr_idx_addr_;\
  3838. /* DWORD 4 (or 6)*/\
  3839. _paddr__tx_ce_wr_idx_addr_;\
  3840. /* DWORD 5 (or 8)*/\
  3841. _paddr__rx_ind_ring_base_addr_;\
  3842. /* DWORD 6 (or 10)*/\
  3843. A_UINT32 rx_ind_ring_size;\
  3844. /* DWORD 7 (or 11)*/\
  3845. _paddr__rx_ind_rd_idx_addr_;\
  3846. /* DWORD 8 (or 13)*/\
  3847. _paddr__rx_ind_wr_idx_addr_;\
  3848. /* DWORD 9 (or 15)*/\
  3849. _paddr__rx_ring2_base_addr_;\
  3850. /* DWORD 10 (or 17) */\
  3851. A_UINT32 rx_ring2_size;\
  3852. /* DWORD 11 (or 18) */\
  3853. _paddr__rx_ring2_rd_idx_addr_;\
  3854. /* DWORD 12 (or 20) */\
  3855. _paddr__rx_ring2_wr_idx_addr_;\
  3856. } POSTPACK
  3857. /* define a htt_wdi_ipa_config32_t type */
  3858. 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));
  3859. /* define a htt_wdi_ipa_config64_t type */
  3860. 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));
  3861. #if HTT_PADDR64
  3862. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3863. #else
  3864. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3865. #endif
  3866. enum htt_wdi_ipa_op_code {
  3867. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3868. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3869. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3870. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3871. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3872. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3873. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3874. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3875. /* keep this last */
  3876. HTT_WDI_IPA_OPCODE_MAX
  3877. };
  3878. /**
  3879. * @brief HTT WDI_IPA Operation Request Message
  3880. *
  3881. * @details
  3882. * HTT WDI_IPA Operation Request message is sent by host
  3883. * to either suspend or resume WDI_IPA TX or RX path.
  3884. * |31 24|23 16|15 8|7 0|
  3885. * |----------------+----------------+----------------+----------------|
  3886. * | op_code | Rsvd | msg_type |
  3887. * |-------------------------------------------------------------------|
  3888. *
  3889. * Header fields:
  3890. * - MSG_TYPE
  3891. * Bits 7:0
  3892. * Purpose: Identifies this as WDI_IPA Operation Request message
  3893. * value: = 0x9
  3894. * - OP_CODE
  3895. * Bits 31:16
  3896. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3897. * value: = enum htt_wdi_ipa_op_code
  3898. */
  3899. PREPACK struct htt_wdi_ipa_op_request_t
  3900. {
  3901. /* DWORD 0: flags and meta-data */
  3902. A_UINT32
  3903. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3904. reserved: 8,
  3905. op_code: 16;
  3906. } POSTPACK;
  3907. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3908. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3909. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3910. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3911. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3912. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3915. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3916. } while (0)
  3917. /*
  3918. * @brief host -> target HTT_SRING_SETUP message
  3919. *
  3920. * @details
  3921. * After target is booted up, Host can send SRING setup message for
  3922. * each host facing LMAC SRING. Target setups up HW registers based
  3923. * on setup message and confirms back to Host if response_required is set.
  3924. * Host should wait for confirmation message before sending new SRING
  3925. * setup message
  3926. *
  3927. * The message would appear as follows:
  3928. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3929. * |--------------- +-----------------+-----------------+-----------------|
  3930. * | ring_type | ring_id | pdev_id | msg_type |
  3931. * |----------------------------------------------------------------------|
  3932. * | ring_base_addr_lo |
  3933. * |----------------------------------------------------------------------|
  3934. * | ring_base_addr_hi |
  3935. * |----------------------------------------------------------------------|
  3936. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3937. * |----------------------------------------------------------------------|
  3938. * | ring_head_offset32_remote_addr_lo |
  3939. * |----------------------------------------------------------------------|
  3940. * | ring_head_offset32_remote_addr_hi |
  3941. * |----------------------------------------------------------------------|
  3942. * | ring_tail_offset32_remote_addr_lo |
  3943. * |----------------------------------------------------------------------|
  3944. * | ring_tail_offset32_remote_addr_hi |
  3945. * |----------------------------------------------------------------------|
  3946. * | ring_msi_addr_lo |
  3947. * |----------------------------------------------------------------------|
  3948. * | ring_msi_addr_hi |
  3949. * |----------------------------------------------------------------------|
  3950. * | ring_msi_data |
  3951. * |----------------------------------------------------------------------|
  3952. * | intr_timer_th |IM| intr_batch_counter_th |
  3953. * |----------------------------------------------------------------------|
  3954. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3955. * |----------------------------------------------------------------------|
  3956. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3957. * |----------------------------------------------------------------------|
  3958. * Where
  3959. * IM = sw_intr_mode
  3960. * RR = response_required
  3961. * PTCF = prefetch_timer_cfg
  3962. * IP = IPA drop flag
  3963. *
  3964. * The message is interpreted as follows:
  3965. * dword0 - b'0:7 - msg_type: This will be set to
  3966. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3967. * b'8:15 - pdev_id:
  3968. * 0 (for rings at SOC/UMAC level),
  3969. * 1/2/3 mac id (for rings at LMAC level)
  3970. * b'16:23 - ring_id: identify which ring is to setup,
  3971. * more details can be got from enum htt_srng_ring_id
  3972. * b'24:31 - ring_type: identify type of host rings,
  3973. * more details can be got from enum htt_srng_ring_type
  3974. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3975. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3976. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3977. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3978. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3979. * SW_TO_HW_RING.
  3980. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3981. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3982. * Lower 32 bits of memory address of the remote variable
  3983. * storing the 4-byte word offset that identifies the head
  3984. * element within the ring.
  3985. * (The head offset variable has type A_UINT32.)
  3986. * Valid for HW_TO_SW and SW_TO_SW rings.
  3987. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3988. * Upper 32 bits of memory address of the remote variable
  3989. * storing the 4-byte word offset that identifies the head
  3990. * element within the ring.
  3991. * (The head offset variable has type A_UINT32.)
  3992. * Valid for HW_TO_SW and SW_TO_SW rings.
  3993. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3994. * Lower 32 bits of memory address of the remote variable
  3995. * storing the 4-byte word offset that identifies the tail
  3996. * element within the ring.
  3997. * (The tail offset variable has type A_UINT32.)
  3998. * Valid for HW_TO_SW and SW_TO_SW rings.
  3999. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4000. * Upper 32 bits of memory address of the remote variable
  4001. * storing the 4-byte word offset that identifies the tail
  4002. * element within the ring.
  4003. * (The tail offset variable has type A_UINT32.)
  4004. * Valid for HW_TO_SW and SW_TO_SW rings.
  4005. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4006. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4007. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4008. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4009. * dword10 - b'0:31 - ring_msi_data: MSI data
  4010. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4011. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4012. * dword11 - b'0:14 - intr_batch_counter_th:
  4013. * batch counter threshold is in units of 4-byte words.
  4014. * HW internally maintains and increments batch count.
  4015. * (see SRING spec for detail description).
  4016. * When batch count reaches threshold value, an interrupt
  4017. * is generated by HW.
  4018. * b'15 - sw_intr_mode:
  4019. * This configuration shall be static.
  4020. * Only programmed at power up.
  4021. * 0: generate pulse style sw interrupts
  4022. * 1: generate level style sw interrupts
  4023. * b'16:31 - intr_timer_th:
  4024. * The timer init value when timer is idle or is
  4025. * initialized to start downcounting.
  4026. * In 8us units (to cover a range of 0 to 524 ms)
  4027. * dword12 - b'0:15 - intr_low_threshold:
  4028. * Used only by Consumer ring to generate ring_sw_int_p.
  4029. * Ring entries low threshold water mark, that is used
  4030. * in combination with the interrupt timer as well as
  4031. * the the clearing of the level interrupt.
  4032. * b'16:18 - prefetch_timer_cfg:
  4033. * Used only by Consumer ring to set timer mode to
  4034. * support Application prefetch handling.
  4035. * The external tail offset/pointer will be updated
  4036. * at following intervals:
  4037. * 3'b000: (Prefetch feature disabled; used only for debug)
  4038. * 3'b001: 1 usec
  4039. * 3'b010: 4 usec
  4040. * 3'b011: 8 usec (default)
  4041. * 3'b100: 16 usec
  4042. * Others: Reserverd
  4043. * b'19 - response_required:
  4044. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4045. * b'20 - ipa_drop_flag:
  4046. Indicates that host will config ipa drop threshold percentage
  4047. * b'21:31 - reserved: reserved for future use
  4048. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4049. * b'8:15 - ipa drop high threshold percentage:
  4050. * b'16:31 - Reserved
  4051. */
  4052. PREPACK struct htt_sring_setup_t {
  4053. A_UINT32 msg_type: 8,
  4054. pdev_id: 8,
  4055. ring_id: 8,
  4056. ring_type: 8;
  4057. A_UINT32 ring_base_addr_lo;
  4058. A_UINT32 ring_base_addr_hi;
  4059. A_UINT32 ring_size: 16,
  4060. ring_entry_size: 8,
  4061. ring_misc_cfg_flag: 8;
  4062. A_UINT32 ring_head_offset32_remote_addr_lo;
  4063. A_UINT32 ring_head_offset32_remote_addr_hi;
  4064. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4065. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4066. A_UINT32 ring_msi_addr_lo;
  4067. A_UINT32 ring_msi_addr_hi;
  4068. A_UINT32 ring_msi_data;
  4069. A_UINT32 intr_batch_counter_th: 15,
  4070. sw_intr_mode: 1,
  4071. intr_timer_th: 16;
  4072. A_UINT32 intr_low_threshold: 16,
  4073. prefetch_timer_cfg: 3,
  4074. response_required: 1,
  4075. ipa_drop_flag: 1,
  4076. reserved1: 11;
  4077. A_UINT32 ipa_drop_low_threshold: 8,
  4078. ipa_drop_high_threshold: 8,
  4079. reserved: 16;
  4080. } POSTPACK;
  4081. enum htt_srng_ring_type {
  4082. HTT_HW_TO_SW_RING = 0,
  4083. HTT_SW_TO_HW_RING,
  4084. HTT_SW_TO_SW_RING,
  4085. /* Insert new ring types above this line */
  4086. };
  4087. enum htt_srng_ring_id {
  4088. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4089. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4090. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4091. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4092. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4093. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4094. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4095. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4096. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4097. /* Add Other SRING which can't be directly configured by host software above this line */
  4098. };
  4099. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4100. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4101. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4102. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4103. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4104. HTT_SRING_SETUP_PDEV_ID_S)
  4105. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4108. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4109. } while (0)
  4110. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4111. #define HTT_SRING_SETUP_RING_ID_S 16
  4112. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4113. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4114. HTT_SRING_SETUP_RING_ID_S)
  4115. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4118. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4119. } while (0)
  4120. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4121. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4122. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4123. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4124. HTT_SRING_SETUP_RING_TYPE_S)
  4125. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4128. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4129. } while (0)
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4131. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4132. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4133. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4134. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4135. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4138. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4139. } while (0)
  4140. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4141. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4142. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4143. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4144. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4145. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4148. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4149. } while (0)
  4150. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4151. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4152. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4153. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4154. HTT_SRING_SETUP_RING_SIZE_S)
  4155. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4156. do { \
  4157. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4158. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4159. } while (0)
  4160. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4161. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4162. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4163. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4164. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4165. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4168. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4169. } while (0)
  4170. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4171. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4172. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4173. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4174. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4175. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4178. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4179. } while (0)
  4180. /* This control bit is applicable to only Producer, which updates Ring ID field
  4181. * of each descriptor before pushing into the ring.
  4182. * 0: updates ring_id(default)
  4183. * 1: ring_id updating disabled */
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4186. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4187. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4188. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4192. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4193. } while (0)
  4194. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4195. * of each descriptor before pushing into the ring.
  4196. * 0: updates Loopcnt(default)
  4197. * 1: Loopcnt updating disabled */
  4198. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4201. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4202. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4203. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4206. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4207. } while (0)
  4208. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4209. * into security_id port of GXI/AXI. */
  4210. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4213. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4214. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4215. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4218. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4219. } while (0)
  4220. /* During MSI write operation, SRNG drives value of this register bit into
  4221. * swap bit of GXI/AXI. */
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4225. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4226. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4227. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4230. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4231. } while (0)
  4232. /* During Pointer write operation, SRNG drives value of this register bit into
  4233. * swap bit of GXI/AXI. */
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4235. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4237. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4238. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4239. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4242. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4243. } while (0)
  4244. /* During any data or TLV write operation, SRNG drives value of this register
  4245. * bit into swap bit of GXI/AXI. */
  4246. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4247. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4248. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4249. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4250. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4251. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4254. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4255. } while (0)
  4256. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4257. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4259. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4260. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4261. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4262. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4263. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4266. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4267. } while (0)
  4268. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4269. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4270. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4271. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4272. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4273. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4276. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4277. } while (0)
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4279. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4280. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4281. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4282. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4283. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4286. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4287. } while (0)
  4288. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4289. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4290. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4291. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4292. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4293. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4296. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4297. } while (0)
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4299. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4300. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4301. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4302. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4303. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4306. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4307. } while (0)
  4308. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4309. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4310. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4311. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4312. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4313. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4316. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4317. } while (0)
  4318. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4319. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4320. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4321. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4322. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4323. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4326. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4327. } while (0)
  4328. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4329. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4330. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4331. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4332. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4333. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4336. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4337. } while (0)
  4338. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4339. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4340. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4341. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4342. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4343. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4346. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4347. } while (0)
  4348. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4349. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4350. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4351. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4352. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4353. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4356. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4357. } while (0)
  4358. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4359. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4360. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4361. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4362. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4363. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4364. do { \
  4365. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4366. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4367. } while (0)
  4368. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4369. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4370. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4371. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4372. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4373. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4376. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4377. } while (0)
  4378. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4379. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4380. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4381. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4382. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4383. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4384. do { \
  4385. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4386. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4387. } while (0)
  4388. /**
  4389. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4390. *
  4391. * @details
  4392. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4393. * configure RXDMA rings.
  4394. * The configuration is per ring based and includes both packet subtypes
  4395. * and PPDU/MPDU TLVs.
  4396. *
  4397. * The message would appear as follows:
  4398. *
  4399. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4400. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4401. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4402. * |-------------------------------------------------------------------|
  4403. * | rsvd2 | ring_buffer_size |
  4404. * |-------------------------------------------------------------------|
  4405. * | packet_type_enable_flags_0 |
  4406. * |-------------------------------------------------------------------|
  4407. * | packet_type_enable_flags_1 |
  4408. * |-------------------------------------------------------------------|
  4409. * | packet_type_enable_flags_2 |
  4410. * |-------------------------------------------------------------------|
  4411. * | packet_type_enable_flags_3 |
  4412. * |-------------------------------------------------------------------|
  4413. * | tlv_filter_in_flags |
  4414. * |-------------------------------------------------------------------|
  4415. * | rx_header_offset | rx_packet_offset |
  4416. * |-------------------------------------------------------------------|
  4417. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4418. * |-------------------------------------------------------------------|
  4419. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4420. * |-------------------------------------------------------------------|
  4421. * | rsvd3 | rx_attention_offset |
  4422. * |-------------------------------------------------------------------|
  4423. * | rsvd4 | mo| fp| rx_drop_threshold |
  4424. * | |ndp|ndp| |
  4425. * |-------------------------------------------------------------------|
  4426. * Where:
  4427. * PS = pkt_swap
  4428. * SS = status_swap
  4429. * OV = rx_offsets_valid
  4430. * DT = drop_thresh_valid
  4431. * The message is interpreted as follows:
  4432. * dword0 - b'0:7 - msg_type: This will be set to
  4433. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4434. * b'8:15 - pdev_id:
  4435. * 0 (for rings at SOC/UMAC level),
  4436. * 1/2/3 mac id (for rings at LMAC level)
  4437. * b'16:23 - ring_id : Identify the ring to configure.
  4438. * More details can be got from enum htt_srng_ring_id
  4439. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4440. * BUF_RING_CFG_0 defs within HW .h files,
  4441. * e.g. wmac_top_reg_seq_hwioreg.h
  4442. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4443. * BUF_RING_CFG_0 defs within HW .h files,
  4444. * e.g. wmac_top_reg_seq_hwioreg.h
  4445. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4446. * configuration fields are valid
  4447. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4448. * rx_drop_threshold field is valid
  4449. * b'28:31 - rsvd1: reserved for future use
  4450. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4451. * in byte units.
  4452. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4453. * - b'16:31 - rsvd2: Reserved for future use
  4454. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4455. * Enable MGMT packet from 0b0000 to 0b1001
  4456. * bits from low to high: FP, MD, MO - 3 bits
  4457. * FP: Filter_Pass
  4458. * MD: Monitor_Direct
  4459. * MO: Monitor_Other
  4460. * 10 mgmt subtypes * 3 bits -> 30 bits
  4461. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4462. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4463. * Enable MGMT packet from 0b1010 to 0b1111
  4464. * bits from low to high: FP, MD, MO - 3 bits
  4465. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4466. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4467. * Enable CTRL packet from 0b0000 to 0b1001
  4468. * bits from low to high: FP, MD, MO - 3 bits
  4469. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4470. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4471. * Enable CTRL packet from 0b1010 to 0b1111,
  4472. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4473. * bits from low to high: FP, MD, MO - 3 bits
  4474. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4475. * dword6 - b'0:31 - tlv_filter_in_flags:
  4476. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4477. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4478. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4479. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4480. * A value of 0 will be considered as ignore this config.
  4481. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4482. * e.g. wmac_top_reg_seq_hwioreg.h
  4483. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4484. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4485. * A value of 0 will be considered as ignore this config.
  4486. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4487. * e.g. wmac_top_reg_seq_hwioreg.h
  4488. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4489. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4490. * A value of 0 will be considered as ignore this config.
  4491. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4492. * e.g. wmac_top_reg_seq_hwioreg.h
  4493. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4494. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4495. * A value of 0 will be considered as ignore this config.
  4496. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4497. * e.g. wmac_top_reg_seq_hwioreg.h
  4498. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4499. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4500. * A value of 0 will be considered as ignore this config.
  4501. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4502. * e.g. wmac_top_reg_seq_hwioreg.h
  4503. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4504. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4505. * A value of 0 will be considered as ignore this config.
  4506. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4507. * e.g. wmac_top_reg_seq_hwioreg.h
  4508. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4509. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4510. * A value of 0 will be considered as ignore this config.
  4511. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4512. * e.g. wmac_top_reg_seq_hwioreg.h
  4513. * - b'16:31 - rsvd3 for future use
  4514. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4515. * to source rings. Consumer drops packets if the available
  4516. * words in the ring falls below the configured threshold
  4517. * value.
  4518. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4519. * by host. 1 -> subscribed
  4520. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4521. * by host. 1 -> subscribed
  4522. */
  4523. PREPACK struct htt_rx_ring_selection_cfg_t {
  4524. A_UINT32 msg_type: 8,
  4525. pdev_id: 8,
  4526. ring_id: 8,
  4527. status_swap: 1,
  4528. pkt_swap: 1,
  4529. rx_offsets_valid: 1,
  4530. drop_thresh_valid: 1,
  4531. rsvd1: 4;
  4532. A_UINT32 ring_buffer_size: 16,
  4533. rsvd2: 16;
  4534. A_UINT32 packet_type_enable_flags_0;
  4535. A_UINT32 packet_type_enable_flags_1;
  4536. A_UINT32 packet_type_enable_flags_2;
  4537. A_UINT32 packet_type_enable_flags_3;
  4538. A_UINT32 tlv_filter_in_flags;
  4539. A_UINT32 rx_packet_offset: 16,
  4540. rx_header_offset: 16;
  4541. A_UINT32 rx_mpdu_end_offset: 16,
  4542. rx_mpdu_start_offset: 16;
  4543. A_UINT32 rx_msdu_end_offset: 16,
  4544. rx_msdu_start_offset: 16;
  4545. A_UINT32 rx_attn_offset: 16,
  4546. rsvd3: 16;
  4547. A_UINT32 rx_drop_threshold: 10,
  4548. fp_ndp: 1,
  4549. mo_ndp: 1,
  4550. rsvd4: 20;
  4551. } POSTPACK;
  4552. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4553. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4554. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4555. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4556. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4557. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4558. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4559. do { \
  4560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4562. } while (0)
  4563. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4564. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4565. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4566. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4567. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4568. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4569. do { \
  4570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4572. } while (0)
  4573. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4574. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4575. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4576. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4577. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4578. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4579. do { \
  4580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4582. } while (0)
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4586. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4587. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4589. do { \
  4590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4592. } while (0)
  4593. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4594. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4595. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4596. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4597. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4599. do { \
  4600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4602. } while (0)
  4603. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4604. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4605. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4606. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4607. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4608. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4609. do { \
  4610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4612. } while (0)
  4613. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4614. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4615. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4616. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4617. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4618. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4619. do { \
  4620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4622. } while (0)
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4626. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4627. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4629. do { \
  4630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4632. } while (0)
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4636. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4637. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4639. do { \
  4640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4642. } while (0)
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4646. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4647. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4649. do { \
  4650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4652. } while (0)
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4656. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4657. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4659. do { \
  4660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4662. } while (0)
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4665. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4666. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4667. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4669. do { \
  4670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4672. } while (0)
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4676. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4677. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4679. do { \
  4680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4682. } while (0)
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4686. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4687. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4689. do { \
  4690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4692. } while (0)
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4696. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4697. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4699. do { \
  4700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4702. } while (0)
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4706. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4707. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4712. } while (0)
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4716. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4717. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4722. } while (0)
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4724. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4725. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4726. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4727. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4728. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4732. } while (0)
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4734. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4735. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4736. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4737. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4738. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4739. do { \
  4740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4742. } while (0)
  4743. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4744. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4745. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4746. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4747. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4748. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4749. do { \
  4750. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4751. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4752. } while (0)
  4753. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4754. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4755. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4756. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4757. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4758. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4761. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4762. } while (0)
  4763. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4764. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4765. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4766. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4767. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4768. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4771. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4772. } while (0)
  4773. /*
  4774. * Subtype based MGMT frames enable bits.
  4775. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4776. */
  4777. /* association request */
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4784. /* association response */
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4791. /* Reassociation request */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4798. /* Reassociation response */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4805. /* Probe request */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4812. /* Probe response */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4819. /* Timing Advertisement */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4826. /* Reserved */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4833. /* Beacon */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4840. /* ATIM */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4847. /* Disassociation */
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4854. /* Authentication */
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4861. /* Deauthentication */
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4868. /* Action */
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4875. /* Action No Ack */
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4882. /* Reserved */
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4889. /*
  4890. * Subtype based CTRL frames enable bits.
  4891. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4892. */
  4893. /* Reserved */
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4900. /* Reserved */
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4907. /* Reserved */
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4914. /* Reserved */
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4921. /* Reserved */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4928. /* Reserved */
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4935. /* Reserved */
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4942. /* Control Wrapper */
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4949. /* Block Ack Request */
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4956. /* Block Ack*/
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4963. /* PS-POLL */
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4970. /* RTS */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4977. /* CTS */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4984. /* ACK */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4991. /* CF-END */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4998. /* CF-END + CF-ACK */
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5005. /* Multicast data */
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5012. /* Unicast data */
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5019. /* NULL data */
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5027. do { \
  5028. HTT_CHECK_SET_VAL(httsym, value); \
  5029. (word) |= (value) << httsym##_S; \
  5030. } while (0)
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5032. (((word) & httsym##_M) >> httsym##_S)
  5033. #define htt_rx_ring_pkt_enable_subtype_set( \
  5034. word, flag, mode, type, subtype, val) \
  5035. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5036. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5037. #define htt_rx_ring_pkt_enable_subtype_get( \
  5038. word, flag, mode, type, subtype) \
  5039. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5040. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5041. /* Definition to filter in TLVs */
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5068. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5069. do { \
  5070. HTT_CHECK_SET_VAL(httsym, enable); \
  5071. (word) |= (enable) << httsym##_S; \
  5072. } while (0)
  5073. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5074. (((word) & httsym##_M) >> httsym##_S)
  5075. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5076. HTT_RX_RING_TLV_ENABLE_SET( \
  5077. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5078. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5079. HTT_RX_RING_TLV_ENABLE_GET( \
  5080. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5081. /**
  5082. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5083. * host --> target Receive Flow Steering configuration message definition.
  5084. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5085. * The reason for this is we want RFS to be configured and ready before MAC
  5086. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5087. *
  5088. * |31 24|23 16|15 9|8|7 0|
  5089. * |----------------+----------------+----------------+----------------|
  5090. * | reserved |E| msg type |
  5091. * |-------------------------------------------------------------------|
  5092. * Where E = RFS enable flag
  5093. *
  5094. * The RFS_CONFIG message consists of a single 4-byte word.
  5095. *
  5096. * Header fields:
  5097. * - MSG_TYPE
  5098. * Bits 7:0
  5099. * Purpose: identifies this as a RFS config msg
  5100. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5101. * - RFS_CONFIG
  5102. * Bit 8
  5103. * Purpose: Tells target whether to enable (1) or disable (0)
  5104. * flow steering feature when sending rx indication messages to host
  5105. */
  5106. #define HTT_H2T_RFS_CONFIG_M 0x100
  5107. #define HTT_H2T_RFS_CONFIG_S 8
  5108. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5109. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5110. HTT_H2T_RFS_CONFIG_S)
  5111. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5112. do { \
  5113. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5114. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5115. } while (0)
  5116. #define HTT_RFS_CFG_REQ_BYTES 4
  5117. /**
  5118. * @brief host -> target FW extended statistics retrieve
  5119. *
  5120. * @details
  5121. * The following field definitions describe the format of the HTT host
  5122. * to target FW extended stats retrieve message.
  5123. * The message specifies the type of stats the host wants to retrieve.
  5124. *
  5125. * |31 24|23 16|15 8|7 0|
  5126. * |-----------------------------------------------------------|
  5127. * | reserved | stats type | pdev_mask | msg type |
  5128. * |-----------------------------------------------------------|
  5129. * | config param [0] |
  5130. * |-----------------------------------------------------------|
  5131. * | config param [1] |
  5132. * |-----------------------------------------------------------|
  5133. * | config param [2] |
  5134. * |-----------------------------------------------------------|
  5135. * | config param [3] |
  5136. * |-----------------------------------------------------------|
  5137. * | reserved |
  5138. * |-----------------------------------------------------------|
  5139. * | cookie LSBs |
  5140. * |-----------------------------------------------------------|
  5141. * | cookie MSBs |
  5142. * |-----------------------------------------------------------|
  5143. * Header fields:
  5144. * - MSG_TYPE
  5145. * Bits 7:0
  5146. * Purpose: identifies this is a extended stats upload request message
  5147. * Value: 0x10
  5148. * - PDEV_MASK
  5149. * Bits 8:15
  5150. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5151. * Value: This is a overloaded field, refer to usage and interpretation of
  5152. * PDEV in interface document.
  5153. * Bit 8 : Reserved for SOC stats
  5154. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5155. * Indicates MACID_MASK in DBS
  5156. * - STATS_TYPE
  5157. * Bits 23:16
  5158. * Purpose: identifies which FW statistics to upload
  5159. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5160. * - Reserved
  5161. * Bits 31:24
  5162. * - CONFIG_PARAM [0]
  5163. * Bits 31:0
  5164. * Purpose: give an opaque configuration value to the specified stats type
  5165. * Value: stats-type specific configuration value
  5166. * Refer to htt_stats.h for interpretation for each stats sub_type
  5167. * - CONFIG_PARAM [1]
  5168. * Bits 31:0
  5169. * Purpose: give an opaque configuration value to the specified stats type
  5170. * Value: stats-type specific configuration value
  5171. * Refer to htt_stats.h for interpretation for each stats sub_type
  5172. * - CONFIG_PARAM [2]
  5173. * Bits 31:0
  5174. * Purpose: give an opaque configuration value to the specified stats type
  5175. * Value: stats-type specific configuration value
  5176. * Refer to htt_stats.h for interpretation for each stats sub_type
  5177. * - CONFIG_PARAM [3]
  5178. * Bits 31:0
  5179. * Purpose: give an opaque configuration value to the specified stats type
  5180. * Value: stats-type specific configuration value
  5181. * Refer to htt_stats.h for interpretation for each stats sub_type
  5182. * - Reserved [31:0] for future use.
  5183. * - COOKIE_LSBS
  5184. * Bits 31:0
  5185. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5186. * message with its preceding host->target stats request message.
  5187. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5188. * - COOKIE_MSBS
  5189. * Bits 31:0
  5190. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5191. * message with its preceding host->target stats request message.
  5192. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5193. */
  5194. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5195. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5196. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5197. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5198. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5199. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5200. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5201. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5202. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5203. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5204. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5205. do { \
  5206. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5207. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5208. } while (0)
  5209. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5210. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5211. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5212. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5215. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5216. } while (0)
  5217. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5218. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5219. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5220. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5223. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5224. } while (0)
  5225. /**
  5226. * @brief host -> target FW PPDU_STATS request message
  5227. *
  5228. * @details
  5229. * The following field definitions describe the format of the HTT host
  5230. * to target FW for PPDU_STATS_CFG msg.
  5231. * The message allows the host to configure the PPDU_STATS_IND messages
  5232. * produced by the target.
  5233. *
  5234. * |31 24|23 16|15 8|7 0|
  5235. * |-----------------------------------------------------------|
  5236. * | REQ bit mask | pdev_mask | msg type |
  5237. * |-----------------------------------------------------------|
  5238. * Header fields:
  5239. * - MSG_TYPE
  5240. * Bits 7:0
  5241. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5242. * Value: 0x11
  5243. * - PDEV_MASK
  5244. * Bits 8:15
  5245. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5246. * Value: This is a overloaded field, refer to usage and interpretation of
  5247. * PDEV in interface document.
  5248. * Bit 8 : Reserved for SOC stats
  5249. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5250. * Indicates MACID_MASK in DBS
  5251. * - REQ_TLV_BIT_MASK
  5252. * Bits 16:31
  5253. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5254. * needs to be included in the target's PPDU_STATS_IND messages.
  5255. * Value: refer htt_ppdu_stats_tlv_tag_t
  5256. *
  5257. */
  5258. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5259. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5260. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5261. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5262. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5263. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5264. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5265. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5266. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5267. do { \
  5268. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5269. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5270. } while (0)
  5271. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5272. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5273. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5274. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5275. do { \
  5276. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5277. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5278. } while (0)
  5279. /**
  5280. * @brief Host-->target HTT RX FSE setup message
  5281. * @details
  5282. * Through this message, the host will provide details of the flow tables
  5283. * in host DDR along with hash keys.
  5284. * This message can be sent per SOC or per PDEV, which is differentiated
  5285. * by pdev id values.
  5286. * The host will allocate flow search table and sends table size,
  5287. * physical DMA address of flow table, and hash keys to firmware to
  5288. * program into the RXOLE FSE HW block.
  5289. *
  5290. * The following field definitions describe the format of the RX FSE setup
  5291. * message sent from the host to target
  5292. *
  5293. * Header fields:
  5294. * dword0 - b'7:0 - msg_type: This will be set to
  5295. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5296. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5297. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5298. * pdev's LMAC ring.
  5299. * b'31:16 - reserved : Reserved for future use
  5300. * dword1 - b'19:0 - number of records: This field indicates the number of
  5301. * entries in the flow table. For example: 8k number of
  5302. * records is equivalent to
  5303. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5304. * b'27:20 - max search: This field specifies the skid length to FSE
  5305. * parser HW module whenever match is not found at the
  5306. * exact index pointed by hash.
  5307. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5308. * Refer htt_ip_da_sa_prefix below for more details.
  5309. * b'31:30 - reserved: Reserved for future use
  5310. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5311. * table allocated by host in DDR
  5312. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5313. * table allocated by host in DDR
  5314. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5315. * entry hashing
  5316. *
  5317. *
  5318. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5319. * |---------------------------------------------------------------|
  5320. * | reserved | pdev_id | MSG_TYPE |
  5321. * |---------------------------------------------------------------|
  5322. * |resvd|IPDSA| max_search | Number of records |
  5323. * |---------------------------------------------------------------|
  5324. * | base address lo |
  5325. * |---------------------------------------------------------------|
  5326. * | base address high |
  5327. * |---------------------------------------------------------------|
  5328. * | toeplitz key 31_0 |
  5329. * |---------------------------------------------------------------|
  5330. * | toeplitz key 63_32 |
  5331. * |---------------------------------------------------------------|
  5332. * | toeplitz key 95_64 |
  5333. * |---------------------------------------------------------------|
  5334. * | toeplitz key 127_96 |
  5335. * |---------------------------------------------------------------|
  5336. * | toeplitz key 159_128 |
  5337. * |---------------------------------------------------------------|
  5338. * | toeplitz key 191_160 |
  5339. * |---------------------------------------------------------------|
  5340. * | toeplitz key 223_192 |
  5341. * |---------------------------------------------------------------|
  5342. * | toeplitz key 255_224 |
  5343. * |---------------------------------------------------------------|
  5344. * | toeplitz key 287_256 |
  5345. * |---------------------------------------------------------------|
  5346. * | reserved | toeplitz key 314_288(26:0 bits) |
  5347. * |---------------------------------------------------------------|
  5348. * where:
  5349. * IPDSA = ip_da_sa
  5350. */
  5351. /**
  5352. * @brief: htt_ip_da_sa_prefix
  5353. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5354. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5355. * documentation per RFC3849
  5356. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5357. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5358. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5359. */
  5360. enum htt_ip_da_sa_prefix {
  5361. HTT_RX_IPV6_20010db8,
  5362. HTT_RX_IPV4_MAPPED_IPV6,
  5363. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5364. HTT_RX_IPV6_64FF9B,
  5365. };
  5366. /**
  5367. * @brief Host-->target HTT RX FISA configure and enable
  5368. * @details
  5369. * The host will send this command down to configure and enable the FISA
  5370. * operational params.
  5371. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5372. * register.
  5373. * Should configure both the MACs.
  5374. *
  5375. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5376. *
  5377. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5378. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5379. * pdev's LMAC ring.
  5380. * b'31:16 - reserved : Reserved for future use
  5381. *
  5382. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5383. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5384. * packets. 1 flow search will be skipped
  5385. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5386. * tcp,udp packets
  5387. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5388. * calculation
  5389. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5390. * calculation
  5391. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5392. * calculation
  5393. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5394. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5395. * length
  5396. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5397. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5398. * length
  5399. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5400. * num jump
  5401. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5402. * num jump
  5403. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5404. * data type switch has happend for MPDU Sequence num jump
  5405. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5406. * for MPDU Sequence num jump
  5407. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5408. * for decrypt errors
  5409. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5410. * while aggregating a msdu
  5411. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5412. * The aggregation is done until (number of MSDUs aggregated
  5413. * < LIMIT + 1)
  5414. * b'31:18 - Reserved
  5415. *
  5416. * fisa_control_value - 32bit value FW can write to register
  5417. *
  5418. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5419. * Threshold value for FISA timeout (units are microseconds).
  5420. * When the global timestamp exceeds this threshold, FISA
  5421. * aggregation will be restarted.
  5422. * A value of 0 means timeout is disabled.
  5423. * Compare the threshold register with timestamp field in
  5424. * flow entry to generate timeout for the flow.
  5425. *
  5426. * |31 18 |17 16|15 8|7 0|
  5427. * |-------------------------------------------------------------|
  5428. * | reserved | pdev_mask | msg type |
  5429. * |-------------------------------------------------------------|
  5430. * | reserved | FISA_CTRL |
  5431. * |-------------------------------------------------------------|
  5432. * | FISA_TIMEOUT_THRESH |
  5433. * |-------------------------------------------------------------|
  5434. */
  5435. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5436. A_UINT32 msg_type:8,
  5437. pdev_id:8,
  5438. reserved0:16;
  5439. /**
  5440. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5441. * [17:0]
  5442. */
  5443. union {
  5444. /*
  5445. * fisa_control_bits structure is deprecated.
  5446. * Please use fisa_control_bits_v2 going forward.
  5447. */
  5448. struct {
  5449. A_UINT32 fisa_enable: 1,
  5450. ipsec_skip_search: 1,
  5451. nontcp_skip_search: 1,
  5452. add_ipv4_fixed_hdr_len: 1,
  5453. add_ipv6_fixed_hdr_len: 1,
  5454. add_tcp_fixed_hdr_len: 1,
  5455. add_udp_hdr_len: 1,
  5456. chksum_cum_ip_len_en: 1,
  5457. disable_tid_check: 1,
  5458. disable_ta_check: 1,
  5459. disable_qos_check: 1,
  5460. disable_raw_check: 1,
  5461. disable_decrypt_err_check: 1,
  5462. disable_msdu_drop_check: 1,
  5463. fisa_aggr_limit: 4,
  5464. reserved: 14;
  5465. } fisa_control_bits;
  5466. struct {
  5467. A_UINT32 fisa_enable: 1,
  5468. fisa_aggr_limit: 4,
  5469. reserved: 27;
  5470. } fisa_control_bits_v2;
  5471. A_UINT32 fisa_control_value;
  5472. } u_fisa_control;
  5473. /**
  5474. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5475. * timeout threshold for aggregation. Unit in usec.
  5476. * [31:0]
  5477. */
  5478. A_UINT32 fisa_timeout_threshold;
  5479. } POSTPACK;
  5480. /* DWord 0: pdev-ID */
  5481. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5482. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5483. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5484. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5485. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5486. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5489. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5490. } while (0)
  5491. /* Dword 1: fisa_control_value fisa config */
  5492. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5493. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5494. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5495. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5496. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5497. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5498. do { \
  5499. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5500. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5501. } while (0)
  5502. /* Dword 1: fisa_control_value ipsec_skip_search */
  5503. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5504. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5505. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5506. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5507. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5508. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5512. } while (0)
  5513. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5514. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5515. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5516. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5517. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5518. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5519. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5523. } while (0)
  5524. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5525. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5526. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5527. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5528. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5529. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5530. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5531. do { \
  5532. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5533. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5534. } while (0)
  5535. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5536. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5537. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5538. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5539. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5540. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5541. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5545. } while (0)
  5546. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5547. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5548. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5549. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5550. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5551. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5552. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5553. do { \
  5554. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5555. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5556. } while (0)
  5557. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5558. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5559. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5560. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5561. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5562. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5563. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5566. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5567. } while (0)
  5568. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5569. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5570. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5571. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5572. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5573. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5574. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5577. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5578. } while (0)
  5579. /* Dword 1: fisa_control_value disable_tid_check */
  5580. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5581. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5582. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5583. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5584. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5586. do { \
  5587. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5588. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5589. } while (0)
  5590. /* Dword 1: fisa_control_value disable_ta_check */
  5591. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5592. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5593. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5594. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5595. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5597. do { \
  5598. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5599. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5600. } while (0)
  5601. /* Dword 1: fisa_control_value disable_qos_check */
  5602. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5604. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5605. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5606. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5608. do { \
  5609. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5610. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5611. } while (0)
  5612. /* Dword 1: fisa_control_value disable_raw_check */
  5613. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5615. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5616. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5617. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5618. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5622. } while (0)
  5623. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5624. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5625. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5626. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5627. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5628. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5629. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5633. } while (0)
  5634. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5635. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5636. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5637. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5638. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5639. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5640. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5641. do { \
  5642. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5643. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5644. } while (0)
  5645. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5646. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5647. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5648. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5649. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5650. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5651. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5654. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5655. } while (0)
  5656. /* Dword 1: fisa_control_value fisa config */
  5657. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5658. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5659. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5660. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5661. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5662. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5665. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5666. } while (0)
  5667. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5668. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5669. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5670. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5671. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5672. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5673. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5676. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5677. } while (0)
  5678. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5679. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5680. pdev_id:8,
  5681. reserved0:16;
  5682. A_UINT32 num_records:20,
  5683. max_search:8,
  5684. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5685. reserved1:2;
  5686. A_UINT32 base_addr_lo;
  5687. A_UINT32 base_addr_hi;
  5688. A_UINT32 toeplitz31_0;
  5689. A_UINT32 toeplitz63_32;
  5690. A_UINT32 toeplitz95_64;
  5691. A_UINT32 toeplitz127_96;
  5692. A_UINT32 toeplitz159_128;
  5693. A_UINT32 toeplitz191_160;
  5694. A_UINT32 toeplitz223_192;
  5695. A_UINT32 toeplitz255_224;
  5696. A_UINT32 toeplitz287_256;
  5697. A_UINT32 toeplitz314_288:27,
  5698. reserved2:5;
  5699. } POSTPACK;
  5700. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5701. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5702. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5703. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5704. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5705. /* DWORD 0: Pdev ID */
  5706. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5707. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5708. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5709. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5710. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5711. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5714. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5715. } while (0)
  5716. /* DWORD 1:num of records */
  5717. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5718. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5719. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5720. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5721. HTT_RX_FSE_SETUP_NUM_REC_S)
  5722. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5725. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5726. } while (0)
  5727. /* DWORD 1:max_search */
  5728. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5729. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5730. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5731. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5732. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5733. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5736. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5737. } while (0)
  5738. /* DWORD 1:ip_da_sa prefix */
  5739. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5740. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5741. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5742. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5743. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5744. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5745. do { \
  5746. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5747. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5748. } while (0)
  5749. /* DWORD 2: Base Address LO */
  5750. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5751. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5752. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5753. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5754. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5755. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5756. do { \
  5757. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5758. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5759. } while (0)
  5760. /* DWORD 3: Base Address High */
  5761. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5762. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5763. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5764. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5765. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5766. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5767. do { \
  5768. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5769. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5770. } while (0)
  5771. /* DWORD 4-12: Hash Value */
  5772. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5773. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5774. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5775. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5776. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5777. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5778. do { \
  5779. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5780. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5781. } while (0)
  5782. /* DWORD 13: Hash Value 314:288 bits */
  5783. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5784. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5785. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5786. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5787. do { \
  5788. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5789. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5790. } while (0)
  5791. /**
  5792. * @brief Host-->target HTT RX FSE operation message
  5793. * @details
  5794. * The host will send this Flow Search Engine (FSE) operation message for
  5795. * every flow add/delete operation.
  5796. * The FSE operation includes FSE full cache invalidation or individual entry
  5797. * invalidation.
  5798. * This message can be sent per SOC or per PDEV which is differentiated
  5799. * by pdev id values.
  5800. *
  5801. * |31 16|15 8|7 1|0|
  5802. * |-------------------------------------------------------------|
  5803. * | reserved | pdev_id | MSG_TYPE |
  5804. * |-------------------------------------------------------------|
  5805. * | reserved | operation |I|
  5806. * |-------------------------------------------------------------|
  5807. * | ip_src_addr_31_0 |
  5808. * |-------------------------------------------------------------|
  5809. * | ip_src_addr_63_32 |
  5810. * |-------------------------------------------------------------|
  5811. * | ip_src_addr_95_64 |
  5812. * |-------------------------------------------------------------|
  5813. * | ip_src_addr_127_96 |
  5814. * |-------------------------------------------------------------|
  5815. * | ip_dst_addr_31_0 |
  5816. * |-------------------------------------------------------------|
  5817. * | ip_dst_addr_63_32 |
  5818. * |-------------------------------------------------------------|
  5819. * | ip_dst_addr_95_64 |
  5820. * |-------------------------------------------------------------|
  5821. * | ip_dst_addr_127_96 |
  5822. * |-------------------------------------------------------------|
  5823. * | l4_dst_port | l4_src_port |
  5824. * | (32-bit SPI incase of IPsec) |
  5825. * |-------------------------------------------------------------|
  5826. * | reserved | l4_proto |
  5827. * |-------------------------------------------------------------|
  5828. *
  5829. * where I is 1-bit ipsec_valid.
  5830. *
  5831. * The following field definitions describe the format of the RX FSE operation
  5832. * message sent from the host to target for every add/delete flow entry to flow
  5833. * table.
  5834. *
  5835. * Header fields:
  5836. * dword0 - b'7:0 - msg_type: This will be set to
  5837. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5838. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5839. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5840. * specified pdev's LMAC ring.
  5841. * b'31:16 - reserved : Reserved for future use
  5842. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5843. * (Internet Protocol Security).
  5844. * IPsec describes the framework for providing security at
  5845. * IP layer. IPsec is defined for both versions of IP:
  5846. * IPV4 and IPV6.
  5847. * Please refer to htt_rx_flow_proto enumeration below for
  5848. * more info.
  5849. * ipsec_valid = 1 for IPSEC packets
  5850. * ipsec_valid = 0 for IP Packets
  5851. * b'7:1 - operation: This indicates types of FSE operation.
  5852. * Refer to htt_rx_fse_operation enumeration:
  5853. * 0 - No Cache Invalidation required
  5854. * 1 - Cache invalidate only one entry given by IP
  5855. * src/dest address at DWORD[2:9]
  5856. * 2 - Complete FSE Cache Invalidation
  5857. * 3 - FSE Disable
  5858. * 4 - FSE Enable
  5859. * b'31:8 - reserved: Reserved for future use
  5860. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5861. * for per flow addition/deletion
  5862. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5863. * and the subsequent 3 A_UINT32 will be padding bytes.
  5864. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5865. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5866. * from 0 to 65535 but only 0 to 1023 are designated as
  5867. * well-known ports. Refer to [RFC1700] for more details.
  5868. * This field is valid only if
  5869. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5870. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5871. * range from 0 to 65535 but only 0 to 1023 are designated
  5872. * as well-known ports. Refer to [RFC1700] for more details.
  5873. * This field is valid only if
  5874. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5875. * - SPI (31:0): Security Parameters Index is an
  5876. * identification tag added to the header while using IPsec
  5877. * for tunneling the IP traffici.
  5878. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5879. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5880. * Assigned Internet Protocol Numbers.
  5881. * l4_proto numbers for standard protocol like UDP/TCP
  5882. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5883. * l4_proto = 17 for UDP etc.
  5884. * b'31:8 - reserved: Reserved for future use.
  5885. *
  5886. */
  5887. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5888. A_UINT32 msg_type:8,
  5889. pdev_id:8,
  5890. reserved0:16;
  5891. A_UINT32 ipsec_valid:1,
  5892. operation:7,
  5893. reserved1:24;
  5894. A_UINT32 ip_src_addr_31_0;
  5895. A_UINT32 ip_src_addr_63_32;
  5896. A_UINT32 ip_src_addr_95_64;
  5897. A_UINT32 ip_src_addr_127_96;
  5898. A_UINT32 ip_dest_addr_31_0;
  5899. A_UINT32 ip_dest_addr_63_32;
  5900. A_UINT32 ip_dest_addr_95_64;
  5901. A_UINT32 ip_dest_addr_127_96;
  5902. union {
  5903. A_UINT32 spi;
  5904. struct {
  5905. A_UINT32 l4_src_port:16,
  5906. l4_dest_port:16;
  5907. } ip;
  5908. } u;
  5909. A_UINT32 l4_proto:8,
  5910. reserved:24;
  5911. } POSTPACK;
  5912. /**
  5913. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5914. * @details
  5915. * The host will send this Full monitor mode register configuration message.
  5916. * This message can be sent per SOC or per PDEV which is differentiated
  5917. * by pdev id values.
  5918. *
  5919. * |31 16|15 11|10 8|7 3|2|1|0|
  5920. * |-------------------------------------------------------------|
  5921. * | reserved | pdev_id | MSG_TYPE |
  5922. * |-------------------------------------------------------------|
  5923. * | reserved |Release Ring |N|Z|E|
  5924. * |-------------------------------------------------------------|
  5925. *
  5926. * where E is 1-bit full monitor mode enable/disable.
  5927. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5928. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5929. *
  5930. * The following field definitions describe the format of the full monitor
  5931. * mode configuration message sent from the host to target for each pdev.
  5932. *
  5933. * Header fields:
  5934. * dword0 - b'7:0 - msg_type: This will be set to
  5935. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5936. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5937. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5938. * specified pdev's LMAC ring.
  5939. * b'31:16 - reserved : Reserved for future use.
  5940. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5941. * monitor mode rxdma register is to be enabled or disabled.
  5942. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5943. * additional descriptors at ppdu end for zero mpdus
  5944. * enabled or disabled.
  5945. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5946. * additional descriptors at ppdu end for non zero mpdus
  5947. * enabled or disabled.
  5948. * b'10:3 - release_ring: This indicates the destination ring
  5949. * selection for the descriptor at the end of PPDU
  5950. * 0 - REO ring select
  5951. * 1 - FW ring select
  5952. * 2 - SW ring select
  5953. * 3 - Release ring select
  5954. * Refer to htt_rx_full_mon_release_ring.
  5955. * b'31:11 - reserved for future use
  5956. */
  5957. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5958. A_UINT32 msg_type:8,
  5959. pdev_id:8,
  5960. reserved0:16;
  5961. A_UINT32 full_monitor_mode_enable:1,
  5962. addnl_descs_zero_mpdus_end:1,
  5963. addnl_descs_non_zero_mpdus_end:1,
  5964. release_ring:8,
  5965. reserved1:21;
  5966. } POSTPACK;
  5967. /**
  5968. * Enumeration for full monitor mode destination ring select
  5969. * 0 - REO destination ring select
  5970. * 1 - FW destination ring select
  5971. * 2 - SW destination ring select
  5972. * 3 - Release destination ring select
  5973. */
  5974. enum htt_rx_full_mon_release_ring {
  5975. HTT_RX_MON_RING_REO,
  5976. HTT_RX_MON_RING_FW,
  5977. HTT_RX_MON_RING_SW,
  5978. HTT_RX_MON_RING_RELEASE,
  5979. };
  5980. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5981. /* DWORD 0: Pdev ID */
  5982. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5983. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5984. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5985. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5986. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5987. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5990. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5991. } while (0)
  5992. /* DWORD 1:ENABLE */
  5993. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5994. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5995. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5996. do { \
  5997. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5998. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5999. } while (0)
  6000. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6001. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6002. /* DWORD 1:ZERO_MPDU */
  6003. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6004. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6005. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6006. do { \
  6007. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6008. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6009. } while (0)
  6010. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6011. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6012. /* DWORD 1:NON_ZERO_MPDU */
  6013. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6014. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6015. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6016. do { \
  6017. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6018. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6019. } while (0)
  6020. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6021. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6022. /* DWORD 1:RELEASE_RINGS */
  6023. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6024. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6025. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6026. do { \
  6027. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6028. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6029. } while (0)
  6030. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6031. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6032. /**
  6033. * Enumeration for IP Protocol or IPSEC Protocol
  6034. * IPsec describes the framework for providing security at IP layer.
  6035. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6036. */
  6037. enum htt_rx_flow_proto {
  6038. HTT_RX_FLOW_IP_PROTO,
  6039. HTT_RX_FLOW_IPSEC_PROTO,
  6040. };
  6041. /**
  6042. * Enumeration for FSE Cache Invalidation
  6043. * 0 - No Cache Invalidation required
  6044. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6045. * 2 - Complete FSE Cache Invalidation
  6046. * 3 - FSE Disable
  6047. * 4 - FSE Enable
  6048. */
  6049. enum htt_rx_fse_operation {
  6050. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6051. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6052. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6053. HTT_RX_FSE_DISABLE,
  6054. HTT_RX_FSE_ENABLE,
  6055. };
  6056. /* DWORD 0: Pdev ID */
  6057. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6058. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6059. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6060. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6061. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6062. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6063. do { \
  6064. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6065. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6066. } while (0)
  6067. /* DWORD 1:IP PROTO or IPSEC */
  6068. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6069. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6070. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6073. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6074. } while (0)
  6075. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6076. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6077. /* DWORD 1:FSE Operation */
  6078. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6079. #define HTT_RX_FSE_OPERATION_S 1
  6080. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6081. do { \
  6082. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6083. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6084. } while (0)
  6085. #define HTT_RX_FSE_OPERATION_GET(word) \
  6086. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6087. /* DWORD 2-9:IP Address */
  6088. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6089. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6090. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6091. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6092. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6093. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6094. do { \
  6095. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6096. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6097. } while (0)
  6098. /* DWORD 10:Source Port Number */
  6099. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6100. #define HTT_RX_FSE_SOURCEPORT_S 0
  6101. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6102. do { \
  6103. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6104. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6105. } while (0)
  6106. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6107. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6108. /* DWORD 11:Destination Port Number */
  6109. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6110. #define HTT_RX_FSE_DESTPORT_S 16
  6111. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6112. do { \
  6113. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6114. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6115. } while (0)
  6116. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6117. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6118. /* DWORD 10-11:SPI (In case of IPSEC) */
  6119. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6120. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6121. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6122. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6123. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6124. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6127. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6128. } while (0)
  6129. /* DWORD 12:L4 PROTO */
  6130. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6131. #define HTT_RX_FSE_L4_PROTO_S 0
  6132. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6133. do { \
  6134. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6135. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6136. } while (0)
  6137. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6138. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6139. /**
  6140. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6141. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6142. *
  6143. * |31 24|23 |15 8|7 2|1|0|
  6144. * |----------------+----------------+----------------+----------------|
  6145. * | reserved | pdev_id | msg_type |
  6146. * |---------------------------------+----------------+----------------|
  6147. * | reserved |E|F|
  6148. * |---------------------------------+----------------+----------------|
  6149. * Where E = Configure the target to provide the 3-tuple hash value in
  6150. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6151. * F = Configure the target to provide the 3-tuple hash value in
  6152. * flow_id_toeplitz field of rx_msdu_start tlv
  6153. *
  6154. * The following field definitions describe the format of the 3 tuple hash value
  6155. * message sent from the host to target as part of initialization sequence.
  6156. *
  6157. * Header fields:
  6158. * dword0 - b'7:0 - msg_type: This will be set to
  6159. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6160. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6161. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6162. * specified pdev's LMAC ring.
  6163. * b'31:16 - reserved : Reserved for future use
  6164. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6165. * b'1 - toeplitz_hash_2_or_4_field_enable
  6166. * b'31:2 - reserved : Reserved for future use
  6167. * ---------+------+----------------------------------------------------------
  6168. * bit1 | bit0 | Functionality
  6169. * ---------+------+----------------------------------------------------------
  6170. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6171. * | | in flow_id_toeplitz field
  6172. * ---------+------+----------------------------------------------------------
  6173. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6174. * | | in toeplitz_hash_2_or_4 field
  6175. * ---------+------+----------------------------------------------------------
  6176. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6177. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6178. * ---------+------+----------------------------------------------------------
  6179. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6180. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6181. * | | toeplitz_hash_2_or_4 field
  6182. *----------------------------------------------------------------------------
  6183. */
  6184. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6185. A_UINT32 msg_type :8,
  6186. pdev_id :8,
  6187. reserved0 :16;
  6188. A_UINT32 flow_id_toeplitz_field_enable :1,
  6189. toeplitz_hash_2_or_4_field_enable :1,
  6190. reserved1 :30;
  6191. } POSTPACK;
  6192. /* DWORD0 : pdev_id configuration Macros */
  6193. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6194. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6195. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6196. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6197. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6198. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6199. do { \
  6200. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6201. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6202. } while (0)
  6203. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6204. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6205. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6206. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6207. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6208. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6209. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6210. do { \
  6211. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6212. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6213. } while (0)
  6214. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6215. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6216. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6217. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6218. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6219. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6220. do { \
  6221. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6222. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6223. } while (0)
  6224. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6225. /*=== target -> host messages ===============================================*/
  6226. enum htt_t2h_msg_type {
  6227. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6228. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6229. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6230. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6231. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6232. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6233. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6234. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6235. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6236. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6237. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6238. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6239. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6240. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6241. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6242. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6243. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6244. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6245. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6246. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6247. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6248. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6249. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6250. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6251. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6252. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6253. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6254. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6255. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6256. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6257. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6258. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6259. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6260. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6261. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6262. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6263. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6264. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6265. /* TX_OFFLOAD_DELIVER_IND:
  6266. * Forward the target's locally-generated packets to the host,
  6267. * to provide to the monitor mode interface.
  6268. */
  6269. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6270. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6271. HTT_T2H_MSG_TYPE_TEST,
  6272. /* keep this last */
  6273. HTT_T2H_NUM_MSGS
  6274. };
  6275. /*
  6276. * HTT target to host message type -
  6277. * stored in bits 7:0 of the first word of the message
  6278. */
  6279. #define HTT_T2H_MSG_TYPE_M 0xff
  6280. #define HTT_T2H_MSG_TYPE_S 0
  6281. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6282. do { \
  6283. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6284. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6285. } while (0)
  6286. #define HTT_T2H_MSG_TYPE_GET(word) \
  6287. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6288. /**
  6289. * @brief target -> host version number confirmation message definition
  6290. *
  6291. * |31 24|23 16|15 8|7 0|
  6292. * |----------------+----------------+----------------+----------------|
  6293. * | reserved | major number | minor number | msg type |
  6294. * |-------------------------------------------------------------------|
  6295. * : option request TLV (optional) |
  6296. * :...................................................................:
  6297. *
  6298. * The VER_CONF message may consist of a single 4-byte word, or may be
  6299. * extended with TLVs that specify HTT options selected by the target.
  6300. * The following option TLVs may be appended to the VER_CONF message:
  6301. * - LL_BUS_ADDR_SIZE
  6302. * - HL_SUPPRESS_TX_COMPL_IND
  6303. * - MAX_TX_QUEUE_GROUPS
  6304. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6305. * may be appended to the VER_CONF message (but only one TLV of each type).
  6306. *
  6307. * Header fields:
  6308. * - MSG_TYPE
  6309. * Bits 7:0
  6310. * Purpose: identifies this as a version number confirmation message
  6311. * Value: 0x0
  6312. * - VER_MINOR
  6313. * Bits 15:8
  6314. * Purpose: Specify the minor number of the HTT message library version
  6315. * in use by the target firmware.
  6316. * The minor number specifies the specific revision within a range
  6317. * of fundamentally compatible HTT message definition revisions.
  6318. * Compatible revisions involve adding new messages or perhaps
  6319. * adding new fields to existing messages, in a backwards-compatible
  6320. * manner.
  6321. * Incompatible revisions involve changing the message type values,
  6322. * or redefining existing messages.
  6323. * Value: minor number
  6324. * - VER_MAJOR
  6325. * Bits 15:8
  6326. * Purpose: Specify the major number of the HTT message library version
  6327. * in use by the target firmware.
  6328. * The major number specifies the family of minor revisions that are
  6329. * fundamentally compatible with each other, but not with prior or
  6330. * later families.
  6331. * Value: major number
  6332. */
  6333. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6334. #define HTT_VER_CONF_MINOR_S 8
  6335. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6336. #define HTT_VER_CONF_MAJOR_S 16
  6337. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6340. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6341. } while (0)
  6342. #define HTT_VER_CONF_MINOR_GET(word) \
  6343. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6344. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6347. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6348. } while (0)
  6349. #define HTT_VER_CONF_MAJOR_GET(word) \
  6350. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6351. #define HTT_VER_CONF_BYTES 4
  6352. /**
  6353. * @brief - target -> host HTT Rx In order indication message
  6354. *
  6355. * @details
  6356. *
  6357. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6358. * |----------------+-------------------+---------------------+---------------|
  6359. * | peer ID | P| F| O| ext TID | msg type |
  6360. * |--------------------------------------------------------------------------|
  6361. * | MSDU count | Reserved | vdev id |
  6362. * |--------------------------------------------------------------------------|
  6363. * | MSDU 0 bus address (bits 31:0) |
  6364. #if HTT_PADDR64
  6365. * | MSDU 0 bus address (bits 63:32) |
  6366. #endif
  6367. * |--------------------------------------------------------------------------|
  6368. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6369. * |--------------------------------------------------------------------------|
  6370. * | MSDU 1 bus address (bits 31:0) |
  6371. #if HTT_PADDR64
  6372. * | MSDU 1 bus address (bits 63:32) |
  6373. #endif
  6374. * |--------------------------------------------------------------------------|
  6375. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6376. * |--------------------------------------------------------------------------|
  6377. */
  6378. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6379. *
  6380. * @details
  6381. * bits
  6382. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6383. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6384. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6385. * | | frag | | | | fail |chksum fail|
  6386. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6387. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6388. */
  6389. struct htt_rx_in_ord_paddr_ind_hdr_t
  6390. {
  6391. A_UINT32 /* word 0 */
  6392. msg_type: 8,
  6393. ext_tid: 5,
  6394. offload: 1,
  6395. frag: 1,
  6396. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6397. peer_id: 16;
  6398. A_UINT32 /* word 1 */
  6399. vap_id: 8,
  6400. /* NOTE:
  6401. * This reserved_1 field is not truly reserved - certain targets use
  6402. * this field internally to store debug information, and do not zero
  6403. * out the contents of the field before uploading the message to the
  6404. * host. Thus, any host-target communication supported by this field
  6405. * is limited to using values that are never used by the debug
  6406. * information stored by certain targets in the reserved_1 field.
  6407. * In particular, the targets in question don't use the value 0x3
  6408. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6409. * so this previously-unused value within these bits is available to
  6410. * use as the host / target PKT_CAPTURE_MODE flag.
  6411. */
  6412. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6413. /* if pkt_capture_mode == 0x3, host should
  6414. * send rx frames to monitor mode interface
  6415. */
  6416. msdu_cnt: 16;
  6417. };
  6418. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6419. {
  6420. A_UINT32 dma_addr;
  6421. A_UINT32
  6422. length: 16,
  6423. fw_desc: 8,
  6424. msdu_info:8;
  6425. };
  6426. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6427. {
  6428. A_UINT32 dma_addr_lo;
  6429. A_UINT32 dma_addr_hi;
  6430. A_UINT32
  6431. length: 16,
  6432. fw_desc: 8,
  6433. msdu_info:8;
  6434. };
  6435. #if HTT_PADDR64
  6436. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6437. #else
  6438. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6439. #endif
  6440. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6441. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6443. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6444. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6445. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6447. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6448. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6449. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6450. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6451. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6452. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6453. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6454. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6455. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6456. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6457. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6458. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6459. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6460. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6461. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6462. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6463. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6464. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6465. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6466. /* for systems using 64-bit format for bus addresses */
  6467. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6468. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6469. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6470. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6471. /* for systems using 32-bit format for bus addresses */
  6472. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6473. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6474. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6475. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6476. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6477. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6478. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6479. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6480. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6483. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6484. } while (0)
  6485. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6486. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6487. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6488. do { \
  6489. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6490. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6491. } while (0)
  6492. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6493. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6494. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6497. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6498. } while (0)
  6499. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6500. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6501. /*
  6502. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6503. * deliver the rx frames to the monitor mode interface.
  6504. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6505. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6506. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6507. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6508. */
  6509. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6510. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6513. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6514. } while (0)
  6515. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6516. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6517. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6518. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6521. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6522. } while (0)
  6523. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6524. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6525. /* for systems using 64-bit format for bus addresses */
  6526. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6529. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6530. } while (0)
  6531. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6532. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6533. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6536. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6537. } while (0)
  6538. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6539. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6540. /* for systems using 32-bit format for bus addresses */
  6541. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6544. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6545. } while (0)
  6546. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6547. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6548. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6551. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6552. } while (0)
  6553. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6554. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6555. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6556. do { \
  6557. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6558. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6559. } while (0)
  6560. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6561. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6562. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6563. do { \
  6564. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6565. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6566. } while (0)
  6567. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6568. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6569. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6570. do { \
  6571. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6572. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6573. } while (0)
  6574. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6575. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6576. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6577. do { \
  6578. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6579. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6580. } while (0)
  6581. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6582. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6583. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6584. do { \
  6585. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6586. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6587. } while (0)
  6588. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6589. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6590. /* definitions used within target -> host rx indication message */
  6591. PREPACK struct htt_rx_ind_hdr_prefix_t
  6592. {
  6593. A_UINT32 /* word 0 */
  6594. msg_type: 8,
  6595. ext_tid: 5,
  6596. release_valid: 1,
  6597. flush_valid: 1,
  6598. reserved0: 1,
  6599. peer_id: 16;
  6600. A_UINT32 /* word 1 */
  6601. flush_start_seq_num: 6,
  6602. flush_end_seq_num: 6,
  6603. release_start_seq_num: 6,
  6604. release_end_seq_num: 6,
  6605. num_mpdu_ranges: 8;
  6606. } POSTPACK;
  6607. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6608. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6609. #define HTT_TGT_RSSI_INVALID 0x80
  6610. PREPACK struct htt_rx_ppdu_desc_t
  6611. {
  6612. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6613. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6614. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6615. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6616. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6617. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6618. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6619. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6620. A_UINT32 /* word 0 */
  6621. rssi_cmb: 8,
  6622. timestamp_submicrosec: 8,
  6623. phy_err_code: 8,
  6624. phy_err: 1,
  6625. legacy_rate: 4,
  6626. legacy_rate_sel: 1,
  6627. end_valid: 1,
  6628. start_valid: 1;
  6629. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6630. union {
  6631. A_UINT32 /* word 1 */
  6632. rssi0_pri20: 8,
  6633. rssi0_ext20: 8,
  6634. rssi0_ext40: 8,
  6635. rssi0_ext80: 8;
  6636. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6637. } u0;
  6638. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6639. union {
  6640. A_UINT32 /* word 2 */
  6641. rssi1_pri20: 8,
  6642. rssi1_ext20: 8,
  6643. rssi1_ext40: 8,
  6644. rssi1_ext80: 8;
  6645. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6646. } u1;
  6647. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6648. union {
  6649. A_UINT32 /* word 3 */
  6650. rssi2_pri20: 8,
  6651. rssi2_ext20: 8,
  6652. rssi2_ext40: 8,
  6653. rssi2_ext80: 8;
  6654. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6655. } u2;
  6656. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6657. union {
  6658. A_UINT32 /* word 4 */
  6659. rssi3_pri20: 8,
  6660. rssi3_ext20: 8,
  6661. rssi3_ext40: 8,
  6662. rssi3_ext80: 8;
  6663. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6664. } u3;
  6665. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6666. A_UINT32 tsf32; /* word 5 */
  6667. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6668. A_UINT32 timestamp_microsec; /* word 6 */
  6669. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6670. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6671. A_UINT32 /* word 7 */
  6672. vht_sig_a1: 24,
  6673. preamble_type: 8;
  6674. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6675. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6676. A_UINT32 /* word 8 */
  6677. vht_sig_a2: 24,
  6678. /* sa_ant_matrix
  6679. * For cases where a single rx chain has options to be connected to
  6680. * different rx antennas, show which rx antennas were in use during
  6681. * receipt of a given PPDU.
  6682. * This sa_ant_matrix provides a bitmask of the antennas used while
  6683. * receiving this frame.
  6684. */
  6685. sa_ant_matrix: 8;
  6686. } POSTPACK;
  6687. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6688. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6689. PREPACK struct htt_rx_ind_hdr_suffix_t
  6690. {
  6691. A_UINT32 /* word 0 */
  6692. fw_rx_desc_bytes: 16,
  6693. reserved0: 16;
  6694. } POSTPACK;
  6695. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6696. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6697. PREPACK struct htt_rx_ind_hdr_t
  6698. {
  6699. struct htt_rx_ind_hdr_prefix_t prefix;
  6700. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6701. struct htt_rx_ind_hdr_suffix_t suffix;
  6702. } POSTPACK;
  6703. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6704. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6705. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6706. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6707. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6708. /*
  6709. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6710. * the offset into the HTT rx indication message at which the
  6711. * FW rx PPDU descriptor resides
  6712. */
  6713. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6714. /*
  6715. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6716. * the offset into the HTT rx indication message at which the
  6717. * header suffix (FW rx MSDU byte count) resides
  6718. */
  6719. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6720. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6721. /*
  6722. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6723. * the offset into the HTT rx indication message at which the per-MSDU
  6724. * information starts
  6725. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6726. * per-MSDU information portion of the message. The per-MSDU info itself
  6727. * starts at byte 12.
  6728. */
  6729. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6730. /**
  6731. * @brief target -> host rx indication message definition
  6732. *
  6733. * @details
  6734. * The following field definitions describe the format of the rx indication
  6735. * message sent from the target to the host.
  6736. * The message consists of three major sections:
  6737. * 1. a fixed-length header
  6738. * 2. a variable-length list of firmware rx MSDU descriptors
  6739. * 3. one or more 4-octet MPDU range information elements
  6740. * The fixed length header itself has two sub-sections
  6741. * 1. the message meta-information, including identification of the
  6742. * sender and type of the received data, and a 4-octet flush/release IE
  6743. * 2. the firmware rx PPDU descriptor
  6744. *
  6745. * The format of the message is depicted below.
  6746. * in this depiction, the following abbreviations are used for information
  6747. * elements within the message:
  6748. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6749. * elements associated with the PPDU start are valid.
  6750. * Specifically, the following fields are valid only if SV is set:
  6751. * RSSI (all variants), L, legacy rate, preamble type, service,
  6752. * VHT-SIG-A
  6753. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6754. * elements associated with the PPDU end are valid.
  6755. * Specifically, the following fields are valid only if EV is set:
  6756. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6757. * - L - Legacy rate selector - if legacy rates are used, this flag
  6758. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6759. * (L == 0) PHY.
  6760. * - P - PHY error flag - boolean indication of whether the rx frame had
  6761. * a PHY error
  6762. *
  6763. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6764. * |----------------+-------------------+---------------------+---------------|
  6765. * | peer ID | |RV|FV| ext TID | msg type |
  6766. * |--------------------------------------------------------------------------|
  6767. * | num | release | release | flush | flush |
  6768. * | MPDU | end | start | end | start |
  6769. * | ranges | seq num | seq num | seq num | seq num |
  6770. * |==========================================================================|
  6771. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6772. * |V|V| | rate | | | timestamp | RSSI |
  6773. * |--------------------------------------------------------------------------|
  6774. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6775. * |--------------------------------------------------------------------------|
  6776. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6777. * |--------------------------------------------------------------------------|
  6778. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6779. * |--------------------------------------------------------------------------|
  6780. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6781. * |--------------------------------------------------------------------------|
  6782. * | TSF LSBs |
  6783. * |--------------------------------------------------------------------------|
  6784. * | microsec timestamp |
  6785. * |--------------------------------------------------------------------------|
  6786. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6787. * |--------------------------------------------------------------------------|
  6788. * | service | HT-SIG / VHT-SIG-A2 |
  6789. * |==========================================================================|
  6790. * | reserved | FW rx desc bytes |
  6791. * |--------------------------------------------------------------------------|
  6792. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6793. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6794. * |--------------------------------------------------------------------------|
  6795. * : : :
  6796. * |--------------------------------------------------------------------------|
  6797. * | alignment | MSDU Rx |
  6798. * | padding | desc Bn |
  6799. * |--------------------------------------------------------------------------|
  6800. * | reserved | MPDU range status | MPDU count |
  6801. * |--------------------------------------------------------------------------|
  6802. * : reserved : MPDU range status : MPDU count :
  6803. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6804. *
  6805. * Header fields:
  6806. * - MSG_TYPE
  6807. * Bits 7:0
  6808. * Purpose: identifies this as an rx indication message
  6809. * Value: 0x1
  6810. * - EXT_TID
  6811. * Bits 12:8
  6812. * Purpose: identify the traffic ID of the rx data, including
  6813. * special "extended" TID values for multicast, broadcast, and
  6814. * non-QoS data frames
  6815. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6816. * - FLUSH_VALID (FV)
  6817. * Bit 13
  6818. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6819. * is valid
  6820. * Value:
  6821. * 1 -> flush IE is valid and needs to be processed
  6822. * 0 -> flush IE is not valid and should be ignored
  6823. * - REL_VALID (RV)
  6824. * Bit 13
  6825. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6826. * is valid
  6827. * Value:
  6828. * 1 -> release IE is valid and needs to be processed
  6829. * 0 -> release IE is not valid and should be ignored
  6830. * - PEER_ID
  6831. * Bits 31:16
  6832. * Purpose: Identify, by ID, which peer sent the rx data
  6833. * Value: ID of the peer who sent the rx data
  6834. * - FLUSH_SEQ_NUM_START
  6835. * Bits 5:0
  6836. * Purpose: Indicate the start of a series of MPDUs to flush
  6837. * Not all MPDUs within this series are necessarily valid - the host
  6838. * must check each sequence number within this range to see if the
  6839. * corresponding MPDU is actually present.
  6840. * This field is only valid if the FV bit is set.
  6841. * Value:
  6842. * The sequence number for the first MPDUs to check to flush.
  6843. * The sequence number is masked by 0x3f.
  6844. * - FLUSH_SEQ_NUM_END
  6845. * Bits 11:6
  6846. * Purpose: Indicate the end of a series of MPDUs to flush
  6847. * Value:
  6848. * The sequence number one larger than the sequence number of the
  6849. * last MPDU to check to flush.
  6850. * The sequence number is masked by 0x3f.
  6851. * Not all MPDUs within this series are necessarily valid - the host
  6852. * must check each sequence number within this range to see if the
  6853. * corresponding MPDU is actually present.
  6854. * This field is only valid if the FV bit is set.
  6855. * - REL_SEQ_NUM_START
  6856. * Bits 17:12
  6857. * Purpose: Indicate the start of a series of MPDUs to release.
  6858. * All MPDUs within this series are present and valid - the host
  6859. * need not check each sequence number within this range to see if
  6860. * the corresponding MPDU is actually present.
  6861. * This field is only valid if the RV bit is set.
  6862. * Value:
  6863. * The sequence number for the first MPDUs to check to release.
  6864. * The sequence number is masked by 0x3f.
  6865. * - REL_SEQ_NUM_END
  6866. * Bits 23:18
  6867. * Purpose: Indicate the end of a series of MPDUs to release.
  6868. * Value:
  6869. * The sequence number one larger than the sequence number of the
  6870. * last MPDU to check to release.
  6871. * The sequence number is masked by 0x3f.
  6872. * All MPDUs within this series are present and valid - the host
  6873. * need not check each sequence number within this range to see if
  6874. * the corresponding MPDU is actually present.
  6875. * This field is only valid if the RV bit is set.
  6876. * - NUM_MPDU_RANGES
  6877. * Bits 31:24
  6878. * Purpose: Indicate how many ranges of MPDUs are present.
  6879. * Each MPDU range consists of a series of contiguous MPDUs within the
  6880. * rx frame sequence which all have the same MPDU status.
  6881. * Value: 1-63 (typically a small number, like 1-3)
  6882. *
  6883. * Rx PPDU descriptor fields:
  6884. * - RSSI_CMB
  6885. * Bits 7:0
  6886. * Purpose: Combined RSSI from all active rx chains, across the active
  6887. * bandwidth.
  6888. * Value: RSSI dB units w.r.t. noise floor
  6889. * - TIMESTAMP_SUBMICROSEC
  6890. * Bits 15:8
  6891. * Purpose: high-resolution timestamp
  6892. * Value:
  6893. * Sub-microsecond time of PPDU reception.
  6894. * This timestamp ranges from [0,MAC clock MHz).
  6895. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6896. * to form a high-resolution, large range rx timestamp.
  6897. * - PHY_ERR_CODE
  6898. * Bits 23:16
  6899. * Purpose:
  6900. * If the rx frame processing resulted in a PHY error, indicate what
  6901. * type of rx PHY error occurred.
  6902. * Value:
  6903. * This field is valid if the "P" (PHY_ERR) flag is set.
  6904. * TBD: document/specify the values for this field
  6905. * - PHY_ERR
  6906. * Bit 24
  6907. * Purpose: indicate whether the rx PPDU had a PHY error
  6908. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6909. * - LEGACY_RATE
  6910. * Bits 28:25
  6911. * Purpose:
  6912. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6913. * specify which rate was used.
  6914. * Value:
  6915. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6916. * flag.
  6917. * If LEGACY_RATE_SEL is 0:
  6918. * 0x8: OFDM 48 Mbps
  6919. * 0x9: OFDM 24 Mbps
  6920. * 0xA: OFDM 12 Mbps
  6921. * 0xB: OFDM 6 Mbps
  6922. * 0xC: OFDM 54 Mbps
  6923. * 0xD: OFDM 36 Mbps
  6924. * 0xE: OFDM 18 Mbps
  6925. * 0xF: OFDM 9 Mbps
  6926. * If LEGACY_RATE_SEL is 1:
  6927. * 0x8: CCK 11 Mbps long preamble
  6928. * 0x9: CCK 5.5 Mbps long preamble
  6929. * 0xA: CCK 2 Mbps long preamble
  6930. * 0xB: CCK 1 Mbps long preamble
  6931. * 0xC: CCK 11 Mbps short preamble
  6932. * 0xD: CCK 5.5 Mbps short preamble
  6933. * 0xE: CCK 2 Mbps short preamble
  6934. * - LEGACY_RATE_SEL
  6935. * Bit 29
  6936. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6937. * Value:
  6938. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6939. * used a legacy rate.
  6940. * 0 -> OFDM, 1 -> CCK
  6941. * - END_VALID
  6942. * Bit 30
  6943. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6944. * the start of the PPDU are valid. Specifically, the following
  6945. * fields are only valid if END_VALID is set:
  6946. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6947. * TIMESTAMP_SUBMICROSEC
  6948. * Value:
  6949. * 0 -> rx PPDU desc end fields are not valid
  6950. * 1 -> rx PPDU desc end fields are valid
  6951. * - START_VALID
  6952. * Bit 31
  6953. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6954. * the end of the PPDU are valid. Specifically, the following
  6955. * fields are only valid if START_VALID is set:
  6956. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6957. * VHT-SIG-A
  6958. * Value:
  6959. * 0 -> rx PPDU desc start fields are not valid
  6960. * 1 -> rx PPDU desc start fields are valid
  6961. * - RSSI0_PRI20
  6962. * Bits 7:0
  6963. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6964. * Value: RSSI dB units w.r.t. noise floor
  6965. *
  6966. * - RSSI0_EXT20
  6967. * Bits 7:0
  6968. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6969. * (if the rx bandwidth was >= 40 MHz)
  6970. * Value: RSSI dB units w.r.t. noise floor
  6971. * - RSSI0_EXT40
  6972. * Bits 7:0
  6973. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6974. * (if the rx bandwidth was >= 80 MHz)
  6975. * Value: RSSI dB units w.r.t. noise floor
  6976. * - RSSI0_EXT80
  6977. * Bits 7:0
  6978. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6979. * (if the rx bandwidth was >= 160 MHz)
  6980. * Value: RSSI dB units w.r.t. noise floor
  6981. *
  6982. * - RSSI1_PRI20
  6983. * Bits 7:0
  6984. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6985. * Value: RSSI dB units w.r.t. noise floor
  6986. * - RSSI1_EXT20
  6987. * Bits 7:0
  6988. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6989. * (if the rx bandwidth was >= 40 MHz)
  6990. * Value: RSSI dB units w.r.t. noise floor
  6991. * - RSSI1_EXT40
  6992. * Bits 7:0
  6993. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6994. * (if the rx bandwidth was >= 80 MHz)
  6995. * Value: RSSI dB units w.r.t. noise floor
  6996. * - RSSI1_EXT80
  6997. * Bits 7:0
  6998. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6999. * (if the rx bandwidth was >= 160 MHz)
  7000. * Value: RSSI dB units w.r.t. noise floor
  7001. *
  7002. * - RSSI2_PRI20
  7003. * Bits 7:0
  7004. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7005. * Value: RSSI dB units w.r.t. noise floor
  7006. * - RSSI2_EXT20
  7007. * Bits 7:0
  7008. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7009. * (if the rx bandwidth was >= 40 MHz)
  7010. * Value: RSSI dB units w.r.t. noise floor
  7011. * - RSSI2_EXT40
  7012. * Bits 7:0
  7013. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7014. * (if the rx bandwidth was >= 80 MHz)
  7015. * Value: RSSI dB units w.r.t. noise floor
  7016. * - RSSI2_EXT80
  7017. * Bits 7:0
  7018. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7019. * (if the rx bandwidth was >= 160 MHz)
  7020. * Value: RSSI dB units w.r.t. noise floor
  7021. *
  7022. * - RSSI3_PRI20
  7023. * Bits 7:0
  7024. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7025. * Value: RSSI dB units w.r.t. noise floor
  7026. * - RSSI3_EXT20
  7027. * Bits 7:0
  7028. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7029. * (if the rx bandwidth was >= 40 MHz)
  7030. * Value: RSSI dB units w.r.t. noise floor
  7031. * - RSSI3_EXT40
  7032. * Bits 7:0
  7033. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7034. * (if the rx bandwidth was >= 80 MHz)
  7035. * Value: RSSI dB units w.r.t. noise floor
  7036. * - RSSI3_EXT80
  7037. * Bits 7:0
  7038. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7039. * (if the rx bandwidth was >= 160 MHz)
  7040. * Value: RSSI dB units w.r.t. noise floor
  7041. *
  7042. * - TSF32
  7043. * Bits 31:0
  7044. * Purpose: specify the time the rx PPDU was received, in TSF units
  7045. * Value: 32 LSBs of the TSF
  7046. * - TIMESTAMP_MICROSEC
  7047. * Bits 31:0
  7048. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7049. * Value: PPDU rx time, in microseconds
  7050. * - VHT_SIG_A1
  7051. * Bits 23:0
  7052. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7053. * from the rx PPDU
  7054. * Value:
  7055. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7056. * VHT-SIG-A1 data.
  7057. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7058. * first 24 bits of the HT-SIG data.
  7059. * Otherwise, this field is invalid.
  7060. * Refer to the the 802.11 protocol for the definition of the
  7061. * HT-SIG and VHT-SIG-A1 fields
  7062. * - VHT_SIG_A2
  7063. * Bits 23:0
  7064. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7065. * from the rx PPDU
  7066. * Value:
  7067. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7068. * VHT-SIG-A2 data.
  7069. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7070. * last 24 bits of the HT-SIG data.
  7071. * Otherwise, this field is invalid.
  7072. * Refer to the the 802.11 protocol for the definition of the
  7073. * HT-SIG and VHT-SIG-A2 fields
  7074. * - PREAMBLE_TYPE
  7075. * Bits 31:24
  7076. * Purpose: indicate the PHY format of the received burst
  7077. * Value:
  7078. * 0x4: Legacy (OFDM/CCK)
  7079. * 0x8: HT
  7080. * 0x9: HT with TxBF
  7081. * 0xC: VHT
  7082. * 0xD: VHT with TxBF
  7083. * - SERVICE
  7084. * Bits 31:24
  7085. * Purpose: TBD
  7086. * Value: TBD
  7087. *
  7088. * Rx MSDU descriptor fields:
  7089. * - FW_RX_DESC_BYTES
  7090. * Bits 15:0
  7091. * Purpose: Indicate how many bytes in the Rx indication are used for
  7092. * FW Rx descriptors
  7093. *
  7094. * Payload fields:
  7095. * - MPDU_COUNT
  7096. * Bits 7:0
  7097. * Purpose: Indicate how many sequential MPDUs share the same status.
  7098. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7099. * - MPDU_STATUS
  7100. * Bits 15:8
  7101. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7102. * received successfully.
  7103. * Value:
  7104. * 0x1: success
  7105. * 0x2: FCS error
  7106. * 0x3: duplicate error
  7107. * 0x4: replay error
  7108. * 0x5: invalid peer
  7109. */
  7110. /* header fields */
  7111. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7112. #define HTT_RX_IND_EXT_TID_S 8
  7113. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7114. #define HTT_RX_IND_FLUSH_VALID_S 13
  7115. #define HTT_RX_IND_REL_VALID_M 0x4000
  7116. #define HTT_RX_IND_REL_VALID_S 14
  7117. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7118. #define HTT_RX_IND_PEER_ID_S 16
  7119. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7120. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7121. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7122. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7123. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7124. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7125. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7126. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7127. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7128. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7129. /* rx PPDU descriptor fields */
  7130. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7131. #define HTT_RX_IND_RSSI_CMB_S 0
  7132. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7133. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7134. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7135. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7136. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7137. #define HTT_RX_IND_PHY_ERR_S 24
  7138. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7139. #define HTT_RX_IND_LEGACY_RATE_S 25
  7140. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7141. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7142. #define HTT_RX_IND_END_VALID_M 0x40000000
  7143. #define HTT_RX_IND_END_VALID_S 30
  7144. #define HTT_RX_IND_START_VALID_M 0x80000000
  7145. #define HTT_RX_IND_START_VALID_S 31
  7146. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7147. #define HTT_RX_IND_RSSI_PRI20_S 0
  7148. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7149. #define HTT_RX_IND_RSSI_EXT20_S 8
  7150. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7151. #define HTT_RX_IND_RSSI_EXT40_S 16
  7152. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7153. #define HTT_RX_IND_RSSI_EXT80_S 24
  7154. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7155. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7156. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7157. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7158. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7159. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7160. #define HTT_RX_IND_SERVICE_M 0xff000000
  7161. #define HTT_RX_IND_SERVICE_S 24
  7162. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7163. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7164. /* rx MSDU descriptor fields */
  7165. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7166. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7167. /* payload fields */
  7168. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7169. #define HTT_RX_IND_MPDU_COUNT_S 0
  7170. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7171. #define HTT_RX_IND_MPDU_STATUS_S 8
  7172. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7173. do { \
  7174. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7175. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7176. } while (0)
  7177. #define HTT_RX_IND_EXT_TID_GET(word) \
  7178. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7179. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7180. do { \
  7181. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7182. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7183. } while (0)
  7184. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7185. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7186. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7187. do { \
  7188. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7189. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7190. } while (0)
  7191. #define HTT_RX_IND_REL_VALID_GET(word) \
  7192. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7193. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7194. do { \
  7195. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7196. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7197. } while (0)
  7198. #define HTT_RX_IND_PEER_ID_GET(word) \
  7199. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7200. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7201. do { \
  7202. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7203. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7204. } while (0)
  7205. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7206. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7207. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7208. do { \
  7209. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7210. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7211. } while (0)
  7212. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7213. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7214. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7215. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7218. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7219. } while (0)
  7220. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7221. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7222. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7223. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7224. do { \
  7225. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7226. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7227. } while (0)
  7228. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7229. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7230. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7231. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7232. do { \
  7233. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7234. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7235. } while (0)
  7236. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7237. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7238. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7239. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7240. do { \
  7241. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7242. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7243. } while (0)
  7244. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7245. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7246. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7247. /* FW rx PPDU descriptor fields */
  7248. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7249. do { \
  7250. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7251. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7252. } while (0)
  7253. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7254. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7255. HTT_RX_IND_RSSI_CMB_S)
  7256. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7259. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7260. } while (0)
  7261. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7262. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7263. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7264. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7265. do { \
  7266. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7267. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7268. } while (0)
  7269. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7270. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7271. HTT_RX_IND_PHY_ERR_CODE_S)
  7272. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7275. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7276. } while (0)
  7277. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7278. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7279. HTT_RX_IND_PHY_ERR_S)
  7280. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7281. do { \
  7282. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7283. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7284. } while (0)
  7285. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7286. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7287. HTT_RX_IND_LEGACY_RATE_S)
  7288. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7289. do { \
  7290. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7291. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7292. } while (0)
  7293. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7294. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7295. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7296. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7299. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7300. } while (0)
  7301. #define HTT_RX_IND_END_VALID_GET(word) \
  7302. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7303. HTT_RX_IND_END_VALID_S)
  7304. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7305. do { \
  7306. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7307. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7308. } while (0)
  7309. #define HTT_RX_IND_START_VALID_GET(word) \
  7310. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7311. HTT_RX_IND_START_VALID_S)
  7312. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7313. do { \
  7314. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7315. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7316. } while (0)
  7317. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7318. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7319. HTT_RX_IND_RSSI_PRI20_S)
  7320. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7321. do { \
  7322. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7323. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7324. } while (0)
  7325. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7326. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7327. HTT_RX_IND_RSSI_EXT20_S)
  7328. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7329. do { \
  7330. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7331. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7332. } while (0)
  7333. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7334. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7335. HTT_RX_IND_RSSI_EXT40_S)
  7336. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7337. do { \
  7338. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7339. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7340. } while (0)
  7341. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7342. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7343. HTT_RX_IND_RSSI_EXT80_S)
  7344. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7347. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7348. } while (0)
  7349. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7350. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7351. HTT_RX_IND_VHT_SIG_A1_S)
  7352. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7353. do { \
  7354. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7355. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7356. } while (0)
  7357. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7358. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7359. HTT_RX_IND_VHT_SIG_A2_S)
  7360. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7361. do { \
  7362. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7363. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7364. } while (0)
  7365. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7366. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7367. HTT_RX_IND_PREAMBLE_TYPE_S)
  7368. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7369. do { \
  7370. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7371. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7372. } while (0)
  7373. #define HTT_RX_IND_SERVICE_GET(word) \
  7374. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7375. HTT_RX_IND_SERVICE_S)
  7376. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7377. do { \
  7378. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7379. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7380. } while (0)
  7381. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7382. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7383. HTT_RX_IND_SA_ANT_MATRIX_S)
  7384. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7385. do { \
  7386. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7387. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7388. } while (0)
  7389. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7390. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7391. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7392. do { \
  7393. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7394. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7395. } while (0)
  7396. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7397. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7398. #define HTT_RX_IND_HL_BYTES \
  7399. (HTT_RX_IND_HDR_BYTES + \
  7400. 4 /* single FW rx MSDU descriptor */ + \
  7401. 4 /* single MPDU range information element */)
  7402. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7403. /* Could we use one macro entry? */
  7404. #define HTT_WORD_SET(word, field, value) \
  7405. do { \
  7406. HTT_CHECK_SET_VAL(field, value); \
  7407. (word) |= ((value) << field ## _S); \
  7408. } while (0)
  7409. #define HTT_WORD_GET(word, field) \
  7410. (((word) & field ## _M) >> field ## _S)
  7411. PREPACK struct hl_htt_rx_ind_base {
  7412. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7413. } POSTPACK;
  7414. /*
  7415. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7416. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7417. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7418. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7419. * htt_rx_ind_hl_rx_desc_t.
  7420. */
  7421. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7422. struct htt_rx_ind_hl_rx_desc_t {
  7423. A_UINT8 ver;
  7424. A_UINT8 len;
  7425. struct {
  7426. A_UINT8
  7427. first_msdu: 1,
  7428. last_msdu: 1,
  7429. c3_failed: 1,
  7430. c4_failed: 1,
  7431. ipv6: 1,
  7432. tcp: 1,
  7433. udp: 1,
  7434. reserved: 1;
  7435. } flags;
  7436. /* NOTE: no reserved space - don't append any new fields here */
  7437. };
  7438. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7439. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7440. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7441. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7442. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7443. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7444. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7445. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7446. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7447. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7448. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7449. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7450. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7451. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7452. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7453. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7454. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7455. /* This structure is used in HL, the basic descriptor information
  7456. * used by host. the structure is translated by FW from HW desc
  7457. * or generated by FW. But in HL monitor mode, the host would use
  7458. * the same structure with LL.
  7459. */
  7460. PREPACK struct hl_htt_rx_desc_base {
  7461. A_UINT32
  7462. seq_num:12,
  7463. encrypted:1,
  7464. chan_info_present:1,
  7465. resv0:2,
  7466. mcast_bcast:1,
  7467. fragment:1,
  7468. key_id_oct:8,
  7469. resv1:6;
  7470. A_UINT32
  7471. pn_31_0;
  7472. union {
  7473. struct {
  7474. A_UINT16 pn_47_32;
  7475. A_UINT16 pn_63_48;
  7476. } pn16;
  7477. A_UINT32 pn_63_32;
  7478. } u0;
  7479. A_UINT32
  7480. pn_95_64;
  7481. A_UINT32
  7482. pn_127_96;
  7483. } POSTPACK;
  7484. /*
  7485. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7486. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7487. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7488. * Please see htt_chan_change_t for description of the fields.
  7489. */
  7490. PREPACK struct htt_chan_info_t
  7491. {
  7492. A_UINT32 primary_chan_center_freq_mhz: 16,
  7493. contig_chan1_center_freq_mhz: 16;
  7494. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7495. phy_mode: 8,
  7496. reserved: 8;
  7497. } POSTPACK;
  7498. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7499. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7500. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7501. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7502. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7503. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7504. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7505. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7506. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7507. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7508. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7509. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7510. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7511. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7512. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7513. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7514. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7515. /* Channel information */
  7516. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7517. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7518. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7519. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7520. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7521. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7522. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7523. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7524. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7525. do { \
  7526. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7527. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7528. } while (0)
  7529. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7530. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7531. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7534. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7535. } while (0)
  7536. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7537. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7538. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7539. do { \
  7540. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7541. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7542. } while (0)
  7543. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7544. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7545. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7546. do { \
  7547. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7548. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7549. } while (0)
  7550. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7551. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7552. /*
  7553. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7554. * @brief target -> host message definition for FW offloaded pkts
  7555. *
  7556. * @details
  7557. * The following field definitions describe the format of the firmware
  7558. * offload deliver message sent from the target to the host.
  7559. *
  7560. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7561. *
  7562. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7563. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7564. * | reserved_1 | msg type |
  7565. * |--------------------------------------------------------------------------|
  7566. * | phy_timestamp_l32 |
  7567. * |--------------------------------------------------------------------------|
  7568. * | WORD2 (see below) |
  7569. * |--------------------------------------------------------------------------|
  7570. * | seqno | framectrl |
  7571. * |--------------------------------------------------------------------------|
  7572. * | reserved_3 | vdev_id | tid_num|
  7573. * |--------------------------------------------------------------------------|
  7574. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7575. * |--------------------------------------------------------------------------|
  7576. *
  7577. * where:
  7578. * STAT = status
  7579. * F = format (802.3 vs. 802.11)
  7580. *
  7581. * definition for word 2
  7582. *
  7583. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7584. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7585. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7586. * |--------------------------------------------------------------------------|
  7587. *
  7588. * where:
  7589. * PR = preamble
  7590. * BF = beamformed
  7591. */
  7592. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7593. {
  7594. A_UINT32 /* word 0 */
  7595. msg_type:8, /* [ 7: 0] */
  7596. reserved_1:24; /* [31: 8] */
  7597. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7598. A_UINT32 /* word 2 */
  7599. /* preamble:
  7600. * 0-OFDM,
  7601. * 1-CCk,
  7602. * 2-HT,
  7603. * 3-VHT
  7604. */
  7605. preamble: 2, /* [1:0] */
  7606. /* mcs:
  7607. * In case of HT preamble interpret
  7608. * MCS along with NSS.
  7609. * Valid values for HT are 0 to 7.
  7610. * HT mcs 0 with NSS 2 is mcs 8.
  7611. * Valid values for VHT are 0 to 9.
  7612. */
  7613. mcs: 4, /* [5:2] */
  7614. /* rate:
  7615. * This is applicable only for
  7616. * CCK and OFDM preamble type
  7617. * rate 0: OFDM 48 Mbps,
  7618. * 1: OFDM 24 Mbps,
  7619. * 2: OFDM 12 Mbps
  7620. * 3: OFDM 6 Mbps
  7621. * 4: OFDM 54 Mbps
  7622. * 5: OFDM 36 Mbps
  7623. * 6: OFDM 18 Mbps
  7624. * 7: OFDM 9 Mbps
  7625. * rate 0: CCK 11 Mbps Long
  7626. * 1: CCK 5.5 Mbps Long
  7627. * 2: CCK 2 Mbps Long
  7628. * 3: CCK 1 Mbps Long
  7629. * 4: CCK 11 Mbps Short
  7630. * 5: CCK 5.5 Mbps Short
  7631. * 6: CCK 2 Mbps Short
  7632. */
  7633. rate : 3, /* [ 8: 6] */
  7634. rssi : 8, /* [16: 9] units=dBm */
  7635. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7636. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7637. stbc : 1, /* [22] */
  7638. sgi : 1, /* [23] */
  7639. ldpc : 1, /* [24] */
  7640. beamformed: 1, /* [25] */
  7641. reserved_2: 6; /* [31:26] */
  7642. A_UINT32 /* word 3 */
  7643. framectrl:16, /* [15: 0] */
  7644. seqno:16; /* [31:16] */
  7645. A_UINT32 /* word 4 */
  7646. tid_num:5, /* [ 4: 0] actual TID number */
  7647. vdev_id:8, /* [12: 5] */
  7648. reserved_3:19; /* [31:13] */
  7649. A_UINT32 /* word 5 */
  7650. /* status:
  7651. * 0: tx_ok
  7652. * 1: retry
  7653. * 2: drop
  7654. * 3: filtered
  7655. * 4: abort
  7656. * 5: tid delete
  7657. * 6: sw abort
  7658. * 7: dropped by peer migration
  7659. */
  7660. status:3, /* [2:0] */
  7661. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7662. tx_mpdu_bytes:16, /* [19:4] */
  7663. /* Indicates retry count of offloaded/local generated Data tx frames */
  7664. tx_retry_cnt:6, /* [25:20] */
  7665. reserved_4:6; /* [31:26] */
  7666. } POSTPACK;
  7667. /* FW offload deliver ind message header fields */
  7668. /* DWORD one */
  7669. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7670. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7671. /* DWORD two */
  7672. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7673. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7674. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7675. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7676. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7677. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7678. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7679. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7680. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7681. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7682. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7683. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7684. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7685. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7686. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7687. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7688. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7689. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7690. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7691. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7692. /* DWORD three*/
  7693. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7694. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7695. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7696. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7697. /* DWORD four */
  7698. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7699. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7700. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7701. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7702. /* DWORD five */
  7703. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7704. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7705. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7706. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7707. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7708. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7709. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7710. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7711. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7712. do { \
  7713. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7714. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7715. } while (0)
  7716. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7717. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7718. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7719. do { \
  7720. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7721. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7722. } while (0)
  7723. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7724. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7725. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7726. do { \
  7727. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7728. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7729. } while (0)
  7730. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7731. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7732. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7733. do { \
  7734. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7735. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7736. } while (0)
  7737. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7738. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7739. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7742. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7743. } while (0)
  7744. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7745. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7746. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7747. do { \
  7748. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7749. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7750. } while (0)
  7751. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7752. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7753. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7754. do { \
  7755. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7756. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7757. } while (0)
  7758. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7759. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7760. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7761. do { \
  7762. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7763. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7764. } while (0)
  7765. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7766. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7767. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7770. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7771. } while (0)
  7772. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7773. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7774. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7775. do { \
  7776. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7777. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7778. } while (0)
  7779. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7780. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7781. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7782. do { \
  7783. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7784. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7785. } while (0)
  7786. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7787. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7788. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7791. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7792. } while (0)
  7793. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7794. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7795. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7798. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7799. } while (0)
  7800. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7801. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7802. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7805. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7806. } while (0)
  7807. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7808. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7809. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7810. do { \
  7811. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7812. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7813. } while (0)
  7814. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7815. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7816. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7817. do { \
  7818. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7819. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7820. } while (0)
  7821. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7822. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7823. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7824. do { \
  7825. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7826. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7827. } while (0)
  7828. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7829. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7830. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7831. do { \
  7832. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7833. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7834. } while (0)
  7835. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7836. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7837. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7838. do { \
  7839. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7840. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7841. } while (0)
  7842. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7843. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7844. /*
  7845. * @brief target -> host rx reorder flush message definition
  7846. *
  7847. * @details
  7848. * The following field definitions describe the format of the rx flush
  7849. * message sent from the target to the host.
  7850. * The message consists of a 4-octet header, followed by one or more
  7851. * 4-octet payload information elements.
  7852. *
  7853. * |31 24|23 8|7 0|
  7854. * |--------------------------------------------------------------|
  7855. * | TID | peer ID | msg type |
  7856. * |--------------------------------------------------------------|
  7857. * | seq num end | seq num start | MPDU status | reserved |
  7858. * |--------------------------------------------------------------|
  7859. * First DWORD:
  7860. * - MSG_TYPE
  7861. * Bits 7:0
  7862. * Purpose: identifies this as an rx flush message
  7863. * Value: 0x2
  7864. * - PEER_ID
  7865. * Bits 23:8 (only bits 18:8 actually used)
  7866. * Purpose: identify which peer's rx data is being flushed
  7867. * Value: (rx) peer ID
  7868. * - TID
  7869. * Bits 31:24 (only bits 27:24 actually used)
  7870. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7871. * Value: traffic identifier
  7872. * Second DWORD:
  7873. * - MPDU_STATUS
  7874. * Bits 15:8
  7875. * Purpose:
  7876. * Indicate whether the flushed MPDUs should be discarded or processed.
  7877. * Value:
  7878. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7879. * stages of rx processing
  7880. * other: discard the MPDUs
  7881. * It is anticipated that flush messages will always have
  7882. * MPDU status == 1, but the status flag is included for
  7883. * flexibility.
  7884. * - SEQ_NUM_START
  7885. * Bits 23:16
  7886. * Purpose:
  7887. * Indicate the start of a series of consecutive MPDUs being flushed.
  7888. * Not all MPDUs within this range are necessarily valid - the host
  7889. * must check each sequence number within this range to see if the
  7890. * corresponding MPDU is actually present.
  7891. * Value:
  7892. * The sequence number for the first MPDU in the sequence.
  7893. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7894. * - SEQ_NUM_END
  7895. * Bits 30:24
  7896. * Purpose:
  7897. * Indicate the end of a series of consecutive MPDUs being flushed.
  7898. * Value:
  7899. * The sequence number one larger than the sequence number of the
  7900. * last MPDU being flushed.
  7901. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7902. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7903. * are to be released for further rx processing.
  7904. * Not all MPDUs within this range are necessarily valid - the host
  7905. * must check each sequence number within this range to see if the
  7906. * corresponding MPDU is actually present.
  7907. */
  7908. /* first DWORD */
  7909. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7910. #define HTT_RX_FLUSH_PEER_ID_S 8
  7911. #define HTT_RX_FLUSH_TID_M 0xff000000
  7912. #define HTT_RX_FLUSH_TID_S 24
  7913. /* second DWORD */
  7914. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7915. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7916. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7917. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7918. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7919. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7920. #define HTT_RX_FLUSH_BYTES 8
  7921. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7922. do { \
  7923. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7924. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7925. } while (0)
  7926. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7927. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7928. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7929. do { \
  7930. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7931. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7932. } while (0)
  7933. #define HTT_RX_FLUSH_TID_GET(word) \
  7934. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7935. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7936. do { \
  7937. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7938. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7939. } while (0)
  7940. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7941. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7942. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7943. do { \
  7944. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7945. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7946. } while (0)
  7947. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7948. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7949. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7950. do { \
  7951. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7952. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7953. } while (0)
  7954. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7955. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7956. /*
  7957. * @brief target -> host rx pn check indication message
  7958. *
  7959. * @details
  7960. * The following field definitions describe the format of the Rx PN check
  7961. * indication message sent from the target to the host.
  7962. * The message consists of a 4-octet header, followed by the start and
  7963. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7964. * IE is one octet containing the sequence number that failed the PN
  7965. * check.
  7966. *
  7967. * |31 24|23 8|7 0|
  7968. * |--------------------------------------------------------------|
  7969. * | TID | peer ID | msg type |
  7970. * |--------------------------------------------------------------|
  7971. * | Reserved | PN IE count | seq num end | seq num start|
  7972. * |--------------------------------------------------------------|
  7973. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7974. * |--------------------------------------------------------------|
  7975. * First DWORD:
  7976. * - MSG_TYPE
  7977. * Bits 7:0
  7978. * Purpose: Identifies this as an rx pn check indication message
  7979. * Value: 0x2
  7980. * - PEER_ID
  7981. * Bits 23:8 (only bits 18:8 actually used)
  7982. * Purpose: identify which peer
  7983. * Value: (rx) peer ID
  7984. * - TID
  7985. * Bits 31:24 (only bits 27:24 actually used)
  7986. * Purpose: identify traffic identifier
  7987. * Value: traffic identifier
  7988. * Second DWORD:
  7989. * - SEQ_NUM_START
  7990. * Bits 7:0
  7991. * Purpose:
  7992. * Indicates the starting sequence number of the MPDU in this
  7993. * series of MPDUs that went though PN check.
  7994. * Value:
  7995. * The sequence number for the first MPDU in the sequence.
  7996. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7997. * - SEQ_NUM_END
  7998. * Bits 15:8
  7999. * Purpose:
  8000. * Indicates the ending sequence number of the MPDU in this
  8001. * series of MPDUs that went though PN check.
  8002. * Value:
  8003. * The sequence number one larger then the sequence number of the last
  8004. * MPDU being flushed.
  8005. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8006. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8007. * for invalid PN numbers and are ready to be released for further processing.
  8008. * Not all MPDUs within this range are necessarily valid - the host
  8009. * must check each sequence number within this range to see if the
  8010. * corresponding MPDU is actually present.
  8011. * - PN_IE_COUNT
  8012. * Bits 23:16
  8013. * Purpose:
  8014. * Used to determine the variable number of PN information elements in this
  8015. * message
  8016. *
  8017. * PN information elements:
  8018. * - PN_IE_x-
  8019. * Purpose:
  8020. * Each PN information element contains the sequence number of the MPDU that
  8021. * has failed the target PN check.
  8022. * Value:
  8023. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8024. * that failed the PN check.
  8025. */
  8026. /* first DWORD */
  8027. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8028. #define HTT_RX_PN_IND_PEER_ID_S 8
  8029. #define HTT_RX_PN_IND_TID_M 0xff000000
  8030. #define HTT_RX_PN_IND_TID_S 24
  8031. /* second DWORD */
  8032. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8033. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8034. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8035. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8036. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8037. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8038. #define HTT_RX_PN_IND_BYTES 8
  8039. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8040. do { \
  8041. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8042. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8043. } while (0)
  8044. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8045. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8046. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8047. do { \
  8048. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8049. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8050. } while (0)
  8051. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8052. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8053. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8054. do { \
  8055. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8056. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8057. } while (0)
  8058. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8059. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8060. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8061. do { \
  8062. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8063. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8064. } while (0)
  8065. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8066. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8067. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8068. do { \
  8069. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8070. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8071. } while (0)
  8072. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8073. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8074. /*
  8075. * @brief target -> host rx offload deliver message for LL system
  8076. *
  8077. * @details
  8078. * In a low latency system this message is sent whenever the offload
  8079. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8080. * The DMA of the actual packets into host memory is done before sending out
  8081. * this message. This message indicates only how many MSDUs to reap. The
  8082. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8083. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8084. * DMA'd by the MAC directly into host memory these packets do not contain
  8085. * the MAC descriptors in the header portion of the packet. Instead they contain
  8086. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8087. * message, the packets are delivered directly to the NW stack without going
  8088. * through the regular reorder buffering and PN checking path since it has
  8089. * already been done in target.
  8090. *
  8091. * |31 24|23 16|15 8|7 0|
  8092. * |-----------------------------------------------------------------------|
  8093. * | Total MSDU count | reserved | msg type |
  8094. * |-----------------------------------------------------------------------|
  8095. *
  8096. * @brief target -> host rx offload deliver message for HL system
  8097. *
  8098. * @details
  8099. * In a high latency system this message is sent whenever the offload manager
  8100. * flushes out the packets it has coalesced in its coalescing buffer. The
  8101. * actual packets are also carried along with this message. When the host
  8102. * receives this message, it is expected to deliver these packets to the NW
  8103. * stack directly instead of routing them through the reorder buffering and
  8104. * PN checking path since it has already been done in target.
  8105. *
  8106. * |31 24|23 16|15 8|7 0|
  8107. * |-----------------------------------------------------------------------|
  8108. * | Total MSDU count | reserved | msg type |
  8109. * |-----------------------------------------------------------------------|
  8110. * | peer ID | MSDU length |
  8111. * |-----------------------------------------------------------------------|
  8112. * | MSDU payload | FW Desc | tid | vdev ID |
  8113. * |-----------------------------------------------------------------------|
  8114. * | MSDU payload contd. |
  8115. * |-----------------------------------------------------------------------|
  8116. * | peer ID | MSDU length |
  8117. * |-----------------------------------------------------------------------|
  8118. * | MSDU payload | FW Desc | tid | vdev ID |
  8119. * |-----------------------------------------------------------------------|
  8120. * | MSDU payload contd. |
  8121. * |-----------------------------------------------------------------------|
  8122. *
  8123. */
  8124. /* first DWORD */
  8125. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8127. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8130. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8131. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8132. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8137. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8138. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8139. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8140. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8141. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8142. do { \
  8143. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8144. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8145. } while (0)
  8146. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8147. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8149. do { \
  8150. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8151. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8152. } while (0)
  8153. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8154. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8156. do { \
  8157. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8158. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8159. } while (0)
  8160. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8161. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8162. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8165. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8166. } while (0)
  8167. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8168. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8169. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8170. do { \
  8171. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8172. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8173. } while (0)
  8174. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8175. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8176. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8177. do { \
  8178. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8179. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8180. } while (0)
  8181. /**
  8182. * @brief target -> host rx peer map/unmap message definition
  8183. *
  8184. * @details
  8185. * The following diagram shows the format of the rx peer map message sent
  8186. * from the target to the host. This layout assumes the target operates
  8187. * as little-endian.
  8188. *
  8189. * This message always contains a SW peer ID. The main purpose of the
  8190. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8191. * with, so that the host can use that peer ID to determine which peer
  8192. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8193. * other purposes, such as identifying during tx completions which peer
  8194. * the tx frames in question were transmitted to.
  8195. *
  8196. * In certain generations of chips, the peer map message also contains
  8197. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8198. * to identify which peer the frame needs to be forwarded to (i.e. the
  8199. * peer assocated with the Destination MAC Address within the packet),
  8200. * and particularly which vdev needs to transmit the frame (for cases
  8201. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8202. * meaning as AST_INDEX_0.
  8203. * This DA-based peer ID that is provided for certain rx frames
  8204. * (the rx frames that need to be re-transmitted as tx frames)
  8205. * is the ID that the HW uses for referring to the peer in question,
  8206. * rather than the peer ID that the SW+FW use to refer to the peer.
  8207. *
  8208. *
  8209. * |31 24|23 16|15 8|7 0|
  8210. * |-----------------------------------------------------------------------|
  8211. * | SW peer ID | VDEV ID | msg type |
  8212. * |-----------------------------------------------------------------------|
  8213. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8214. * |-----------------------------------------------------------------------|
  8215. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8216. * |-----------------------------------------------------------------------|
  8217. *
  8218. *
  8219. * The following diagram shows the format of the rx peer unmap message sent
  8220. * from the target to the host.
  8221. *
  8222. * |31 24|23 16|15 8|7 0|
  8223. * |-----------------------------------------------------------------------|
  8224. * | SW peer ID | VDEV ID | msg type |
  8225. * |-----------------------------------------------------------------------|
  8226. *
  8227. * The following field definitions describe the format of the rx peer map
  8228. * and peer unmap messages sent from the target to the host.
  8229. * - MSG_TYPE
  8230. * Bits 7:0
  8231. * Purpose: identifies this as an rx peer map or peer unmap message
  8232. * Value: peer map -> 0x3, peer unmap -> 0x4
  8233. * - VDEV_ID
  8234. * Bits 15:8
  8235. * Purpose: Indicates which virtual device the peer is associated
  8236. * with.
  8237. * Value: vdev ID (used in the host to look up the vdev object)
  8238. * - PEER_ID (a.k.a. SW_PEER_ID)
  8239. * Bits 31:16
  8240. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8241. * freeing (unmap)
  8242. * Value: (rx) peer ID
  8243. * - MAC_ADDR_L32 (peer map only)
  8244. * Bits 31:0
  8245. * Purpose: Identifies which peer node the peer ID is for.
  8246. * Value: lower 4 bytes of peer node's MAC address
  8247. * - MAC_ADDR_U16 (peer map only)
  8248. * Bits 15:0
  8249. * Purpose: Identifies which peer node the peer ID is for.
  8250. * Value: upper 2 bytes of peer node's MAC address
  8251. * - HW_PEER_ID
  8252. * Bits 31:16
  8253. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8254. * address, so for rx frames marked for rx --> tx forwarding, the
  8255. * host can determine from the HW peer ID provided as meta-data with
  8256. * the rx frame which peer the frame is supposed to be forwarded to.
  8257. * Value: ID used by the MAC HW to identify the peer
  8258. */
  8259. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8260. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8261. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8262. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8263. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8264. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8265. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8266. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8267. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8268. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8269. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8270. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8271. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8272. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8275. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8276. } while (0)
  8277. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8278. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8279. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8280. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8281. do { \
  8282. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8283. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8284. } while (0)
  8285. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8286. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8287. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8288. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8289. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8290. do { \
  8291. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8292. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8293. } while (0)
  8294. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8295. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8296. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8297. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8298. #define HTT_RX_PEER_MAP_BYTES 12
  8299. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8300. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8301. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8302. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8303. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8304. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8305. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8306. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8307. #define HTT_RX_PEER_UNMAP_BYTES 4
  8308. /**
  8309. * @brief target -> host rx peer map V2 message definition
  8310. *
  8311. * @details
  8312. * The following diagram shows the format of the rx peer map v2 message sent
  8313. * from the target to the host. This layout assumes the target operates
  8314. * as little-endian.
  8315. *
  8316. * This message always contains a SW peer ID. The main purpose of the
  8317. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8318. * with, so that the host can use that peer ID to determine which peer
  8319. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8320. * other purposes, such as identifying during tx completions which peer
  8321. * the tx frames in question were transmitted to.
  8322. *
  8323. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8324. * is used during rx --> tx frame forwarding to identify which peer the
  8325. * frame needs to be forwarded to (i.e. the peer assocated with the
  8326. * Destination MAC Address within the packet), and particularly which vdev
  8327. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8328. * This DA-based peer ID that is provided for certain rx frames
  8329. * (the rx frames that need to be re-transmitted as tx frames)
  8330. * is the ID that the HW uses for referring to the peer in question,
  8331. * rather than the peer ID that the SW+FW use to refer to the peer.
  8332. *
  8333. * The HW peer id here is the same meaning as AST_INDEX_0.
  8334. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8335. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8336. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8337. * AST is valid.
  8338. *
  8339. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8340. * |-----------------------------------------------------------------------|
  8341. * | SW peer ID | VDEV ID | msg type |
  8342. * |-----------------------------------------------------------------------|
  8343. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8344. * |-----------------------------------------------------------------------|
  8345. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8346. * |-----------------------------------------------------------------------|
  8347. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8348. * |-----------------------------------------------------------------------|
  8349. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8350. * |-----------------------------------------------------------------------|
  8351. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8352. * |-----------------------------------------------------------------------|
  8353. * | Reserved_1 | AST index 3 |
  8354. * |-----------------------------------------------------------------------|
  8355. * | Reserved_2 |
  8356. * |-----------------------------------------------------------------------|
  8357. * Where:
  8358. * NH = Next Hop
  8359. * ASTVM = AST valid mask
  8360. * ASTFM = AST flow mask
  8361. *
  8362. * The following field definitions describe the format of the rx peer map v2
  8363. * messages sent from the target to the host.
  8364. * - MSG_TYPE
  8365. * Bits 7:0
  8366. * Purpose: identifies this as an rx peer map v2 message
  8367. * Value: peer map v2 -> 0x1e
  8368. * - VDEV_ID
  8369. * Bits 15:8
  8370. * Purpose: Indicates which virtual device the peer is associated with.
  8371. * Value: vdev ID (used in the host to look up the vdev object)
  8372. * - SW_PEER_ID
  8373. * Bits 31:16
  8374. * Purpose: The peer ID (index) that WAL is allocating
  8375. * Value: (rx) peer ID
  8376. * - MAC_ADDR_L32
  8377. * Bits 31:0
  8378. * Purpose: Identifies which peer node the peer ID is for.
  8379. * Value: lower 4 bytes of peer node's MAC address
  8380. * - MAC_ADDR_U16
  8381. * Bits 15:0
  8382. * Purpose: Identifies which peer node the peer ID is for.
  8383. * Value: upper 2 bytes of peer node's MAC address
  8384. * - HW_PEER_ID / AST_INDEX_0
  8385. * Bits 31:16
  8386. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8387. * address, so for rx frames marked for rx --> tx forwarding, the
  8388. * host can determine from the HW peer ID provided as meta-data with
  8389. * the rx frame which peer the frame is supposed to be forwarded to.
  8390. * Value: ID used by the MAC HW to identify the peer
  8391. * - AST_HASH_VALUE
  8392. * Bits 15:0
  8393. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8394. * override feature.
  8395. * - NEXT_HOP
  8396. * Bit 16
  8397. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8398. * (Wireless Distribution System).
  8399. * - AST_VALID_MASK
  8400. * Bits 19:17
  8401. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8402. * - AST_INDEX_1
  8403. * Bits 15:0
  8404. * Purpose: indicate the second AST index for this peer
  8405. * - AST_0_FLOW_MASK
  8406. * Bits 19:16
  8407. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8408. * - AST_1_FLOW_MASK
  8409. * Bits 23:20
  8410. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8411. * - AST_2_FLOW_MASK
  8412. * Bits 27:24
  8413. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8414. * - AST_3_FLOW_MASK
  8415. * Bits 31:28
  8416. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8417. * - AST_INDEX_2
  8418. * Bits 15:0
  8419. * Purpose: indicate the third AST index for this peer
  8420. * - TID_VALID_HI_PRI
  8421. * Bits 23:16
  8422. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8423. * - TID_VALID_LOW_PRI
  8424. * Bits 31:24
  8425. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8426. * - AST_INDEX_3
  8427. * Bits 15:0
  8428. * Purpose: indicate the fourth AST index for this peer
  8429. */
  8430. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8431. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8432. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8433. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8434. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8435. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8436. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8437. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8438. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8439. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8440. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8441. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8442. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8443. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8444. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8445. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8446. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8447. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8448. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8449. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8450. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8451. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8452. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8453. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8454. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8455. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8456. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8457. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8458. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8459. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8460. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8461. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8462. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8463. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8464. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8465. do { \
  8466. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8467. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8468. } while (0)
  8469. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8470. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8471. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8472. do { \
  8473. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8474. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8475. } while (0)
  8476. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8477. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8478. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8481. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8482. } while (0)
  8483. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8484. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8485. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8486. do { \
  8487. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8488. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8489. } while (0)
  8490. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8491. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8492. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8493. do { \
  8494. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8495. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8496. } while (0)
  8497. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8498. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8499. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8500. do { \
  8501. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8502. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8503. } while (0)
  8504. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8505. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8506. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8507. do { \
  8508. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8509. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8510. } while (0)
  8511. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8512. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8513. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8516. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8517. } while (0)
  8518. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8519. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8520. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8521. do { \
  8522. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8523. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8524. } while (0)
  8525. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8526. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8527. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8528. do { \
  8529. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8530. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8531. } while (0)
  8532. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8533. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8534. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8537. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8538. } while (0)
  8539. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8540. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8541. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8542. do { \
  8543. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8544. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8545. } while (0)
  8546. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8547. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8548. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8549. do { \
  8550. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8551. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8552. } while (0)
  8553. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8554. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8555. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8556. do { \
  8557. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8558. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8559. } while (0)
  8560. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8561. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8562. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8563. do { \
  8564. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8565. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8566. } while (0)
  8567. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8568. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8569. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8570. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8571. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8572. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8573. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8574. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8575. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8576. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8577. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8578. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8579. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8580. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8581. /**
  8582. * @brief target -> host rx peer unmap V2 message definition
  8583. *
  8584. *
  8585. * The following diagram shows the format of the rx peer unmap message sent
  8586. * from the target to the host.
  8587. *
  8588. * |31 24|23 16|15 8|7 0|
  8589. * |-----------------------------------------------------------------------|
  8590. * | SW peer ID | VDEV ID | msg type |
  8591. * |-----------------------------------------------------------------------|
  8592. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8593. * |-----------------------------------------------------------------------|
  8594. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8595. * |-----------------------------------------------------------------------|
  8596. * | Peer Delete Duration |
  8597. * |-----------------------------------------------------------------------|
  8598. * | Reserved_0 | WDS Free Count |
  8599. * |-----------------------------------------------------------------------|
  8600. * | Reserved_1 |
  8601. * |-----------------------------------------------------------------------|
  8602. * | Reserved_2 |
  8603. * |-----------------------------------------------------------------------|
  8604. *
  8605. *
  8606. * The following field definitions describe the format of the rx peer unmap
  8607. * messages sent from the target to the host.
  8608. * - MSG_TYPE
  8609. * Bits 7:0
  8610. * Purpose: identifies this as an rx peer unmap v2 message
  8611. * Value: peer unmap v2 -> 0x1f
  8612. * - VDEV_ID
  8613. * Bits 15:8
  8614. * Purpose: Indicates which virtual device the peer is associated
  8615. * with.
  8616. * Value: vdev ID (used in the host to look up the vdev object)
  8617. * - SW_PEER_ID
  8618. * Bits 31:16
  8619. * Purpose: The peer ID (index) that WAL is freeing
  8620. * Value: (rx) peer ID
  8621. * - MAC_ADDR_L32
  8622. * Bits 31:0
  8623. * Purpose: Identifies which peer node the peer ID is for.
  8624. * Value: lower 4 bytes of peer node's MAC address
  8625. * - MAC_ADDR_U16
  8626. * Bits 15:0
  8627. * Purpose: Identifies which peer node the peer ID is for.
  8628. * Value: upper 2 bytes of peer node's MAC address
  8629. * - NEXT_HOP
  8630. * Bits 16
  8631. * Purpose: Bit indicates next_hop AST entry used for WDS
  8632. * (Wireless Distribution System).
  8633. * - PEER_DELETE_DURATION
  8634. * Bits 31:0
  8635. * Purpose: Time taken to delete peer, in msec,
  8636. * Used for monitoring / debugging PEER delete response delay
  8637. * - PEER_WDS_FREE_COUNT
  8638. * Bits 15:0
  8639. * Purpose: Count of WDS entries deleted associated to peer deleted
  8640. */
  8641. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8642. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8643. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8644. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8645. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8646. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8647. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8648. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8649. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8650. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8651. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8652. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8653. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8654. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8655. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8656. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8657. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8658. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8659. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8660. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8661. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8662. do { \
  8663. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8664. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8665. } while (0)
  8666. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8667. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8668. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8669. do { \
  8670. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8671. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8672. } while (0)
  8673. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8674. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8675. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8676. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8677. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8678. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8679. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8680. /**
  8681. * @brief target -> host message specifying security parameters
  8682. *
  8683. * @details
  8684. * The following diagram shows the format of the security specification
  8685. * message sent from the target to the host.
  8686. * This security specification message tells the host whether a PN check is
  8687. * necessary on rx data frames, and if so, how large the PN counter is.
  8688. * This message also tells the host about the security processing to apply
  8689. * to defragmented rx frames - specifically, whether a Message Integrity
  8690. * Check is required, and the Michael key to use.
  8691. *
  8692. * |31 24|23 16|15|14 8|7 0|
  8693. * |-----------------------------------------------------------------------|
  8694. * | peer ID | U| security type | msg type |
  8695. * |-----------------------------------------------------------------------|
  8696. * | Michael Key K0 |
  8697. * |-----------------------------------------------------------------------|
  8698. * | Michael Key K1 |
  8699. * |-----------------------------------------------------------------------|
  8700. * | WAPI RSC Low0 |
  8701. * |-----------------------------------------------------------------------|
  8702. * | WAPI RSC Low1 |
  8703. * |-----------------------------------------------------------------------|
  8704. * | WAPI RSC Hi0 |
  8705. * |-----------------------------------------------------------------------|
  8706. * | WAPI RSC Hi1 |
  8707. * |-----------------------------------------------------------------------|
  8708. *
  8709. * The following field definitions describe the format of the security
  8710. * indication message sent from the target to the host.
  8711. * - MSG_TYPE
  8712. * Bits 7:0
  8713. * Purpose: identifies this as a security specification message
  8714. * Value: 0xb
  8715. * - SEC_TYPE
  8716. * Bits 14:8
  8717. * Purpose: specifies which type of security applies to the peer
  8718. * Value: htt_sec_type enum value
  8719. * - UNICAST
  8720. * Bit 15
  8721. * Purpose: whether this security is applied to unicast or multicast data
  8722. * Value: 1 -> unicast, 0 -> multicast
  8723. * - PEER_ID
  8724. * Bits 31:16
  8725. * Purpose: The ID number for the peer the security specification is for
  8726. * Value: peer ID
  8727. * - MICHAEL_KEY_K0
  8728. * Bits 31:0
  8729. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8730. * Value: Michael Key K0 (if security type is TKIP)
  8731. * - MICHAEL_KEY_K1
  8732. * Bits 31:0
  8733. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8734. * Value: Michael Key K1 (if security type is TKIP)
  8735. * - WAPI_RSC_LOW0
  8736. * Bits 31:0
  8737. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8738. * Value: WAPI RSC Low0 (if security type is WAPI)
  8739. * - WAPI_RSC_LOW1
  8740. * Bits 31:0
  8741. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8742. * Value: WAPI RSC Low1 (if security type is WAPI)
  8743. * - WAPI_RSC_HI0
  8744. * Bits 31:0
  8745. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8746. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8747. * - WAPI_RSC_HI1
  8748. * Bits 31:0
  8749. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8750. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8751. */
  8752. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8753. #define HTT_SEC_IND_SEC_TYPE_S 8
  8754. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8755. #define HTT_SEC_IND_UNICAST_S 15
  8756. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8757. #define HTT_SEC_IND_PEER_ID_S 16
  8758. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8759. do { \
  8760. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8761. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8762. } while (0)
  8763. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8764. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8765. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8766. do { \
  8767. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8768. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8769. } while (0)
  8770. #define HTT_SEC_IND_UNICAST_GET(word) \
  8771. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8772. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8773. do { \
  8774. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8775. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8776. } while (0)
  8777. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8778. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8779. #define HTT_SEC_IND_BYTES 28
  8780. /**
  8781. * @brief target -> host rx ADDBA / DELBA message definitions
  8782. *
  8783. * @details
  8784. * The following diagram shows the format of the rx ADDBA message sent
  8785. * from the target to the host:
  8786. *
  8787. * |31 20|19 16|15 8|7 0|
  8788. * |---------------------------------------------------------------------|
  8789. * | peer ID | TID | window size | msg type |
  8790. * |---------------------------------------------------------------------|
  8791. *
  8792. * The following diagram shows the format of the rx DELBA message sent
  8793. * from the target to the host:
  8794. *
  8795. * |31 20|19 16|15 10|9 8|7 0|
  8796. * |---------------------------------------------------------------------|
  8797. * | peer ID | TID | window size | IR| msg type |
  8798. * |---------------------------------------------------------------------|
  8799. *
  8800. * The following field definitions describe the format of the rx ADDBA
  8801. * and DELBA messages sent from the target to the host.
  8802. * - MSG_TYPE
  8803. * Bits 7:0
  8804. * Purpose: identifies this as an rx ADDBA or DELBA message
  8805. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8806. * - IR (initiator / recipient)
  8807. * Bits 9:8 (DELBA only)
  8808. * Purpose: specify whether the DELBA handshake was initiated by the
  8809. * local STA/AP, or by the peer STA/AP
  8810. * Value:
  8811. * 0 - unspecified
  8812. * 1 - initiator (a.k.a. originator)
  8813. * 2 - recipient (a.k.a. responder)
  8814. * 3 - unused / reserved
  8815. * - WIN_SIZE
  8816. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8817. * Purpose: Specifies the length of the block ack window (max = 64).
  8818. * Value:
  8819. * block ack window length specified by the received ADDBA/DELBA
  8820. * management message.
  8821. * - TID
  8822. * Bits 19:16
  8823. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8824. * Value:
  8825. * TID specified by the received ADDBA or DELBA management message.
  8826. * - PEER_ID
  8827. * Bits 31:20
  8828. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8829. * Value:
  8830. * ID (hash value) used by the host for fast, direct lookup of
  8831. * host SW peer info, including rx reorder states.
  8832. */
  8833. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8834. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8835. #define HTT_RX_ADDBA_TID_M 0xf0000
  8836. #define HTT_RX_ADDBA_TID_S 16
  8837. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8838. #define HTT_RX_ADDBA_PEER_ID_S 20
  8839. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8840. do { \
  8841. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8842. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8843. } while (0)
  8844. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8845. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8846. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8847. do { \
  8848. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8849. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8850. } while (0)
  8851. #define HTT_RX_ADDBA_TID_GET(word) \
  8852. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8853. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8854. do { \
  8855. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8856. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8857. } while (0)
  8858. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8859. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8860. #define HTT_RX_ADDBA_BYTES 4
  8861. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8862. #define HTT_RX_DELBA_INITIATOR_S 8
  8863. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8864. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8865. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8866. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8867. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8868. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8869. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8870. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8871. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8872. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8873. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8874. do { \
  8875. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8876. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8877. } while (0)
  8878. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8879. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8880. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8881. do { \
  8882. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8883. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8884. } while (0)
  8885. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8886. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8887. #define HTT_RX_DELBA_BYTES 4
  8888. /**
  8889. * @brief tx queue group information element definition
  8890. *
  8891. * @details
  8892. * The following diagram shows the format of the tx queue group
  8893. * information element, which can be included in target --> host
  8894. * messages to specify the number of tx "credits" (tx descriptors
  8895. * for LL, or tx buffers for HL) available to a particular group
  8896. * of host-side tx queues, and which host-side tx queues belong to
  8897. * the group.
  8898. *
  8899. * |31|30 24|23 16|15|14|13 0|
  8900. * |------------------------------------------------------------------------|
  8901. * | X| reserved | tx queue grp ID | A| S| credit count |
  8902. * |------------------------------------------------------------------------|
  8903. * | vdev ID mask | AC mask |
  8904. * |------------------------------------------------------------------------|
  8905. *
  8906. * The following definitions describe the fields within the tx queue group
  8907. * information element:
  8908. * - credit_count
  8909. * Bits 13:1
  8910. * Purpose: specify how many tx credits are available to the tx queue group
  8911. * Value: An absolute or relative, positive or negative credit value
  8912. * The 'A' bit specifies whether the value is absolute or relative.
  8913. * The 'S' bit specifies whether the value is positive or negative.
  8914. * A negative value can only be relative, not absolute.
  8915. * An absolute value replaces any prior credit value the host has for
  8916. * the tx queue group in question.
  8917. * A relative value is added to the prior credit value the host has for
  8918. * the tx queue group in question.
  8919. * - sign
  8920. * Bit 14
  8921. * Purpose: specify whether the credit count is positive or negative
  8922. * Value: 0 -> positive, 1 -> negative
  8923. * - absolute
  8924. * Bit 15
  8925. * Purpose: specify whether the credit count is absolute or relative
  8926. * Value: 0 -> relative, 1 -> absolute
  8927. * - txq_group_id
  8928. * Bits 23:16
  8929. * Purpose: indicate which tx queue group's credit and/or membership are
  8930. * being specified
  8931. * Value: 0 to max_tx_queue_groups-1
  8932. * - reserved
  8933. * Bits 30:16
  8934. * Value: 0x0
  8935. * - eXtension
  8936. * Bit 31
  8937. * Purpose: specify whether another tx queue group info element follows
  8938. * Value: 0 -> no more tx queue group information elements
  8939. * 1 -> another tx queue group information element immediately follows
  8940. * - ac_mask
  8941. * Bits 15:0
  8942. * Purpose: specify which Access Categories belong to the tx queue group
  8943. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8944. * the tx queue group.
  8945. * The AC bit-mask values are obtained by left-shifting by the
  8946. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8947. * - vdev_id_mask
  8948. * Bits 31:16
  8949. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8950. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8951. * belong to the tx queue group.
  8952. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8953. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8954. */
  8955. PREPACK struct htt_txq_group {
  8956. A_UINT32
  8957. credit_count: 14,
  8958. sign: 1,
  8959. absolute: 1,
  8960. tx_queue_group_id: 8,
  8961. reserved0: 7,
  8962. extension: 1;
  8963. A_UINT32
  8964. ac_mask: 16,
  8965. vdev_id_mask: 16;
  8966. } POSTPACK;
  8967. /* first word */
  8968. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8969. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8970. #define HTT_TXQ_GROUP_SIGN_S 14
  8971. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8972. #define HTT_TXQ_GROUP_ABS_S 15
  8973. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8974. #define HTT_TXQ_GROUP_ID_S 16
  8975. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8976. #define HTT_TXQ_GROUP_EXT_S 31
  8977. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8978. /* second word */
  8979. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8980. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8981. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8982. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8983. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8986. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8987. } while (0)
  8988. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8989. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8990. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8993. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8994. } while (0)
  8995. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8996. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8997. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8998. do { \
  8999. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9000. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9001. } while (0)
  9002. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9003. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9004. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9005. do { \
  9006. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9007. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9008. } while (0)
  9009. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9010. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9011. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9012. do { \
  9013. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9014. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9015. } while (0)
  9016. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9017. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9018. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9019. do { \
  9020. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9021. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9022. } while (0)
  9023. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9024. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9025. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9026. do { \
  9027. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9028. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9029. } while (0)
  9030. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9031. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9032. /**
  9033. * @brief target -> host TX completion indication message definition
  9034. *
  9035. * @details
  9036. * The following diagram shows the format of the TX completion indication sent
  9037. * from the target to the host
  9038. *
  9039. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9040. * |-------------------------------------------------------------------|
  9041. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9042. * |-------------------------------------------------------------------|
  9043. * payload:| MSDU1 ID | MSDU0 ID |
  9044. * |-------------------------------------------------------------------|
  9045. * : MSDU3 ID | MSDU2 ID :
  9046. * |-------------------------------------------------------------------|
  9047. * | struct htt_tx_compl_ind_append_retries |
  9048. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9049. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9050. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9051. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9052. * |-------------------------------------------------------------------|
  9053. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9054. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9055. * | MSDU0 tx_tsf64_low |
  9056. * |-------------------------------------------------------------------|
  9057. * | MSDU0 tx_tsf64_high |
  9058. * |-------------------------------------------------------------------|
  9059. * | MSDU1 tx_tsf64_low |
  9060. * |-------------------------------------------------------------------|
  9061. * | MSDU1 tx_tsf64_high |
  9062. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9063. * | phy_timestamp |
  9064. * |-------------------------------------------------------------------|
  9065. * | rate specs (see below) |
  9066. * |-------------------------------------------------------------------|
  9067. * | seqctrl | framectrl |
  9068. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9069. * Where:
  9070. * A0 = append (a.k.a. append0)
  9071. * A1 = append1
  9072. * TP = MSDU tx power presence
  9073. * A2 = append2
  9074. * A3 = append3
  9075. * A4 = append4
  9076. *
  9077. * The following field definitions describe the format of the TX completion
  9078. * indication sent from the target to the host
  9079. * Header fields:
  9080. * - msg_type
  9081. * Bits 7:0
  9082. * Purpose: identifies this as HTT TX completion indication
  9083. * Value: 0x7
  9084. * - status
  9085. * Bits 10:8
  9086. * Purpose: the TX completion status of payload fragmentations descriptors
  9087. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9088. * - tid
  9089. * Bits 14:11
  9090. * Purpose: the tid associated with those fragmentation descriptors. It is
  9091. * valid or not, depending on the tid_invalid bit.
  9092. * Value: 0 to 15
  9093. * - tid_invalid
  9094. * Bits 15:15
  9095. * Purpose: this bit indicates whether the tid field is valid or not
  9096. * Value: 0 indicates valid; 1 indicates invalid
  9097. * - num
  9098. * Bits 23:16
  9099. * Purpose: the number of payload in this indication
  9100. * Value: 1 to 255
  9101. * - append (a.k.a. append0)
  9102. * Bits 24:24
  9103. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9104. * the number of tx retries for one MSDU at the end of this message
  9105. * Value: 0 indicates no appending; 1 indicates appending
  9106. * - append1
  9107. * Bits 25:25
  9108. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9109. * contains the timestamp info for each TX msdu id in payload.
  9110. * The order of the timestamps matches the order of the MSDU IDs.
  9111. * Note that a big-endian host needs to account for the reordering
  9112. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9113. * conversion) when determining which tx timestamp corresponds to
  9114. * which MSDU ID.
  9115. * Value: 0 indicates no appending; 1 indicates appending
  9116. * - msdu_tx_power_presence
  9117. * Bits 26:26
  9118. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9119. * for each MSDU referenced by the TX_COMPL_IND message.
  9120. * The tx power is reported in 0.5 dBm units.
  9121. * The order of the per-MSDU tx power reports matches the order
  9122. * of the MSDU IDs.
  9123. * Note that a big-endian host needs to account for the reordering
  9124. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9125. * conversion) when determining which Tx Power corresponds to
  9126. * which MSDU ID.
  9127. * Value: 0 indicates MSDU tx power reports are not appended,
  9128. * 1 indicates MSDU tx power reports are appended
  9129. * - append2
  9130. * Bits 27:27
  9131. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9132. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9133. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9134. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9135. * for each MSDU, for convenience.
  9136. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9137. * this append2 bit is set).
  9138. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9139. * dB above the noise floor.
  9140. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9141. * 1 indicates MSDU ACK RSSI values are appended.
  9142. * - append3
  9143. * Bits 28:28
  9144. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9145. * contains the tx tsf info based on wlan global TSF for
  9146. * each TX msdu id in payload.
  9147. * The order of the tx tsf matches the order of the MSDU IDs.
  9148. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9149. * values to indicate the the lower 32 bits and higher 32 bits of
  9150. * the tx tsf.
  9151. * The tx_tsf64 here represents the time MSDU was acked and the
  9152. * tx_tsf64 has microseconds units.
  9153. * Value: 0 indicates no appending; 1 indicates appending
  9154. * - append4
  9155. * Bits 29:29
  9156. * Purpose: Indicate whether data frame control fields and fields required
  9157. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9158. * message. The order of the this message matches the order of
  9159. * the MSDU IDs.
  9160. * Value: 0 indicates frame control fields and fields required for
  9161. * radio tap header values are not appended,
  9162. * 1 indicates frame control fields and fields required for
  9163. * radio tap header values are appended.
  9164. * Payload fields:
  9165. * - hmsdu_id
  9166. * Bits 15:0
  9167. * Purpose: this ID is used to track the Tx buffer in host
  9168. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9169. */
  9170. PREPACK struct htt_tx_data_hdr_information {
  9171. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9172. A_UINT32 /* word 1 */
  9173. /* preamble:
  9174. * 0-OFDM,
  9175. * 1-CCk,
  9176. * 2-HT,
  9177. * 3-VHT
  9178. */
  9179. preamble: 2, /* [1:0] */
  9180. /* mcs:
  9181. * In case of HT preamble interpret
  9182. * MCS along with NSS.
  9183. * Valid values for HT are 0 to 7.
  9184. * HT mcs 0 with NSS 2 is mcs 8.
  9185. * Valid values for VHT are 0 to 9.
  9186. */
  9187. mcs: 4, /* [5:2] */
  9188. /* rate:
  9189. * This is applicable only for
  9190. * CCK and OFDM preamble type
  9191. * rate 0: OFDM 48 Mbps,
  9192. * 1: OFDM 24 Mbps,
  9193. * 2: OFDM 12 Mbps
  9194. * 3: OFDM 6 Mbps
  9195. * 4: OFDM 54 Mbps
  9196. * 5: OFDM 36 Mbps
  9197. * 6: OFDM 18 Mbps
  9198. * 7: OFDM 9 Mbps
  9199. * rate 0: CCK 11 Mbps Long
  9200. * 1: CCK 5.5 Mbps Long
  9201. * 2: CCK 2 Mbps Long
  9202. * 3: CCK 1 Mbps Long
  9203. * 4: CCK 11 Mbps Short
  9204. * 5: CCK 5.5 Mbps Short
  9205. * 6: CCK 2 Mbps Short
  9206. */
  9207. rate : 3, /* [ 8: 6] */
  9208. rssi : 8, /* [16: 9] units=dBm */
  9209. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9210. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9211. stbc : 1, /* [22] */
  9212. sgi : 1, /* [23] */
  9213. ldpc : 1, /* [24] */
  9214. beamformed: 1, /* [25] */
  9215. /* tx_retry_cnt:
  9216. * Indicates retry count of data tx frames provided by the host.
  9217. */
  9218. tx_retry_cnt: 6; /* [31:26] */
  9219. A_UINT32 /* word 2 */
  9220. framectrl:16, /* [15: 0] */
  9221. seqno:16; /* [31:16] */
  9222. } POSTPACK;
  9223. #define HTT_TX_COMPL_IND_STATUS_S 8
  9224. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9225. #define HTT_TX_COMPL_IND_TID_S 11
  9226. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9227. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9228. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9229. #define HTT_TX_COMPL_IND_NUM_S 16
  9230. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9231. #define HTT_TX_COMPL_IND_APPEND_S 24
  9232. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9233. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9234. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9235. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9236. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9237. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9238. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9239. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9240. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9241. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9242. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9243. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9244. do { \
  9245. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9246. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9247. } while (0)
  9248. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9249. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9250. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9251. do { \
  9252. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9253. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9254. } while (0)
  9255. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9256. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9257. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9258. do { \
  9259. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9260. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9261. } while (0)
  9262. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9263. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9264. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9265. do { \
  9266. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9267. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9268. } while (0)
  9269. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9270. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9271. HTT_TX_COMPL_IND_TID_INV_S)
  9272. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9273. do { \
  9274. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9275. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9276. } while (0)
  9277. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9278. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9279. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9280. do { \
  9281. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9282. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9283. } while (0)
  9284. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9285. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9286. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9287. do { \
  9288. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9289. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9290. } while (0)
  9291. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9292. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9293. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9294. do { \
  9295. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9296. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9297. } while (0)
  9298. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9299. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9300. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9301. do { \
  9302. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9303. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9304. } while (0)
  9305. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9306. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9307. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9308. do { \
  9309. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9310. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9311. } while (0)
  9312. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9313. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9314. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9315. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9316. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9317. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9318. #define HTT_TX_COMPL_IND_STAT_OK 0
  9319. /* DISCARD:
  9320. * current meaning:
  9321. * MSDUs were queued for transmission but filtered by HW or SW
  9322. * without any over the air attempts
  9323. * legacy meaning (HL Rome):
  9324. * MSDUs were discarded by the target FW without any over the air
  9325. * attempts due to lack of space
  9326. */
  9327. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9328. /* NO_ACK:
  9329. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9330. */
  9331. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9332. /* POSTPONE:
  9333. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9334. * be downloaded again later (in the appropriate order), when they are
  9335. * deliverable.
  9336. */
  9337. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9338. /*
  9339. * The PEER_DEL tx completion status is used for HL cases
  9340. * where the peer the frame is for has been deleted.
  9341. * The host has already discarded its copy of the frame, but
  9342. * it still needs the tx completion to restore its credit.
  9343. */
  9344. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9345. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9346. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9347. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9348. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9349. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9350. PREPACK struct htt_tx_compl_ind_base {
  9351. A_UINT32 hdr;
  9352. A_UINT16 payload[1/*or more*/];
  9353. } POSTPACK;
  9354. PREPACK struct htt_tx_compl_ind_append_retries {
  9355. A_UINT16 msdu_id;
  9356. A_UINT8 tx_retries;
  9357. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9358. 0: this is the last append_retries struct */
  9359. } POSTPACK;
  9360. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9361. A_UINT32 timestamp[1/*or more*/];
  9362. } POSTPACK;
  9363. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9364. A_UINT32 tx_tsf64_low;
  9365. A_UINT32 tx_tsf64_high;
  9366. } POSTPACK;
  9367. /* htt_tx_data_hdr_information payload extension fields: */
  9368. /* DWORD zero */
  9369. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9370. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9371. /* DWORD one */
  9372. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9373. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9374. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9375. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9376. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9377. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9378. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9379. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9380. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9381. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9382. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9383. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9384. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9385. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9386. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9387. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9388. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9389. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9390. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9391. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9392. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9393. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9394. /* DWORD two */
  9395. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9396. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9397. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9398. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9399. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9402. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9403. } while (0)
  9404. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9405. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9406. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9407. do { \
  9408. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9409. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9410. } while (0)
  9411. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9412. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9413. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9414. do { \
  9415. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9416. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9417. } while (0)
  9418. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9419. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9420. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9421. do { \
  9422. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9423. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9424. } while (0)
  9425. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9426. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9427. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9430. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9431. } while (0)
  9432. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9433. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9434. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9437. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9438. } while (0)
  9439. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9440. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9441. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9444. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9445. } while (0)
  9446. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9447. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9448. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9451. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9452. } while (0)
  9453. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9454. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9455. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9458. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9459. } while (0)
  9460. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9461. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9462. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9463. do { \
  9464. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9465. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9466. } while (0)
  9467. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9468. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9469. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9470. do { \
  9471. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9472. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9473. } while (0)
  9474. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9475. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9476. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9477. do { \
  9478. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9479. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9480. } while (0)
  9481. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9482. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9483. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9484. do { \
  9485. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9486. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9487. } while (0)
  9488. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9489. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9490. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9491. do { \
  9492. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9493. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9494. } while (0)
  9495. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9496. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9497. /**
  9498. * @brief target -> host rate-control update indication message
  9499. *
  9500. * @details
  9501. * The following diagram shows the format of the RC Update message
  9502. * sent from the target to the host, while processing the tx-completion
  9503. * of a transmitted PPDU.
  9504. *
  9505. * |31 24|23 16|15 8|7 0|
  9506. * |-------------------------------------------------------------|
  9507. * | peer ID | vdev ID | msg_type |
  9508. * |-------------------------------------------------------------|
  9509. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9510. * |-------------------------------------------------------------|
  9511. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9512. * |-------------------------------------------------------------|
  9513. * | : |
  9514. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9515. * | : |
  9516. * |-------------------------------------------------------------|
  9517. * | : |
  9518. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9519. * | : |
  9520. * |-------------------------------------------------------------|
  9521. * : :
  9522. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9523. *
  9524. */
  9525. typedef struct {
  9526. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9527. A_UINT32 rate_code_flags;
  9528. A_UINT32 flags; /* Encodes information such as excessive
  9529. retransmission, aggregate, some info
  9530. from .11 frame control,
  9531. STBC, LDPC, (SGI and Tx Chain Mask
  9532. are encoded in ptx_rc->flags field),
  9533. AMPDU truncation (BT/time based etc.),
  9534. RTS/CTS attempt */
  9535. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9536. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9537. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9538. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9539. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9540. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9541. } HTT_RC_TX_DONE_PARAMS;
  9542. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9543. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9544. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9545. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9546. #define HTT_RC_UPDATE_VDEVID_S 8
  9547. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9548. #define HTT_RC_UPDATE_PEERID_S 16
  9549. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9550. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9551. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9552. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9553. do { \
  9554. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9555. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9556. } while (0)
  9557. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9558. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9559. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9560. do { \
  9561. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9562. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9563. } while (0)
  9564. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9565. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9566. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9569. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9570. } while (0)
  9571. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9572. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9573. /**
  9574. * @brief target -> host rx fragment indication message definition
  9575. *
  9576. * @details
  9577. * The following field definitions describe the format of the rx fragment
  9578. * indication message sent from the target to the host.
  9579. * The rx fragment indication message shares the format of the
  9580. * rx indication message, but not all fields from the rx indication message
  9581. * are relevant to the rx fragment indication message.
  9582. *
  9583. *
  9584. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9585. * |-----------+-------------------+---------------------+-------------|
  9586. * | peer ID | |FV| ext TID | msg type |
  9587. * |-------------------------------------------------------------------|
  9588. * | | flush | flush |
  9589. * | | end | start |
  9590. * | | seq num | seq num |
  9591. * |-------------------------------------------------------------------|
  9592. * | reserved | FW rx desc bytes |
  9593. * |-------------------------------------------------------------------|
  9594. * | | FW MSDU Rx |
  9595. * | | desc B0 |
  9596. * |-------------------------------------------------------------------|
  9597. * Header fields:
  9598. * - MSG_TYPE
  9599. * Bits 7:0
  9600. * Purpose: identifies this as an rx fragment indication message
  9601. * Value: 0xa
  9602. * - EXT_TID
  9603. * Bits 12:8
  9604. * Purpose: identify the traffic ID of the rx data, including
  9605. * special "extended" TID values for multicast, broadcast, and
  9606. * non-QoS data frames
  9607. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9608. * - FLUSH_VALID (FV)
  9609. * Bit 13
  9610. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9611. * is valid
  9612. * Value:
  9613. * 1 -> flush IE is valid and needs to be processed
  9614. * 0 -> flush IE is not valid and should be ignored
  9615. * - PEER_ID
  9616. * Bits 31:16
  9617. * Purpose: Identify, by ID, which peer sent the rx data
  9618. * Value: ID of the peer who sent the rx data
  9619. * - FLUSH_SEQ_NUM_START
  9620. * Bits 5:0
  9621. * Purpose: Indicate the start of a series of MPDUs to flush
  9622. * Not all MPDUs within this series are necessarily valid - the host
  9623. * must check each sequence number within this range to see if the
  9624. * corresponding MPDU is actually present.
  9625. * This field is only valid if the FV bit is set.
  9626. * Value:
  9627. * The sequence number for the first MPDUs to check to flush.
  9628. * The sequence number is masked by 0x3f.
  9629. * - FLUSH_SEQ_NUM_END
  9630. * Bits 11:6
  9631. * Purpose: Indicate the end of a series of MPDUs to flush
  9632. * Value:
  9633. * The sequence number one larger than the sequence number of the
  9634. * last MPDU to check to flush.
  9635. * The sequence number is masked by 0x3f.
  9636. * Not all MPDUs within this series are necessarily valid - the host
  9637. * must check each sequence number within this range to see if the
  9638. * corresponding MPDU is actually present.
  9639. * This field is only valid if the FV bit is set.
  9640. * Rx descriptor fields:
  9641. * - FW_RX_DESC_BYTES
  9642. * Bits 15:0
  9643. * Purpose: Indicate how many bytes in the Rx indication are used for
  9644. * FW Rx descriptors
  9645. * Value: 1
  9646. */
  9647. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9648. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9649. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9650. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9651. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9652. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9653. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9654. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9655. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9656. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9657. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9658. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9659. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9660. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9661. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9662. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9663. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9664. #define HTT_RX_FRAG_IND_BYTES \
  9665. (4 /* msg hdr */ + \
  9666. 4 /* flush spec */ + \
  9667. 4 /* (unused) FW rx desc bytes spec */ + \
  9668. 4 /* FW rx desc */)
  9669. /**
  9670. * @brief target -> host test message definition
  9671. *
  9672. * @details
  9673. * The following field definitions describe the format of the test
  9674. * message sent from the target to the host.
  9675. * The message consists of a 4-octet header, followed by a variable
  9676. * number of 32-bit integer values, followed by a variable number
  9677. * of 8-bit character values.
  9678. *
  9679. * |31 16|15 8|7 0|
  9680. * |-----------------------------------------------------------|
  9681. * | num chars | num ints | msg type |
  9682. * |-----------------------------------------------------------|
  9683. * | int 0 |
  9684. * |-----------------------------------------------------------|
  9685. * | int 1 |
  9686. * |-----------------------------------------------------------|
  9687. * | ... |
  9688. * |-----------------------------------------------------------|
  9689. * | char 3 | char 2 | char 1 | char 0 |
  9690. * |-----------------------------------------------------------|
  9691. * | | | ... | char 4 |
  9692. * |-----------------------------------------------------------|
  9693. * - MSG_TYPE
  9694. * Bits 7:0
  9695. * Purpose: identifies this as a test message
  9696. * Value: HTT_MSG_TYPE_TEST
  9697. * - NUM_INTS
  9698. * Bits 15:8
  9699. * Purpose: indicate how many 32-bit integers follow the message header
  9700. * - NUM_CHARS
  9701. * Bits 31:16
  9702. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9703. */
  9704. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9705. #define HTT_RX_TEST_NUM_INTS_S 8
  9706. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9707. #define HTT_RX_TEST_NUM_CHARS_S 16
  9708. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9709. do { \
  9710. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9711. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9712. } while (0)
  9713. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9714. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9715. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9716. do { \
  9717. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9718. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9719. } while (0)
  9720. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9721. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9722. /**
  9723. * @brief target -> host packet log message
  9724. *
  9725. * @details
  9726. * The following field definitions describe the format of the packet log
  9727. * message sent from the target to the host.
  9728. * The message consists of a 4-octet header,followed by a variable number
  9729. * of 32-bit character values.
  9730. *
  9731. * |31 16|15 12|11 10|9 8|7 0|
  9732. * |------------------------------------------------------------------|
  9733. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9734. * |------------------------------------------------------------------|
  9735. * | payload |
  9736. * |------------------------------------------------------------------|
  9737. * - MSG_TYPE
  9738. * Bits 7:0
  9739. * Purpose: identifies this as a pktlog message
  9740. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9741. * - mac_id
  9742. * Bits 9:8
  9743. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9744. * Value: 0-3
  9745. * - pdev_id
  9746. * Bits 11:10
  9747. * Purpose: pdev_id
  9748. * Value: 0-3
  9749. * 0 (for rings at SOC level),
  9750. * 1/2/3 PDEV -> 0/1/2
  9751. * - payload_size
  9752. * Bits 31:16
  9753. * Purpose: explicitly specify the payload size
  9754. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9755. */
  9756. PREPACK struct htt_pktlog_msg {
  9757. A_UINT32 header;
  9758. A_UINT32 payload[1/* or more */];
  9759. } POSTPACK;
  9760. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9761. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9762. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9763. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9764. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9765. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9766. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9767. do { \
  9768. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9769. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9770. } while (0)
  9771. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9772. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9773. HTT_T2H_PKTLOG_MAC_ID_S)
  9774. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9775. do { \
  9776. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9777. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9778. } while (0)
  9779. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9780. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9781. HTT_T2H_PKTLOG_PDEV_ID_S)
  9782. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9783. do { \
  9784. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9785. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9786. } while (0)
  9787. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9788. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9789. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9790. /*
  9791. * Rx reorder statistics
  9792. * NB: all the fields must be defined in 4 octets size.
  9793. */
  9794. struct rx_reorder_stats {
  9795. /* Non QoS MPDUs received */
  9796. A_UINT32 deliver_non_qos;
  9797. /* MPDUs received in-order */
  9798. A_UINT32 deliver_in_order;
  9799. /* Flush due to reorder timer expired */
  9800. A_UINT32 deliver_flush_timeout;
  9801. /* Flush due to move out of window */
  9802. A_UINT32 deliver_flush_oow;
  9803. /* Flush due to DELBA */
  9804. A_UINT32 deliver_flush_delba;
  9805. /* MPDUs dropped due to FCS error */
  9806. A_UINT32 fcs_error;
  9807. /* MPDUs dropped due to monitor mode non-data packet */
  9808. A_UINT32 mgmt_ctrl;
  9809. /* Unicast-data MPDUs dropped due to invalid peer */
  9810. A_UINT32 invalid_peer;
  9811. /* MPDUs dropped due to duplication (non aggregation) */
  9812. A_UINT32 dup_non_aggr;
  9813. /* MPDUs dropped due to processed before */
  9814. A_UINT32 dup_past;
  9815. /* MPDUs dropped due to duplicate in reorder queue */
  9816. A_UINT32 dup_in_reorder;
  9817. /* Reorder timeout happened */
  9818. A_UINT32 reorder_timeout;
  9819. /* invalid bar ssn */
  9820. A_UINT32 invalid_bar_ssn;
  9821. /* reorder reset due to bar ssn */
  9822. A_UINT32 ssn_reset;
  9823. /* Flush due to delete peer */
  9824. A_UINT32 deliver_flush_delpeer;
  9825. /* Flush due to offload*/
  9826. A_UINT32 deliver_flush_offload;
  9827. /* Flush due to out of buffer*/
  9828. A_UINT32 deliver_flush_oob;
  9829. /* MPDUs dropped due to PN check fail */
  9830. A_UINT32 pn_fail;
  9831. /* MPDUs dropped due to unable to allocate memory */
  9832. A_UINT32 store_fail;
  9833. /* Number of times the tid pool alloc succeeded */
  9834. A_UINT32 tid_pool_alloc_succ;
  9835. /* Number of times the MPDU pool alloc succeeded */
  9836. A_UINT32 mpdu_pool_alloc_succ;
  9837. /* Number of times the MSDU pool alloc succeeded */
  9838. A_UINT32 msdu_pool_alloc_succ;
  9839. /* Number of times the tid pool alloc failed */
  9840. A_UINT32 tid_pool_alloc_fail;
  9841. /* Number of times the MPDU pool alloc failed */
  9842. A_UINT32 mpdu_pool_alloc_fail;
  9843. /* Number of times the MSDU pool alloc failed */
  9844. A_UINT32 msdu_pool_alloc_fail;
  9845. /* Number of times the tid pool freed */
  9846. A_UINT32 tid_pool_free;
  9847. /* Number of times the MPDU pool freed */
  9848. A_UINT32 mpdu_pool_free;
  9849. /* Number of times the MSDU pool freed */
  9850. A_UINT32 msdu_pool_free;
  9851. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9852. A_UINT32 msdu_queued;
  9853. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9854. A_UINT32 msdu_recycled;
  9855. /* Number of MPDUs with invalid peer but A2 found in AST */
  9856. A_UINT32 invalid_peer_a2_in_ast;
  9857. /* Number of MPDUs with invalid peer but A3 found in AST */
  9858. A_UINT32 invalid_peer_a3_in_ast;
  9859. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9860. A_UINT32 invalid_peer_bmc_mpdus;
  9861. /* Number of MSDUs with err attention word */
  9862. A_UINT32 rxdesc_err_att;
  9863. /* Number of MSDUs with flag of peer_idx_invalid */
  9864. A_UINT32 rxdesc_err_peer_idx_inv;
  9865. /* Number of MSDUs with flag of peer_idx_timeout */
  9866. A_UINT32 rxdesc_err_peer_idx_to;
  9867. /* Number of MSDUs with flag of overflow */
  9868. A_UINT32 rxdesc_err_ov;
  9869. /* Number of MSDUs with flag of msdu_length_err */
  9870. A_UINT32 rxdesc_err_msdu_len;
  9871. /* Number of MSDUs with flag of mpdu_length_err */
  9872. A_UINT32 rxdesc_err_mpdu_len;
  9873. /* Number of MSDUs with flag of tkip_mic_err */
  9874. A_UINT32 rxdesc_err_tkip_mic;
  9875. /* Number of MSDUs with flag of decrypt_err */
  9876. A_UINT32 rxdesc_err_decrypt;
  9877. /* Number of MSDUs with flag of fcs_err */
  9878. A_UINT32 rxdesc_err_fcs;
  9879. /* Number of Unicast (bc_mc bit is not set in attention word)
  9880. * frames with invalid peer handler
  9881. */
  9882. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9883. /* Number of unicast frame directly (direct bit is set in attention word)
  9884. * to DUT with invalid peer handler
  9885. */
  9886. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9887. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9888. * frames with invalid peer handler
  9889. */
  9890. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9891. /* Number of MSDUs dropped due to no first MSDU flag */
  9892. A_UINT32 rxdesc_no_1st_msdu;
  9893. /* Number of MSDUs droped due to ring overflow */
  9894. A_UINT32 msdu_drop_ring_ov;
  9895. /* Number of MSDUs dropped due to FC mismatch */
  9896. A_UINT32 msdu_drop_fc_mismatch;
  9897. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9898. A_UINT32 msdu_drop_mgmt_remote_ring;
  9899. /* Number of MSDUs dropped due to errors not reported in attention word */
  9900. A_UINT32 msdu_drop_misc;
  9901. /* Number of MSDUs go to offload before reorder */
  9902. A_UINT32 offload_msdu_wal;
  9903. /* Number of data frame dropped by offload after reorder */
  9904. A_UINT32 offload_msdu_reorder;
  9905. /* Number of MPDUs with sequence number in the past and within the BA window */
  9906. A_UINT32 dup_past_within_window;
  9907. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9908. A_UINT32 dup_past_outside_window;
  9909. /* Number of MSDUs with decrypt/MIC error */
  9910. A_UINT32 rxdesc_err_decrypt_mic;
  9911. /* Number of data MSDUs received on both local and remote rings */
  9912. A_UINT32 data_msdus_on_both_rings;
  9913. /* MPDUs never filled */
  9914. A_UINT32 holes_not_filled;
  9915. };
  9916. /*
  9917. * Rx Remote buffer statistics
  9918. * NB: all the fields must be defined in 4 octets size.
  9919. */
  9920. struct rx_remote_buffer_mgmt_stats {
  9921. /* Total number of MSDUs reaped for Rx processing */
  9922. A_UINT32 remote_reaped;
  9923. /* MSDUs recycled within firmware */
  9924. A_UINT32 remote_recycled;
  9925. /* MSDUs stored by Data Rx */
  9926. A_UINT32 data_rx_msdus_stored;
  9927. /* Number of HTT indications from WAL Rx MSDU */
  9928. A_UINT32 wal_rx_ind;
  9929. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9930. A_UINT32 wal_rx_ind_unconsumed;
  9931. /* Number of HTT indications from Data Rx MSDU */
  9932. A_UINT32 data_rx_ind;
  9933. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9934. A_UINT32 data_rx_ind_unconsumed;
  9935. /* Number of HTT indications from ATHBUF */
  9936. A_UINT32 athbuf_rx_ind;
  9937. /* Number of remote buffers requested for refill */
  9938. A_UINT32 refill_buf_req;
  9939. /* Number of remote buffers filled by the host */
  9940. A_UINT32 refill_buf_rsp;
  9941. /* Number of times MAC hw_index = f/w write_index */
  9942. A_INT32 mac_no_bufs;
  9943. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9944. A_INT32 fw_indices_equal;
  9945. /* Number of times f/w finds no buffers to post */
  9946. A_INT32 host_no_bufs;
  9947. };
  9948. /*
  9949. * TXBF MU/SU packets and NDPA statistics
  9950. * NB: all the fields must be defined in 4 octets size.
  9951. */
  9952. struct rx_txbf_musu_ndpa_pkts_stats {
  9953. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9954. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9955. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9956. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9957. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9958. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9959. };
  9960. /*
  9961. * htt_dbg_stats_status -
  9962. * present - The requested stats have been delivered in full.
  9963. * This indicates that either the stats information was contained
  9964. * in its entirety within this message, or else this message
  9965. * completes the delivery of the requested stats info that was
  9966. * partially delivered through earlier STATS_CONF messages.
  9967. * partial - The requested stats have been delivered in part.
  9968. * One or more subsequent STATS_CONF messages with the same
  9969. * cookie value will be sent to deliver the remainder of the
  9970. * information.
  9971. * error - The requested stats could not be delivered, for example due
  9972. * to a shortage of memory to construct a message holding the
  9973. * requested stats.
  9974. * invalid - The requested stat type is either not recognized, or the
  9975. * target is configured to not gather the stats type in question.
  9976. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9977. * series_done - This special value indicates that no further stats info
  9978. * elements are present within a series of stats info elems
  9979. * (within a stats upload confirmation message).
  9980. */
  9981. enum htt_dbg_stats_status {
  9982. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9983. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9984. HTT_DBG_STATS_STATUS_ERROR = 2,
  9985. HTT_DBG_STATS_STATUS_INVALID = 3,
  9986. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9987. };
  9988. /**
  9989. * @brief target -> host statistics upload
  9990. *
  9991. * @details
  9992. * The following field definitions describe the format of the HTT target
  9993. * to host stats upload confirmation message.
  9994. * The message contains a cookie echoed from the HTT host->target stats
  9995. * upload request, which identifies which request the confirmation is
  9996. * for, and a series of tag-length-value stats information elements.
  9997. * The tag-length header for each stats info element also includes a
  9998. * status field, to indicate whether the request for the stat type in
  9999. * question was fully met, partially met, unable to be met, or invalid
  10000. * (if the stat type in question is disabled in the target).
  10001. * A special value of all 1's in this status field is used to indicate
  10002. * the end of the series of stats info elements.
  10003. *
  10004. *
  10005. * |31 16|15 8|7 5|4 0|
  10006. * |------------------------------------------------------------|
  10007. * | reserved | msg type |
  10008. * |------------------------------------------------------------|
  10009. * | cookie LSBs |
  10010. * |------------------------------------------------------------|
  10011. * | cookie MSBs |
  10012. * |------------------------------------------------------------|
  10013. * | stats entry length | reserved | S |stat type|
  10014. * |------------------------------------------------------------|
  10015. * | |
  10016. * | type-specific stats info |
  10017. * | |
  10018. * |------------------------------------------------------------|
  10019. * | stats entry length | reserved | S |stat type|
  10020. * |------------------------------------------------------------|
  10021. * | |
  10022. * | type-specific stats info |
  10023. * | |
  10024. * |------------------------------------------------------------|
  10025. * | n/a | reserved | 111 | n/a |
  10026. * |------------------------------------------------------------|
  10027. * Header fields:
  10028. * - MSG_TYPE
  10029. * Bits 7:0
  10030. * Purpose: identifies this is a statistics upload confirmation message
  10031. * Value: 0x9
  10032. * - COOKIE_LSBS
  10033. * Bits 31:0
  10034. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10035. * message with its preceding host->target stats request message.
  10036. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10037. * - COOKIE_MSBS
  10038. * Bits 31:0
  10039. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10040. * message with its preceding host->target stats request message.
  10041. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10042. *
  10043. * Stats Information Element tag-length header fields:
  10044. * - STAT_TYPE
  10045. * Bits 4:0
  10046. * Purpose: identifies the type of statistics info held in the
  10047. * following information element
  10048. * Value: htt_dbg_stats_type
  10049. * - STATUS
  10050. * Bits 7:5
  10051. * Purpose: indicate whether the requested stats are present
  10052. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10053. * the completion of the stats entry series
  10054. * - LENGTH
  10055. * Bits 31:16
  10056. * Purpose: indicate the stats information size
  10057. * Value: This field specifies the number of bytes of stats information
  10058. * that follows the element tag-length header.
  10059. * It is expected but not required that this length is a multiple of
  10060. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10061. * subsequent stats entry header will begin on a 4-byte aligned
  10062. * boundary.
  10063. */
  10064. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10065. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10066. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10067. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10068. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10069. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10070. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10071. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10072. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10073. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10074. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10077. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10078. } while (0)
  10079. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10080. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10081. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10082. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10083. do { \
  10084. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10085. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10086. } while (0)
  10087. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10088. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10089. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10090. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10091. do { \
  10092. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10093. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10094. } while (0)
  10095. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10096. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10097. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10098. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10099. #define HTT_MAX_AGGR 64
  10100. #define HTT_HL_MAX_AGGR 18
  10101. /**
  10102. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10103. *
  10104. * @details
  10105. * The following field definitions describe the format of the HTT host
  10106. * to target frag_desc/msdu_ext bank configuration message.
  10107. * The message contains the based address and the min and max id of the
  10108. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10109. * MSDU_EXT/FRAG_DESC.
  10110. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10111. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10112. * the hardware does the mapping/translation.
  10113. *
  10114. * Total banks that can be configured is configured to 16.
  10115. *
  10116. * This should be called before any TX has be initiated by the HTT
  10117. *
  10118. * |31 16|15 8|7 5|4 0|
  10119. * |------------------------------------------------------------|
  10120. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10121. * |------------------------------------------------------------|
  10122. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10123. #if HTT_PADDR64
  10124. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10125. #endif
  10126. * |------------------------------------------------------------|
  10127. * | ... |
  10128. * |------------------------------------------------------------|
  10129. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10130. #if HTT_PADDR64
  10131. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10132. #endif
  10133. * |------------------------------------------------------------|
  10134. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10135. * |------------------------------------------------------------|
  10136. * | ... |
  10137. * |------------------------------------------------------------|
  10138. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10139. * |------------------------------------------------------------|
  10140. * Header fields:
  10141. * - MSG_TYPE
  10142. * Bits 7:0
  10143. * Value: 0x6
  10144. * for systems with 64-bit format for bus addresses:
  10145. * - BANKx_BASE_ADDRESS_LO
  10146. * Bits 31:0
  10147. * Purpose: Provide a mechanism to specify the base address of the
  10148. * MSDU_EXT bank physical/bus address.
  10149. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10150. * - BANKx_BASE_ADDRESS_HI
  10151. * Bits 31:0
  10152. * Purpose: Provide a mechanism to specify the base address of the
  10153. * MSDU_EXT bank physical/bus address.
  10154. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10155. * for systems with 32-bit format for bus addresses:
  10156. * - BANKx_BASE_ADDRESS
  10157. * Bits 31:0
  10158. * Purpose: Provide a mechanism to specify the base address of the
  10159. * MSDU_EXT bank physical/bus address.
  10160. * Value: MSDU_EXT bank physical / bus address
  10161. * - BANKx_MIN_ID
  10162. * Bits 15:0
  10163. * Purpose: Provide a mechanism to specify the min index that needs to
  10164. * mapped.
  10165. * - BANKx_MAX_ID
  10166. * Bits 31:16
  10167. * Purpose: Provide a mechanism to specify the max index that needs to
  10168. * mapped.
  10169. *
  10170. */
  10171. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10172. * safe value.
  10173. * @note MAX supported banks is 16.
  10174. */
  10175. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10176. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10177. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10178. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10179. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10180. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10181. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10183. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10185. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10186. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10187. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10188. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10189. do { \
  10190. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10191. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10192. } while (0)
  10193. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10194. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10195. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10196. do { \
  10197. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10198. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10199. } while (0)
  10200. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10201. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10202. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10203. do { \
  10204. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10205. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10206. } while (0)
  10207. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10208. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10209. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10210. do { \
  10211. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10212. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10213. } while (0)
  10214. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10215. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10216. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10219. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10220. } while (0)
  10221. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10222. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10223. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10224. do { \
  10225. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10226. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10227. } while (0)
  10228. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10229. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10230. /*
  10231. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10232. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10233. * addresses are stored in a XXX-bit field.
  10234. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10235. * htt_tx_frag_desc64_bank_cfg_t structs.
  10236. */
  10237. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10238. _paddr_bits_, \
  10239. _paddr__bank_base_address_) \
  10240. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10241. /** word 0 \
  10242. * msg_type: 8, \
  10243. * pdev_id: 2, \
  10244. * swap: 1, \
  10245. * reserved0: 5, \
  10246. * num_banks: 8, \
  10247. * desc_size: 8; \
  10248. */ \
  10249. A_UINT32 word0; \
  10250. /* \
  10251. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10252. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10253. * the second A_UINT32). \
  10254. */ \
  10255. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10256. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10257. } POSTPACK
  10258. /* define htt_tx_frag_desc32_bank_cfg_t */
  10259. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10260. /* define htt_tx_frag_desc64_bank_cfg_t */
  10261. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10262. /*
  10263. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10264. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10265. */
  10266. #if HTT_PADDR64
  10267. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10268. #else
  10269. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10270. #endif
  10271. /**
  10272. * @brief target -> host HTT TX Credit total count update message definition
  10273. *
  10274. *|31 16|15|14 9| 8 |7 0 |
  10275. *|---------------------+--+----------+-------+----------|
  10276. *|cur htt credit delta | Q| reserved | sign | msg type |
  10277. *|------------------------------------------------------|
  10278. *
  10279. * Header fields:
  10280. * - MSG_TYPE
  10281. * Bits 7:0
  10282. * Purpose: identifies this as a htt tx credit delta update message
  10283. * Value: 0xe
  10284. * - SIGN
  10285. * Bits 8
  10286. * identifies whether credit delta is positive or negative
  10287. * Value:
  10288. * - 0x0: credit delta is positive, rebalance in some buffers
  10289. * - 0x1: credit delta is negative, rebalance out some buffers
  10290. * - reserved
  10291. * Bits 14:9
  10292. * Value: 0x0
  10293. * - TXQ_GRP
  10294. * Bit 15
  10295. * Purpose: indicates whether any tx queue group information elements
  10296. * are appended to the tx credit update message
  10297. * Value: 0 -> no tx queue group information element is present
  10298. * 1 -> a tx queue group information element immediately follows
  10299. * - DELTA_COUNT
  10300. * Bits 31:16
  10301. * Purpose: Specify current htt credit delta absolute count
  10302. */
  10303. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10304. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10305. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10306. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10307. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10308. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10309. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10310. do { \
  10311. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10312. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10313. } while (0)
  10314. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10315. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10316. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10317. do { \
  10318. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10319. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10320. } while (0)
  10321. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10322. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10323. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10326. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10327. } while (0)
  10328. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10329. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10330. #define HTT_TX_CREDIT_MSG_BYTES 4
  10331. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10332. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10333. /**
  10334. * @brief HTT WDI_IPA Operation Response Message
  10335. *
  10336. * @details
  10337. * HTT WDI_IPA Operation Response message is sent by target
  10338. * to host confirming suspend or resume operation.
  10339. * |31 24|23 16|15 8|7 0|
  10340. * |----------------+----------------+----------------+----------------|
  10341. * | op_code | Rsvd | msg_type |
  10342. * |-------------------------------------------------------------------|
  10343. * | Rsvd | Response len |
  10344. * |-------------------------------------------------------------------|
  10345. * | |
  10346. * | Response-type specific info |
  10347. * | |
  10348. * | |
  10349. * |-------------------------------------------------------------------|
  10350. * Header fields:
  10351. * - MSG_TYPE
  10352. * Bits 7:0
  10353. * Purpose: Identifies this as WDI_IPA Operation Response message
  10354. * value: = 0x13
  10355. * - OP_CODE
  10356. * Bits 31:16
  10357. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10358. * value: = enum htt_wdi_ipa_op_code
  10359. * - RSP_LEN
  10360. * Bits 16:0
  10361. * Purpose: length for the response-type specific info
  10362. * value: = length in bytes for response-type specific info
  10363. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10364. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10365. */
  10366. PREPACK struct htt_wdi_ipa_op_response_t
  10367. {
  10368. /* DWORD 0: flags and meta-data */
  10369. A_UINT32
  10370. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10371. reserved1: 8,
  10372. op_code: 16;
  10373. A_UINT32
  10374. rsp_len: 16,
  10375. reserved2: 16;
  10376. } POSTPACK;
  10377. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10378. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10379. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10380. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10381. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10382. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10383. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10384. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10385. do { \
  10386. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10387. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10388. } while (0)
  10389. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10390. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10391. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10392. do { \
  10393. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10394. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10395. } while (0)
  10396. enum htt_phy_mode {
  10397. htt_phy_mode_11a = 0,
  10398. htt_phy_mode_11g = 1,
  10399. htt_phy_mode_11b = 2,
  10400. htt_phy_mode_11g_only = 3,
  10401. htt_phy_mode_11na_ht20 = 4,
  10402. htt_phy_mode_11ng_ht20 = 5,
  10403. htt_phy_mode_11na_ht40 = 6,
  10404. htt_phy_mode_11ng_ht40 = 7,
  10405. htt_phy_mode_11ac_vht20 = 8,
  10406. htt_phy_mode_11ac_vht40 = 9,
  10407. htt_phy_mode_11ac_vht80 = 10,
  10408. htt_phy_mode_11ac_vht20_2g = 11,
  10409. htt_phy_mode_11ac_vht40_2g = 12,
  10410. htt_phy_mode_11ac_vht80_2g = 13,
  10411. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10412. htt_phy_mode_11ac_vht160 = 15,
  10413. htt_phy_mode_max,
  10414. };
  10415. /**
  10416. * @brief target -> host HTT channel change indication
  10417. * @details
  10418. * Specify when a channel change occurs.
  10419. * This allows the host to precisely determine which rx frames arrived
  10420. * on the old channel and which rx frames arrived on the new channel.
  10421. *
  10422. *|31 |7 0 |
  10423. *|-------------------------------------------+----------|
  10424. *| reserved | msg type |
  10425. *|------------------------------------------------------|
  10426. *| primary_chan_center_freq_mhz |
  10427. *|------------------------------------------------------|
  10428. *| contiguous_chan1_center_freq_mhz |
  10429. *|------------------------------------------------------|
  10430. *| contiguous_chan2_center_freq_mhz |
  10431. *|------------------------------------------------------|
  10432. *| phy_mode |
  10433. *|------------------------------------------------------|
  10434. *
  10435. * Header fields:
  10436. * - MSG_TYPE
  10437. * Bits 7:0
  10438. * Purpose: identifies this as a htt channel change indication message
  10439. * Value: 0x15
  10440. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10441. * Bits 31:0
  10442. * Purpose: identify the (center of the) new 20 MHz primary channel
  10443. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10444. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10445. * Bits 31:0
  10446. * Purpose: identify the (center of the) contiguous frequency range
  10447. * comprising the new channel.
  10448. * For example, if the new channel is a 80 MHz channel extending
  10449. * 60 MHz beyond the primary channel, this field would be 30 larger
  10450. * than the primary channel center frequency field.
  10451. * Value: center frequency of the contiguous frequency range comprising
  10452. * the full channel in MHz units
  10453. * (80+80 channels also use the CONTIG_CHAN2 field)
  10454. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10455. * Bits 31:0
  10456. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10457. * within a VHT 80+80 channel.
  10458. * This field is only relevant for VHT 80+80 channels.
  10459. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10460. * channel (arbitrary value for cases besides VHT 80+80)
  10461. * - PHY_MODE
  10462. * Bits 31:0
  10463. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10464. * and band
  10465. * Value: htt_phy_mode enum value
  10466. */
  10467. PREPACK struct htt_chan_change_t
  10468. {
  10469. /* DWORD 0: flags and meta-data */
  10470. A_UINT32
  10471. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10472. reserved1: 24;
  10473. A_UINT32 primary_chan_center_freq_mhz;
  10474. A_UINT32 contig_chan1_center_freq_mhz;
  10475. A_UINT32 contig_chan2_center_freq_mhz;
  10476. A_UINT32 phy_mode;
  10477. } POSTPACK;
  10478. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10479. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10480. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10481. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10482. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10483. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10484. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10485. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10486. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10487. do { \
  10488. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10489. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10490. } while (0)
  10491. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10492. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10493. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10494. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10495. do { \
  10496. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10497. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10498. } while (0)
  10499. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10500. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10501. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10502. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10503. do { \
  10504. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10505. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10506. } while (0)
  10507. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10508. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10509. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10510. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10511. do { \
  10512. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10513. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10514. } while (0)
  10515. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10516. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10517. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10518. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10519. /**
  10520. * @brief rx offload packet error message
  10521. *
  10522. * @details
  10523. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10524. * of target payload like mic err.
  10525. *
  10526. * |31 24|23 16|15 8|7 0|
  10527. * |----------------+----------------+----------------+----------------|
  10528. * | tid | vdev_id | msg_sub_type | msg_type |
  10529. * |-------------------------------------------------------------------|
  10530. * : (sub-type dependent content) :
  10531. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10532. * Header fields:
  10533. * - msg_type
  10534. * Bits 7:0
  10535. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10536. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10537. * - msg_sub_type
  10538. * Bits 15:8
  10539. * Purpose: Identifies which type of rx error is reported by this message
  10540. * value: htt_rx_ofld_pkt_err_type
  10541. * - vdev_id
  10542. * Bits 23:16
  10543. * Purpose: Identifies which vdev received the erroneous rx frame
  10544. * value:
  10545. * - tid
  10546. * Bits 31:24
  10547. * Purpose: Identifies the traffic type of the rx frame
  10548. * value:
  10549. *
  10550. * - The payload fields used if the sub-type == MIC error are shown below.
  10551. * Note - MIC err is per MSDU, while PN is per MPDU.
  10552. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10553. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10554. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10555. * instead of sending separate HTT messages for each wrong MSDU within
  10556. * the MPDU.
  10557. *
  10558. * |31 24|23 16|15 8|7 0|
  10559. * |----------------+----------------+----------------+----------------|
  10560. * | Rsvd | key_id | peer_id |
  10561. * |-------------------------------------------------------------------|
  10562. * | receiver MAC addr 31:0 |
  10563. * |-------------------------------------------------------------------|
  10564. * | Rsvd | receiver MAC addr 47:32 |
  10565. * |-------------------------------------------------------------------|
  10566. * | transmitter MAC addr 31:0 |
  10567. * |-------------------------------------------------------------------|
  10568. * | Rsvd | transmitter MAC addr 47:32 |
  10569. * |-------------------------------------------------------------------|
  10570. * | PN 31:0 |
  10571. * |-------------------------------------------------------------------|
  10572. * | Rsvd | PN 47:32 |
  10573. * |-------------------------------------------------------------------|
  10574. * - peer_id
  10575. * Bits 15:0
  10576. * Purpose: identifies which peer is frame is from
  10577. * value:
  10578. * - key_id
  10579. * Bits 23:16
  10580. * Purpose: identifies key_id of rx frame
  10581. * value:
  10582. * - RA_31_0 (receiver MAC addr 31:0)
  10583. * Bits 31:0
  10584. * Purpose: identifies by MAC address which vdev received the frame
  10585. * value: MAC address lower 4 bytes
  10586. * - RA_47_32 (receiver MAC addr 47:32)
  10587. * Bits 15:0
  10588. * Purpose: identifies by MAC address which vdev received the frame
  10589. * value: MAC address upper 2 bytes
  10590. * - TA_31_0 (transmitter MAC addr 31:0)
  10591. * Bits 31:0
  10592. * Purpose: identifies by MAC address which peer transmitted the frame
  10593. * value: MAC address lower 4 bytes
  10594. * - TA_47_32 (transmitter MAC addr 47:32)
  10595. * Bits 15:0
  10596. * Purpose: identifies by MAC address which peer transmitted the frame
  10597. * value: MAC address upper 2 bytes
  10598. * - PN_31_0
  10599. * Bits 31:0
  10600. * Purpose: Identifies pn of rx frame
  10601. * value: PN lower 4 bytes
  10602. * - PN_47_32
  10603. * Bits 15:0
  10604. * Purpose: Identifies pn of rx frame
  10605. * value:
  10606. * TKIP or CCMP: PN upper 2 bytes
  10607. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10608. */
  10609. enum htt_rx_ofld_pkt_err_type {
  10610. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10611. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10612. };
  10613. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10614. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10615. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10616. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10617. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10618. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10619. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10620. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10621. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10622. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10623. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10624. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10625. do { \
  10626. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10627. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10628. } while (0)
  10629. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10630. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10631. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10632. do { \
  10633. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10634. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10635. } while (0)
  10636. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10637. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10638. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10639. do { \
  10640. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10641. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10642. } while (0)
  10643. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10644. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10646. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10649. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10662. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10663. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10665. do { \
  10666. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10667. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10668. } while (0)
  10669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10670. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10671. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10673. do { \
  10674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10676. } while (0)
  10677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10678. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10679. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10681. do { \
  10682. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10683. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10684. } while (0)
  10685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10686. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10687. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10689. do { \
  10690. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10691. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10692. } while (0)
  10693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10694. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10695. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10697. do { \
  10698. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10699. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10700. } while (0)
  10701. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10702. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10703. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10704. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10705. do { \
  10706. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10707. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10708. } while (0)
  10709. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10710. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10711. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10712. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10715. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10716. } while (0)
  10717. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10718. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10719. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10720. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10721. do { \
  10722. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10723. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10724. } while (0)
  10725. /**
  10726. * @brief peer rate report message
  10727. *
  10728. * @details
  10729. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10730. * justified rate of all the peers.
  10731. *
  10732. * |31 24|23 16|15 8|7 0|
  10733. * |----------------+----------------+----------------+----------------|
  10734. * | peer_count | | msg_type |
  10735. * |-------------------------------------------------------------------|
  10736. * : Payload (variant number of peer rate report) :
  10737. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10738. * Header fields:
  10739. * - msg_type
  10740. * Bits 7:0
  10741. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10742. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10743. * - reserved
  10744. * Bits 15:8
  10745. * Purpose:
  10746. * value:
  10747. * - peer_count
  10748. * Bits 31:16
  10749. * Purpose: Specify how many peer rate report elements are present in the payload.
  10750. * value:
  10751. *
  10752. * Payload:
  10753. * There are variant number of peer rate report follow the first 32 bits.
  10754. * The peer rate report is defined as follows.
  10755. *
  10756. * |31 20|19 16|15 0|
  10757. * |-----------------------+---------+---------------------------------|-
  10758. * | reserved | phy | peer_id | \
  10759. * |-------------------------------------------------------------------| -> report #0
  10760. * | rate | /
  10761. * |-----------------------+---------+---------------------------------|-
  10762. * | reserved | phy | peer_id | \
  10763. * |-------------------------------------------------------------------| -> report #1
  10764. * | rate | /
  10765. * |-----------------------+---------+---------------------------------|-
  10766. * | reserved | phy | peer_id | \
  10767. * |-------------------------------------------------------------------| -> report #2
  10768. * | rate | /
  10769. * |-------------------------------------------------------------------|-
  10770. * : :
  10771. * : :
  10772. * : :
  10773. * :-------------------------------------------------------------------:
  10774. *
  10775. * - peer_id
  10776. * Bits 15:0
  10777. * Purpose: identify the peer
  10778. * value:
  10779. * - phy
  10780. * Bits 19:16
  10781. * Purpose: identify which phy is in use
  10782. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10783. * Please see enum htt_peer_report_phy_type for detail.
  10784. * - reserved
  10785. * Bits 31:20
  10786. * Purpose:
  10787. * value:
  10788. * - rate
  10789. * Bits 31:0
  10790. * Purpose: represent the justified rate of the peer specified by peer_id
  10791. * value:
  10792. */
  10793. enum htt_peer_rate_report_phy_type {
  10794. HTT_PEER_RATE_REPORT_11B = 0,
  10795. HTT_PEER_RATE_REPORT_11A_G,
  10796. HTT_PEER_RATE_REPORT_11N,
  10797. HTT_PEER_RATE_REPORT_11AC,
  10798. };
  10799. #define HTT_PEER_RATE_REPORT_SIZE 8
  10800. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10801. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10802. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10803. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10804. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10805. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10806. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10807. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10808. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10809. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10812. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10813. } while (0)
  10814. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10815. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10816. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10817. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10818. do { \
  10819. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10820. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10821. } while (0)
  10822. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10823. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10824. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10825. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10826. do { \
  10827. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10828. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10829. } while (0)
  10830. /**
  10831. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10832. *
  10833. * @details
  10834. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10835. * a flow of descriptors.
  10836. *
  10837. * This message is in TLV format and indicates the parameters to be setup a
  10838. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10839. * receive descriptors from a specified pool.
  10840. *
  10841. * The message would appear as follows:
  10842. *
  10843. * |31 24|23 16|15 8|7 0|
  10844. * |----------------+----------------+----------------+----------------|
  10845. * header | reserved | num_flows | msg_type |
  10846. * |-------------------------------------------------------------------|
  10847. * | |
  10848. * : payload :
  10849. * | |
  10850. * |-------------------------------------------------------------------|
  10851. *
  10852. * The header field is one DWORD long and is interpreted as follows:
  10853. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10854. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10855. * this message
  10856. * b'16-31 - reserved: These bits are reserved for future use
  10857. *
  10858. * Payload:
  10859. * The payload would contain multiple objects of the following structure. Each
  10860. * object represents a flow.
  10861. *
  10862. * |31 24|23 16|15 8|7 0|
  10863. * |----------------+----------------+----------------+----------------|
  10864. * header | reserved | num_flows | msg_type |
  10865. * |-------------------------------------------------------------------|
  10866. * payload0| flow_type |
  10867. * |-------------------------------------------------------------------|
  10868. * | flow_id |
  10869. * |-------------------------------------------------------------------|
  10870. * | reserved0 | flow_pool_id |
  10871. * |-------------------------------------------------------------------|
  10872. * | reserved1 | flow_pool_size |
  10873. * |-------------------------------------------------------------------|
  10874. * | reserved2 |
  10875. * |-------------------------------------------------------------------|
  10876. * payload1| flow_type |
  10877. * |-------------------------------------------------------------------|
  10878. * | flow_id |
  10879. * |-------------------------------------------------------------------|
  10880. * | reserved0 | flow_pool_id |
  10881. * |-------------------------------------------------------------------|
  10882. * | reserved1 | flow_pool_size |
  10883. * |-------------------------------------------------------------------|
  10884. * | reserved2 |
  10885. * |-------------------------------------------------------------------|
  10886. * | . |
  10887. * | . |
  10888. * | . |
  10889. * |-------------------------------------------------------------------|
  10890. *
  10891. * Each payload is 5 DWORDS long and is interpreted as follows:
  10892. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10893. * this flow is associated. It can be VDEV, peer,
  10894. * or tid (AC). Based on enum htt_flow_type.
  10895. *
  10896. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10897. * object. For flow_type vdev it is set to the
  10898. * vdevid, for peer it is peerid and for tid, it is
  10899. * tid_num.
  10900. *
  10901. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10902. * in the host for this flow
  10903. * b'16:31 - reserved0: This field in reserved for the future. In case
  10904. * we have a hierarchical implementation (HCM) of
  10905. * pools, it can be used to indicate the ID of the
  10906. * parent-pool.
  10907. *
  10908. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10909. * Descriptors for this flow will be
  10910. * allocated from this pool in the host.
  10911. * b'16:31 - reserved1: This field in reserved for the future. In case
  10912. * we have a hierarchical implementation of pools,
  10913. * it can be used to indicate the max number of
  10914. * descriptors in the pool. The b'0:15 can be used
  10915. * to indicate min number of descriptors in the
  10916. * HCM scheme.
  10917. *
  10918. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10919. * we have a hierarchical implementation of pools,
  10920. * b'0:15 can be used to indicate the
  10921. * priority-based borrowing (PBB) threshold of
  10922. * the flow's pool. The b'16:31 are still left
  10923. * reserved.
  10924. */
  10925. enum htt_flow_type {
  10926. FLOW_TYPE_VDEV = 0,
  10927. /* Insert new flow types above this line */
  10928. };
  10929. PREPACK struct htt_flow_pool_map_payload_t {
  10930. A_UINT32 flow_type;
  10931. A_UINT32 flow_id;
  10932. A_UINT32 flow_pool_id:16,
  10933. reserved0:16;
  10934. A_UINT32 flow_pool_size:16,
  10935. reserved1:16;
  10936. A_UINT32 reserved2;
  10937. } POSTPACK;
  10938. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10939. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10940. (sizeof(struct htt_flow_pool_map_payload_t))
  10941. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10942. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10943. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10944. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10945. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10946. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10947. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10948. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10949. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10950. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10951. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10952. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10953. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10954. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10955. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10956. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10957. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10958. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10959. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10960. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10961. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10962. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10963. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10964. do { \
  10965. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10966. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10967. } while (0)
  10968. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10969. do { \
  10970. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10971. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10972. } while (0)
  10973. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10974. do { \
  10975. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10976. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10977. } while (0)
  10978. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10979. do { \
  10980. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10981. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10982. } while (0)
  10983. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10984. do { \
  10985. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10986. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10987. } while (0)
  10988. /**
  10989. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10990. *
  10991. * @details
  10992. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10993. * down a flow of descriptors.
  10994. * This message indicates that for the flow (whose ID is provided) is wanting
  10995. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10996. * pool of descriptors from where descriptors are being allocated for this
  10997. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10998. * be unmapped by the host.
  10999. *
  11000. * The message would appear as follows:
  11001. *
  11002. * |31 24|23 16|15 8|7 0|
  11003. * |----------------+----------------+----------------+----------------|
  11004. * | reserved0 | msg_type |
  11005. * |-------------------------------------------------------------------|
  11006. * | flow_type |
  11007. * |-------------------------------------------------------------------|
  11008. * | flow_id |
  11009. * |-------------------------------------------------------------------|
  11010. * | reserved1 | flow_pool_id |
  11011. * |-------------------------------------------------------------------|
  11012. *
  11013. * The message is interpreted as follows:
  11014. * dword0 - b'0:7 - msg_type: This will be set to
  11015. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11016. * b'8:31 - reserved0: Reserved for future use
  11017. *
  11018. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11019. * this flow is associated. It can be VDEV, peer,
  11020. * or tid (AC). Based on enum htt_flow_type.
  11021. *
  11022. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11023. * object. For flow_type vdev it is set to the
  11024. * vdevid, for peer it is peerid and for tid, it is
  11025. * tid_num.
  11026. *
  11027. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11028. * used in the host for this flow
  11029. * b'16:31 - reserved0: This field in reserved for the future.
  11030. *
  11031. */
  11032. PREPACK struct htt_flow_pool_unmap_t {
  11033. A_UINT32 msg_type:8,
  11034. reserved0:24;
  11035. A_UINT32 flow_type;
  11036. A_UINT32 flow_id;
  11037. A_UINT32 flow_pool_id:16,
  11038. reserved1:16;
  11039. } POSTPACK;
  11040. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11041. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11042. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11043. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11044. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11045. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11046. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11047. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11048. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11049. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11050. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11051. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11052. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11053. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11054. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11055. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11056. do { \
  11057. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11058. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11059. } while (0)
  11060. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11061. do { \
  11062. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11063. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11064. } while (0)
  11065. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11066. do { \
  11067. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11068. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11069. } while (0)
  11070. /**
  11071. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11072. *
  11073. * @details
  11074. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11075. * SRNG ring setup is done
  11076. *
  11077. * This message indicates whether the last setup operation is successful.
  11078. * It will be sent to host when host set respose_required bit in
  11079. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11080. * The message would appear as follows:
  11081. *
  11082. * |31 24|23 16|15 8|7 0|
  11083. * |--------------- +----------------+----------------+----------------|
  11084. * | setup_status | ring_id | pdev_id | msg_type |
  11085. * |-------------------------------------------------------------------|
  11086. *
  11087. * The message is interpreted as follows:
  11088. * dword0 - b'0:7 - msg_type: This will be set to
  11089. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11090. * b'8:15 - pdev_id:
  11091. * 0 (for rings at SOC/UMAC level),
  11092. * 1/2/3 mac id (for rings at LMAC level)
  11093. * b'16:23 - ring_id: Identify the ring which is set up
  11094. * More details can be got from enum htt_srng_ring_id
  11095. * b'24:31 - setup_status: Indicate status of setup operation
  11096. * Refer to htt_ring_setup_status
  11097. */
  11098. PREPACK struct htt_sring_setup_done_t {
  11099. A_UINT32 msg_type: 8,
  11100. pdev_id: 8,
  11101. ring_id: 8,
  11102. setup_status: 8;
  11103. } POSTPACK;
  11104. enum htt_ring_setup_status {
  11105. htt_ring_setup_status_ok = 0,
  11106. htt_ring_setup_status_error,
  11107. };
  11108. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11109. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11110. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11111. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11112. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11113. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11114. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11115. do { \
  11116. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11117. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11118. } while (0)
  11119. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11120. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11121. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11122. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11123. HTT_SRING_SETUP_DONE_RING_ID_S)
  11124. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11125. do { \
  11126. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11127. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11128. } while (0)
  11129. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11130. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11131. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11132. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11133. HTT_SRING_SETUP_DONE_STATUS_S)
  11134. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11135. do { \
  11136. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11137. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11138. } while (0)
  11139. /**
  11140. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11141. *
  11142. * @details
  11143. * HTT TX map flow entry with tqm flow pointer
  11144. * Sent from firmware to host to add tqm flow pointer in corresponding
  11145. * flow search entry. Flow metadata is replayed back to host as part of this
  11146. * struct to enable host to find the specific flow search entry
  11147. *
  11148. * The message would appear as follows:
  11149. *
  11150. * |31 28|27 18|17 14|13 8|7 0|
  11151. * |-------+------------------------------------------+----------------|
  11152. * | rsvd0 | fse_hsh_idx | msg_type |
  11153. * |-------------------------------------------------------------------|
  11154. * | rsvd1 | tid | peer_id |
  11155. * |-------------------------------------------------------------------|
  11156. * | tqm_flow_pntr_lo |
  11157. * |-------------------------------------------------------------------|
  11158. * | tqm_flow_pntr_hi |
  11159. * |-------------------------------------------------------------------|
  11160. * | fse_meta_data |
  11161. * |-------------------------------------------------------------------|
  11162. *
  11163. * The message is interpreted as follows:
  11164. *
  11165. * dword0 - b'0:7 - msg_type: This will be set to
  11166. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11167. *
  11168. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11169. * for this flow entry
  11170. *
  11171. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11172. *
  11173. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11174. *
  11175. * dword1 - b'14:17 - tid
  11176. *
  11177. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11178. *
  11179. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11180. *
  11181. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11182. *
  11183. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11184. * given by host
  11185. */
  11186. PREPACK struct htt_tx_map_flow_info {
  11187. A_UINT32
  11188. msg_type: 8,
  11189. fse_hsh_idx: 20,
  11190. rsvd0: 4;
  11191. A_UINT32
  11192. peer_id: 14,
  11193. tid: 4,
  11194. rsvd1: 14;
  11195. A_UINT32 tqm_flow_pntr_lo;
  11196. A_UINT32 tqm_flow_pntr_hi;
  11197. struct htt_tx_flow_metadata fse_meta_data;
  11198. } POSTPACK;
  11199. /* DWORD 0 */
  11200. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11201. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11202. /* DWORD 1 */
  11203. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11204. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11205. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11206. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11207. /* DWORD 0 */
  11208. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11209. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11210. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11211. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11214. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11215. } while (0)
  11216. /* DWORD 1 */
  11217. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11218. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11219. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11220. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11221. do { \
  11222. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11223. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11224. } while (0)
  11225. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11226. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11227. HTT_TX_MAP_FLOW_INFO_TID_S)
  11228. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11229. do { \
  11230. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11231. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11232. } while (0)
  11233. /*
  11234. * htt_dbg_ext_stats_status -
  11235. * present - The requested stats have been delivered in full.
  11236. * This indicates that either the stats information was contained
  11237. * in its entirety within this message, or else this message
  11238. * completes the delivery of the requested stats info that was
  11239. * partially delivered through earlier STATS_CONF messages.
  11240. * partial - The requested stats have been delivered in part.
  11241. * One or more subsequent STATS_CONF messages with the same
  11242. * cookie value will be sent to deliver the remainder of the
  11243. * information.
  11244. * error - The requested stats could not be delivered, for example due
  11245. * to a shortage of memory to construct a message holding the
  11246. * requested stats.
  11247. * invalid - The requested stat type is either not recognized, or the
  11248. * target is configured to not gather the stats type in question.
  11249. */
  11250. enum htt_dbg_ext_stats_status {
  11251. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11252. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11253. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11254. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11255. };
  11256. /**
  11257. * @brief target -> host ppdu stats upload
  11258. *
  11259. * @details
  11260. * The following field definitions describe the format of the HTT target
  11261. * to host ppdu stats indication message.
  11262. *
  11263. *
  11264. * |31 16|15 12|11 10|9 8|7 0 |
  11265. * |----------------------------------------------------------------------|
  11266. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11267. * |----------------------------------------------------------------------|
  11268. * | ppdu_id |
  11269. * |----------------------------------------------------------------------|
  11270. * | Timestamp in us |
  11271. * |----------------------------------------------------------------------|
  11272. * | reserved |
  11273. * |----------------------------------------------------------------------|
  11274. * | type-specific stats info |
  11275. * | (see htt_ppdu_stats.h) |
  11276. * |----------------------------------------------------------------------|
  11277. * Header fields:
  11278. * - MSG_TYPE
  11279. * Bits 7:0
  11280. * Purpose: Identifies this is a PPDU STATS indication
  11281. * message.
  11282. * Value: 0x1d
  11283. * - mac_id
  11284. * Bits 9:8
  11285. * Purpose: mac_id of this ppdu_id
  11286. * Value: 0-3
  11287. * - pdev_id
  11288. * Bits 11:10
  11289. * Purpose: pdev_id of this ppdu_id
  11290. * Value: 0-3
  11291. * 0 (for rings at SOC level),
  11292. * 1/2/3 PDEV -> 0/1/2
  11293. * - payload_size
  11294. * Bits 31:16
  11295. * Purpose: total tlv size
  11296. * Value: payload_size in bytes
  11297. */
  11298. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11299. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11300. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11301. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11302. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11303. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11304. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11305. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11306. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11307. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11310. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11311. } while (0)
  11312. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11313. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11314. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11315. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11316. do { \
  11317. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11318. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11319. } while (0)
  11320. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11321. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11322. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11323. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11324. do { \
  11325. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11326. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11327. } while (0)
  11328. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11329. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11330. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11331. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11332. do { \
  11333. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11334. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11335. } while (0)
  11336. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11337. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11338. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11339. /* htt_t2h_ppdu_stats_ind_hdr_t
  11340. * This struct contains the fields within the header of the
  11341. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11342. * stats info.
  11343. * This struct assumes little-endian layout, and thus is only
  11344. * suitable for use within processors known to be little-endian
  11345. * (such as the target).
  11346. * In contrast, the above macros provide endian-portable methods
  11347. * to get and set the bitfields within this PPDU_STATS_IND header.
  11348. */
  11349. typedef struct {
  11350. A_UINT32 msg_type: 8, /* bits 7:0 */
  11351. mac_id: 2, /* bits 9:8 */
  11352. pdev_id: 2, /* bits 11:10 */
  11353. reserved1: 4, /* bits 15:12 */
  11354. payload_size: 16; /* bits 31:16 */
  11355. A_UINT32 ppdu_id;
  11356. A_UINT32 timestamp_us;
  11357. A_UINT32 reserved2;
  11358. } htt_t2h_ppdu_stats_ind_hdr_t;
  11359. /**
  11360. * @brief target -> host extended statistics upload
  11361. *
  11362. * @details
  11363. * The following field definitions describe the format of the HTT target
  11364. * to host stats upload confirmation message.
  11365. * The message contains a cookie echoed from the HTT host->target stats
  11366. * upload request, which identifies which request the confirmation is
  11367. * for, and a single stats can span over multiple HTT stats indication
  11368. * due to the HTT message size limitation so every HTT ext stats indication
  11369. * will have tag-length-value stats information elements.
  11370. * The tag-length header for each HTT stats IND message also includes a
  11371. * status field, to indicate whether the request for the stat type in
  11372. * question was fully met, partially met, unable to be met, or invalid
  11373. * (if the stat type in question is disabled in the target).
  11374. * A Done bit 1's indicate the end of the of stats info elements.
  11375. *
  11376. *
  11377. * |31 16|15 12|11|10 8|7 5|4 0|
  11378. * |--------------------------------------------------------------|
  11379. * | reserved | msg type |
  11380. * |--------------------------------------------------------------|
  11381. * | cookie LSBs |
  11382. * |--------------------------------------------------------------|
  11383. * | cookie MSBs |
  11384. * |--------------------------------------------------------------|
  11385. * | stats entry length | rsvd | D| S | stat type |
  11386. * |--------------------------------------------------------------|
  11387. * | type-specific stats info |
  11388. * | (see htt_stats.h) |
  11389. * |--------------------------------------------------------------|
  11390. * Header fields:
  11391. * - MSG_TYPE
  11392. * Bits 7:0
  11393. * Purpose: Identifies this is a extended statistics upload confirmation
  11394. * message.
  11395. * Value: 0x1c
  11396. * - COOKIE_LSBS
  11397. * Bits 31:0
  11398. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11399. * message with its preceding host->target stats request message.
  11400. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11401. * - COOKIE_MSBS
  11402. * Bits 31:0
  11403. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11404. * message with its preceding host->target stats request message.
  11405. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11406. *
  11407. * Stats Information Element tag-length header fields:
  11408. * - STAT_TYPE
  11409. * Bits 7:0
  11410. * Purpose: identifies the type of statistics info held in the
  11411. * following information element
  11412. * Value: htt_dbg_ext_stats_type
  11413. * - STATUS
  11414. * Bits 10:8
  11415. * Purpose: indicate whether the requested stats are present
  11416. * Value: htt_dbg_ext_stats_status
  11417. * - DONE
  11418. * Bits 11
  11419. * Purpose:
  11420. * Indicates the completion of the stats entry, this will be the last
  11421. * stats conf HTT segment for the requested stats type.
  11422. * Value:
  11423. * 0 -> the stats retrieval is ongoing
  11424. * 1 -> the stats retrieval is complete
  11425. * - LENGTH
  11426. * Bits 31:16
  11427. * Purpose: indicate the stats information size
  11428. * Value: This field specifies the number of bytes of stats information
  11429. * that follows the element tag-length header.
  11430. * It is expected but not required that this length is a multiple of
  11431. * 4 bytes.
  11432. */
  11433. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11434. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11435. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11436. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11437. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11438. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11439. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11440. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11441. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11442. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11443. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11444. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11445. do { \
  11446. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11447. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11448. } while (0)
  11449. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11450. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11451. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11452. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11453. do { \
  11454. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11455. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11456. } while (0)
  11457. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11458. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11459. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11460. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11461. do { \
  11462. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11463. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11464. } while (0)
  11465. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11466. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11467. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11468. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11469. do { \
  11470. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11471. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11472. } while (0)
  11473. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11474. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11475. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11476. typedef enum {
  11477. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11478. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11479. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11480. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11481. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11482. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11483. /* Reserved from 128 - 255 for target internal use.*/
  11484. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11485. } HTT_PEER_TYPE;
  11486. /** 2 word representation of MAC addr */
  11487. typedef struct {
  11488. /** upper 4 bytes of MAC address */
  11489. A_UINT32 mac_addr31to0;
  11490. /** lower 2 bytes of MAC address */
  11491. A_UINT32 mac_addr47to32;
  11492. } htt_mac_addr;
  11493. /** macro to convert MAC address from char array to HTT word format */
  11494. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11495. (phtt_mac_addr)->mac_addr31to0 = \
  11496. (((c_macaddr)[0] << 0) | \
  11497. ((c_macaddr)[1] << 8) | \
  11498. ((c_macaddr)[2] << 16) | \
  11499. ((c_macaddr)[3] << 24)); \
  11500. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11501. } while (0)
  11502. /**
  11503. * @brief target -> host monitor mac header indication message
  11504. *
  11505. * @details
  11506. * The following diagram shows the format of the monitor mac header message
  11507. * sent from the target to the host.
  11508. * This message is primarily sent when promiscuous rx mode is enabled.
  11509. * One message is sent per rx PPDU.
  11510. *
  11511. * |31 24|23 16|15 8|7 0|
  11512. * |-------------------------------------------------------------|
  11513. * | peer_id | reserved0 | msg_type |
  11514. * |-------------------------------------------------------------|
  11515. * | reserved1 | num_mpdu |
  11516. * |-------------------------------------------------------------|
  11517. * | struct hw_rx_desc |
  11518. * | (see wal_rx_desc.h) |
  11519. * |-------------------------------------------------------------|
  11520. * | struct ieee80211_frame_addr4 |
  11521. * | (see ieee80211_defs.h) |
  11522. * |-------------------------------------------------------------|
  11523. * | struct ieee80211_frame_addr4 |
  11524. * | (see ieee80211_defs.h) |
  11525. * |-------------------------------------------------------------|
  11526. * | ...... |
  11527. * |-------------------------------------------------------------|
  11528. *
  11529. * Header fields:
  11530. * - msg_type
  11531. * Bits 7:0
  11532. * Purpose: Identifies this is a monitor mac header indication message.
  11533. * Value: 0x20
  11534. * - peer_id
  11535. * Bits 31:16
  11536. * Purpose: Software peer id given by host during association,
  11537. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11538. * for rx PPDUs received from unassociated peers.
  11539. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11540. * - num_mpdu
  11541. * Bits 15:0
  11542. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11543. * delivered within the message.
  11544. * Value: 1 to 32
  11545. * num_mpdu is limited to a maximum value of 32, due to buffer
  11546. * size limits. For PPDUs with more than 32 MPDUs, only the
  11547. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11548. * the PPDU will be provided.
  11549. */
  11550. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11551. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11552. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11553. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11554. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11555. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11556. do { \
  11557. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11558. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11559. } while (0)
  11560. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11561. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11562. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11563. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11564. do { \
  11565. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11566. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11567. } while (0)
  11568. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11569. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11570. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11571. /**
  11572. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11573. *
  11574. * @details
  11575. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11576. * the flow pool associated with the specified ID is resized
  11577. *
  11578. * The message would appear as follows:
  11579. *
  11580. * |31 16|15 8|7 0|
  11581. * |---------------------------------+----------------+----------------|
  11582. * | reserved0 | Msg type |
  11583. * |-------------------------------------------------------------------|
  11584. * | flow pool new size | flow pool ID |
  11585. * |-------------------------------------------------------------------|
  11586. *
  11587. * The message is interpreted as follows:
  11588. * b'0:7 - msg_type: This will be set to
  11589. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11590. *
  11591. * b'0:15 - flow pool ID: Existing flow pool ID
  11592. *
  11593. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11594. *
  11595. */
  11596. PREPACK struct htt_flow_pool_resize_t {
  11597. A_UINT32 msg_type:8,
  11598. reserved0:24;
  11599. A_UINT32 flow_pool_id:16,
  11600. flow_pool_new_size:16;
  11601. } POSTPACK;
  11602. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11603. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11604. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11605. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11606. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11607. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11608. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11609. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11610. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11611. do { \
  11612. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11613. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11614. } while (0)
  11615. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11616. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11617. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11618. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11619. do { \
  11620. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11621. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11622. } while (0)
  11623. /**
  11624. * @brief host -> target channel change message
  11625. *
  11626. * @details
  11627. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11628. * to associate RX frames to correct channel they were received on.
  11629. * The following field definitions describe the format of the HTT target
  11630. * to host channel change message.
  11631. * |31 16|15 8|7 5|4 0|
  11632. * |------------------------------------------------------------|
  11633. * | reserved | MSG_TYPE |
  11634. * |------------------------------------------------------------|
  11635. * | CHAN_MHZ |
  11636. * |------------------------------------------------------------|
  11637. * | BAND_CENTER_FREQ1 |
  11638. * |------------------------------------------------------------|
  11639. * | BAND_CENTER_FREQ2 |
  11640. * |------------------------------------------------------------|
  11641. * | CHAN_PHY_MODE |
  11642. * |------------------------------------------------------------|
  11643. * Header fields:
  11644. * - MSG_TYPE
  11645. * Bits 7:0
  11646. * Value: 0xf
  11647. * - CHAN_MHZ
  11648. * Bits 31:0
  11649. * Purpose: frequency of the primary 20mhz channel.
  11650. * - BAND_CENTER_FREQ1
  11651. * Bits 31:0
  11652. * Purpose: centre frequency of the full channel.
  11653. * - BAND_CENTER_FREQ2
  11654. * Bits 31:0
  11655. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11656. * - CHAN_PHY_MODE
  11657. * Bits 31:0
  11658. * Purpose: phy mode of the channel.
  11659. */
  11660. PREPACK struct htt_chan_change_msg {
  11661. A_UINT32 chan_mhz; /* frequency in mhz */
  11662. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11663. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11664. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11665. } POSTPACK;
  11666. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11667. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11668. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11669. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11670. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11671. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11672. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11673. /*
  11674. * The read and write indices point to the data within the host buffer.
  11675. * Because the first 4 bytes of the host buffer is used for the read index and
  11676. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11677. * The read index and write index are the byte offsets from the base of the
  11678. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11679. * Refer the ASCII text picture below.
  11680. */
  11681. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11682. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11683. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11684. /*
  11685. ***************************************************************************
  11686. *
  11687. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11688. *
  11689. ***************************************************************************
  11690. *
  11691. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11692. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11693. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11694. * written into the Host memory region mentioned below.
  11695. *
  11696. * Read index is updated by the Host. At any point of time, the read index will
  11697. * indicate the index that will next be read by the Host. The read index is
  11698. * in units of bytes offset from the base of the meta-data buffer.
  11699. *
  11700. * Write index is updated by the FW. At any point of time, the write index will
  11701. * indicate from where the FW can start writing any new data. The write index is
  11702. * in units of bytes offset from the base of the meta-data buffer.
  11703. *
  11704. * If the Host is not fast enough in reading the CFR data, any new capture data
  11705. * would be dropped if there is no space left to write the new captures.
  11706. *
  11707. * The last 4 bytes of the memory region will have the magic pattern
  11708. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11709. * not overrun the host buffer.
  11710. *
  11711. * ,--------------------. read and write indices store the
  11712. * | | byte offset from the base of the
  11713. * | ,--------+--------. meta-data buffer to the next
  11714. * | | | | location within the data buffer
  11715. * | | v v that will be read / written
  11716. * ************************************************************************
  11717. * * Read * Write * * Magic *
  11718. * * index * index * CFR data1 ...... CFR data N * pattern *
  11719. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11720. * ************************************************************************
  11721. * |<---------- data buffer ---------->|
  11722. *
  11723. * |<----------------- meta-data buffer allocated in Host ----------------|
  11724. *
  11725. * Note:
  11726. * - Considering the 4 bytes needed to store the Read index (R) and the
  11727. * Write index (W), the initial value is as follows:
  11728. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11729. * - Buffer empty condition:
  11730. * R = W
  11731. *
  11732. * Regarding CFR data format:
  11733. * --------------------------
  11734. *
  11735. * Each CFR tone is stored in HW as 16-bits with the following format:
  11736. * {bits[15:12], bits[11:6], bits[5:0]} =
  11737. * {unsigned exponent (4 bits),
  11738. * signed mantissa_real (6 bits),
  11739. * signed mantissa_imag (6 bits)}
  11740. *
  11741. * CFR_real = mantissa_real * 2^(exponent-5)
  11742. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11743. *
  11744. *
  11745. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11746. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11747. *
  11748. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11749. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11750. * .
  11751. * .
  11752. * .
  11753. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11754. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11755. */
  11756. /* Bandwidth of peer CFR captures */
  11757. typedef enum {
  11758. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11759. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11760. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11761. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11762. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11763. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11764. } HTT_PEER_CFR_CAPTURE_BW;
  11765. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11766. * was captured
  11767. */
  11768. typedef enum {
  11769. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11770. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11771. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11772. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11773. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11774. } HTT_PEER_CFR_CAPTURE_MODE;
  11775. typedef enum {
  11776. /* This message type is currently used for the below purpose:
  11777. *
  11778. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11779. * wmi_peer_cfr_capture_cmd.
  11780. * If payload_present bit is set to 0 then the associated memory region
  11781. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11782. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11783. * message; the CFR dump will be present at the end of the message,
  11784. * after the chan_phy_mode.
  11785. */
  11786. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11787. /* Always keep this last */
  11788. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11789. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11790. /**
  11791. * @brief target -> host CFR dump completion indication message definition
  11792. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11793. *
  11794. * @details
  11795. * The following diagram shows the format of the Channel Frequency Response
  11796. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11797. * the channel capture of a peer is copied by Firmware into the Host memory
  11798. *
  11799. * **************************************************************************
  11800. *
  11801. * Message format when the CFR capture message type is
  11802. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11803. *
  11804. * **************************************************************************
  11805. *
  11806. * |31 16|15 |8|7 0|
  11807. * |----------------------------------------------------------------|
  11808. * header: | reserved |P| msg_type |
  11809. * word 0 | | | |
  11810. * |----------------------------------------------------------------|
  11811. * payload: | cfr_capture_msg_type |
  11812. * word 1 | |
  11813. * |----------------------------------------------------------------|
  11814. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11815. * word 2 | | | | | | | | |
  11816. * |----------------------------------------------------------------|
  11817. * | mac_addr31to0 |
  11818. * word 3 | |
  11819. * |----------------------------------------------------------------|
  11820. * | unused / reserved | mac_addr47to32 |
  11821. * word 4 | | |
  11822. * |----------------------------------------------------------------|
  11823. * | index |
  11824. * word 5 | |
  11825. * |----------------------------------------------------------------|
  11826. * | length |
  11827. * word 6 | |
  11828. * |----------------------------------------------------------------|
  11829. * | timestamp |
  11830. * word 7 | |
  11831. * |----------------------------------------------------------------|
  11832. * | counter |
  11833. * word 8 | |
  11834. * |----------------------------------------------------------------|
  11835. * | chan_mhz |
  11836. * word 9 | |
  11837. * |----------------------------------------------------------------|
  11838. * | band_center_freq1 |
  11839. * word 10 | |
  11840. * |----------------------------------------------------------------|
  11841. * | band_center_freq2 |
  11842. * word 11 | |
  11843. * |----------------------------------------------------------------|
  11844. * | chan_phy_mode |
  11845. * word 12 | |
  11846. * |----------------------------------------------------------------|
  11847. * where,
  11848. * P - payload present bit (payload_present explained below)
  11849. * req_id - memory request id (mem_req_id explained below)
  11850. * S - status field (status explained below)
  11851. * capbw - capture bandwidth (capture_bw explained below)
  11852. * mode - mode of capture (mode explained below)
  11853. * sts - space time streams (sts_count explained below)
  11854. * chbw - channel bandwidth (channel_bw explained below)
  11855. * captype - capture type (cap_type explained below)
  11856. *
  11857. * The following field definitions describe the format of the CFR dump
  11858. * completion indication sent from the target to the host
  11859. *
  11860. * Header fields:
  11861. *
  11862. * Word 0
  11863. * - msg_type
  11864. * Bits 7:0
  11865. * Purpose: Identifies this as CFR TX completion indication
  11866. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11867. * - payload_present
  11868. * Bit 8
  11869. * Purpose: Identifies how CFR data is sent to host
  11870. * Value: 0 - If CFR Payload is written to host memory
  11871. * 1 - If CFR Payload is sent as part of HTT message
  11872. * (This is the requirement for SDIO/USB where it is
  11873. * not possible to write CFR data to host memory)
  11874. * - reserved
  11875. * Bits 31:9
  11876. * Purpose: Reserved
  11877. * Value: 0
  11878. *
  11879. * Payload fields:
  11880. *
  11881. * Word 1
  11882. * - cfr_capture_msg_type
  11883. * Bits 31:0
  11884. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11885. * to specify the format used for the remainder of the message
  11886. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11887. * (currently only MSG_TYPE_1 is defined)
  11888. *
  11889. * Word 2
  11890. * - mem_req_id
  11891. * Bits 6:0
  11892. * Purpose: Contain the mem request id of the region where the CFR capture
  11893. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11894. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11895. this value is invalid)
  11896. * - status
  11897. * Bit 7
  11898. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11899. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11900. * - capture_bw
  11901. * Bits 10:8
  11902. * Purpose: Carry the bandwidth of the CFR capture
  11903. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11904. * - mode
  11905. * Bits 13:11
  11906. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11907. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11908. * - sts_count
  11909. * Bits 16:14
  11910. * Purpose: Carry the number of space time streams
  11911. * Value: Number of space time streams
  11912. * - channel_bw
  11913. * Bits 19:17
  11914. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11915. * measurement
  11916. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11917. * - cap_type
  11918. * Bits 23:20
  11919. * Purpose: Carry the type of the capture
  11920. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11921. * - vdev_id
  11922. * Bits 31:24
  11923. * Purpose: Carry the virtual device id
  11924. * Value: vdev ID
  11925. *
  11926. * Word 3
  11927. * - mac_addr31to0
  11928. * Bits 31:0
  11929. * Purpose: Contain the bits 31:0 of the peer MAC address
  11930. * Value: Bits 31:0 of the peer MAC address
  11931. *
  11932. * Word 4
  11933. * - mac_addr47to32
  11934. * Bits 15:0
  11935. * Purpose: Contain the bits 47:32 of the peer MAC address
  11936. * Value: Bits 47:32 of the peer MAC address
  11937. *
  11938. * Word 5
  11939. * - index
  11940. * Bits 31:0
  11941. * Purpose: Contain the index at which this CFR dump was written in the Host
  11942. * allocated memory. This index is the number of bytes from the base address.
  11943. * Value: Index position
  11944. *
  11945. * Word 6
  11946. * - length
  11947. * Bits 31:0
  11948. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11949. * Value: Length of the CFR capture of the peer
  11950. *
  11951. * Word 7
  11952. * - timestamp
  11953. * Bits 31:0
  11954. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11955. * clock used for this timestamp is private to the target and not visible to
  11956. * the host i.e., Host can interpret only the relative timestamp deltas from
  11957. * one message to the next, but can't interpret the absolute timestamp from a
  11958. * single message.
  11959. * Value: Timestamp in microseconds
  11960. *
  11961. * Word 8
  11962. * - counter
  11963. * Bits 31:0
  11964. * Purpose: Carry the count of the current CFR capture from FW. This is
  11965. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11966. * in host memory)
  11967. * Value: Count of the current CFR capture
  11968. *
  11969. * Word 9
  11970. * - chan_mhz
  11971. * Bits 31:0
  11972. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11973. * Value: Primary 20 channel frequency
  11974. *
  11975. * Word 10
  11976. * - band_center_freq1
  11977. * Bits 31:0
  11978. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11979. * Value: Center frequency 1 in MHz
  11980. *
  11981. * Word 11
  11982. * - band_center_freq2
  11983. * Bits 31:0
  11984. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11985. * the VDEV
  11986. * 80plus80 mode
  11987. * Value: Center frequency 2 in MHz
  11988. *
  11989. * Word 12
  11990. * - chan_phy_mode
  11991. * Bits 31:0
  11992. * Purpose: Carry the phy mode of the channel, of the VDEV
  11993. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11994. */
  11995. PREPACK struct htt_cfr_dump_ind_type_1 {
  11996. A_UINT32 mem_req_id:7,
  11997. status:1,
  11998. capture_bw:3,
  11999. mode:3,
  12000. sts_count:3,
  12001. channel_bw:3,
  12002. cap_type:4,
  12003. vdev_id:8;
  12004. htt_mac_addr addr;
  12005. A_UINT32 index;
  12006. A_UINT32 length;
  12007. A_UINT32 timestamp;
  12008. A_UINT32 counter;
  12009. struct htt_chan_change_msg chan;
  12010. } POSTPACK;
  12011. PREPACK struct htt_cfr_dump_compl_ind {
  12012. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12013. union {
  12014. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12015. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12016. /* If there is a need to change the memory layout and its associated
  12017. * HTT indication format, a new CFR capture message type can be
  12018. * introduced and added into this union.
  12019. */
  12020. };
  12021. } POSTPACK;
  12022. /*
  12023. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12024. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12025. */
  12026. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12027. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12028. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12029. do { \
  12030. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12031. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12032. } while(0)
  12033. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12034. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12035. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12036. /*
  12037. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12038. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12039. */
  12040. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12041. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12042. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12043. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12044. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12045. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12046. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12047. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12048. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12049. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12050. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12051. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12052. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12053. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12054. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12055. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12056. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12057. do { \
  12058. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12059. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12060. } while (0)
  12061. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12062. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12063. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12064. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12065. do { \
  12066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12068. } while (0)
  12069. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12071. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12072. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12076. } while (0)
  12077. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12079. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12080. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12084. } while (0)
  12085. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12087. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12088. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12089. do { \
  12090. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12091. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12092. } while (0)
  12093. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12094. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12095. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12096. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12097. do { \
  12098. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12099. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12100. } while (0)
  12101. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12102. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12103. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12104. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12105. do { \
  12106. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12107. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12108. } while (0)
  12109. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12110. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12111. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12112. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12113. do { \
  12114. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12115. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12116. } while (0)
  12117. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12118. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12119. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12120. /**
  12121. * @brief target -> host peer (PPDU) stats message
  12122. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12123. * @details
  12124. * This message is generated by FW when FW is sending stats to host
  12125. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12126. * This message is sent autonomously by the target rather than upon request
  12127. * by the host.
  12128. * The following field definitions describe the format of the HTT target
  12129. * to host peer stats indication message.
  12130. *
  12131. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12132. * or more PPDU stats records.
  12133. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12134. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12135. * then the message would start with the
  12136. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12137. * below.
  12138. *
  12139. * |31 16|15|14|13 11|10 9|8|7 0|
  12140. * |-------------------------------------------------------------|
  12141. * | reserved |MSG_TYPE |
  12142. * |-------------------------------------------------------------|
  12143. * rec 0 | TLV header |
  12144. * rec 0 |-------------------------------------------------------------|
  12145. * rec 0 | ppdu successful bytes |
  12146. * rec 0 |-------------------------------------------------------------|
  12147. * rec 0 | ppdu retry bytes |
  12148. * rec 0 |-------------------------------------------------------------|
  12149. * rec 0 | ppdu failed bytes |
  12150. * rec 0 |-------------------------------------------------------------|
  12151. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12152. * rec 0 |-------------------------------------------------------------|
  12153. * rec 0 | retried MSDUs | successful MSDUs |
  12154. * rec 0 |-------------------------------------------------------------|
  12155. * rec 0 | TX duration | failed MSDUs |
  12156. * rec 0 |-------------------------------------------------------------|
  12157. * ...
  12158. * |-------------------------------------------------------------|
  12159. * rec N | TLV header |
  12160. * rec N |-------------------------------------------------------------|
  12161. * rec N | ppdu successful bytes |
  12162. * rec N |-------------------------------------------------------------|
  12163. * rec N | ppdu retry bytes |
  12164. * rec N |-------------------------------------------------------------|
  12165. * rec N | ppdu failed bytes |
  12166. * rec N |-------------------------------------------------------------|
  12167. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12168. * rec N |-------------------------------------------------------------|
  12169. * rec N | retried MSDUs | successful MSDUs |
  12170. * rec N |-------------------------------------------------------------|
  12171. * rec N | TX duration | failed MSDUs |
  12172. * rec N |-------------------------------------------------------------|
  12173. *
  12174. * where:
  12175. * A = is A-MPDU flag
  12176. * BA = block-ack failure flags
  12177. * BW = bandwidth spec
  12178. * SG = SGI enabled spec
  12179. * S = skipped rate ctrl
  12180. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12181. *
  12182. * Header
  12183. * ------
  12184. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12185. * dword0 - b'8:31 - reserved : Reserved for future use
  12186. *
  12187. * payload include below peer_stats information
  12188. * --------------------------------------------
  12189. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12190. * @tx_success_bytes : total successful bytes in the PPDU.
  12191. * @tx_retry_bytes : total retried bytes in the PPDU.
  12192. * @tx_failed_bytes : total failed bytes in the PPDU.
  12193. * @tx_ratecode : rate code used for the PPDU.
  12194. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12195. * @ba_ack_failed : BA/ACK failed for this PPDU
  12196. * b00 -> BA received
  12197. * b01 -> BA failed once
  12198. * b10 -> BA failed twice, when HW retry is enabled.
  12199. * @bw : BW
  12200. * b00 -> 20 MHz
  12201. * b01 -> 40 MHz
  12202. * b10 -> 80 MHz
  12203. * b11 -> 160 MHz (or 80+80)
  12204. * @sg : SGI enabled
  12205. * @s : skipped ratectrl
  12206. * @peer_id : peer id
  12207. * @tx_success_msdus : successful MSDUs
  12208. * @tx_retry_msdus : retried MSDUs
  12209. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12210. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12211. */
  12212. /**
  12213. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12214. *
  12215. * @details
  12216. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12217. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12218. * This message will only be sent if the backpressure condition has existed
  12219. * continuously for an initial period (100 ms).
  12220. * Repeat messages with updated information will be sent after each
  12221. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12222. * This message indicates the ring id along with current head and tail index
  12223. * locations (i.e. write and read indices).
  12224. * The backpressure time indicates the time in ms for which continous
  12225. * backpressure has been observed in the ring.
  12226. *
  12227. * The message format is as follows:
  12228. *
  12229. * |31 24|23 16|15 8|7 0|
  12230. * |----------------+----------------+----------------+----------------|
  12231. * | ring_id | ring_type | pdev_id | msg_type |
  12232. * |-------------------------------------------------------------------|
  12233. * | tail_idx | head_idx |
  12234. * |-------------------------------------------------------------------|
  12235. * | backpressure_time_ms |
  12236. * |-------------------------------------------------------------------|
  12237. *
  12238. * The message is interpreted as follows:
  12239. * dword0 - b'0:7 - msg_type: This will be set to
  12240. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12241. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12242. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12243. the msg is for LMAC ring.
  12244. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12245. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12246. * htt_backpressure_lmac_ring_id. This represents
  12247. * the ring id for which continous backpressure is seen
  12248. *
  12249. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12250. * the ring indicated by the ring_id
  12251. *
  12252. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12253. * the ring indicated by the ring id
  12254. *
  12255. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12256. * backpressure has been seen in the ring
  12257. * indicated by the ring_id.
  12258. * Units = milliseconds
  12259. */
  12260. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12261. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12262. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12263. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12264. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12265. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12266. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12267. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12268. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12269. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12270. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12271. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12272. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12273. do { \
  12274. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12275. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12276. } while (0)
  12277. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12278. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12279. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12280. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12281. do { \
  12282. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12283. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12284. } while (0)
  12285. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12286. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12287. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12288. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12289. do { \
  12290. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12291. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12292. } while (0)
  12293. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12294. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12295. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12296. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12297. do { \
  12298. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12299. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12300. } while (0)
  12301. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12302. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12303. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12304. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12305. do { \
  12306. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12307. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12308. } while (0)
  12309. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12310. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12311. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12312. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12313. do { \
  12314. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12315. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12316. } while (0)
  12317. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12318. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12319. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12320. enum htt_backpressure_ring_type {
  12321. HTT_SW_RING_TYPE_UMAC,
  12322. HTT_SW_RING_TYPE_LMAC,
  12323. HTT_SW_RING_TYPE_MAX,
  12324. };
  12325. /* Ring id for which the message is sent to host */
  12326. enum htt_backpressure_umac_ringid {
  12327. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12328. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12329. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12330. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12331. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12332. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12333. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12334. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12335. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12336. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12337. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12338. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12339. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12340. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12341. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12342. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12343. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12344. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12345. HTT_SW_UMAC_RING_IDX_MAX,
  12346. };
  12347. enum htt_backpressure_lmac_ringid {
  12348. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12349. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12350. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12351. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12352. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12353. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12354. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12355. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12356. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12357. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12358. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12359. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12360. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12361. HTT_SW_LMAC_RING_IDX_MAX,
  12362. };
  12363. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12364. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12365. pdev_id: 8,
  12366. ring_type: 8, /* htt_backpressure_ring_type */
  12367. /*
  12368. * ring_id holds an enum value from either
  12369. * htt_backpressure_umac_ringid or
  12370. * htt_backpressure_lmac_ringid, based on
  12371. * the ring_type setting.
  12372. */
  12373. ring_id: 8;
  12374. A_UINT16 head_idx;
  12375. A_UINT16 tail_idx;
  12376. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12377. } POSTPACK;
  12378. /*
  12379. * Defines two 32 bit words that can be used by the target to indicate a per
  12380. * user RU allocation and rate information.
  12381. *
  12382. * This information is currently provided in the "sw_response_reference_ptr"
  12383. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12384. * "rx_ppdu_end_user_stats" TLV.
  12385. *
  12386. * VALID:
  12387. * The consumer of these words must explicitly check the valid bit,
  12388. * and only attempt interpretation of any of the remaining fields if
  12389. * the valid bit is set to 1.
  12390. *
  12391. * VERSION:
  12392. * The consumer of these words must also explicitly check the version bit,
  12393. * and only use the V0 definition if the VERSION field is set to 0.
  12394. *
  12395. * Version 1 is currently undefined, with the exception of the VALID and
  12396. * VERSION fields.
  12397. *
  12398. * Version 0:
  12399. *
  12400. * The fields below are duplicated per BW.
  12401. *
  12402. * The consumer must determine which BW field to use, based on the UL OFDMA
  12403. * PPDU BW indicated by HW.
  12404. *
  12405. * RU_START: RU26 start index for the user.
  12406. * Note that this is always using the RU26 index, regardless
  12407. * of the actual RU assigned to the user
  12408. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12409. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12410. *
  12411. * For example, 20MHz (the value in the top row is RU_START)
  12412. *
  12413. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12414. * RU Size 1 (52): | | | | | |
  12415. * RU Size 2 (106): | | | |
  12416. * RU Size 3 (242): | |
  12417. *
  12418. * RU_SIZE: Indicates the RU size, as defined by enum
  12419. * htt_ul_ofdma_user_info_ru_size.
  12420. *
  12421. * LDPC: LDPC enabled (if 0, BCC is used)
  12422. *
  12423. * DCM: DCM enabled
  12424. *
  12425. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12426. * |---------------------------------+--------------------------------|
  12427. * |Ver|Valid| FW internal |
  12428. * |---------------------------------+--------------------------------|
  12429. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12430. * |---------------------------------+--------------------------------|
  12431. */
  12432. enum htt_ul_ofdma_user_info_ru_size {
  12433. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12434. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12435. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12436. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12437. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12438. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12439. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12440. };
  12441. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12442. struct htt_ul_ofdma_user_info_v0 {
  12443. A_UINT32 word0;
  12444. A_UINT32 word1;
  12445. };
  12446. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12447. A_UINT32 w0_fw_rsvd:30; \
  12448. A_UINT32 w0_valid:1; \
  12449. A_UINT32 w0_version:1;
  12450. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12451. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12452. };
  12453. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12454. A_UINT32 w1_nss:3; \
  12455. A_UINT32 w1_mcs:4; \
  12456. A_UINT32 w1_ldpc:1; \
  12457. A_UINT32 w1_dcm:1; \
  12458. A_UINT32 w1_ru_start:7; \
  12459. A_UINT32 w1_ru_size:3; \
  12460. A_UINT32 w1_trig_type:4; \
  12461. A_UINT32 w1_unused:9;
  12462. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12463. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12464. };
  12465. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12466. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12467. union {
  12468. A_UINT32 word0;
  12469. struct {
  12470. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12471. };
  12472. };
  12473. union {
  12474. A_UINT32 word1;
  12475. struct {
  12476. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12477. };
  12478. };
  12479. } POSTPACK;
  12480. enum HTT_UL_OFDMA_TRIG_TYPE {
  12481. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12482. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12483. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12484. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12485. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12486. };
  12487. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12488. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12489. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12490. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12491. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12492. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12493. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12494. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12495. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12496. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12497. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12499. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12501. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12502. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12503. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12504. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12505. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12506. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12507. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12508. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12509. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12510. /*--- word 0 ---*/
  12511. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12512. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12513. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12514. do { \
  12515. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12516. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12517. } while (0)
  12518. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12519. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12520. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12521. do { \
  12522. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12523. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12524. } while (0)
  12525. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12526. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12527. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12528. do { \
  12529. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12530. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12531. } while (0)
  12532. /*--- word 1 ---*/
  12533. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12534. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12535. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12536. do { \
  12537. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12538. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12539. } while (0)
  12540. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12541. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12543. do { \
  12544. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12545. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12546. } while (0)
  12547. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12548. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12549. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12550. do { \
  12551. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12552. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12553. } while (0)
  12554. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12555. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12556. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12557. do { \
  12558. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12559. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12560. } while (0)
  12561. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12562. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12563. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12564. do { \
  12565. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12566. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12567. } while (0)
  12568. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12569. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12570. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12571. do { \
  12572. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12573. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12574. } while (0)
  12575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12576. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12578. do { \
  12579. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12580. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12581. } while (0)
  12582. /**
  12583. * @brief target -> host channel calibration data message
  12584. * @brief host -> target channel calibration data message
  12585. *
  12586. * @details
  12587. * The following field definitions describe the format of the channel
  12588. * calibration data message sent from the target to the host when
  12589. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12590. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12591. * The message is defined as htt_chan_caldata_msg followed by a variable
  12592. * number of 32-bit character values.
  12593. *
  12594. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12595. * |------------------------------------------------------------------|
  12596. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12597. * |------------------------------------------------------------------|
  12598. * | payload size | mhz |
  12599. * |------------------------------------------------------------------|
  12600. * | center frequency 2 | center frequency 1 |
  12601. * |------------------------------------------------------------------|
  12602. * | check sum |
  12603. * |------------------------------------------------------------------|
  12604. * | payload |
  12605. * |------------------------------------------------------------------|
  12606. * message info field:
  12607. * - MSG_TYPE
  12608. * Bits 7:0
  12609. * Purpose: identifies this as a channel calibration data message
  12610. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12611. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12612. * - SUB_TYPE
  12613. * Bits 11:8
  12614. * Purpose: T2H: indicates whether target is providing chan cal data
  12615. * to the host to store, or requesting that the host
  12616. * download previously-stored data.
  12617. * H2T: indicates whether the host is providing the requested
  12618. * channel cal data, or if it is rejecting the data
  12619. * request because it does not have the requested data.
  12620. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12621. * - CHKSUM_VALID
  12622. * Bit 12
  12623. * Purpose: indicates if the checksum field is valid
  12624. * value:
  12625. * - FRAG
  12626. * Bit 19:16
  12627. * Purpose: indicates the fragment index for message
  12628. * value: 0 for first fragment, 1 for second fragment, ...
  12629. * - APPEND
  12630. * Bit 20
  12631. * Purpose: indicates if this is the last fragment
  12632. * value: 0 = final fragment, 1 = more fragments will be appended
  12633. *
  12634. * channel and payload size field
  12635. * - MHZ
  12636. * Bits 15:0
  12637. * Purpose: indicates the channel primary frequency
  12638. * Value:
  12639. * - PAYLOAD_SIZE
  12640. * Bits 31:16
  12641. * Purpose: indicates the bytes of calibration data in payload
  12642. * Value:
  12643. *
  12644. * center frequency field
  12645. * - CENTER FREQUENCY 1
  12646. * Bits 15:0
  12647. * Purpose: indicates the channel center frequency
  12648. * Value: channel center frequency, in MHz units
  12649. * - CENTER FREQUENCY 2
  12650. * Bits 31:16
  12651. * Purpose: indicates the secondary channel center frequency,
  12652. * only for 11acvht 80plus80 mode
  12653. * Value: secondary channel center frequeny, in MHz units, if applicable
  12654. *
  12655. * checksum field
  12656. * - CHECK_SUM
  12657. * Bits 31:0
  12658. * Purpose: check the payload data, it is just for this fragment.
  12659. * This is intended for the target to check that the channel
  12660. * calibration data returned by the host is the unmodified data
  12661. * that was previously provided to the host by the target.
  12662. * value: checksum of fragment payload
  12663. */
  12664. PREPACK struct htt_chan_caldata_msg {
  12665. /* DWORD 0: message info */
  12666. A_UINT32
  12667. msg_type: 8,
  12668. sub_type: 4 ,
  12669. chksum_valid: 1, /** 1:valid, 0:invalid */
  12670. reserved1: 3,
  12671. frag_idx: 4, /** fragment index for calibration data */
  12672. appending: 1, /** 0: no fragment appending,
  12673. * 1: extra fragment appending */
  12674. reserved2: 11;
  12675. /* DWORD 1: channel and payload size */
  12676. A_UINT32
  12677. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12678. payload_size: 16; /** unit: bytes */
  12679. /* DWORD 2: center frequency */
  12680. A_UINT32
  12681. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12682. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12683. * valid only for 11acvht 80plus80 mode */
  12684. /* DWORD 3: check sum */
  12685. A_UINT32 chksum;
  12686. /* variable length for calibration data */
  12687. A_UINT32 payload[1/* or more */];
  12688. } POSTPACK;
  12689. /* T2H SUBTYPE */
  12690. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12691. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12692. /* H2T SUBTYPE */
  12693. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12694. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12695. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12696. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12697. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12698. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12699. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12700. do { \
  12701. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12702. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12703. } while (0)
  12704. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12705. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12706. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12707. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12708. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12709. do { \
  12710. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12711. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12712. } while (0)
  12713. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12714. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12715. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12716. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12717. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12718. do { \
  12719. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12720. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12721. } while (0)
  12722. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12723. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12724. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12725. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12726. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12727. do { \
  12728. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12729. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12730. } while (0)
  12731. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12732. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12733. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12734. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12735. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12736. do { \
  12737. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12738. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12739. } while (0)
  12740. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12741. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12742. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12743. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12744. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12745. do { \
  12746. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12747. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12748. } while (0)
  12749. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12750. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12751. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12752. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12753. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12754. do { \
  12755. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12756. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12757. } while (0)
  12758. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12759. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12760. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12761. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12762. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12763. do { \
  12764. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12765. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12766. } while (0)
  12767. /**
  12768. * @brief - HTT PPDU ID format
  12769. *
  12770. * @details
  12771. * The following field definitions describe the format of the PPDU ID.
  12772. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12773. *
  12774. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12775. * +--------------------------------------------------------------------------
  12776. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12777. * +--------------------------------------------------------------------------
  12778. *
  12779. * sch id :Schedule command id
  12780. * Bits [11 : 0] : monotonically increasing counter to track the
  12781. * PPDU posted to a specific transmit queue.
  12782. *
  12783. * hwq_id: Hardware Queue ID.
  12784. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12785. *
  12786. * mac_id: MAC ID
  12787. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12788. *
  12789. * seq_idx: Sequence index.
  12790. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12791. * a particular TXOP.
  12792. *
  12793. * tqm_cmd: HWSCH/TQM flag.
  12794. * Bit [23] : Always set to 0.
  12795. *
  12796. * seq_cmd_type: Sequence command type.
  12797. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12798. * Refer to enum HTT_STATS_FTYPE for values.
  12799. */
  12800. PREPACK struct htt_ppdu_id {
  12801. A_UINT32
  12802. sch_id: 12,
  12803. hwq_id: 5,
  12804. mac_id: 2,
  12805. seq_idx: 2,
  12806. reserved1: 2,
  12807. tqm_cmd: 1,
  12808. seq_cmd_type: 6,
  12809. reserved2: 2;
  12810. } POSTPACK;
  12811. #define HTT_PPDU_ID_SCH_ID_S 0
  12812. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12813. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12814. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12815. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12816. do { \
  12817. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12818. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12819. } while (0)
  12820. #define HTT_PPDU_ID_HWQ_ID_S 12
  12821. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12822. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12823. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12824. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12825. do { \
  12826. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12827. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12828. } while (0)
  12829. #define HTT_PPDU_ID_MAC_ID_S 17
  12830. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12831. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12832. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12833. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12834. do { \
  12835. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12836. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12837. } while (0)
  12838. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12839. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  12840. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12841. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12842. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12843. do { \
  12844. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12845. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12846. } while (0)
  12847. #define HTT_PPDU_ID_TQM_CMD_S 23
  12848. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12849. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12850. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12851. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12852. do { \
  12853. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12854. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12855. } while (0)
  12856. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12857. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12858. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12859. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12860. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12861. do { \
  12862. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12863. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12864. } while (0)
  12865. #endif