wmi.h 140 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _WMI_H_
  18. #define _WMI_H_
  19. #include <linux/types.h>
  20. #include <net/mac80211.h>
  21. /*
  22. * This file specifies the WMI interface for the Unified Software
  23. * Architecture.
  24. *
  25. * It includes definitions of all the commands and events. Commands are
  26. * messages from the host to the target. Events and Replies are messages
  27. * from the target to the host.
  28. *
  29. * Ownership of correctness in regards to WMI commands belongs to the host
  30. * driver and the target is not required to validate parameters for value,
  31. * proper range, or any other checking.
  32. *
  33. * Guidelines for extending this interface are below.
  34. *
  35. * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
  36. *
  37. * 2. Use ONLY u32 type for defining member variables within WMI
  38. * command/event structures. Do not use u8, u16, bool or
  39. * enum types within these structures.
  40. *
  41. * 3. DO NOT define bit fields within structures. Implement bit fields
  42. * using masks if necessary. Do not use the programming language's bit
  43. * field definition.
  44. *
  45. * 4. Define macros for encode/decode of u8, u16 fields within
  46. * the u32 variables. Use these macros for set/get of these fields.
  47. * Try to use this to optimize the structure without bloating it with
  48. * u32 variables for every lower sized field.
  49. *
  50. * 5. Do not use PACK/UNPACK attributes for the structures as each member
  51. * variable is already 4-byte aligned by virtue of being a u32
  52. * type.
  53. *
  54. * 6. Comment each parameter part of the WMI command/event structure by
  55. * using the 2 stars at the begining of C comment instead of one star to
  56. * enable HTML document generation using Doxygen.
  57. *
  58. */
  59. /* Control Path */
  60. struct wmi_cmd_hdr {
  61. __le32 cmd_id;
  62. } __packed;
  63. #define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
  64. #define WMI_CMD_HDR_CMD_ID_LSB 0
  65. #define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
  66. #define WMI_CMD_HDR_PLT_PRIV_LSB 24
  67. #define HTC_PROTOCOL_VERSION 0x0002
  68. #define WMI_PROTOCOL_VERSION 0x0002
  69. enum wmi_service {
  70. WMI_SERVICE_BEACON_OFFLOAD = 0,
  71. WMI_SERVICE_SCAN_OFFLOAD,
  72. WMI_SERVICE_ROAM_OFFLOAD,
  73. WMI_SERVICE_BCN_MISS_OFFLOAD,
  74. WMI_SERVICE_STA_PWRSAVE,
  75. WMI_SERVICE_STA_ADVANCED_PWRSAVE,
  76. WMI_SERVICE_AP_UAPSD,
  77. WMI_SERVICE_AP_DFS,
  78. WMI_SERVICE_11AC,
  79. WMI_SERVICE_BLOCKACK,
  80. WMI_SERVICE_PHYERR,
  81. WMI_SERVICE_BCN_FILTER,
  82. WMI_SERVICE_RTT,
  83. WMI_SERVICE_RATECTRL,
  84. WMI_SERVICE_WOW,
  85. WMI_SERVICE_RATECTRL_CACHE,
  86. WMI_SERVICE_IRAM_TIDS,
  87. WMI_SERVICE_ARPNS_OFFLOAD,
  88. WMI_SERVICE_NLO,
  89. WMI_SERVICE_GTK_OFFLOAD,
  90. WMI_SERVICE_SCAN_SCH,
  91. WMI_SERVICE_CSA_OFFLOAD,
  92. WMI_SERVICE_CHATTER,
  93. WMI_SERVICE_COEX_FREQAVOID,
  94. WMI_SERVICE_PACKET_POWER_SAVE,
  95. WMI_SERVICE_FORCE_FW_HANG,
  96. WMI_SERVICE_GPIO,
  97. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  98. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  99. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  100. WMI_SERVICE_STA_KEEP_ALIVE,
  101. WMI_SERVICE_TX_ENCAP,
  102. WMI_SERVICE_BURST,
  103. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  104. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  105. WMI_SERVICE_ROAM_SCAN_OFFLOAD,
  106. WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  107. WMI_SERVICE_EARLY_RX,
  108. WMI_SERVICE_STA_SMPS,
  109. WMI_SERVICE_FWTEST,
  110. WMI_SERVICE_STA_WMMAC,
  111. WMI_SERVICE_TDLS,
  112. WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
  113. WMI_SERVICE_ADAPTIVE_OCS,
  114. WMI_SERVICE_BA_SSN_SUPPORT,
  115. WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
  116. WMI_SERVICE_WLAN_HB,
  117. WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
  118. WMI_SERVICE_BATCH_SCAN,
  119. WMI_SERVICE_QPOWER,
  120. WMI_SERVICE_PLMREQ,
  121. WMI_SERVICE_THERMAL_MGMT,
  122. WMI_SERVICE_RMC,
  123. WMI_SERVICE_MHF_OFFLOAD,
  124. WMI_SERVICE_COEX_SAR,
  125. WMI_SERVICE_BCN_TXRATE_OVERRIDE,
  126. WMI_SERVICE_NAN,
  127. WMI_SERVICE_L1SS_STAT,
  128. WMI_SERVICE_ESTIMATE_LINKSPEED,
  129. WMI_SERVICE_OBSS_SCAN,
  130. WMI_SERVICE_TDLS_OFFCHAN,
  131. WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
  132. WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
  133. WMI_SERVICE_IBSS_PWRSAVE,
  134. WMI_SERVICE_LPASS,
  135. WMI_SERVICE_EXTSCAN,
  136. WMI_SERVICE_D0WOW,
  137. WMI_SERVICE_HSOFFLOAD,
  138. WMI_SERVICE_ROAM_HO_OFFLOAD,
  139. WMI_SERVICE_RX_FULL_REORDER,
  140. WMI_SERVICE_DHCP_OFFLOAD,
  141. WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
  142. WMI_SERVICE_MDNS_OFFLOAD,
  143. WMI_SERVICE_SAP_AUTH_OFFLOAD,
  144. /* keep last */
  145. WMI_SERVICE_MAX,
  146. };
  147. enum wmi_10x_service {
  148. WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
  149. WMI_10X_SERVICE_SCAN_OFFLOAD,
  150. WMI_10X_SERVICE_ROAM_OFFLOAD,
  151. WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  152. WMI_10X_SERVICE_STA_PWRSAVE,
  153. WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  154. WMI_10X_SERVICE_AP_UAPSD,
  155. WMI_10X_SERVICE_AP_DFS,
  156. WMI_10X_SERVICE_11AC,
  157. WMI_10X_SERVICE_BLOCKACK,
  158. WMI_10X_SERVICE_PHYERR,
  159. WMI_10X_SERVICE_BCN_FILTER,
  160. WMI_10X_SERVICE_RTT,
  161. WMI_10X_SERVICE_RATECTRL,
  162. WMI_10X_SERVICE_WOW,
  163. WMI_10X_SERVICE_RATECTRL_CACHE,
  164. WMI_10X_SERVICE_IRAM_TIDS,
  165. WMI_10X_SERVICE_BURST,
  166. /* introduced in 10.2 */
  167. WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  168. WMI_10X_SERVICE_FORCE_FW_HANG,
  169. WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  170. };
  171. enum wmi_main_service {
  172. WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
  173. WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  174. WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  175. WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  176. WMI_MAIN_SERVICE_STA_PWRSAVE,
  177. WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  178. WMI_MAIN_SERVICE_AP_UAPSD,
  179. WMI_MAIN_SERVICE_AP_DFS,
  180. WMI_MAIN_SERVICE_11AC,
  181. WMI_MAIN_SERVICE_BLOCKACK,
  182. WMI_MAIN_SERVICE_PHYERR,
  183. WMI_MAIN_SERVICE_BCN_FILTER,
  184. WMI_MAIN_SERVICE_RTT,
  185. WMI_MAIN_SERVICE_RATECTRL,
  186. WMI_MAIN_SERVICE_WOW,
  187. WMI_MAIN_SERVICE_RATECTRL_CACHE,
  188. WMI_MAIN_SERVICE_IRAM_TIDS,
  189. WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  190. WMI_MAIN_SERVICE_NLO,
  191. WMI_MAIN_SERVICE_GTK_OFFLOAD,
  192. WMI_MAIN_SERVICE_SCAN_SCH,
  193. WMI_MAIN_SERVICE_CSA_OFFLOAD,
  194. WMI_MAIN_SERVICE_CHATTER,
  195. WMI_MAIN_SERVICE_COEX_FREQAVOID,
  196. WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  197. WMI_MAIN_SERVICE_FORCE_FW_HANG,
  198. WMI_MAIN_SERVICE_GPIO,
  199. WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  200. WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  201. WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  202. WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  203. WMI_MAIN_SERVICE_TX_ENCAP,
  204. };
  205. static inline char *wmi_service_name(int service_id)
  206. {
  207. #define SVCSTR(x) case x: return #x
  208. switch (service_id) {
  209. SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
  210. SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
  211. SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
  212. SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
  213. SVCSTR(WMI_SERVICE_STA_PWRSAVE);
  214. SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  215. SVCSTR(WMI_SERVICE_AP_UAPSD);
  216. SVCSTR(WMI_SERVICE_AP_DFS);
  217. SVCSTR(WMI_SERVICE_11AC);
  218. SVCSTR(WMI_SERVICE_BLOCKACK);
  219. SVCSTR(WMI_SERVICE_PHYERR);
  220. SVCSTR(WMI_SERVICE_BCN_FILTER);
  221. SVCSTR(WMI_SERVICE_RTT);
  222. SVCSTR(WMI_SERVICE_RATECTRL);
  223. SVCSTR(WMI_SERVICE_WOW);
  224. SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
  225. SVCSTR(WMI_SERVICE_IRAM_TIDS);
  226. SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
  227. SVCSTR(WMI_SERVICE_NLO);
  228. SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
  229. SVCSTR(WMI_SERVICE_SCAN_SCH);
  230. SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
  231. SVCSTR(WMI_SERVICE_CHATTER);
  232. SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
  233. SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
  234. SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
  235. SVCSTR(WMI_SERVICE_GPIO);
  236. SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
  237. SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
  238. SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
  239. SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
  240. SVCSTR(WMI_SERVICE_TX_ENCAP);
  241. SVCSTR(WMI_SERVICE_BURST);
  242. SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
  243. SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
  244. SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
  245. SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
  246. SVCSTR(WMI_SERVICE_EARLY_RX);
  247. SVCSTR(WMI_SERVICE_STA_SMPS);
  248. SVCSTR(WMI_SERVICE_FWTEST);
  249. SVCSTR(WMI_SERVICE_STA_WMMAC);
  250. SVCSTR(WMI_SERVICE_TDLS);
  251. SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
  252. SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
  253. SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
  254. SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
  255. SVCSTR(WMI_SERVICE_WLAN_HB);
  256. SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
  257. SVCSTR(WMI_SERVICE_BATCH_SCAN);
  258. SVCSTR(WMI_SERVICE_QPOWER);
  259. SVCSTR(WMI_SERVICE_PLMREQ);
  260. SVCSTR(WMI_SERVICE_THERMAL_MGMT);
  261. SVCSTR(WMI_SERVICE_RMC);
  262. SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
  263. SVCSTR(WMI_SERVICE_COEX_SAR);
  264. SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
  265. SVCSTR(WMI_SERVICE_NAN);
  266. SVCSTR(WMI_SERVICE_L1SS_STAT);
  267. SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
  268. SVCSTR(WMI_SERVICE_OBSS_SCAN);
  269. SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
  270. SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
  271. SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
  272. SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
  273. SVCSTR(WMI_SERVICE_LPASS);
  274. SVCSTR(WMI_SERVICE_EXTSCAN);
  275. SVCSTR(WMI_SERVICE_D0WOW);
  276. SVCSTR(WMI_SERVICE_HSOFFLOAD);
  277. SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
  278. SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
  279. SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
  280. SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
  281. SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
  282. SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
  283. default:
  284. return NULL;
  285. }
  286. #undef SVCSTR
  287. }
  288. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
  289. ((svc_id) < (len) && \
  290. __le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
  291. BIT((svc_id)%(sizeof(u32))))
  292. #define SVCMAP(x, y, len) \
  293. do { \
  294. if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
  295. __set_bit(y, out); \
  296. } while (0)
  297. static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
  298. size_t len)
  299. {
  300. SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
  301. WMI_SERVICE_BEACON_OFFLOAD, len);
  302. SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
  303. WMI_SERVICE_SCAN_OFFLOAD, len);
  304. SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
  305. WMI_SERVICE_ROAM_OFFLOAD, len);
  306. SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  307. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  308. SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
  309. WMI_SERVICE_STA_PWRSAVE, len);
  310. SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  311. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  312. SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
  313. WMI_SERVICE_AP_UAPSD, len);
  314. SVCMAP(WMI_10X_SERVICE_AP_DFS,
  315. WMI_SERVICE_AP_DFS, len);
  316. SVCMAP(WMI_10X_SERVICE_11AC,
  317. WMI_SERVICE_11AC, len);
  318. SVCMAP(WMI_10X_SERVICE_BLOCKACK,
  319. WMI_SERVICE_BLOCKACK, len);
  320. SVCMAP(WMI_10X_SERVICE_PHYERR,
  321. WMI_SERVICE_PHYERR, len);
  322. SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
  323. WMI_SERVICE_BCN_FILTER, len);
  324. SVCMAP(WMI_10X_SERVICE_RTT,
  325. WMI_SERVICE_RTT, len);
  326. SVCMAP(WMI_10X_SERVICE_RATECTRL,
  327. WMI_SERVICE_RATECTRL, len);
  328. SVCMAP(WMI_10X_SERVICE_WOW,
  329. WMI_SERVICE_WOW, len);
  330. SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
  331. WMI_SERVICE_RATECTRL_CACHE, len);
  332. SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
  333. WMI_SERVICE_IRAM_TIDS, len);
  334. SVCMAP(WMI_10X_SERVICE_BURST,
  335. WMI_SERVICE_BURST, len);
  336. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  337. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
  338. SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
  339. WMI_SERVICE_FORCE_FW_HANG, len);
  340. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  341. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
  342. }
  343. static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
  344. size_t len)
  345. {
  346. SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
  347. WMI_SERVICE_BEACON_OFFLOAD, len);
  348. SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  349. WMI_SERVICE_SCAN_OFFLOAD, len);
  350. SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  351. WMI_SERVICE_ROAM_OFFLOAD, len);
  352. SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  353. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  354. SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
  355. WMI_SERVICE_STA_PWRSAVE, len);
  356. SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  357. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  358. SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
  359. WMI_SERVICE_AP_UAPSD, len);
  360. SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
  361. WMI_SERVICE_AP_DFS, len);
  362. SVCMAP(WMI_MAIN_SERVICE_11AC,
  363. WMI_SERVICE_11AC, len);
  364. SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
  365. WMI_SERVICE_BLOCKACK, len);
  366. SVCMAP(WMI_MAIN_SERVICE_PHYERR,
  367. WMI_SERVICE_PHYERR, len);
  368. SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
  369. WMI_SERVICE_BCN_FILTER, len);
  370. SVCMAP(WMI_MAIN_SERVICE_RTT,
  371. WMI_SERVICE_RTT, len);
  372. SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
  373. WMI_SERVICE_RATECTRL, len);
  374. SVCMAP(WMI_MAIN_SERVICE_WOW,
  375. WMI_SERVICE_WOW, len);
  376. SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
  377. WMI_SERVICE_RATECTRL_CACHE, len);
  378. SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
  379. WMI_SERVICE_IRAM_TIDS, len);
  380. SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  381. WMI_SERVICE_ARPNS_OFFLOAD, len);
  382. SVCMAP(WMI_MAIN_SERVICE_NLO,
  383. WMI_SERVICE_NLO, len);
  384. SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
  385. WMI_SERVICE_GTK_OFFLOAD, len);
  386. SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
  387. WMI_SERVICE_SCAN_SCH, len);
  388. SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
  389. WMI_SERVICE_CSA_OFFLOAD, len);
  390. SVCMAP(WMI_MAIN_SERVICE_CHATTER,
  391. WMI_SERVICE_CHATTER, len);
  392. SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
  393. WMI_SERVICE_COEX_FREQAVOID, len);
  394. SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  395. WMI_SERVICE_PACKET_POWER_SAVE, len);
  396. SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
  397. WMI_SERVICE_FORCE_FW_HANG, len);
  398. SVCMAP(WMI_MAIN_SERVICE_GPIO,
  399. WMI_SERVICE_GPIO, len);
  400. SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  401. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
  402. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  403. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
  404. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  405. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
  406. SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  407. WMI_SERVICE_STA_KEEP_ALIVE, len);
  408. SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
  409. WMI_SERVICE_TX_ENCAP, len);
  410. }
  411. #undef SVCMAP
  412. /* 2 word representation of MAC addr */
  413. struct wmi_mac_addr {
  414. union {
  415. u8 addr[6];
  416. struct {
  417. u32 word0;
  418. u32 word1;
  419. } __packed;
  420. } __packed;
  421. } __packed;
  422. struct wmi_cmd_map {
  423. u32 init_cmdid;
  424. u32 start_scan_cmdid;
  425. u32 stop_scan_cmdid;
  426. u32 scan_chan_list_cmdid;
  427. u32 scan_sch_prio_tbl_cmdid;
  428. u32 pdev_set_regdomain_cmdid;
  429. u32 pdev_set_channel_cmdid;
  430. u32 pdev_set_param_cmdid;
  431. u32 pdev_pktlog_enable_cmdid;
  432. u32 pdev_pktlog_disable_cmdid;
  433. u32 pdev_set_wmm_params_cmdid;
  434. u32 pdev_set_ht_cap_ie_cmdid;
  435. u32 pdev_set_vht_cap_ie_cmdid;
  436. u32 pdev_set_dscp_tid_map_cmdid;
  437. u32 pdev_set_quiet_mode_cmdid;
  438. u32 pdev_green_ap_ps_enable_cmdid;
  439. u32 pdev_get_tpc_config_cmdid;
  440. u32 pdev_set_base_macaddr_cmdid;
  441. u32 vdev_create_cmdid;
  442. u32 vdev_delete_cmdid;
  443. u32 vdev_start_request_cmdid;
  444. u32 vdev_restart_request_cmdid;
  445. u32 vdev_up_cmdid;
  446. u32 vdev_stop_cmdid;
  447. u32 vdev_down_cmdid;
  448. u32 vdev_set_param_cmdid;
  449. u32 vdev_install_key_cmdid;
  450. u32 peer_create_cmdid;
  451. u32 peer_delete_cmdid;
  452. u32 peer_flush_tids_cmdid;
  453. u32 peer_set_param_cmdid;
  454. u32 peer_assoc_cmdid;
  455. u32 peer_add_wds_entry_cmdid;
  456. u32 peer_remove_wds_entry_cmdid;
  457. u32 peer_mcast_group_cmdid;
  458. u32 bcn_tx_cmdid;
  459. u32 pdev_send_bcn_cmdid;
  460. u32 bcn_tmpl_cmdid;
  461. u32 bcn_filter_rx_cmdid;
  462. u32 prb_req_filter_rx_cmdid;
  463. u32 mgmt_tx_cmdid;
  464. u32 prb_tmpl_cmdid;
  465. u32 addba_clear_resp_cmdid;
  466. u32 addba_send_cmdid;
  467. u32 addba_status_cmdid;
  468. u32 delba_send_cmdid;
  469. u32 addba_set_resp_cmdid;
  470. u32 send_singleamsdu_cmdid;
  471. u32 sta_powersave_mode_cmdid;
  472. u32 sta_powersave_param_cmdid;
  473. u32 sta_mimo_ps_mode_cmdid;
  474. u32 pdev_dfs_enable_cmdid;
  475. u32 pdev_dfs_disable_cmdid;
  476. u32 roam_scan_mode;
  477. u32 roam_scan_rssi_threshold;
  478. u32 roam_scan_period;
  479. u32 roam_scan_rssi_change_threshold;
  480. u32 roam_ap_profile;
  481. u32 ofl_scan_add_ap_profile;
  482. u32 ofl_scan_remove_ap_profile;
  483. u32 ofl_scan_period;
  484. u32 p2p_dev_set_device_info;
  485. u32 p2p_dev_set_discoverability;
  486. u32 p2p_go_set_beacon_ie;
  487. u32 p2p_go_set_probe_resp_ie;
  488. u32 p2p_set_vendor_ie_data_cmdid;
  489. u32 ap_ps_peer_param_cmdid;
  490. u32 ap_ps_peer_uapsd_coex_cmdid;
  491. u32 peer_rate_retry_sched_cmdid;
  492. u32 wlan_profile_trigger_cmdid;
  493. u32 wlan_profile_set_hist_intvl_cmdid;
  494. u32 wlan_profile_get_profile_data_cmdid;
  495. u32 wlan_profile_enable_profile_id_cmdid;
  496. u32 wlan_profile_list_profile_id_cmdid;
  497. u32 pdev_suspend_cmdid;
  498. u32 pdev_resume_cmdid;
  499. u32 add_bcn_filter_cmdid;
  500. u32 rmv_bcn_filter_cmdid;
  501. u32 wow_add_wake_pattern_cmdid;
  502. u32 wow_del_wake_pattern_cmdid;
  503. u32 wow_enable_disable_wake_event_cmdid;
  504. u32 wow_enable_cmdid;
  505. u32 wow_hostwakeup_from_sleep_cmdid;
  506. u32 rtt_measreq_cmdid;
  507. u32 rtt_tsf_cmdid;
  508. u32 vdev_spectral_scan_configure_cmdid;
  509. u32 vdev_spectral_scan_enable_cmdid;
  510. u32 request_stats_cmdid;
  511. u32 set_arp_ns_offload_cmdid;
  512. u32 network_list_offload_config_cmdid;
  513. u32 gtk_offload_cmdid;
  514. u32 csa_offload_enable_cmdid;
  515. u32 csa_offload_chanswitch_cmdid;
  516. u32 chatter_set_mode_cmdid;
  517. u32 peer_tid_addba_cmdid;
  518. u32 peer_tid_delba_cmdid;
  519. u32 sta_dtim_ps_method_cmdid;
  520. u32 sta_uapsd_auto_trig_cmdid;
  521. u32 sta_keepalive_cmd;
  522. u32 echo_cmdid;
  523. u32 pdev_utf_cmdid;
  524. u32 dbglog_cfg_cmdid;
  525. u32 pdev_qvit_cmdid;
  526. u32 pdev_ftm_intg_cmdid;
  527. u32 vdev_set_keepalive_cmdid;
  528. u32 vdev_get_keepalive_cmdid;
  529. u32 force_fw_hang_cmdid;
  530. u32 gpio_config_cmdid;
  531. u32 gpio_output_cmdid;
  532. u32 pdev_get_temperature_cmdid;
  533. u32 vdev_set_wmm_params_cmdid;
  534. };
  535. /*
  536. * wmi command groups.
  537. */
  538. enum wmi_cmd_group {
  539. /* 0 to 2 are reserved */
  540. WMI_GRP_START = 0x3,
  541. WMI_GRP_SCAN = WMI_GRP_START,
  542. WMI_GRP_PDEV,
  543. WMI_GRP_VDEV,
  544. WMI_GRP_PEER,
  545. WMI_GRP_MGMT,
  546. WMI_GRP_BA_NEG,
  547. WMI_GRP_STA_PS,
  548. WMI_GRP_DFS,
  549. WMI_GRP_ROAM,
  550. WMI_GRP_OFL_SCAN,
  551. WMI_GRP_P2P,
  552. WMI_GRP_AP_PS,
  553. WMI_GRP_RATE_CTRL,
  554. WMI_GRP_PROFILE,
  555. WMI_GRP_SUSPEND,
  556. WMI_GRP_BCN_FILTER,
  557. WMI_GRP_WOW,
  558. WMI_GRP_RTT,
  559. WMI_GRP_SPECTRAL,
  560. WMI_GRP_STATS,
  561. WMI_GRP_ARP_NS_OFL,
  562. WMI_GRP_NLO_OFL,
  563. WMI_GRP_GTK_OFL,
  564. WMI_GRP_CSA_OFL,
  565. WMI_GRP_CHATTER,
  566. WMI_GRP_TID_ADDBA,
  567. WMI_GRP_MISC,
  568. WMI_GRP_GPIO,
  569. };
  570. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  571. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  572. #define WMI_CMD_UNSUPPORTED 0
  573. /* Command IDs and command events for MAIN FW. */
  574. enum wmi_cmd_id {
  575. WMI_INIT_CMDID = 0x1,
  576. /* Scan specific commands */
  577. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  578. WMI_STOP_SCAN_CMDID,
  579. WMI_SCAN_CHAN_LIST_CMDID,
  580. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  581. /* PDEV (physical device) specific commands */
  582. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  583. WMI_PDEV_SET_CHANNEL_CMDID,
  584. WMI_PDEV_SET_PARAM_CMDID,
  585. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  586. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  587. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  588. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  589. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  590. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  591. WMI_PDEV_SET_QUIET_MODE_CMDID,
  592. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  593. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  594. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  595. /* VDEV (virtual device) specific commands */
  596. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  597. WMI_VDEV_DELETE_CMDID,
  598. WMI_VDEV_START_REQUEST_CMDID,
  599. WMI_VDEV_RESTART_REQUEST_CMDID,
  600. WMI_VDEV_UP_CMDID,
  601. WMI_VDEV_STOP_CMDID,
  602. WMI_VDEV_DOWN_CMDID,
  603. WMI_VDEV_SET_PARAM_CMDID,
  604. WMI_VDEV_INSTALL_KEY_CMDID,
  605. /* peer specific commands */
  606. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  607. WMI_PEER_DELETE_CMDID,
  608. WMI_PEER_FLUSH_TIDS_CMDID,
  609. WMI_PEER_SET_PARAM_CMDID,
  610. WMI_PEER_ASSOC_CMDID,
  611. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  612. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  613. WMI_PEER_MCAST_GROUP_CMDID,
  614. /* beacon/management specific commands */
  615. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  616. WMI_PDEV_SEND_BCN_CMDID,
  617. WMI_BCN_TMPL_CMDID,
  618. WMI_BCN_FILTER_RX_CMDID,
  619. WMI_PRB_REQ_FILTER_RX_CMDID,
  620. WMI_MGMT_TX_CMDID,
  621. WMI_PRB_TMPL_CMDID,
  622. /* commands to directly control BA negotiation directly from host. */
  623. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  624. WMI_ADDBA_SEND_CMDID,
  625. WMI_ADDBA_STATUS_CMDID,
  626. WMI_DELBA_SEND_CMDID,
  627. WMI_ADDBA_SET_RESP_CMDID,
  628. WMI_SEND_SINGLEAMSDU_CMDID,
  629. /* Station power save specific config */
  630. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  631. WMI_STA_POWERSAVE_PARAM_CMDID,
  632. WMI_STA_MIMO_PS_MODE_CMDID,
  633. /** DFS-specific commands */
  634. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  635. WMI_PDEV_DFS_DISABLE_CMDID,
  636. /* Roaming specific commands */
  637. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  638. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  639. WMI_ROAM_SCAN_PERIOD,
  640. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  641. WMI_ROAM_AP_PROFILE,
  642. /* offload scan specific commands */
  643. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  644. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  645. WMI_OFL_SCAN_PERIOD,
  646. /* P2P specific commands */
  647. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  648. WMI_P2P_DEV_SET_DISCOVERABILITY,
  649. WMI_P2P_GO_SET_BEACON_IE,
  650. WMI_P2P_GO_SET_PROBE_RESP_IE,
  651. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  652. /* AP power save specific config */
  653. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  654. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  655. /* Rate-control specific commands */
  656. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  657. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  658. /* WLAN Profiling commands. */
  659. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  660. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  661. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  662. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  663. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  664. /* Suspend resume command Ids */
  665. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  666. WMI_PDEV_RESUME_CMDID,
  667. /* Beacon filter commands */
  668. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  669. WMI_RMV_BCN_FILTER_CMDID,
  670. /* WOW Specific WMI commands*/
  671. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  672. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  673. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  674. WMI_WOW_ENABLE_CMDID,
  675. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  676. /* RTT measurement related cmd */
  677. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  678. WMI_RTT_TSF_CMDID,
  679. /* spectral scan commands */
  680. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  681. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  682. /* F/W stats */
  683. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  684. /* ARP OFFLOAD REQUEST*/
  685. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  686. /* NS offload confid*/
  687. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  688. /* GTK offload Specific WMI commands*/
  689. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  690. /* CSA offload Specific WMI commands*/
  691. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  692. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  693. /* Chatter commands*/
  694. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  695. /* addba specific commands */
  696. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  697. WMI_PEER_TID_DELBA_CMDID,
  698. /* set station mimo powersave method */
  699. WMI_STA_DTIM_PS_METHOD_CMDID,
  700. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  701. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  702. /* STA Keep alive parameter configuration,
  703. Requires WMI_SERVICE_STA_KEEP_ALIVE */
  704. WMI_STA_KEEPALIVE_CMD,
  705. /* misc command group */
  706. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  707. WMI_PDEV_UTF_CMDID,
  708. WMI_DBGLOG_CFG_CMDID,
  709. WMI_PDEV_QVIT_CMDID,
  710. WMI_PDEV_FTM_INTG_CMDID,
  711. WMI_VDEV_SET_KEEPALIVE_CMDID,
  712. WMI_VDEV_GET_KEEPALIVE_CMDID,
  713. WMI_FORCE_FW_HANG_CMDID,
  714. /* GPIO Configuration */
  715. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  716. WMI_GPIO_OUTPUT_CMDID,
  717. };
  718. enum wmi_event_id {
  719. WMI_SERVICE_READY_EVENTID = 0x1,
  720. WMI_READY_EVENTID,
  721. /* Scan specific events */
  722. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  723. /* PDEV specific events */
  724. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  725. WMI_CHAN_INFO_EVENTID,
  726. WMI_PHYERR_EVENTID,
  727. /* VDEV specific events */
  728. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  729. WMI_VDEV_STOPPED_EVENTID,
  730. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  731. /* peer specific events */
  732. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  733. /* beacon/mgmt specific events */
  734. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  735. WMI_HOST_SWBA_EVENTID,
  736. WMI_TBTTOFFSET_UPDATE_EVENTID,
  737. /* ADDBA Related WMI Events*/
  738. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  739. WMI_TX_ADDBA_COMPLETE_EVENTID,
  740. /* Roam event to trigger roaming on host */
  741. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  742. WMI_PROFILE_MATCH,
  743. /* WoW */
  744. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  745. /* RTT */
  746. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  747. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  748. WMI_RTT_ERROR_REPORT_EVENTID,
  749. /* GTK offload */
  750. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  751. WMI_GTK_REKEY_FAIL_EVENTID,
  752. /* CSA IE received event */
  753. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  754. /* Misc events */
  755. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  756. WMI_PDEV_UTF_EVENTID,
  757. WMI_DEBUG_MESG_EVENTID,
  758. WMI_UPDATE_STATS_EVENTID,
  759. WMI_DEBUG_PRINT_EVENTID,
  760. WMI_DCS_INTERFERENCE_EVENTID,
  761. WMI_PDEV_QVIT_EVENTID,
  762. WMI_WLAN_PROFILE_DATA_EVENTID,
  763. WMI_PDEV_FTM_INTG_EVENTID,
  764. WMI_WLAN_FREQ_AVOID_EVENTID,
  765. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  766. /* GPIO Event */
  767. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  768. };
  769. /* Command IDs and command events for 10.X firmware */
  770. enum wmi_10x_cmd_id {
  771. WMI_10X_START_CMDID = 0x9000,
  772. WMI_10X_END_CMDID = 0x9FFF,
  773. /* initialize the wlan sub system */
  774. WMI_10X_INIT_CMDID,
  775. /* Scan specific commands */
  776. WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
  777. WMI_10X_STOP_SCAN_CMDID,
  778. WMI_10X_SCAN_CHAN_LIST_CMDID,
  779. WMI_10X_ECHO_CMDID,
  780. /* PDEV(physical device) specific commands */
  781. WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
  782. WMI_10X_PDEV_SET_CHANNEL_CMDID,
  783. WMI_10X_PDEV_SET_PARAM_CMDID,
  784. WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
  785. WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
  786. WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
  787. WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
  788. WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
  789. WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
  790. WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
  791. WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
  792. WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  793. WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
  794. /* VDEV(virtual device) specific commands */
  795. WMI_10X_VDEV_CREATE_CMDID,
  796. WMI_10X_VDEV_DELETE_CMDID,
  797. WMI_10X_VDEV_START_REQUEST_CMDID,
  798. WMI_10X_VDEV_RESTART_REQUEST_CMDID,
  799. WMI_10X_VDEV_UP_CMDID,
  800. WMI_10X_VDEV_STOP_CMDID,
  801. WMI_10X_VDEV_DOWN_CMDID,
  802. WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
  803. WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
  804. WMI_10X_VDEV_SET_PARAM_CMDID,
  805. WMI_10X_VDEV_INSTALL_KEY_CMDID,
  806. /* peer specific commands */
  807. WMI_10X_PEER_CREATE_CMDID,
  808. WMI_10X_PEER_DELETE_CMDID,
  809. WMI_10X_PEER_FLUSH_TIDS_CMDID,
  810. WMI_10X_PEER_SET_PARAM_CMDID,
  811. WMI_10X_PEER_ASSOC_CMDID,
  812. WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
  813. WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
  814. WMI_10X_PEER_MCAST_GROUP_CMDID,
  815. /* beacon/management specific commands */
  816. WMI_10X_BCN_TX_CMDID,
  817. WMI_10X_BCN_PRB_TMPL_CMDID,
  818. WMI_10X_BCN_FILTER_RX_CMDID,
  819. WMI_10X_PRB_REQ_FILTER_RX_CMDID,
  820. WMI_10X_MGMT_TX_CMDID,
  821. /* commands to directly control ba negotiation directly from host. */
  822. WMI_10X_ADDBA_CLEAR_RESP_CMDID,
  823. WMI_10X_ADDBA_SEND_CMDID,
  824. WMI_10X_ADDBA_STATUS_CMDID,
  825. WMI_10X_DELBA_SEND_CMDID,
  826. WMI_10X_ADDBA_SET_RESP_CMDID,
  827. WMI_10X_SEND_SINGLEAMSDU_CMDID,
  828. /* Station power save specific config */
  829. WMI_10X_STA_POWERSAVE_MODE_CMDID,
  830. WMI_10X_STA_POWERSAVE_PARAM_CMDID,
  831. WMI_10X_STA_MIMO_PS_MODE_CMDID,
  832. /* set debug log config */
  833. WMI_10X_DBGLOG_CFG_CMDID,
  834. /* DFS-specific commands */
  835. WMI_10X_PDEV_DFS_ENABLE_CMDID,
  836. WMI_10X_PDEV_DFS_DISABLE_CMDID,
  837. /* QVIT specific command id */
  838. WMI_10X_PDEV_QVIT_CMDID,
  839. /* Offload Scan and Roaming related commands */
  840. WMI_10X_ROAM_SCAN_MODE,
  841. WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
  842. WMI_10X_ROAM_SCAN_PERIOD,
  843. WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  844. WMI_10X_ROAM_AP_PROFILE,
  845. WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
  846. WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
  847. WMI_10X_OFL_SCAN_PERIOD,
  848. /* P2P specific commands */
  849. WMI_10X_P2P_DEV_SET_DEVICE_INFO,
  850. WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
  851. WMI_10X_P2P_GO_SET_BEACON_IE,
  852. WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
  853. /* AP power save specific config */
  854. WMI_10X_AP_PS_PEER_PARAM_CMDID,
  855. WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
  856. /* Rate-control specific commands */
  857. WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
  858. /* WLAN Profiling commands. */
  859. WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
  860. WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  861. WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  862. WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  863. WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  864. /* Suspend resume command Ids */
  865. WMI_10X_PDEV_SUSPEND_CMDID,
  866. WMI_10X_PDEV_RESUME_CMDID,
  867. /* Beacon filter commands */
  868. WMI_10X_ADD_BCN_FILTER_CMDID,
  869. WMI_10X_RMV_BCN_FILTER_CMDID,
  870. /* WOW Specific WMI commands*/
  871. WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
  872. WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
  873. WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  874. WMI_10X_WOW_ENABLE_CMDID,
  875. WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  876. /* RTT measurement related cmd */
  877. WMI_10X_RTT_MEASREQ_CMDID,
  878. WMI_10X_RTT_TSF_CMDID,
  879. /* transmit beacon by value */
  880. WMI_10X_PDEV_SEND_BCN_CMDID,
  881. /* F/W stats */
  882. WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  883. WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  884. WMI_10X_REQUEST_STATS_CMDID,
  885. /* GPIO Configuration */
  886. WMI_10X_GPIO_CONFIG_CMDID,
  887. WMI_10X_GPIO_OUTPUT_CMDID,
  888. WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
  889. };
  890. enum wmi_10x_event_id {
  891. WMI_10X_SERVICE_READY_EVENTID = 0x8000,
  892. WMI_10X_READY_EVENTID,
  893. WMI_10X_START_EVENTID = 0x9000,
  894. WMI_10X_END_EVENTID = 0x9FFF,
  895. /* Scan specific events */
  896. WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
  897. WMI_10X_ECHO_EVENTID,
  898. WMI_10X_DEBUG_MESG_EVENTID,
  899. WMI_10X_UPDATE_STATS_EVENTID,
  900. /* Instantaneous RSSI event */
  901. WMI_10X_INST_RSSI_STATS_EVENTID,
  902. /* VDEV specific events */
  903. WMI_10X_VDEV_START_RESP_EVENTID,
  904. WMI_10X_VDEV_STANDBY_REQ_EVENTID,
  905. WMI_10X_VDEV_RESUME_REQ_EVENTID,
  906. WMI_10X_VDEV_STOPPED_EVENTID,
  907. /* peer specific events */
  908. WMI_10X_PEER_STA_KICKOUT_EVENTID,
  909. /* beacon/mgmt specific events */
  910. WMI_10X_HOST_SWBA_EVENTID,
  911. WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
  912. WMI_10X_MGMT_RX_EVENTID,
  913. /* Channel stats event */
  914. WMI_10X_CHAN_INFO_EVENTID,
  915. /* PHY Error specific WMI event */
  916. WMI_10X_PHYERR_EVENTID,
  917. /* Roam event to trigger roaming on host */
  918. WMI_10X_ROAM_EVENTID,
  919. /* matching AP found from list of profiles */
  920. WMI_10X_PROFILE_MATCH,
  921. /* debug print message used for tracing FW code while debugging */
  922. WMI_10X_DEBUG_PRINT_EVENTID,
  923. /* VI spoecific event */
  924. WMI_10X_PDEV_QVIT_EVENTID,
  925. /* FW code profile data in response to profile request */
  926. WMI_10X_WLAN_PROFILE_DATA_EVENTID,
  927. /*RTT related event ID*/
  928. WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
  929. WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
  930. WMI_10X_RTT_ERROR_REPORT_EVENTID,
  931. WMI_10X_WOW_WAKEUP_HOST_EVENTID,
  932. WMI_10X_DCS_INTERFERENCE_EVENTID,
  933. /* TPC config for the current operating channel */
  934. WMI_10X_PDEV_TPC_CONFIG_EVENTID,
  935. WMI_10X_GPIO_INPUT_EVENTID,
  936. WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
  937. };
  938. enum wmi_10_2_cmd_id {
  939. WMI_10_2_START_CMDID = 0x9000,
  940. WMI_10_2_END_CMDID = 0x9FFF,
  941. WMI_10_2_INIT_CMDID,
  942. WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
  943. WMI_10_2_STOP_SCAN_CMDID,
  944. WMI_10_2_SCAN_CHAN_LIST_CMDID,
  945. WMI_10_2_ECHO_CMDID,
  946. WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
  947. WMI_10_2_PDEV_SET_CHANNEL_CMDID,
  948. WMI_10_2_PDEV_SET_PARAM_CMDID,
  949. WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
  950. WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
  951. WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
  952. WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
  953. WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
  954. WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
  955. WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
  956. WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  957. WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
  958. WMI_10_2_VDEV_CREATE_CMDID,
  959. WMI_10_2_VDEV_DELETE_CMDID,
  960. WMI_10_2_VDEV_START_REQUEST_CMDID,
  961. WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
  962. WMI_10_2_VDEV_UP_CMDID,
  963. WMI_10_2_VDEV_STOP_CMDID,
  964. WMI_10_2_VDEV_DOWN_CMDID,
  965. WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
  966. WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
  967. WMI_10_2_VDEV_SET_PARAM_CMDID,
  968. WMI_10_2_VDEV_INSTALL_KEY_CMDID,
  969. WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
  970. WMI_10_2_PEER_CREATE_CMDID,
  971. WMI_10_2_PEER_DELETE_CMDID,
  972. WMI_10_2_PEER_FLUSH_TIDS_CMDID,
  973. WMI_10_2_PEER_SET_PARAM_CMDID,
  974. WMI_10_2_PEER_ASSOC_CMDID,
  975. WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
  976. WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
  977. WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
  978. WMI_10_2_PEER_MCAST_GROUP_CMDID,
  979. WMI_10_2_BCN_TX_CMDID,
  980. WMI_10_2_BCN_PRB_TMPL_CMDID,
  981. WMI_10_2_BCN_FILTER_RX_CMDID,
  982. WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
  983. WMI_10_2_MGMT_TX_CMDID,
  984. WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
  985. WMI_10_2_ADDBA_SEND_CMDID,
  986. WMI_10_2_ADDBA_STATUS_CMDID,
  987. WMI_10_2_DELBA_SEND_CMDID,
  988. WMI_10_2_ADDBA_SET_RESP_CMDID,
  989. WMI_10_2_SEND_SINGLEAMSDU_CMDID,
  990. WMI_10_2_STA_POWERSAVE_MODE_CMDID,
  991. WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
  992. WMI_10_2_STA_MIMO_PS_MODE_CMDID,
  993. WMI_10_2_DBGLOG_CFG_CMDID,
  994. WMI_10_2_PDEV_DFS_ENABLE_CMDID,
  995. WMI_10_2_PDEV_DFS_DISABLE_CMDID,
  996. WMI_10_2_PDEV_QVIT_CMDID,
  997. WMI_10_2_ROAM_SCAN_MODE,
  998. WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
  999. WMI_10_2_ROAM_SCAN_PERIOD,
  1000. WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1001. WMI_10_2_ROAM_AP_PROFILE,
  1002. WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
  1003. WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
  1004. WMI_10_2_OFL_SCAN_PERIOD,
  1005. WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
  1006. WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
  1007. WMI_10_2_P2P_GO_SET_BEACON_IE,
  1008. WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
  1009. WMI_10_2_AP_PS_PEER_PARAM_CMDID,
  1010. WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
  1011. WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
  1012. WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
  1013. WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1014. WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1015. WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1016. WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1017. WMI_10_2_PDEV_SUSPEND_CMDID,
  1018. WMI_10_2_PDEV_RESUME_CMDID,
  1019. WMI_10_2_ADD_BCN_FILTER_CMDID,
  1020. WMI_10_2_RMV_BCN_FILTER_CMDID,
  1021. WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
  1022. WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
  1023. WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1024. WMI_10_2_WOW_ENABLE_CMDID,
  1025. WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1026. WMI_10_2_RTT_MEASREQ_CMDID,
  1027. WMI_10_2_RTT_TSF_CMDID,
  1028. WMI_10_2_RTT_KEEPALIVE_CMDID,
  1029. WMI_10_2_PDEV_SEND_BCN_CMDID,
  1030. WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1031. WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1032. WMI_10_2_REQUEST_STATS_CMDID,
  1033. WMI_10_2_GPIO_CONFIG_CMDID,
  1034. WMI_10_2_GPIO_OUTPUT_CMDID,
  1035. WMI_10_2_VDEV_RATEMASK_CMDID,
  1036. WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
  1037. WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  1038. WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  1039. WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  1040. WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  1041. WMI_10_2_FORCE_FW_HANG_CMDID,
  1042. WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  1043. WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
  1044. WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  1045. WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
  1046. WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  1047. WMI_10_2_PDEV_GET_INFO,
  1048. WMI_10_2_VDEV_GET_INFO,
  1049. WMI_10_2_VDEV_ATF_REQUEST_CMDID,
  1050. WMI_10_2_PEER_ATF_REQUEST_CMDID,
  1051. WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
  1052. WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
  1053. };
  1054. enum wmi_10_2_event_id {
  1055. WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
  1056. WMI_10_2_READY_EVENTID,
  1057. WMI_10_2_DEBUG_MESG_EVENTID,
  1058. WMI_10_2_START_EVENTID = 0x9000,
  1059. WMI_10_2_END_EVENTID = 0x9FFF,
  1060. WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
  1061. WMI_10_2_ECHO_EVENTID,
  1062. WMI_10_2_UPDATE_STATS_EVENTID,
  1063. WMI_10_2_INST_RSSI_STATS_EVENTID,
  1064. WMI_10_2_VDEV_START_RESP_EVENTID,
  1065. WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
  1066. WMI_10_2_VDEV_RESUME_REQ_EVENTID,
  1067. WMI_10_2_VDEV_STOPPED_EVENTID,
  1068. WMI_10_2_PEER_STA_KICKOUT_EVENTID,
  1069. WMI_10_2_HOST_SWBA_EVENTID,
  1070. WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
  1071. WMI_10_2_MGMT_RX_EVENTID,
  1072. WMI_10_2_CHAN_INFO_EVENTID,
  1073. WMI_10_2_PHYERR_EVENTID,
  1074. WMI_10_2_ROAM_EVENTID,
  1075. WMI_10_2_PROFILE_MATCH,
  1076. WMI_10_2_DEBUG_PRINT_EVENTID,
  1077. WMI_10_2_PDEV_QVIT_EVENTID,
  1078. WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
  1079. WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
  1080. WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
  1081. WMI_10_2_RTT_ERROR_REPORT_EVENTID,
  1082. WMI_10_2_RTT_KEEPALIVE_EVENTID,
  1083. WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
  1084. WMI_10_2_DCS_INTERFERENCE_EVENTID,
  1085. WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
  1086. WMI_10_2_GPIO_INPUT_EVENTID,
  1087. WMI_10_2_PEER_RATECODE_LIST_EVENTID,
  1088. WMI_10_2_GENERIC_BUFFER_EVENTID,
  1089. WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
  1090. WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
  1091. WMI_10_2_WDS_PEER_EVENTID,
  1092. WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
  1093. WMI_10_2_PDEV_TEMPERATURE_EVENTID,
  1094. WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
  1095. };
  1096. enum wmi_phy_mode {
  1097. MODE_11A = 0, /* 11a Mode */
  1098. MODE_11G = 1, /* 11b/g Mode */
  1099. MODE_11B = 2, /* 11b Mode */
  1100. MODE_11GONLY = 3, /* 11g only Mode */
  1101. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  1102. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  1103. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  1104. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  1105. MODE_11AC_VHT20 = 8,
  1106. MODE_11AC_VHT40 = 9,
  1107. MODE_11AC_VHT80 = 10,
  1108. /* MODE_11AC_VHT160 = 11, */
  1109. MODE_11AC_VHT20_2G = 11,
  1110. MODE_11AC_VHT40_2G = 12,
  1111. MODE_11AC_VHT80_2G = 13,
  1112. MODE_UNKNOWN = 14,
  1113. MODE_MAX = 14
  1114. };
  1115. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  1116. {
  1117. switch (mode) {
  1118. case MODE_11A:
  1119. return "11a";
  1120. case MODE_11G:
  1121. return "11g";
  1122. case MODE_11B:
  1123. return "11b";
  1124. case MODE_11GONLY:
  1125. return "11gonly";
  1126. case MODE_11NA_HT20:
  1127. return "11na-ht20";
  1128. case MODE_11NG_HT20:
  1129. return "11ng-ht20";
  1130. case MODE_11NA_HT40:
  1131. return "11na-ht40";
  1132. case MODE_11NG_HT40:
  1133. return "11ng-ht40";
  1134. case MODE_11AC_VHT20:
  1135. return "11ac-vht20";
  1136. case MODE_11AC_VHT40:
  1137. return "11ac-vht40";
  1138. case MODE_11AC_VHT80:
  1139. return "11ac-vht80";
  1140. case MODE_11AC_VHT20_2G:
  1141. return "11ac-vht20-2g";
  1142. case MODE_11AC_VHT40_2G:
  1143. return "11ac-vht40-2g";
  1144. case MODE_11AC_VHT80_2G:
  1145. return "11ac-vht80-2g";
  1146. case MODE_UNKNOWN:
  1147. /* skip */
  1148. break;
  1149. /* no default handler to allow compiler to check that the
  1150. * enum is fully handled */
  1151. };
  1152. return "<unknown>";
  1153. }
  1154. #define WMI_CHAN_LIST_TAG 0x1
  1155. #define WMI_SSID_LIST_TAG 0x2
  1156. #define WMI_BSSID_LIST_TAG 0x3
  1157. #define WMI_IE_TAG 0x4
  1158. struct wmi_channel {
  1159. __le32 mhz;
  1160. __le32 band_center_freq1;
  1161. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  1162. union {
  1163. __le32 flags; /* WMI_CHAN_FLAG_ */
  1164. struct {
  1165. u8 mode; /* only 6 LSBs */
  1166. } __packed;
  1167. } __packed;
  1168. union {
  1169. __le32 reginfo0;
  1170. struct {
  1171. /* note: power unit is 0.5 dBm */
  1172. u8 min_power;
  1173. u8 max_power;
  1174. u8 reg_power;
  1175. u8 reg_classid;
  1176. } __packed;
  1177. } __packed;
  1178. union {
  1179. __le32 reginfo1;
  1180. struct {
  1181. u8 antenna_max;
  1182. } __packed;
  1183. } __packed;
  1184. } __packed;
  1185. struct wmi_channel_arg {
  1186. u32 freq;
  1187. u32 band_center_freq1;
  1188. bool passive;
  1189. bool allow_ibss;
  1190. bool allow_ht;
  1191. bool allow_vht;
  1192. bool ht40plus;
  1193. bool chan_radar;
  1194. /* note: power unit is 0.5 dBm */
  1195. u32 min_power;
  1196. u32 max_power;
  1197. u32 max_reg_power;
  1198. u32 max_antenna_gain;
  1199. u32 reg_class_id;
  1200. enum wmi_phy_mode mode;
  1201. };
  1202. enum wmi_channel_change_cause {
  1203. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  1204. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  1205. };
  1206. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  1207. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  1208. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  1209. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  1210. #define WMI_CHAN_FLAG_DFS (1 << 10)
  1211. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  1212. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  1213. /* Indicate reason for channel switch */
  1214. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  1215. #define WMI_MAX_SPATIAL_STREAM 3
  1216. /* HT Capabilities*/
  1217. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  1218. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  1219. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  1220. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  1221. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  1222. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  1223. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  1224. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  1225. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  1226. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  1227. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  1228. #define WMI_HT_CAP_HT40_SGI 0x0800
  1229. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  1230. WMI_HT_CAP_HT20_SGI | \
  1231. WMI_HT_CAP_HT40_SGI | \
  1232. WMI_HT_CAP_TX_STBC | \
  1233. WMI_HT_CAP_RX_STBC | \
  1234. WMI_HT_CAP_LDPC)
  1235. /*
  1236. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  1237. * field. The fields not defined here are not supported, or reserved.
  1238. * Do not change these masks and if you have to add new one follow the
  1239. * bitmask as specified by 802.11ac draft.
  1240. */
  1241. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  1242. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  1243. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  1244. #define WMI_VHT_CAP_TX_STBC 0x00000080
  1245. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  1246. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  1247. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  1248. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  1249. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  1250. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  1251. /* The following also refer for max HT AMSDU */
  1252. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  1253. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  1254. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  1255. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  1256. WMI_VHT_CAP_RX_LDPC | \
  1257. WMI_VHT_CAP_SGI_80MHZ | \
  1258. WMI_VHT_CAP_TX_STBC | \
  1259. WMI_VHT_CAP_RX_STBC_MASK | \
  1260. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  1261. WMI_VHT_CAP_RX_FIXED_ANT | \
  1262. WMI_VHT_CAP_TX_FIXED_ANT)
  1263. /*
  1264. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  1265. * 802.11ac
  1266. */
  1267. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  1268. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  1269. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  1270. enum {
  1271. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  1272. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  1273. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  1274. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  1275. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  1276. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  1277. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  1278. REGDMN_MODE_XR = 0x00100, /* XR channels */
  1279. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  1280. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  1281. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  1282. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  1283. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  1284. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  1285. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  1286. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  1287. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  1288. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  1289. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  1290. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  1291. REGDMN_MODE_ALL = 0xffffffff
  1292. };
  1293. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  1294. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  1295. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  1296. /* regulatory capabilities */
  1297. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  1298. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  1299. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  1300. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  1301. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  1302. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  1303. struct hal_reg_capabilities {
  1304. /* regdomain value specified in EEPROM */
  1305. __le32 eeprom_rd;
  1306. /*regdomain */
  1307. __le32 eeprom_rd_ext;
  1308. /* CAP1 capabilities bit map. */
  1309. __le32 regcap1;
  1310. /* REGDMN EEPROM CAP. */
  1311. __le32 regcap2;
  1312. /* REGDMN MODE */
  1313. __le32 wireless_modes;
  1314. __le32 low_2ghz_chan;
  1315. __le32 high_2ghz_chan;
  1316. __le32 low_5ghz_chan;
  1317. __le32 high_5ghz_chan;
  1318. } __packed;
  1319. enum wlan_mode_capability {
  1320. WHAL_WLAN_11A_CAPABILITY = 0x1,
  1321. WHAL_WLAN_11G_CAPABILITY = 0x2,
  1322. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  1323. };
  1324. /* structure used by FW for requesting host memory */
  1325. struct wlan_host_mem_req {
  1326. /* ID of the request */
  1327. __le32 req_id;
  1328. /* size of the of each unit */
  1329. __le32 unit_size;
  1330. /* flags to indicate that
  1331. * the number units is dependent
  1332. * on number of resources(num vdevs num peers .. etc)
  1333. */
  1334. __le32 num_unit_info;
  1335. /*
  1336. * actual number of units to allocate . if flags in the num_unit_info
  1337. * indicate that number of units is tied to number of a particular
  1338. * resource to allocate then num_units filed is set to 0 and host
  1339. * will derive the number units from number of the resources it is
  1340. * requesting.
  1341. */
  1342. __le32 num_units;
  1343. } __packed;
  1344. /*
  1345. * The following struct holds optional payload for
  1346. * wmi_service_ready_event,e.g., 11ac pass some of the
  1347. * device capability to the host.
  1348. */
  1349. struct wmi_service_ready_event {
  1350. __le32 sw_version;
  1351. __le32 sw_version_1;
  1352. __le32 abi_version;
  1353. /* WMI_PHY_CAPABILITY */
  1354. __le32 phy_capability;
  1355. /* Maximum number of frag table entries that SW will populate less 1 */
  1356. __le32 max_frag_entry;
  1357. __le32 wmi_service_bitmap[16];
  1358. __le32 num_rf_chains;
  1359. /*
  1360. * The following field is only valid for service type
  1361. * WMI_SERVICE_11AC
  1362. */
  1363. __le32 ht_cap_info; /* WMI HT Capability */
  1364. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1365. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1366. __le32 hw_min_tx_power;
  1367. __le32 hw_max_tx_power;
  1368. struct hal_reg_capabilities hal_reg_capabilities;
  1369. __le32 sys_cap_info;
  1370. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1371. /*
  1372. * Max beacon and Probe Response IE offload size
  1373. * (includes optional P2P IEs)
  1374. */
  1375. __le32 max_bcn_ie_size;
  1376. /*
  1377. * request to host to allocate a chuck of memory and pss it down to FW
  1378. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1379. * data structures. Only valid for low latency interfaces like PCIE
  1380. * where FW can access this memory directly (or) by DMA.
  1381. */
  1382. __le32 num_mem_reqs;
  1383. struct wlan_host_mem_req mem_reqs[0];
  1384. } __packed;
  1385. /* This is the definition from 10.X firmware branch */
  1386. struct wmi_10x_service_ready_event {
  1387. __le32 sw_version;
  1388. __le32 abi_version;
  1389. /* WMI_PHY_CAPABILITY */
  1390. __le32 phy_capability;
  1391. /* Maximum number of frag table entries that SW will populate less 1 */
  1392. __le32 max_frag_entry;
  1393. __le32 wmi_service_bitmap[16];
  1394. __le32 num_rf_chains;
  1395. /*
  1396. * The following field is only valid for service type
  1397. * WMI_SERVICE_11AC
  1398. */
  1399. __le32 ht_cap_info; /* WMI HT Capability */
  1400. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1401. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1402. __le32 hw_min_tx_power;
  1403. __le32 hw_max_tx_power;
  1404. struct hal_reg_capabilities hal_reg_capabilities;
  1405. __le32 sys_cap_info;
  1406. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1407. /*
  1408. * request to host to allocate a chuck of memory and pss it down to FW
  1409. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1410. * data structures. Only valid for low latency interfaces like PCIE
  1411. * where FW can access this memory directly (or) by DMA.
  1412. */
  1413. __le32 num_mem_reqs;
  1414. struct wlan_host_mem_req mem_reqs[0];
  1415. } __packed;
  1416. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  1417. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  1418. struct wmi_ready_event {
  1419. __le32 sw_version;
  1420. __le32 abi_version;
  1421. struct wmi_mac_addr mac_addr;
  1422. __le32 status;
  1423. } __packed;
  1424. struct wmi_resource_config {
  1425. /* number of virtual devices (VAPs) to support */
  1426. __le32 num_vdevs;
  1427. /* number of peer nodes to support */
  1428. __le32 num_peers;
  1429. /*
  1430. * In offload mode target supports features like WOW, chatter and
  1431. * other protocol offloads. In order to support them some
  1432. * functionalities like reorder buffering, PN checking need to be
  1433. * done in target. This determines maximum number of peers suported
  1434. * by target in offload mode
  1435. */
  1436. __le32 num_offload_peers;
  1437. /* For target-based RX reordering */
  1438. __le32 num_offload_reorder_bufs;
  1439. /* number of keys per peer */
  1440. __le32 num_peer_keys;
  1441. /* total number of TX/RX data TIDs */
  1442. __le32 num_tids;
  1443. /*
  1444. * max skid for resolving hash collisions
  1445. *
  1446. * The address search table is sparse, so that if two MAC addresses
  1447. * result in the same hash value, the second of these conflicting
  1448. * entries can slide to the next index in the address search table,
  1449. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1450. * specifies the upper bound on how many subsequent indices to search
  1451. * over to find an unoccupied space.
  1452. */
  1453. __le32 ast_skid_limit;
  1454. /*
  1455. * the nominal chain mask for transmit
  1456. *
  1457. * The chain mask may be modified dynamically, e.g. to operate AP
  1458. * tx with a reduced number of chains if no clients are associated.
  1459. * This configuration parameter specifies the nominal chain-mask that
  1460. * should be used when not operating with a reduced set of tx chains.
  1461. */
  1462. __le32 tx_chain_mask;
  1463. /*
  1464. * the nominal chain mask for receive
  1465. *
  1466. * The chain mask may be modified dynamically, e.g. for a client
  1467. * to use a reduced number of chains for receive if the traffic to
  1468. * the client is low enough that it doesn't require downlink MIMO
  1469. * or antenna diversity.
  1470. * This configuration parameter specifies the nominal chain-mask that
  1471. * should be used when not operating with a reduced set of rx chains.
  1472. */
  1473. __le32 rx_chain_mask;
  1474. /*
  1475. * what rx reorder timeout (ms) to use for the AC
  1476. *
  1477. * Each WMM access class (voice, video, best-effort, background) will
  1478. * have its own timeout value to dictate how long to wait for missing
  1479. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1480. * already been received.
  1481. * This parameter specifies the timeout in milliseconds for each
  1482. * class.
  1483. */
  1484. __le32 rx_timeout_pri_vi;
  1485. __le32 rx_timeout_pri_vo;
  1486. __le32 rx_timeout_pri_be;
  1487. __le32 rx_timeout_pri_bk;
  1488. /*
  1489. * what mode the rx should decap packets to
  1490. *
  1491. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1492. * THis setting also determines the default TX behavior, however TX
  1493. * behavior can be modified on a per VAP basis during VAP init
  1494. */
  1495. __le32 rx_decap_mode;
  1496. /* what is the maximum number of scan requests that can be queued */
  1497. __le32 scan_max_pending_reqs;
  1498. /* maximum VDEV that could use BMISS offload */
  1499. __le32 bmiss_offload_max_vdev;
  1500. /* maximum VDEV that could use offload roaming */
  1501. __le32 roam_offload_max_vdev;
  1502. /* maximum AP profiles that would push to offload roaming */
  1503. __le32 roam_offload_max_ap_profiles;
  1504. /*
  1505. * how many groups to use for mcast->ucast conversion
  1506. *
  1507. * The target's WAL maintains a table to hold information regarding
  1508. * which peers belong to a given multicast group, so that if
  1509. * multicast->unicast conversion is enabled, the target can convert
  1510. * multicast tx frames to a series of unicast tx frames, to each
  1511. * peer within the multicast group.
  1512. This num_mcast_groups configuration parameter tells the target how
  1513. * many multicast groups to provide storage for within its multicast
  1514. * group membership table.
  1515. */
  1516. __le32 num_mcast_groups;
  1517. /*
  1518. * size to alloc for the mcast membership table
  1519. *
  1520. * This num_mcast_table_elems configuration parameter tells the
  1521. * target how many peer elements it needs to provide storage for in
  1522. * its multicast group membership table.
  1523. * These multicast group membership table elements are shared by the
  1524. * multicast groups stored within the table.
  1525. */
  1526. __le32 num_mcast_table_elems;
  1527. /*
  1528. * whether/how to do multicast->unicast conversion
  1529. *
  1530. * This configuration parameter specifies whether the target should
  1531. * perform multicast --> unicast conversion on transmit, and if so,
  1532. * what to do if it finds no entries in its multicast group
  1533. * membership table for the multicast IP address in the tx frame.
  1534. * Configuration value:
  1535. * 0 -> Do not perform multicast to unicast conversion.
  1536. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1537. * address from the tx frame is found in the multicast group
  1538. * membership table. If the IP multicast address is not found,
  1539. * drop the frame.
  1540. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1541. * address from the tx frame is found in the multicast group
  1542. * membership table. If the IP multicast address is not found,
  1543. * transmit the frame as multicast.
  1544. */
  1545. __le32 mcast2ucast_mode;
  1546. /*
  1547. * how much memory to allocate for a tx PPDU dbg log
  1548. *
  1549. * This parameter controls how much memory the target will allocate
  1550. * to store a log of tx PPDU meta-information (how large the PPDU
  1551. * was, when it was sent, whether it was successful, etc.)
  1552. */
  1553. __le32 tx_dbg_log_size;
  1554. /* how many AST entries to be allocated for WDS */
  1555. __le32 num_wds_entries;
  1556. /*
  1557. * MAC DMA burst size, e.g., For target PCI limit can be
  1558. * 0 -default, 1 256B
  1559. */
  1560. __le32 dma_burst_size;
  1561. /*
  1562. * Fixed delimiters to be inserted after every MPDU to
  1563. * account for interface latency to avoid underrun.
  1564. */
  1565. __le32 mac_aggr_delim;
  1566. /*
  1567. * determine whether target is responsible for detecting duplicate
  1568. * non-aggregate MPDU and timing out stale fragments.
  1569. *
  1570. * A-MPDU reordering is always performed on the target.
  1571. *
  1572. * 0: target responsible for frag timeout and dup checking
  1573. * 1: host responsible for frag timeout and dup checking
  1574. */
  1575. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1576. /*
  1577. * Configuration for VoW :
  1578. * No of Video Nodes to be supported
  1579. * and Max no of descriptors for each Video link (node).
  1580. */
  1581. __le32 vow_config;
  1582. /* maximum VDEV that could use GTK offload */
  1583. __le32 gtk_offload_max_vdev;
  1584. /* Number of msdu descriptors target should use */
  1585. __le32 num_msdu_desc;
  1586. /*
  1587. * Max. number of Tx fragments per MSDU
  1588. * This parameter controls the max number of Tx fragments per MSDU.
  1589. * This is sent by the target as part of the WMI_SERVICE_READY event
  1590. * and is overriden by the OS shim as required.
  1591. */
  1592. __le32 max_frag_entries;
  1593. } __packed;
  1594. struct wmi_resource_config_10x {
  1595. /* number of virtual devices (VAPs) to support */
  1596. __le32 num_vdevs;
  1597. /* number of peer nodes to support */
  1598. __le32 num_peers;
  1599. /* number of keys per peer */
  1600. __le32 num_peer_keys;
  1601. /* total number of TX/RX data TIDs */
  1602. __le32 num_tids;
  1603. /*
  1604. * max skid for resolving hash collisions
  1605. *
  1606. * The address search table is sparse, so that if two MAC addresses
  1607. * result in the same hash value, the second of these conflicting
  1608. * entries can slide to the next index in the address search table,
  1609. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1610. * specifies the upper bound on how many subsequent indices to search
  1611. * over to find an unoccupied space.
  1612. */
  1613. __le32 ast_skid_limit;
  1614. /*
  1615. * the nominal chain mask for transmit
  1616. *
  1617. * The chain mask may be modified dynamically, e.g. to operate AP
  1618. * tx with a reduced number of chains if no clients are associated.
  1619. * This configuration parameter specifies the nominal chain-mask that
  1620. * should be used when not operating with a reduced set of tx chains.
  1621. */
  1622. __le32 tx_chain_mask;
  1623. /*
  1624. * the nominal chain mask for receive
  1625. *
  1626. * The chain mask may be modified dynamically, e.g. for a client
  1627. * to use a reduced number of chains for receive if the traffic to
  1628. * the client is low enough that it doesn't require downlink MIMO
  1629. * or antenna diversity.
  1630. * This configuration parameter specifies the nominal chain-mask that
  1631. * should be used when not operating with a reduced set of rx chains.
  1632. */
  1633. __le32 rx_chain_mask;
  1634. /*
  1635. * what rx reorder timeout (ms) to use for the AC
  1636. *
  1637. * Each WMM access class (voice, video, best-effort, background) will
  1638. * have its own timeout value to dictate how long to wait for missing
  1639. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1640. * already been received.
  1641. * This parameter specifies the timeout in milliseconds for each
  1642. * class.
  1643. */
  1644. __le32 rx_timeout_pri_vi;
  1645. __le32 rx_timeout_pri_vo;
  1646. __le32 rx_timeout_pri_be;
  1647. __le32 rx_timeout_pri_bk;
  1648. /*
  1649. * what mode the rx should decap packets to
  1650. *
  1651. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1652. * THis setting also determines the default TX behavior, however TX
  1653. * behavior can be modified on a per VAP basis during VAP init
  1654. */
  1655. __le32 rx_decap_mode;
  1656. /* what is the maximum number of scan requests that can be queued */
  1657. __le32 scan_max_pending_reqs;
  1658. /* maximum VDEV that could use BMISS offload */
  1659. __le32 bmiss_offload_max_vdev;
  1660. /* maximum VDEV that could use offload roaming */
  1661. __le32 roam_offload_max_vdev;
  1662. /* maximum AP profiles that would push to offload roaming */
  1663. __le32 roam_offload_max_ap_profiles;
  1664. /*
  1665. * how many groups to use for mcast->ucast conversion
  1666. *
  1667. * The target's WAL maintains a table to hold information regarding
  1668. * which peers belong to a given multicast group, so that if
  1669. * multicast->unicast conversion is enabled, the target can convert
  1670. * multicast tx frames to a series of unicast tx frames, to each
  1671. * peer within the multicast group.
  1672. This num_mcast_groups configuration parameter tells the target how
  1673. * many multicast groups to provide storage for within its multicast
  1674. * group membership table.
  1675. */
  1676. __le32 num_mcast_groups;
  1677. /*
  1678. * size to alloc for the mcast membership table
  1679. *
  1680. * This num_mcast_table_elems configuration parameter tells the
  1681. * target how many peer elements it needs to provide storage for in
  1682. * its multicast group membership table.
  1683. * These multicast group membership table elements are shared by the
  1684. * multicast groups stored within the table.
  1685. */
  1686. __le32 num_mcast_table_elems;
  1687. /*
  1688. * whether/how to do multicast->unicast conversion
  1689. *
  1690. * This configuration parameter specifies whether the target should
  1691. * perform multicast --> unicast conversion on transmit, and if so,
  1692. * what to do if it finds no entries in its multicast group
  1693. * membership table for the multicast IP address in the tx frame.
  1694. * Configuration value:
  1695. * 0 -> Do not perform multicast to unicast conversion.
  1696. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1697. * address from the tx frame is found in the multicast group
  1698. * membership table. If the IP multicast address is not found,
  1699. * drop the frame.
  1700. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1701. * address from the tx frame is found in the multicast group
  1702. * membership table. If the IP multicast address is not found,
  1703. * transmit the frame as multicast.
  1704. */
  1705. __le32 mcast2ucast_mode;
  1706. /*
  1707. * how much memory to allocate for a tx PPDU dbg log
  1708. *
  1709. * This parameter controls how much memory the target will allocate
  1710. * to store a log of tx PPDU meta-information (how large the PPDU
  1711. * was, when it was sent, whether it was successful, etc.)
  1712. */
  1713. __le32 tx_dbg_log_size;
  1714. /* how many AST entries to be allocated for WDS */
  1715. __le32 num_wds_entries;
  1716. /*
  1717. * MAC DMA burst size, e.g., For target PCI limit can be
  1718. * 0 -default, 1 256B
  1719. */
  1720. __le32 dma_burst_size;
  1721. /*
  1722. * Fixed delimiters to be inserted after every MPDU to
  1723. * account for interface latency to avoid underrun.
  1724. */
  1725. __le32 mac_aggr_delim;
  1726. /*
  1727. * determine whether target is responsible for detecting duplicate
  1728. * non-aggregate MPDU and timing out stale fragments.
  1729. *
  1730. * A-MPDU reordering is always performed on the target.
  1731. *
  1732. * 0: target responsible for frag timeout and dup checking
  1733. * 1: host responsible for frag timeout and dup checking
  1734. */
  1735. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1736. /*
  1737. * Configuration for VoW :
  1738. * No of Video Nodes to be supported
  1739. * and Max no of descriptors for each Video link (node).
  1740. */
  1741. __le32 vow_config;
  1742. /* Number of msdu descriptors target should use */
  1743. __le32 num_msdu_desc;
  1744. /*
  1745. * Max. number of Tx fragments per MSDU
  1746. * This parameter controls the max number of Tx fragments per MSDU.
  1747. * This is sent by the target as part of the WMI_SERVICE_READY event
  1748. * and is overriden by the OS shim as required.
  1749. */
  1750. __le32 max_frag_entries;
  1751. } __packed;
  1752. enum wmi_10_2_feature_mask {
  1753. WMI_10_2_RX_BATCH_MODE = BIT(0),
  1754. WMI_10_2_ATF_CONFIG = BIT(1),
  1755. };
  1756. struct wmi_resource_config_10_2 {
  1757. struct wmi_resource_config_10x common;
  1758. __le32 max_peer_ext_stats;
  1759. __le32 smart_ant_cap; /* 0-disable, 1-enable */
  1760. __le32 bk_min_free;
  1761. __le32 be_min_free;
  1762. __le32 vi_min_free;
  1763. __le32 vo_min_free;
  1764. __le32 feature_mask;
  1765. } __packed;
  1766. #define NUM_UNITS_IS_NUM_VDEVS 0x1
  1767. #define NUM_UNITS_IS_NUM_PEERS 0x2
  1768. /* strucutre describing host memory chunk. */
  1769. struct host_memory_chunk {
  1770. /* id of the request that is passed up in service ready */
  1771. __le32 req_id;
  1772. /* the physical address the memory chunk */
  1773. __le32 ptr;
  1774. /* size of the chunk */
  1775. __le32 size;
  1776. } __packed;
  1777. struct wmi_host_mem_chunks {
  1778. __le32 count;
  1779. /* some fw revisions require at least 1 chunk regardless of count */
  1780. struct host_memory_chunk items[1];
  1781. } __packed;
  1782. struct wmi_init_cmd {
  1783. struct wmi_resource_config resource_config;
  1784. struct wmi_host_mem_chunks mem_chunks;
  1785. } __packed;
  1786. /* _10x stucture is from 10.X FW API */
  1787. struct wmi_init_cmd_10x {
  1788. struct wmi_resource_config_10x resource_config;
  1789. struct wmi_host_mem_chunks mem_chunks;
  1790. } __packed;
  1791. struct wmi_init_cmd_10_2 {
  1792. struct wmi_resource_config_10_2 resource_config;
  1793. struct wmi_host_mem_chunks mem_chunks;
  1794. } __packed;
  1795. struct wmi_chan_list_entry {
  1796. __le16 freq;
  1797. u8 phy_mode; /* valid for 10.2 only */
  1798. u8 reserved;
  1799. } __packed;
  1800. /* TLV for channel list */
  1801. struct wmi_chan_list {
  1802. __le32 tag; /* WMI_CHAN_LIST_TAG */
  1803. __le32 num_chan;
  1804. struct wmi_chan_list_entry channel_list[0];
  1805. } __packed;
  1806. struct wmi_bssid_list {
  1807. __le32 tag; /* WMI_BSSID_LIST_TAG */
  1808. __le32 num_bssid;
  1809. struct wmi_mac_addr bssid_list[0];
  1810. } __packed;
  1811. struct wmi_ie_data {
  1812. __le32 tag; /* WMI_IE_TAG */
  1813. __le32 ie_len;
  1814. u8 ie_data[0];
  1815. } __packed;
  1816. struct wmi_ssid {
  1817. __le32 ssid_len;
  1818. u8 ssid[32];
  1819. } __packed;
  1820. struct wmi_ssid_list {
  1821. __le32 tag; /* WMI_SSID_LIST_TAG */
  1822. __le32 num_ssids;
  1823. struct wmi_ssid ssids[0];
  1824. } __packed;
  1825. /* prefix used by scan requestor ids on the host */
  1826. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  1827. /* prefix used by scan request ids generated on the host */
  1828. /* host cycles through the lower 12 bits to generate ids */
  1829. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  1830. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  1831. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  1832. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  1833. /* Values lower than this may be refused by some firmware revisions with a scan
  1834. * completion with a timedout reason.
  1835. */
  1836. #define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
  1837. /* Scan priority numbers must be sequential, starting with 0 */
  1838. enum wmi_scan_priority {
  1839. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  1840. WMI_SCAN_PRIORITY_LOW,
  1841. WMI_SCAN_PRIORITY_MEDIUM,
  1842. WMI_SCAN_PRIORITY_HIGH,
  1843. WMI_SCAN_PRIORITY_VERY_HIGH,
  1844. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  1845. };
  1846. struct wmi_start_scan_common {
  1847. /* Scan ID */
  1848. __le32 scan_id;
  1849. /* Scan requestor ID */
  1850. __le32 scan_req_id;
  1851. /* VDEV id(interface) that is requesting scan */
  1852. __le32 vdev_id;
  1853. /* Scan Priority, input to scan scheduler */
  1854. __le32 scan_priority;
  1855. /* Scan events subscription */
  1856. __le32 notify_scan_events;
  1857. /* dwell time in msec on active channels */
  1858. __le32 dwell_time_active;
  1859. /* dwell time in msec on passive channels */
  1860. __le32 dwell_time_passive;
  1861. /*
  1862. * min time in msec on the BSS channel,only valid if atleast one
  1863. * VDEV is active
  1864. */
  1865. __le32 min_rest_time;
  1866. /*
  1867. * max rest time in msec on the BSS channel,only valid if at least
  1868. * one VDEV is active
  1869. */
  1870. /*
  1871. * the scanner will rest on the bss channel at least min_rest_time
  1872. * after min_rest_time the scanner will start checking for tx/rx
  1873. * activity on all VDEVs. if there is no activity the scanner will
  1874. * switch to off channel. if there is activity the scanner will let
  1875. * the radio on the bss channel until max_rest_time expires.at
  1876. * max_rest_time scanner will switch to off channel irrespective of
  1877. * activity. activity is determined by the idle_time parameter.
  1878. */
  1879. __le32 max_rest_time;
  1880. /*
  1881. * time before sending next set of probe requests.
  1882. * The scanner keeps repeating probe requests transmission with
  1883. * period specified by repeat_probe_time.
  1884. * The number of probe requests specified depends on the ssid_list
  1885. * and bssid_list
  1886. */
  1887. __le32 repeat_probe_time;
  1888. /* time in msec between 2 consequetive probe requests with in a set. */
  1889. __le32 probe_spacing_time;
  1890. /*
  1891. * data inactivity time in msec on bss channel that will be used by
  1892. * scanner for measuring the inactivity.
  1893. */
  1894. __le32 idle_time;
  1895. /* maximum time in msec allowed for scan */
  1896. __le32 max_scan_time;
  1897. /*
  1898. * delay in msec before sending first probe request after switching
  1899. * to a channel
  1900. */
  1901. __le32 probe_delay;
  1902. /* Scan control flags */
  1903. __le32 scan_ctrl_flags;
  1904. } __packed;
  1905. struct wmi_start_scan_tlvs {
  1906. /* TLV parameters. These includes channel list, ssid list, bssid list,
  1907. * extra ies.
  1908. */
  1909. u8 tlvs[0];
  1910. } __packed;
  1911. struct wmi_start_scan_cmd {
  1912. struct wmi_start_scan_common common;
  1913. __le32 burst_duration_ms;
  1914. struct wmi_start_scan_tlvs tlvs;
  1915. } __packed;
  1916. /* This is the definition from 10.X firmware branch */
  1917. struct wmi_10x_start_scan_cmd {
  1918. struct wmi_start_scan_common common;
  1919. struct wmi_start_scan_tlvs tlvs;
  1920. } __packed;
  1921. struct wmi_ssid_arg {
  1922. int len;
  1923. const u8 *ssid;
  1924. };
  1925. struct wmi_bssid_arg {
  1926. const u8 *bssid;
  1927. };
  1928. struct wmi_start_scan_arg {
  1929. u32 scan_id;
  1930. u32 scan_req_id;
  1931. u32 vdev_id;
  1932. u32 scan_priority;
  1933. u32 notify_scan_events;
  1934. u32 dwell_time_active;
  1935. u32 dwell_time_passive;
  1936. u32 min_rest_time;
  1937. u32 max_rest_time;
  1938. u32 repeat_probe_time;
  1939. u32 probe_spacing_time;
  1940. u32 idle_time;
  1941. u32 max_scan_time;
  1942. u32 probe_delay;
  1943. u32 scan_ctrl_flags;
  1944. u32 ie_len;
  1945. u32 n_channels;
  1946. u32 n_ssids;
  1947. u32 n_bssids;
  1948. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1949. u16 channels[64];
  1950. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1951. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1952. };
  1953. /* scan control flags */
  1954. /* passively scan all channels including active channels */
  1955. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1956. /* add wild card ssid probe request even though ssid_list is specified. */
  1957. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1958. /* add cck rates to rates/xrate ie for the generated probe request */
  1959. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1960. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1961. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1962. /* To enable indication of Chan load and Noise floor to host */
  1963. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1964. /* Filter Probe request frames */
  1965. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1966. /* When set, DFS channels will not be scanned */
  1967. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1968. /* Different FW scan engine may choose to bail out on errors.
  1969. * Allow the driver to have influence over that. */
  1970. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1971. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1972. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1973. enum wmi_stop_scan_type {
  1974. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1975. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1976. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1977. };
  1978. struct wmi_stop_scan_cmd {
  1979. __le32 scan_req_id;
  1980. __le32 scan_id;
  1981. __le32 req_type;
  1982. __le32 vdev_id;
  1983. } __packed;
  1984. struct wmi_stop_scan_arg {
  1985. u32 req_id;
  1986. enum wmi_stop_scan_type req_type;
  1987. union {
  1988. u32 scan_id;
  1989. u32 vdev_id;
  1990. } u;
  1991. };
  1992. struct wmi_scan_chan_list_cmd {
  1993. __le32 num_scan_chans;
  1994. struct wmi_channel chan_info[0];
  1995. } __packed;
  1996. struct wmi_scan_chan_list_arg {
  1997. u32 n_channels;
  1998. struct wmi_channel_arg *channels;
  1999. };
  2000. enum wmi_bss_filter {
  2001. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  2002. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  2003. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  2004. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  2005. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  2006. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  2007. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  2008. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  2009. };
  2010. enum wmi_scan_event_type {
  2011. WMI_SCAN_EVENT_STARTED = 0x1,
  2012. WMI_SCAN_EVENT_COMPLETED = 0x2,
  2013. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  2014. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  2015. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  2016. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  2017. WMI_SCAN_EVENT_START_FAILED = 0x40,
  2018. WMI_SCAN_EVENT_RESTARTED = 0x80,
  2019. WMI_SCAN_EVENT_MAX = 0x8000
  2020. };
  2021. enum wmi_scan_completion_reason {
  2022. WMI_SCAN_REASON_COMPLETED,
  2023. WMI_SCAN_REASON_CANCELLED,
  2024. WMI_SCAN_REASON_PREEMPTED,
  2025. WMI_SCAN_REASON_TIMEDOUT,
  2026. WMI_SCAN_REASON_MAX,
  2027. };
  2028. struct wmi_scan_event {
  2029. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  2030. __le32 reason; /* %WMI_SCAN_REASON_ */
  2031. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  2032. __le32 scan_req_id;
  2033. __le32 scan_id;
  2034. __le32 vdev_id;
  2035. } __packed;
  2036. /*
  2037. * This defines how much headroom is kept in the
  2038. * receive frame between the descriptor and the
  2039. * payload, in order for the WMI PHY error and
  2040. * management handler to insert header contents.
  2041. *
  2042. * This is in bytes.
  2043. */
  2044. #define WMI_MGMT_RX_HDR_HEADROOM 52
  2045. /*
  2046. * This event will be used for sending scan results
  2047. * as well as rx mgmt frames to the host. The rx buffer
  2048. * will be sent as part of this WMI event. It would be a
  2049. * good idea to pass all the fields in the RX status
  2050. * descriptor up to the host.
  2051. */
  2052. struct wmi_mgmt_rx_hdr_v1 {
  2053. __le32 channel;
  2054. __le32 snr;
  2055. __le32 rate;
  2056. __le32 phy_mode;
  2057. __le32 buf_len;
  2058. __le32 status; /* %WMI_RX_STATUS_ */
  2059. } __packed;
  2060. struct wmi_mgmt_rx_hdr_v2 {
  2061. struct wmi_mgmt_rx_hdr_v1 v1;
  2062. __le32 rssi_ctl[4];
  2063. } __packed;
  2064. struct wmi_mgmt_rx_event_v1 {
  2065. struct wmi_mgmt_rx_hdr_v1 hdr;
  2066. u8 buf[0];
  2067. } __packed;
  2068. struct wmi_mgmt_rx_event_v2 {
  2069. struct wmi_mgmt_rx_hdr_v2 hdr;
  2070. u8 buf[0];
  2071. } __packed;
  2072. #define WMI_RX_STATUS_OK 0x00
  2073. #define WMI_RX_STATUS_ERR_CRC 0x01
  2074. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  2075. #define WMI_RX_STATUS_ERR_MIC 0x10
  2076. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  2077. #define PHY_ERROR_SPECTRAL_SCAN 0x26
  2078. #define PHY_ERROR_FALSE_RADAR_EXT 0x24
  2079. #define PHY_ERROR_RADAR 0x05
  2080. struct wmi_phyerr {
  2081. __le32 tsf_timestamp;
  2082. __le16 freq1;
  2083. __le16 freq2;
  2084. u8 rssi_combined;
  2085. u8 chan_width_mhz;
  2086. u8 phy_err_code;
  2087. u8 rsvd0;
  2088. __le32 rssi_chains[4];
  2089. __le16 nf_chains[4];
  2090. __le32 buf_len;
  2091. u8 buf[0];
  2092. } __packed;
  2093. struct wmi_phyerr_event {
  2094. __le32 num_phyerrs;
  2095. __le32 tsf_l32;
  2096. __le32 tsf_u32;
  2097. struct wmi_phyerr phyerrs[0];
  2098. } __packed;
  2099. #define PHYERR_TLV_SIG 0xBB
  2100. #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
  2101. #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
  2102. #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
  2103. struct phyerr_radar_report {
  2104. __le32 reg0; /* RADAR_REPORT_REG0_* */
  2105. __le32 reg1; /* REDAR_REPORT_REG1_* */
  2106. } __packed;
  2107. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
  2108. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
  2109. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
  2110. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
  2111. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
  2112. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
  2113. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
  2114. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
  2115. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
  2116. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
  2117. #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
  2118. #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
  2119. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
  2120. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
  2121. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
  2122. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
  2123. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
  2124. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
  2125. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
  2126. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
  2127. #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
  2128. #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
  2129. struct phyerr_fft_report {
  2130. __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
  2131. __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
  2132. } __packed;
  2133. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
  2134. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
  2135. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
  2136. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
  2137. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
  2138. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
  2139. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
  2140. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
  2141. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
  2142. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
  2143. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
  2144. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
  2145. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
  2146. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
  2147. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
  2148. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
  2149. struct phyerr_tlv {
  2150. __le16 len;
  2151. u8 tag;
  2152. u8 sig;
  2153. } __packed;
  2154. #define DFS_RSSI_POSSIBLY_FALSE 50
  2155. #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
  2156. struct wmi_mgmt_tx_hdr {
  2157. __le32 vdev_id;
  2158. struct wmi_mac_addr peer_macaddr;
  2159. __le32 tx_rate;
  2160. __le32 tx_power;
  2161. __le32 buf_len;
  2162. } __packed;
  2163. struct wmi_mgmt_tx_cmd {
  2164. struct wmi_mgmt_tx_hdr hdr;
  2165. u8 buf[0];
  2166. } __packed;
  2167. struct wmi_echo_event {
  2168. __le32 value;
  2169. } __packed;
  2170. struct wmi_echo_cmd {
  2171. __le32 value;
  2172. } __packed;
  2173. struct wmi_pdev_set_regdomain_cmd {
  2174. __le32 reg_domain;
  2175. __le32 reg_domain_2G;
  2176. __le32 reg_domain_5G;
  2177. __le32 conformance_test_limit_2G;
  2178. __le32 conformance_test_limit_5G;
  2179. } __packed;
  2180. enum wmi_dfs_region {
  2181. /* Uninitialized dfs domain */
  2182. WMI_UNINIT_DFS_DOMAIN = 0,
  2183. /* FCC3 dfs domain */
  2184. WMI_FCC_DFS_DOMAIN = 1,
  2185. /* ETSI dfs domain */
  2186. WMI_ETSI_DFS_DOMAIN = 2,
  2187. /*Japan dfs domain */
  2188. WMI_MKK4_DFS_DOMAIN = 3,
  2189. };
  2190. struct wmi_pdev_set_regdomain_cmd_10x {
  2191. __le32 reg_domain;
  2192. __le32 reg_domain_2G;
  2193. __le32 reg_domain_5G;
  2194. __le32 conformance_test_limit_2G;
  2195. __le32 conformance_test_limit_5G;
  2196. /* dfs domain from wmi_dfs_region */
  2197. __le32 dfs_domain;
  2198. } __packed;
  2199. /* Command to set/unset chip in quiet mode */
  2200. struct wmi_pdev_set_quiet_cmd {
  2201. /* period in TUs */
  2202. __le32 period;
  2203. /* duration in TUs */
  2204. __le32 duration;
  2205. /* offset in TUs */
  2206. __le32 next_start;
  2207. /* enable/disable */
  2208. __le32 enabled;
  2209. } __packed;
  2210. /*
  2211. * 802.11g protection mode.
  2212. */
  2213. enum ath10k_protmode {
  2214. ATH10K_PROT_NONE = 0, /* no protection */
  2215. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  2216. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  2217. };
  2218. enum wmi_rtscts_profile {
  2219. WMI_RTSCTS_FOR_NO_RATESERIES = 0,
  2220. WMI_RTSCTS_FOR_SECOND_RATESERIES,
  2221. WMI_RTSCTS_ACROSS_SW_RETRIES
  2222. };
  2223. #define WMI_RTSCTS_ENABLED 1
  2224. #define WMI_RTSCTS_SET_MASK 0x0f
  2225. #define WMI_RTSCTS_SET_LSB 0
  2226. #define WMI_RTSCTS_PROFILE_MASK 0xf0
  2227. #define WMI_RTSCTS_PROFILE_LSB 4
  2228. enum wmi_beacon_gen_mode {
  2229. WMI_BEACON_STAGGERED_MODE = 0,
  2230. WMI_BEACON_BURST_MODE = 1
  2231. };
  2232. enum wmi_csa_event_ies_present_flag {
  2233. WMI_CSA_IE_PRESENT = 0x00000001,
  2234. WMI_XCSA_IE_PRESENT = 0x00000002,
  2235. WMI_WBW_IE_PRESENT = 0x00000004,
  2236. WMI_CSWARP_IE_PRESENT = 0x00000008,
  2237. };
  2238. /* wmi CSA receive event from beacon frame */
  2239. struct wmi_csa_event {
  2240. __le32 i_fc_dur;
  2241. /* Bit 0-15: FC */
  2242. /* Bit 16-31: DUR */
  2243. struct wmi_mac_addr i_addr1;
  2244. struct wmi_mac_addr i_addr2;
  2245. __le32 csa_ie[2];
  2246. __le32 xcsa_ie[2];
  2247. __le32 wb_ie[2];
  2248. __le32 cswarp_ie;
  2249. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  2250. } __packed;
  2251. /* the definition of different PDEV parameters */
  2252. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2253. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  2254. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  2255. struct wmi_pdev_param_map {
  2256. u32 tx_chain_mask;
  2257. u32 rx_chain_mask;
  2258. u32 txpower_limit2g;
  2259. u32 txpower_limit5g;
  2260. u32 txpower_scale;
  2261. u32 beacon_gen_mode;
  2262. u32 beacon_tx_mode;
  2263. u32 resmgr_offchan_mode;
  2264. u32 protection_mode;
  2265. u32 dynamic_bw;
  2266. u32 non_agg_sw_retry_th;
  2267. u32 agg_sw_retry_th;
  2268. u32 sta_kickout_th;
  2269. u32 ac_aggrsize_scaling;
  2270. u32 ltr_enable;
  2271. u32 ltr_ac_latency_be;
  2272. u32 ltr_ac_latency_bk;
  2273. u32 ltr_ac_latency_vi;
  2274. u32 ltr_ac_latency_vo;
  2275. u32 ltr_ac_latency_timeout;
  2276. u32 ltr_sleep_override;
  2277. u32 ltr_rx_override;
  2278. u32 ltr_tx_activity_timeout;
  2279. u32 l1ss_enable;
  2280. u32 dsleep_enable;
  2281. u32 pcielp_txbuf_flush;
  2282. u32 pcielp_txbuf_watermark;
  2283. u32 pcielp_txbuf_tmo_en;
  2284. u32 pcielp_txbuf_tmo_value;
  2285. u32 pdev_stats_update_period;
  2286. u32 vdev_stats_update_period;
  2287. u32 peer_stats_update_period;
  2288. u32 bcnflt_stats_update_period;
  2289. u32 pmf_qos;
  2290. u32 arp_ac_override;
  2291. u32 dcs;
  2292. u32 ani_enable;
  2293. u32 ani_poll_period;
  2294. u32 ani_listen_period;
  2295. u32 ani_ofdm_level;
  2296. u32 ani_cck_level;
  2297. u32 dyntxchain;
  2298. u32 proxy_sta;
  2299. u32 idle_ps_config;
  2300. u32 power_gating_sleep;
  2301. u32 fast_channel_reset;
  2302. u32 burst_dur;
  2303. u32 burst_enable;
  2304. u32 cal_period;
  2305. };
  2306. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  2307. enum wmi_pdev_param {
  2308. /* TX chain mask */
  2309. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2310. /* RX chain mask */
  2311. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  2312. /* TX power limit for 2G Radio */
  2313. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  2314. /* TX power limit for 5G Radio */
  2315. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  2316. /* TX power scale */
  2317. WMI_PDEV_PARAM_TXPOWER_SCALE,
  2318. /* Beacon generation mode . 0: host, 1: target */
  2319. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  2320. /* Beacon generation mode . 0: staggered 1: bursted */
  2321. WMI_PDEV_PARAM_BEACON_TX_MODE,
  2322. /*
  2323. * Resource manager off chan mode .
  2324. * 0: turn off off chan mode. 1: turn on offchan mode
  2325. */
  2326. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2327. /*
  2328. * Protection mode:
  2329. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2330. */
  2331. WMI_PDEV_PARAM_PROTECTION_MODE,
  2332. /*
  2333. * Dynamic bandwidth - 0: disable, 1: enable
  2334. *
  2335. * When enabled HW rate control tries different bandwidths when
  2336. * retransmitting frames.
  2337. */
  2338. WMI_PDEV_PARAM_DYNAMIC_BW,
  2339. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2340. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2341. /* aggregrate sw retry threshold. 0-disable*/
  2342. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  2343. /* Station kickout threshold (non of consecutive failures).0-disable */
  2344. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  2345. /* Aggerate size scaling configuration per AC */
  2346. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2347. /* LTR enable */
  2348. WMI_PDEV_PARAM_LTR_ENABLE,
  2349. /* LTR latency for BE, in us */
  2350. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2351. /* LTR latency for BK, in us */
  2352. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2353. /* LTR latency for VI, in us */
  2354. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2355. /* LTR latency for VO, in us */
  2356. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2357. /* LTR AC latency timeout, in ms */
  2358. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2359. /* LTR platform latency override, in us */
  2360. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2361. /* LTR-RX override, in us */
  2362. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  2363. /* Tx activity timeout for LTR, in us */
  2364. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2365. /* L1SS state machine enable */
  2366. WMI_PDEV_PARAM_L1SS_ENABLE,
  2367. /* Deep sleep state machine enable */
  2368. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  2369. /* RX buffering flush enable */
  2370. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  2371. /* RX buffering matermark */
  2372. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  2373. /* RX buffering timeout enable */
  2374. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  2375. /* RX buffering timeout value */
  2376. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  2377. /* pdev level stats update period in ms */
  2378. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2379. /* vdev level stats update period in ms */
  2380. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2381. /* peer level stats update period in ms */
  2382. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2383. /* beacon filter status update period */
  2384. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2385. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2386. WMI_PDEV_PARAM_PMF_QOS,
  2387. /* Access category on which ARP frames are sent */
  2388. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  2389. /* DCS configuration */
  2390. WMI_PDEV_PARAM_DCS,
  2391. /* Enable/Disable ANI on target */
  2392. WMI_PDEV_PARAM_ANI_ENABLE,
  2393. /* configure the ANI polling period */
  2394. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  2395. /* configure the ANI listening period */
  2396. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2397. /* configure OFDM immunity level */
  2398. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  2399. /* configure CCK immunity level */
  2400. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  2401. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2402. WMI_PDEV_PARAM_DYNTXCHAIN,
  2403. /* Enable/Disable proxy STA */
  2404. WMI_PDEV_PARAM_PROXY_STA,
  2405. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  2406. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  2407. /* Enable/Disable power gating sleep */
  2408. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  2409. };
  2410. enum wmi_10x_pdev_param {
  2411. /* TX chian mask */
  2412. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2413. /* RX chian mask */
  2414. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  2415. /* TX power limit for 2G Radio */
  2416. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  2417. /* TX power limit for 5G Radio */
  2418. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  2419. /* TX power scale */
  2420. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  2421. /* Beacon generation mode . 0: host, 1: target */
  2422. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  2423. /* Beacon generation mode . 0: staggered 1: bursted */
  2424. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  2425. /*
  2426. * Resource manager off chan mode .
  2427. * 0: turn off off chan mode. 1: turn on offchan mode
  2428. */
  2429. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2430. /*
  2431. * Protection mode:
  2432. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2433. */
  2434. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  2435. /* Dynamic bandwidth 0: disable 1: enable */
  2436. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  2437. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2438. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2439. /* aggregrate sw retry threshold. 0-disable*/
  2440. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  2441. /* Station kickout threshold (non of consecutive failures).0-disable */
  2442. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  2443. /* Aggerate size scaling configuration per AC */
  2444. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2445. /* LTR enable */
  2446. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  2447. /* LTR latency for BE, in us */
  2448. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2449. /* LTR latency for BK, in us */
  2450. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2451. /* LTR latency for VI, in us */
  2452. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2453. /* LTR latency for VO, in us */
  2454. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2455. /* LTR AC latency timeout, in ms */
  2456. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2457. /* LTR platform latency override, in us */
  2458. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2459. /* LTR-RX override, in us */
  2460. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  2461. /* Tx activity timeout for LTR, in us */
  2462. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2463. /* L1SS state machine enable */
  2464. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  2465. /* Deep sleep state machine enable */
  2466. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  2467. /* pdev level stats update period in ms */
  2468. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2469. /* vdev level stats update period in ms */
  2470. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2471. /* peer level stats update period in ms */
  2472. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2473. /* beacon filter status update period */
  2474. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2475. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2476. WMI_10X_PDEV_PARAM_PMF_QOS,
  2477. /* Access category on which ARP and DHCP frames are sent */
  2478. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  2479. /* DCS configuration */
  2480. WMI_10X_PDEV_PARAM_DCS,
  2481. /* Enable/Disable ANI on target */
  2482. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  2483. /* configure the ANI polling period */
  2484. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  2485. /* configure the ANI listening period */
  2486. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2487. /* configure OFDM immunity level */
  2488. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  2489. /* configure CCK immunity level */
  2490. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  2491. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2492. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  2493. /* Enable/Disable Fast channel reset*/
  2494. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  2495. /* Set Bursting DUR */
  2496. WMI_10X_PDEV_PARAM_BURST_DUR,
  2497. /* Set Bursting Enable*/
  2498. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  2499. /* following are available as of firmware 10.2 */
  2500. WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  2501. WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
  2502. WMI_10X_PDEV_PARAM_IGMPMLD_TID,
  2503. WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
  2504. WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
  2505. WMI_10X_PDEV_PARAM_RX_FILTER,
  2506. WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
  2507. WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
  2508. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  2509. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  2510. WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  2511. WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
  2512. WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
  2513. WMI_10X_PDEV_PARAM_CAL_PERIOD
  2514. };
  2515. struct wmi_pdev_set_param_cmd {
  2516. __le32 param_id;
  2517. __le32 param_value;
  2518. } __packed;
  2519. /* valid period is 1 ~ 60000ms, unit in millisecond */
  2520. #define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
  2521. struct wmi_pdev_get_tpc_config_cmd {
  2522. /* parameter */
  2523. __le32 param;
  2524. } __packed;
  2525. #define WMI_TPC_RATE_MAX 160
  2526. #define WMI_TPC_TX_N_CHAIN 4
  2527. enum wmi_tpc_config_event_flag {
  2528. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  2529. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  2530. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  2531. };
  2532. struct wmi_pdev_tpc_config_event {
  2533. __le32 reg_domain;
  2534. __le32 chan_freq;
  2535. __le32 phy_mode;
  2536. __le32 twice_antenna_reduction;
  2537. __le32 twice_max_rd_power;
  2538. s32 twice_antenna_gain;
  2539. __le32 power_limit;
  2540. __le32 rate_max;
  2541. __le32 num_tx_chain;
  2542. __le32 ctl;
  2543. __le32 flags;
  2544. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  2545. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2546. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2547. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2548. u8 rates_array[WMI_TPC_RATE_MAX];
  2549. } __packed;
  2550. /* Transmit power scale factor. */
  2551. enum wmi_tp_scale {
  2552. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  2553. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  2554. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  2555. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  2556. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  2557. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  2558. };
  2559. struct wmi_pdev_chanlist_update_event {
  2560. /* number of channels */
  2561. __le32 num_chan;
  2562. /* array of channels */
  2563. struct wmi_channel channel_list[1];
  2564. } __packed;
  2565. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  2566. struct wmi_debug_mesg_event {
  2567. /* message buffer, NULL terminated */
  2568. char bufp[WMI_MAX_DEBUG_MESG];
  2569. } __packed;
  2570. enum {
  2571. /* P2P device */
  2572. VDEV_SUBTYPE_P2PDEV = 0,
  2573. /* P2P client */
  2574. VDEV_SUBTYPE_P2PCLI,
  2575. /* P2P GO */
  2576. VDEV_SUBTYPE_P2PGO,
  2577. /* BT3.0 HS */
  2578. VDEV_SUBTYPE_BT,
  2579. };
  2580. struct wmi_pdev_set_channel_cmd {
  2581. /* idnore power , only use flags , mode and freq */
  2582. struct wmi_channel chan;
  2583. } __packed;
  2584. struct wmi_pdev_pktlog_enable_cmd {
  2585. __le32 ev_bitmap;
  2586. } __packed;
  2587. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  2588. #define WMI_DSCP_MAP_MAX (64)
  2589. struct wmi_pdev_set_dscp_tid_map_cmd {
  2590. /* map indicating DSCP to TID conversion */
  2591. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  2592. } __packed;
  2593. enum mcast_bcast_rate_id {
  2594. WMI_SET_MCAST_RATE,
  2595. WMI_SET_BCAST_RATE
  2596. };
  2597. struct mcast_bcast_rate {
  2598. enum mcast_bcast_rate_id rate_id;
  2599. __le32 rate;
  2600. } __packed;
  2601. struct wmi_wmm_params {
  2602. __le32 cwmin;
  2603. __le32 cwmax;
  2604. __le32 aifs;
  2605. __le32 txop;
  2606. __le32 acm;
  2607. __le32 no_ack;
  2608. } __packed;
  2609. struct wmi_pdev_set_wmm_params {
  2610. struct wmi_wmm_params ac_be;
  2611. struct wmi_wmm_params ac_bk;
  2612. struct wmi_wmm_params ac_vi;
  2613. struct wmi_wmm_params ac_vo;
  2614. } __packed;
  2615. struct wmi_wmm_params_arg {
  2616. u32 cwmin;
  2617. u32 cwmax;
  2618. u32 aifs;
  2619. u32 txop;
  2620. u32 acm;
  2621. u32 no_ack;
  2622. };
  2623. struct wmi_wmm_params_all_arg {
  2624. struct wmi_wmm_params_arg ac_be;
  2625. struct wmi_wmm_params_arg ac_bk;
  2626. struct wmi_wmm_params_arg ac_vi;
  2627. struct wmi_wmm_params_arg ac_vo;
  2628. };
  2629. struct wmi_pdev_stats_tx {
  2630. /* Num HTT cookies queued to dispatch list */
  2631. __le32 comp_queued;
  2632. /* Num HTT cookies dispatched */
  2633. __le32 comp_delivered;
  2634. /* Num MSDU queued to WAL */
  2635. __le32 msdu_enqued;
  2636. /* Num MPDU queue to WAL */
  2637. __le32 mpdu_enqued;
  2638. /* Num MSDUs dropped by WMM limit */
  2639. __le32 wmm_drop;
  2640. /* Num Local frames queued */
  2641. __le32 local_enqued;
  2642. /* Num Local frames done */
  2643. __le32 local_freed;
  2644. /* Num queued to HW */
  2645. __le32 hw_queued;
  2646. /* Num PPDU reaped from HW */
  2647. __le32 hw_reaped;
  2648. /* Num underruns */
  2649. __le32 underrun;
  2650. /* Num PPDUs cleaned up in TX abort */
  2651. __le32 tx_abort;
  2652. /* Num MPDUs requed by SW */
  2653. __le32 mpdus_requed;
  2654. /* excessive retries */
  2655. __le32 tx_ko;
  2656. /* data hw rate code */
  2657. __le32 data_rc;
  2658. /* Scheduler self triggers */
  2659. __le32 self_triggers;
  2660. /* frames dropped due to excessive sw retries */
  2661. __le32 sw_retry_failure;
  2662. /* illegal rate phy errors */
  2663. __le32 illgl_rate_phy_err;
  2664. /* wal pdev continous xretry */
  2665. __le32 pdev_cont_xretry;
  2666. /* wal pdev continous xretry */
  2667. __le32 pdev_tx_timeout;
  2668. /* wal pdev resets */
  2669. __le32 pdev_resets;
  2670. /* frames dropped due to non-availability of stateless TIDs */
  2671. __le32 stateless_tid_alloc_failure;
  2672. __le32 phy_underrun;
  2673. /* MPDU is more than txop limit */
  2674. __le32 txop_ovf;
  2675. } __packed;
  2676. struct wmi_pdev_stats_rx {
  2677. /* Cnts any change in ring routing mid-ppdu */
  2678. __le32 mid_ppdu_route_change;
  2679. /* Total number of statuses processed */
  2680. __le32 status_rcvd;
  2681. /* Extra frags on rings 0-3 */
  2682. __le32 r0_frags;
  2683. __le32 r1_frags;
  2684. __le32 r2_frags;
  2685. __le32 r3_frags;
  2686. /* MSDUs / MPDUs delivered to HTT */
  2687. __le32 htt_msdus;
  2688. __le32 htt_mpdus;
  2689. /* MSDUs / MPDUs delivered to local stack */
  2690. __le32 loc_msdus;
  2691. __le32 loc_mpdus;
  2692. /* AMSDUs that have more MSDUs than the status ring size */
  2693. __le32 oversize_amsdu;
  2694. /* Number of PHY errors */
  2695. __le32 phy_errs;
  2696. /* Number of PHY errors drops */
  2697. __le32 phy_err_drop;
  2698. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  2699. __le32 mpdu_errs;
  2700. } __packed;
  2701. struct wmi_pdev_stats_peer {
  2702. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  2703. __le32 dummy;
  2704. } __packed;
  2705. enum wmi_stats_id {
  2706. WMI_STAT_PEER = BIT(0),
  2707. WMI_STAT_AP = BIT(1),
  2708. WMI_STAT_PDEV = BIT(2),
  2709. WMI_STAT_VDEV = BIT(3),
  2710. WMI_STAT_BCNFLT = BIT(4),
  2711. WMI_STAT_VDEV_RATE = BIT(5),
  2712. };
  2713. struct wlan_inst_rssi_args {
  2714. __le16 cfg_retry_count;
  2715. __le16 retry_count;
  2716. };
  2717. struct wmi_request_stats_cmd {
  2718. __le32 stats_id;
  2719. __le32 vdev_id;
  2720. /* peer MAC address */
  2721. struct wmi_mac_addr peer_macaddr;
  2722. /* Instantaneous RSSI arguments */
  2723. struct wlan_inst_rssi_args inst_rssi_args;
  2724. } __packed;
  2725. /* Suspend option */
  2726. enum {
  2727. /* suspend */
  2728. WMI_PDEV_SUSPEND,
  2729. /* suspend and disable all interrupts */
  2730. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  2731. };
  2732. struct wmi_pdev_suspend_cmd {
  2733. /* suspend option sent to target */
  2734. __le32 suspend_opt;
  2735. } __packed;
  2736. struct wmi_stats_event {
  2737. __le32 stats_id; /* WMI_STAT_ */
  2738. /*
  2739. * number of pdev stats event structures
  2740. * (wmi_pdev_stats) 0 or 1
  2741. */
  2742. __le32 num_pdev_stats;
  2743. /*
  2744. * number of vdev stats event structures
  2745. * (wmi_vdev_stats) 0 or max vdevs
  2746. */
  2747. __le32 num_vdev_stats;
  2748. /*
  2749. * number of peer stats event structures
  2750. * (wmi_peer_stats) 0 or max peers
  2751. */
  2752. __le32 num_peer_stats;
  2753. __le32 num_bcnflt_stats;
  2754. /*
  2755. * followed by
  2756. * num_pdev_stats * size of(struct wmi_pdev_stats)
  2757. * num_vdev_stats * size of(struct wmi_vdev_stats)
  2758. * num_peer_stats * size of(struct wmi_peer_stats)
  2759. *
  2760. * By having a zero sized array, the pointer to data area
  2761. * becomes available without increasing the struct size
  2762. */
  2763. u8 data[0];
  2764. } __packed;
  2765. struct wmi_10_2_stats_event {
  2766. __le32 stats_id; /* %WMI_REQUEST_ */
  2767. __le32 num_pdev_stats;
  2768. __le32 num_pdev_ext_stats;
  2769. __le32 num_vdev_stats;
  2770. __le32 num_peer_stats;
  2771. __le32 num_bcnflt_stats;
  2772. u8 data[0];
  2773. } __packed;
  2774. /*
  2775. * PDEV statistics
  2776. * TODO: add all PDEV stats here
  2777. */
  2778. struct wmi_pdev_stats_base {
  2779. __le32 chan_nf;
  2780. __le32 tx_frame_count;
  2781. __le32 rx_frame_count;
  2782. __le32 rx_clear_count;
  2783. __le32 cycle_count;
  2784. __le32 phy_err_count;
  2785. __le32 chan_tx_pwr;
  2786. } __packed;
  2787. struct wmi_pdev_stats {
  2788. struct wmi_pdev_stats_base base;
  2789. struct wmi_pdev_stats_tx tx;
  2790. struct wmi_pdev_stats_rx rx;
  2791. struct wmi_pdev_stats_peer peer;
  2792. } __packed;
  2793. struct wmi_pdev_stats_extra {
  2794. __le32 ack_rx_bad;
  2795. __le32 rts_bad;
  2796. __le32 rts_good;
  2797. __le32 fcs_bad;
  2798. __le32 no_beacons;
  2799. __le32 mib_int_count;
  2800. } __packed;
  2801. struct wmi_10x_pdev_stats {
  2802. struct wmi_pdev_stats_base base;
  2803. struct wmi_pdev_stats_tx tx;
  2804. struct wmi_pdev_stats_rx rx;
  2805. struct wmi_pdev_stats_peer peer;
  2806. struct wmi_pdev_stats_extra extra;
  2807. } __packed;
  2808. struct wmi_pdev_stats_mem {
  2809. __le32 dram_free;
  2810. __le32 iram_free;
  2811. } __packed;
  2812. struct wmi_10_2_pdev_stats {
  2813. struct wmi_pdev_stats_base base;
  2814. struct wmi_pdev_stats_tx tx;
  2815. __le32 mc_drop;
  2816. struct wmi_pdev_stats_rx rx;
  2817. __le32 pdev_rx_timeout;
  2818. struct wmi_pdev_stats_mem mem;
  2819. struct wmi_pdev_stats_peer peer;
  2820. struct wmi_pdev_stats_extra extra;
  2821. } __packed;
  2822. /*
  2823. * VDEV statistics
  2824. * TODO: add all VDEV stats here
  2825. */
  2826. struct wmi_vdev_stats {
  2827. __le32 vdev_id;
  2828. } __packed;
  2829. /*
  2830. * peer statistics.
  2831. * TODO: add more stats
  2832. */
  2833. struct wmi_peer_stats {
  2834. struct wmi_mac_addr peer_macaddr;
  2835. __le32 peer_rssi;
  2836. __le32 peer_tx_rate;
  2837. } __packed;
  2838. struct wmi_10x_peer_stats {
  2839. struct wmi_peer_stats old;
  2840. __le32 peer_rx_rate;
  2841. } __packed;
  2842. struct wmi_10_2_peer_stats {
  2843. struct wmi_peer_stats old;
  2844. __le32 peer_rx_rate;
  2845. __le32 current_per;
  2846. __le32 retries;
  2847. __le32 tx_rate_count;
  2848. __le32 max_4ms_frame_len;
  2849. __le32 total_sub_frames;
  2850. __le32 tx_bytes;
  2851. __le32 num_pkt_loss_overflow[4];
  2852. __le32 num_pkt_loss_excess_retry[4];
  2853. } __packed;
  2854. struct wmi_10_2_4_peer_stats {
  2855. struct wmi_10_2_peer_stats common;
  2856. __le32 unknown_value; /* FIXME: what is this word? */
  2857. } __packed;
  2858. struct wmi_10_2_pdev_ext_stats {
  2859. __le32 rx_rssi_comb;
  2860. __le32 rx_rssi[4];
  2861. __le32 rx_mcs[10];
  2862. __le32 tx_mcs[10];
  2863. __le32 ack_rssi;
  2864. } __packed;
  2865. struct wmi_vdev_create_cmd {
  2866. __le32 vdev_id;
  2867. __le32 vdev_type;
  2868. __le32 vdev_subtype;
  2869. struct wmi_mac_addr vdev_macaddr;
  2870. } __packed;
  2871. enum wmi_vdev_type {
  2872. WMI_VDEV_TYPE_AP = 1,
  2873. WMI_VDEV_TYPE_STA = 2,
  2874. WMI_VDEV_TYPE_IBSS = 3,
  2875. WMI_VDEV_TYPE_MONITOR = 4,
  2876. };
  2877. enum wmi_vdev_subtype {
  2878. WMI_VDEV_SUBTYPE_NONE = 0,
  2879. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  2880. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  2881. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  2882. };
  2883. /* values for vdev_subtype */
  2884. /* values for vdev_start_request flags */
  2885. /*
  2886. * Indicates that AP VDEV uses hidden ssid. only valid for
  2887. * AP/GO */
  2888. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  2889. /*
  2890. * Indicates if robust management frame/management frame
  2891. * protection is enabled. For GO/AP vdevs, it indicates that
  2892. * it may support station/client associations with RMF enabled.
  2893. * For STA/client vdevs, it indicates that sta will
  2894. * associate with AP with RMF enabled. */
  2895. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  2896. struct wmi_p2p_noa_descriptor {
  2897. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  2898. __le32 duration; /* Absent period duration in micro seconds */
  2899. __le32 interval; /* Absent period interval in micro seconds */
  2900. __le32 start_time; /* 32 bit tsf time when in starts */
  2901. } __packed;
  2902. struct wmi_vdev_start_request_cmd {
  2903. /* WMI channel */
  2904. struct wmi_channel chan;
  2905. /* unique id identifying the VDEV, generated by the caller */
  2906. __le32 vdev_id;
  2907. /* requestor id identifying the caller module */
  2908. __le32 requestor_id;
  2909. /* beacon interval from received beacon */
  2910. __le32 beacon_interval;
  2911. /* DTIM Period from the received beacon */
  2912. __le32 dtim_period;
  2913. /* Flags */
  2914. __le32 flags;
  2915. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  2916. struct wmi_ssid ssid;
  2917. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  2918. __le32 bcn_tx_rate;
  2919. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  2920. __le32 bcn_tx_power;
  2921. /* number of p2p NOA descriptor(s) from scan entry */
  2922. __le32 num_noa_descriptors;
  2923. /*
  2924. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  2925. * During CAC, Our HW shouldn't ack ditected frames
  2926. */
  2927. __le32 disable_hw_ack;
  2928. /* actual p2p NOA descriptor from scan entry */
  2929. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  2930. } __packed;
  2931. struct wmi_vdev_restart_request_cmd {
  2932. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  2933. } __packed;
  2934. struct wmi_vdev_start_request_arg {
  2935. u32 vdev_id;
  2936. struct wmi_channel_arg channel;
  2937. u32 bcn_intval;
  2938. u32 dtim_period;
  2939. u8 *ssid;
  2940. u32 ssid_len;
  2941. u32 bcn_tx_rate;
  2942. u32 bcn_tx_power;
  2943. bool disable_hw_ack;
  2944. bool hidden_ssid;
  2945. bool pmf_enabled;
  2946. };
  2947. struct wmi_vdev_delete_cmd {
  2948. /* unique id identifying the VDEV, generated by the caller */
  2949. __le32 vdev_id;
  2950. } __packed;
  2951. struct wmi_vdev_up_cmd {
  2952. __le32 vdev_id;
  2953. __le32 vdev_assoc_id;
  2954. struct wmi_mac_addr vdev_bssid;
  2955. } __packed;
  2956. struct wmi_vdev_stop_cmd {
  2957. __le32 vdev_id;
  2958. } __packed;
  2959. struct wmi_vdev_down_cmd {
  2960. __le32 vdev_id;
  2961. } __packed;
  2962. struct wmi_vdev_standby_response_cmd {
  2963. /* unique id identifying the VDEV, generated by the caller */
  2964. __le32 vdev_id;
  2965. } __packed;
  2966. struct wmi_vdev_resume_response_cmd {
  2967. /* unique id identifying the VDEV, generated by the caller */
  2968. __le32 vdev_id;
  2969. } __packed;
  2970. struct wmi_vdev_set_param_cmd {
  2971. __le32 vdev_id;
  2972. __le32 param_id;
  2973. __le32 param_value;
  2974. } __packed;
  2975. #define WMI_MAX_KEY_INDEX 3
  2976. #define WMI_MAX_KEY_LEN 32
  2977. #define WMI_KEY_PAIRWISE 0x00
  2978. #define WMI_KEY_GROUP 0x01
  2979. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  2980. struct wmi_key_seq_counter {
  2981. __le32 key_seq_counter_l;
  2982. __le32 key_seq_counter_h;
  2983. } __packed;
  2984. #define WMI_CIPHER_NONE 0x0 /* clear key */
  2985. #define WMI_CIPHER_WEP 0x1
  2986. #define WMI_CIPHER_TKIP 0x2
  2987. #define WMI_CIPHER_AES_OCB 0x3
  2988. #define WMI_CIPHER_AES_CCM 0x4
  2989. #define WMI_CIPHER_WAPI 0x5
  2990. #define WMI_CIPHER_CKIP 0x6
  2991. #define WMI_CIPHER_AES_CMAC 0x7
  2992. struct wmi_vdev_install_key_cmd {
  2993. __le32 vdev_id;
  2994. struct wmi_mac_addr peer_macaddr;
  2995. __le32 key_idx;
  2996. __le32 key_flags;
  2997. __le32 key_cipher; /* %WMI_CIPHER_ */
  2998. struct wmi_key_seq_counter key_rsc_counter;
  2999. struct wmi_key_seq_counter key_global_rsc_counter;
  3000. struct wmi_key_seq_counter key_tsc_counter;
  3001. u8 wpi_key_rsc_counter[16];
  3002. u8 wpi_key_tsc_counter[16];
  3003. __le32 key_len;
  3004. __le32 key_txmic_len;
  3005. __le32 key_rxmic_len;
  3006. /* contains key followed by tx mic followed by rx mic */
  3007. u8 key_data[0];
  3008. } __packed;
  3009. struct wmi_vdev_install_key_arg {
  3010. u32 vdev_id;
  3011. const u8 *macaddr;
  3012. u32 key_idx;
  3013. u32 key_flags;
  3014. u32 key_cipher;
  3015. u32 key_len;
  3016. u32 key_txmic_len;
  3017. u32 key_rxmic_len;
  3018. const void *key_data;
  3019. };
  3020. /*
  3021. * vdev fixed rate format:
  3022. * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
  3023. * - nss - b5:b4 - ss number (0 mean 1ss)
  3024. * - rate_mcs - b3:b0 - as below
  3025. * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
  3026. * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
  3027. * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
  3028. * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
  3029. * HT/VHT: MCS index
  3030. */
  3031. /* Preamble types to be used with VDEV fixed rate configuration */
  3032. enum wmi_rate_preamble {
  3033. WMI_RATE_PREAMBLE_OFDM,
  3034. WMI_RATE_PREAMBLE_CCK,
  3035. WMI_RATE_PREAMBLE_HT,
  3036. WMI_RATE_PREAMBLE_VHT,
  3037. };
  3038. /* Value to disable fixed rate setting */
  3039. #define WMI_FIXED_RATE_NONE (0xff)
  3040. struct wmi_vdev_param_map {
  3041. u32 rts_threshold;
  3042. u32 fragmentation_threshold;
  3043. u32 beacon_interval;
  3044. u32 listen_interval;
  3045. u32 multicast_rate;
  3046. u32 mgmt_tx_rate;
  3047. u32 slot_time;
  3048. u32 preamble;
  3049. u32 swba_time;
  3050. u32 wmi_vdev_stats_update_period;
  3051. u32 wmi_vdev_pwrsave_ageout_time;
  3052. u32 wmi_vdev_host_swba_interval;
  3053. u32 dtim_period;
  3054. u32 wmi_vdev_oc_scheduler_air_time_limit;
  3055. u32 wds;
  3056. u32 atim_window;
  3057. u32 bmiss_count_max;
  3058. u32 bmiss_first_bcnt;
  3059. u32 bmiss_final_bcnt;
  3060. u32 feature_wmm;
  3061. u32 chwidth;
  3062. u32 chextoffset;
  3063. u32 disable_htprotection;
  3064. u32 sta_quickkickout;
  3065. u32 mgmt_rate;
  3066. u32 protection_mode;
  3067. u32 fixed_rate;
  3068. u32 sgi;
  3069. u32 ldpc;
  3070. u32 tx_stbc;
  3071. u32 rx_stbc;
  3072. u32 intra_bss_fwd;
  3073. u32 def_keyid;
  3074. u32 nss;
  3075. u32 bcast_data_rate;
  3076. u32 mcast_data_rate;
  3077. u32 mcast_indicate;
  3078. u32 dhcp_indicate;
  3079. u32 unknown_dest_indicate;
  3080. u32 ap_keepalive_min_idle_inactive_time_secs;
  3081. u32 ap_keepalive_max_idle_inactive_time_secs;
  3082. u32 ap_keepalive_max_unresponsive_time_secs;
  3083. u32 ap_enable_nawds;
  3084. u32 mcast2ucast_set;
  3085. u32 enable_rtscts;
  3086. u32 txbf;
  3087. u32 packet_powersave;
  3088. u32 drop_unencry;
  3089. u32 tx_encap_type;
  3090. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  3091. };
  3092. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  3093. /* the definition of different VDEV parameters */
  3094. enum wmi_vdev_param {
  3095. /* RTS Threshold */
  3096. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3097. /* Fragmentation threshold */
  3098. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3099. /* beacon interval in TUs */
  3100. WMI_VDEV_PARAM_BEACON_INTERVAL,
  3101. /* Listen interval in TUs */
  3102. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  3103. /* muticast rate in Mbps */
  3104. WMI_VDEV_PARAM_MULTICAST_RATE,
  3105. /* management frame rate in Mbps */
  3106. WMI_VDEV_PARAM_MGMT_TX_RATE,
  3107. /* slot time (long vs short) */
  3108. WMI_VDEV_PARAM_SLOT_TIME,
  3109. /* preamble (long vs short) */
  3110. WMI_VDEV_PARAM_PREAMBLE,
  3111. /* SWBA time (time before tbtt in msec) */
  3112. WMI_VDEV_PARAM_SWBA_TIME,
  3113. /* time period for updating VDEV stats */
  3114. WMI_VDEV_STATS_UPDATE_PERIOD,
  3115. /* age out time in msec for frames queued for station in power save */
  3116. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  3117. /*
  3118. * Host SWBA interval (time in msec before tbtt for SWBA event
  3119. * generation).
  3120. */
  3121. WMI_VDEV_HOST_SWBA_INTERVAL,
  3122. /* DTIM period (specified in units of num beacon intervals) */
  3123. WMI_VDEV_PARAM_DTIM_PERIOD,
  3124. /*
  3125. * scheduler air time limit for this VDEV. used by off chan
  3126. * scheduler.
  3127. */
  3128. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3129. /* enable/dsiable WDS for this VDEV */
  3130. WMI_VDEV_PARAM_WDS,
  3131. /* ATIM Window */
  3132. WMI_VDEV_PARAM_ATIM_WINDOW,
  3133. /* BMISS max */
  3134. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  3135. /* BMISS first time */
  3136. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  3137. /* BMISS final time */
  3138. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  3139. /* WMM enables/disabled */
  3140. WMI_VDEV_PARAM_FEATURE_WMM,
  3141. /* Channel width */
  3142. WMI_VDEV_PARAM_CHWIDTH,
  3143. /* Channel Offset */
  3144. WMI_VDEV_PARAM_CHEXTOFFSET,
  3145. /* Disable HT Protection */
  3146. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  3147. /* Quick STA Kickout */
  3148. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  3149. /* Rate to be used with Management frames */
  3150. WMI_VDEV_PARAM_MGMT_RATE,
  3151. /* Protection Mode */
  3152. WMI_VDEV_PARAM_PROTECTION_MODE,
  3153. /* Fixed rate setting */
  3154. WMI_VDEV_PARAM_FIXED_RATE,
  3155. /* Short GI Enable/Disable */
  3156. WMI_VDEV_PARAM_SGI,
  3157. /* Enable LDPC */
  3158. WMI_VDEV_PARAM_LDPC,
  3159. /* Enable Tx STBC */
  3160. WMI_VDEV_PARAM_TX_STBC,
  3161. /* Enable Rx STBC */
  3162. WMI_VDEV_PARAM_RX_STBC,
  3163. /* Intra BSS forwarding */
  3164. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  3165. /* Setting Default xmit key for Vdev */
  3166. WMI_VDEV_PARAM_DEF_KEYID,
  3167. /* NSS width */
  3168. WMI_VDEV_PARAM_NSS,
  3169. /* Set the custom rate for the broadcast data frames */
  3170. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  3171. /* Set the custom rate (rate-code) for multicast data frames */
  3172. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  3173. /* Tx multicast packet indicate Enable/Disable */
  3174. WMI_VDEV_PARAM_MCAST_INDICATE,
  3175. /* Tx DHCP packet indicate Enable/Disable */
  3176. WMI_VDEV_PARAM_DHCP_INDICATE,
  3177. /* Enable host inspection of Tx unicast packet to unknown destination */
  3178. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3179. /* The minimum amount of time AP begins to consider STA inactive */
  3180. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3181. /*
  3182. * An associated STA is considered inactive when there is no recent
  3183. * TX/RX activity and no downlink frames are buffered for it. Once a
  3184. * STA exceeds the maximum idle inactive time, the AP will send an
  3185. * 802.11 data-null as a keep alive to verify the STA is still
  3186. * associated. If the STA does ACK the data-null, or if the data-null
  3187. * is buffered and the STA does not retrieve it, the STA will be
  3188. * considered unresponsive
  3189. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3190. */
  3191. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3192. /*
  3193. * An associated STA is considered unresponsive if there is no recent
  3194. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3195. * exceeds the maximum unresponsive time, the AP will send a
  3196. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  3197. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3198. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3199. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  3200. /* Enable/Disable RTS-CTS */
  3201. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  3202. /* Enable TXBFee/er */
  3203. WMI_VDEV_PARAM_TXBF,
  3204. /* Set packet power save */
  3205. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  3206. /*
  3207. * Drops un-encrypted packets if eceived in an encrypted connection
  3208. * otherwise forwards to host.
  3209. */
  3210. WMI_VDEV_PARAM_DROP_UNENCRY,
  3211. /*
  3212. * Set the encapsulation type for frames.
  3213. */
  3214. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  3215. };
  3216. /* the definition of different VDEV parameters */
  3217. enum wmi_10x_vdev_param {
  3218. /* RTS Threshold */
  3219. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  3220. /* Fragmentation threshold */
  3221. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  3222. /* beacon interval in TUs */
  3223. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  3224. /* Listen interval in TUs */
  3225. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  3226. /* muticast rate in Mbps */
  3227. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  3228. /* management frame rate in Mbps */
  3229. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  3230. /* slot time (long vs short) */
  3231. WMI_10X_VDEV_PARAM_SLOT_TIME,
  3232. /* preamble (long vs short) */
  3233. WMI_10X_VDEV_PARAM_PREAMBLE,
  3234. /* SWBA time (time before tbtt in msec) */
  3235. WMI_10X_VDEV_PARAM_SWBA_TIME,
  3236. /* time period for updating VDEV stats */
  3237. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  3238. /* age out time in msec for frames queued for station in power save */
  3239. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  3240. /*
  3241. * Host SWBA interval (time in msec before tbtt for SWBA event
  3242. * generation).
  3243. */
  3244. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  3245. /* DTIM period (specified in units of num beacon intervals) */
  3246. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  3247. /*
  3248. * scheduler air time limit for this VDEV. used by off chan
  3249. * scheduler.
  3250. */
  3251. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  3252. /* enable/dsiable WDS for this VDEV */
  3253. WMI_10X_VDEV_PARAM_WDS,
  3254. /* ATIM Window */
  3255. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  3256. /* BMISS max */
  3257. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  3258. /* WMM enables/disabled */
  3259. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  3260. /* Channel width */
  3261. WMI_10X_VDEV_PARAM_CHWIDTH,
  3262. /* Channel Offset */
  3263. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  3264. /* Disable HT Protection */
  3265. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  3266. /* Quick STA Kickout */
  3267. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  3268. /* Rate to be used with Management frames */
  3269. WMI_10X_VDEV_PARAM_MGMT_RATE,
  3270. /* Protection Mode */
  3271. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  3272. /* Fixed rate setting */
  3273. WMI_10X_VDEV_PARAM_FIXED_RATE,
  3274. /* Short GI Enable/Disable */
  3275. WMI_10X_VDEV_PARAM_SGI,
  3276. /* Enable LDPC */
  3277. WMI_10X_VDEV_PARAM_LDPC,
  3278. /* Enable Tx STBC */
  3279. WMI_10X_VDEV_PARAM_TX_STBC,
  3280. /* Enable Rx STBC */
  3281. WMI_10X_VDEV_PARAM_RX_STBC,
  3282. /* Intra BSS forwarding */
  3283. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  3284. /* Setting Default xmit key for Vdev */
  3285. WMI_10X_VDEV_PARAM_DEF_KEYID,
  3286. /* NSS width */
  3287. WMI_10X_VDEV_PARAM_NSS,
  3288. /* Set the custom rate for the broadcast data frames */
  3289. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  3290. /* Set the custom rate (rate-code) for multicast data frames */
  3291. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  3292. /* Tx multicast packet indicate Enable/Disable */
  3293. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  3294. /* Tx DHCP packet indicate Enable/Disable */
  3295. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  3296. /* Enable host inspection of Tx unicast packet to unknown destination */
  3297. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  3298. /* The minimum amount of time AP begins to consider STA inactive */
  3299. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  3300. /*
  3301. * An associated STA is considered inactive when there is no recent
  3302. * TX/RX activity and no downlink frames are buffered for it. Once a
  3303. * STA exceeds the maximum idle inactive time, the AP will send an
  3304. * 802.11 data-null as a keep alive to verify the STA is still
  3305. * associated. If the STA does ACK the data-null, or if the data-null
  3306. * is buffered and the STA does not retrieve it, the STA will be
  3307. * considered unresponsive
  3308. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  3309. */
  3310. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  3311. /*
  3312. * An associated STA is considered unresponsive if there is no recent
  3313. * TX/RX activity and downlink frames are buffered for it. Once a STA
  3314. * exceeds the maximum unresponsive time, the AP will send a
  3315. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
  3316. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  3317. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  3318. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  3319. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  3320. /* Enable/Disable RTS-CTS */
  3321. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  3322. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  3323. /* following are available as of firmware 10.2 */
  3324. WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
  3325. WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
  3326. WMI_10X_VDEV_PARAM_MFPTEST_SET,
  3327. WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
  3328. WMI_10X_VDEV_PARAM_VHT_SGIMASK,
  3329. WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
  3330. };
  3331. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
  3332. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
  3333. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
  3334. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
  3335. /* slot time long */
  3336. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  3337. /* slot time short */
  3338. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  3339. /* preablbe long */
  3340. #define WMI_VDEV_PREAMBLE_LONG 0x1
  3341. /* preablbe short */
  3342. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  3343. enum wmi_start_event_param {
  3344. WMI_VDEV_RESP_START_EVENT = 0,
  3345. WMI_VDEV_RESP_RESTART_EVENT,
  3346. };
  3347. struct wmi_vdev_start_response_event {
  3348. __le32 vdev_id;
  3349. __le32 req_id;
  3350. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  3351. __le32 status;
  3352. } __packed;
  3353. struct wmi_vdev_standby_req_event {
  3354. /* unique id identifying the VDEV, generated by the caller */
  3355. __le32 vdev_id;
  3356. } __packed;
  3357. struct wmi_vdev_resume_req_event {
  3358. /* unique id identifying the VDEV, generated by the caller */
  3359. __le32 vdev_id;
  3360. } __packed;
  3361. struct wmi_vdev_stopped_event {
  3362. /* unique id identifying the VDEV, generated by the caller */
  3363. __le32 vdev_id;
  3364. } __packed;
  3365. /*
  3366. * common structure used for simple events
  3367. * (stopped, resume_req, standby response)
  3368. */
  3369. struct wmi_vdev_simple_event {
  3370. /* unique id identifying the VDEV, generated by the caller */
  3371. __le32 vdev_id;
  3372. } __packed;
  3373. /* VDEV start response status codes */
  3374. /* VDEV succesfully started */
  3375. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  3376. /* requested VDEV not found */
  3377. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  3378. /* unsupported VDEV combination */
  3379. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  3380. /* TODO: please add more comments if you have in-depth information */
  3381. struct wmi_vdev_spectral_conf_cmd {
  3382. __le32 vdev_id;
  3383. /* number of fft samples to send (0 for infinite) */
  3384. __le32 scan_count;
  3385. __le32 scan_period;
  3386. __le32 scan_priority;
  3387. /* number of bins in the FFT: 2^(fft_size - bin_scale) */
  3388. __le32 scan_fft_size;
  3389. __le32 scan_gc_ena;
  3390. __le32 scan_restart_ena;
  3391. __le32 scan_noise_floor_ref;
  3392. __le32 scan_init_delay;
  3393. __le32 scan_nb_tone_thr;
  3394. __le32 scan_str_bin_thr;
  3395. __le32 scan_wb_rpt_mode;
  3396. __le32 scan_rssi_rpt_mode;
  3397. __le32 scan_rssi_thr;
  3398. __le32 scan_pwr_format;
  3399. /* rpt_mode: Format of FFT report to software for spectral scan
  3400. * triggered FFTs:
  3401. * 0: No FFT report (only spectral scan summary report)
  3402. * 1: 2-dword summary of metrics for each completed FFT + spectral
  3403. * scan summary report
  3404. * 2: 2-dword summary of metrics for each completed FFT +
  3405. * 1x- oversampled bins(in-band) per FFT + spectral scan summary
  3406. * report
  3407. * 3: 2-dword summary of metrics for each completed FFT +
  3408. * 2x- oversampled bins (all) per FFT + spectral scan summary
  3409. */
  3410. __le32 scan_rpt_mode;
  3411. __le32 scan_bin_scale;
  3412. __le32 scan_dbm_adj;
  3413. __le32 scan_chn_mask;
  3414. } __packed;
  3415. struct wmi_vdev_spectral_conf_arg {
  3416. u32 vdev_id;
  3417. u32 scan_count;
  3418. u32 scan_period;
  3419. u32 scan_priority;
  3420. u32 scan_fft_size;
  3421. u32 scan_gc_ena;
  3422. u32 scan_restart_ena;
  3423. u32 scan_noise_floor_ref;
  3424. u32 scan_init_delay;
  3425. u32 scan_nb_tone_thr;
  3426. u32 scan_str_bin_thr;
  3427. u32 scan_wb_rpt_mode;
  3428. u32 scan_rssi_rpt_mode;
  3429. u32 scan_rssi_thr;
  3430. u32 scan_pwr_format;
  3431. u32 scan_rpt_mode;
  3432. u32 scan_bin_scale;
  3433. u32 scan_dbm_adj;
  3434. u32 scan_chn_mask;
  3435. };
  3436. #define WMI_SPECTRAL_ENABLE_DEFAULT 0
  3437. #define WMI_SPECTRAL_COUNT_DEFAULT 0
  3438. #define WMI_SPECTRAL_PERIOD_DEFAULT 35
  3439. #define WMI_SPECTRAL_PRIORITY_DEFAULT 1
  3440. #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
  3441. #define WMI_SPECTRAL_GC_ENA_DEFAULT 1
  3442. #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
  3443. #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
  3444. #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
  3445. #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
  3446. #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
  3447. #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
  3448. #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
  3449. #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
  3450. #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
  3451. #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
  3452. #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
  3453. #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
  3454. #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
  3455. struct wmi_vdev_spectral_enable_cmd {
  3456. __le32 vdev_id;
  3457. __le32 trigger_cmd;
  3458. __le32 enable_cmd;
  3459. } __packed;
  3460. #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
  3461. #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
  3462. #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
  3463. #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
  3464. /* Beacon processing related command and event structures */
  3465. struct wmi_bcn_tx_hdr {
  3466. __le32 vdev_id;
  3467. __le32 tx_rate;
  3468. __le32 tx_power;
  3469. __le32 bcn_len;
  3470. } __packed;
  3471. struct wmi_bcn_tx_cmd {
  3472. struct wmi_bcn_tx_hdr hdr;
  3473. u8 *bcn[0];
  3474. } __packed;
  3475. struct wmi_bcn_tx_arg {
  3476. u32 vdev_id;
  3477. u32 tx_rate;
  3478. u32 tx_power;
  3479. u32 bcn_len;
  3480. const void *bcn;
  3481. };
  3482. enum wmi_bcn_tx_ref_flags {
  3483. WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
  3484. WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
  3485. };
  3486. /* TODO: It is unclear why "no antenna" works while any other seemingly valid
  3487. * chainmask yields no beacons on the air at all.
  3488. */
  3489. #define WMI_BCN_TX_REF_DEF_ANTENNA 0
  3490. struct wmi_bcn_tx_ref_cmd {
  3491. __le32 vdev_id;
  3492. __le32 data_len;
  3493. /* physical address of the frame - dma pointer */
  3494. __le32 data_ptr;
  3495. /* id for host to track */
  3496. __le32 msdu_id;
  3497. /* frame ctrl to setup PPDU desc */
  3498. __le32 frame_control;
  3499. /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
  3500. __le32 flags;
  3501. /* introduced in 10.2 */
  3502. __le32 antenna_mask;
  3503. } __packed;
  3504. /* Beacon filter */
  3505. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  3506. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  3507. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  3508. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  3509. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  3510. struct wmi_bcn_filter_rx_cmd {
  3511. /* Filter ID */
  3512. __le32 bcn_filter_id;
  3513. /* Filter type - wmi_bcn_filter */
  3514. __le32 bcn_filter;
  3515. /* Buffer len */
  3516. __le32 bcn_filter_len;
  3517. /* Filter info (threshold, BSSID, RSSI) */
  3518. u8 *bcn_filter_buf;
  3519. } __packed;
  3520. /* Capabilities and IEs to be passed to firmware */
  3521. struct wmi_bcn_prb_info {
  3522. /* Capabilities */
  3523. __le32 caps;
  3524. /* ERP info */
  3525. __le32 erp;
  3526. /* Advanced capabilities */
  3527. /* HT capabilities */
  3528. /* HT Info */
  3529. /* ibss_dfs */
  3530. /* wpa Info */
  3531. /* rsn Info */
  3532. /* rrm info */
  3533. /* ath_ext */
  3534. /* app IE */
  3535. } __packed;
  3536. struct wmi_bcn_tmpl_cmd {
  3537. /* unique id identifying the VDEV, generated by the caller */
  3538. __le32 vdev_id;
  3539. /* TIM IE offset from the beginning of the template. */
  3540. __le32 tim_ie_offset;
  3541. /* beacon probe capabilities and IEs */
  3542. struct wmi_bcn_prb_info bcn_prb_info;
  3543. /* beacon buffer length */
  3544. __le32 buf_len;
  3545. /* variable length data */
  3546. u8 data[1];
  3547. } __packed;
  3548. struct wmi_prb_tmpl_cmd {
  3549. /* unique id identifying the VDEV, generated by the caller */
  3550. __le32 vdev_id;
  3551. /* beacon probe capabilities and IEs */
  3552. struct wmi_bcn_prb_info bcn_prb_info;
  3553. /* beacon buffer length */
  3554. __le32 buf_len;
  3555. /* Variable length data */
  3556. u8 data[1];
  3557. } __packed;
  3558. enum wmi_sta_ps_mode {
  3559. /* enable power save for the given STA VDEV */
  3560. WMI_STA_PS_MODE_DISABLED = 0,
  3561. /* disable power save for a given STA VDEV */
  3562. WMI_STA_PS_MODE_ENABLED = 1,
  3563. };
  3564. struct wmi_sta_powersave_mode_cmd {
  3565. /* unique id identifying the VDEV, generated by the caller */
  3566. __le32 vdev_id;
  3567. /*
  3568. * Power save mode
  3569. * (see enum wmi_sta_ps_mode)
  3570. */
  3571. __le32 sta_ps_mode;
  3572. } __packed;
  3573. enum wmi_csa_offload_en {
  3574. WMI_CSA_OFFLOAD_DISABLE = 0,
  3575. WMI_CSA_OFFLOAD_ENABLE = 1,
  3576. };
  3577. struct wmi_csa_offload_enable_cmd {
  3578. __le32 vdev_id;
  3579. __le32 csa_offload_enable;
  3580. } __packed;
  3581. struct wmi_csa_offload_chanswitch_cmd {
  3582. __le32 vdev_id;
  3583. struct wmi_channel chan;
  3584. } __packed;
  3585. /*
  3586. * This parameter controls the policy for retrieving frames from AP while the
  3587. * STA is in sleep state.
  3588. *
  3589. * Only takes affect if the sta_ps_mode is enabled
  3590. */
  3591. enum wmi_sta_ps_param_rx_wake_policy {
  3592. /*
  3593. * Wake up when ever there is an RX activity on the VDEV. In this mode
  3594. * the Power save SM(state machine) will come out of sleep by either
  3595. * sending null frame (or) a data frame (with PS==0) in response to TIM
  3596. * bit set in the received beacon frame from AP.
  3597. */
  3598. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  3599. /*
  3600. * Here the power save state machine will not wakeup in response to TIM
  3601. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  3602. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  3603. * access categories are delivery-enabled, the station will send a
  3604. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  3605. */
  3606. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  3607. };
  3608. /*
  3609. * Number of tx frames/beacon that cause the power save SM to wake up.
  3610. *
  3611. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  3612. * meaning, It will cause the SM to never wake up. This is useful if you want
  3613. * to keep the system to sleep all the time for some kind of test mode . host
  3614. * can change this parameter any time. It will affect at the next tx frame.
  3615. */
  3616. enum wmi_sta_ps_param_tx_wake_threshold {
  3617. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  3618. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  3619. /*
  3620. * Values greater than one indicate that many TX attempts per beacon
  3621. * interval before the STA will wake up
  3622. */
  3623. };
  3624. /*
  3625. * The maximum number of PS-Poll frames the FW will send in response to
  3626. * traffic advertised in TIM before waking up (by sending a null frame with PS
  3627. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  3628. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  3629. * parameter is used when the RX wake policy is
  3630. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  3631. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  3632. */
  3633. enum wmi_sta_ps_param_pspoll_count {
  3634. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  3635. /*
  3636. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  3637. * FW will send before waking up.
  3638. */
  3639. /* When u-APSD is enabled the firmware will be very reluctant to exit
  3640. * STA PS. This could result in very poor Rx performance with STA doing
  3641. * PS-Poll for each and every buffered frame. This value is a bit
  3642. * arbitrary.
  3643. */
  3644. WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
  3645. };
  3646. /*
  3647. * This will include the delivery and trigger enabled state for every AC.
  3648. * This is the negotiated state with AP. The host MLME needs to set this based
  3649. * on AP capability and the state Set in the association request by the
  3650. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  3651. */
  3652. #define WMI_UAPSD_AC_TYPE_DELI 0
  3653. #define WMI_UAPSD_AC_TYPE_TRIG 1
  3654. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  3655. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  3656. enum wmi_sta_ps_param_uapsd {
  3657. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3658. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3659. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3660. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3661. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3662. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3663. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3664. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3665. };
  3666. #define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
  3667. struct wmi_sta_uapsd_auto_trig_param {
  3668. __le32 wmm_ac;
  3669. __le32 user_priority;
  3670. __le32 service_interval;
  3671. __le32 suspend_interval;
  3672. __le32 delay_interval;
  3673. };
  3674. struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
  3675. __le32 vdev_id;
  3676. struct wmi_mac_addr peer_macaddr;
  3677. __le32 num_ac;
  3678. };
  3679. struct wmi_sta_uapsd_auto_trig_arg {
  3680. u32 wmm_ac;
  3681. u32 user_priority;
  3682. u32 service_interval;
  3683. u32 suspend_interval;
  3684. u32 delay_interval;
  3685. };
  3686. enum wmi_sta_powersave_param {
  3687. /*
  3688. * Controls how frames are retrievd from AP while STA is sleeping
  3689. *
  3690. * (see enum wmi_sta_ps_param_rx_wake_policy)
  3691. */
  3692. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  3693. /*
  3694. * The STA will go active after this many TX
  3695. *
  3696. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  3697. */
  3698. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  3699. /*
  3700. * Number of PS-Poll to send before STA wakes up
  3701. *
  3702. * (see enum wmi_sta_ps_param_pspoll_count)
  3703. *
  3704. */
  3705. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  3706. /*
  3707. * TX/RX inactivity time in msec before going to sleep.
  3708. *
  3709. * The power save SM will monitor tx/rx activity on the VDEV, if no
  3710. * activity for the specified msec of the parameter the Power save
  3711. * SM will go to sleep.
  3712. */
  3713. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  3714. /*
  3715. * Set uapsd configuration.
  3716. *
  3717. * (see enum wmi_sta_ps_param_uapsd)
  3718. */
  3719. WMI_STA_PS_PARAM_UAPSD = 4,
  3720. };
  3721. struct wmi_sta_powersave_param_cmd {
  3722. __le32 vdev_id;
  3723. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  3724. __le32 param_value;
  3725. } __packed;
  3726. /* No MIMO power save */
  3727. #define WMI_STA_MIMO_PS_MODE_DISABLE
  3728. /* mimo powersave mode static*/
  3729. #define WMI_STA_MIMO_PS_MODE_STATIC
  3730. /* mimo powersave mode dynamic */
  3731. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  3732. struct wmi_sta_mimo_ps_mode_cmd {
  3733. /* unique id identifying the VDEV, generated by the caller */
  3734. __le32 vdev_id;
  3735. /* mimo powersave mode as defined above */
  3736. __le32 mimo_pwrsave_mode;
  3737. } __packed;
  3738. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  3739. enum wmi_ap_ps_param_uapsd {
  3740. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3741. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3742. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3743. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3744. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3745. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3746. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3747. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3748. };
  3749. /* U-APSD maximum service period of peer station */
  3750. enum wmi_ap_ps_peer_param_max_sp {
  3751. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  3752. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  3753. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  3754. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  3755. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  3756. };
  3757. /*
  3758. * AP power save parameter
  3759. * Set a power save specific parameter for a peer station
  3760. */
  3761. enum wmi_ap_ps_peer_param {
  3762. /* Set uapsd configuration for a given peer.
  3763. *
  3764. * Include the delivery and trigger enabled state for every AC.
  3765. * The host MLME needs to set this based on AP capability and stations
  3766. * request Set in the association request received from the station.
  3767. *
  3768. * Lower 8 bits of the value specify the UAPSD configuration.
  3769. *
  3770. * (see enum wmi_ap_ps_param_uapsd)
  3771. * The default value is 0.
  3772. */
  3773. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  3774. /*
  3775. * Set the service period for a UAPSD capable station
  3776. *
  3777. * The service period from wme ie in the (re)assoc request frame.
  3778. *
  3779. * (see enum wmi_ap_ps_peer_param_max_sp)
  3780. */
  3781. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  3782. /* Time in seconds for aging out buffered frames for STA in PS */
  3783. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  3784. };
  3785. struct wmi_ap_ps_peer_cmd {
  3786. /* unique id identifying the VDEV, generated by the caller */
  3787. __le32 vdev_id;
  3788. /* peer MAC address */
  3789. struct wmi_mac_addr peer_macaddr;
  3790. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  3791. __le32 param_id;
  3792. /* AP powersave param value */
  3793. __le32 param_value;
  3794. } __packed;
  3795. /* 128 clients = 4 words */
  3796. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  3797. struct wmi_tim_info {
  3798. __le32 tim_len;
  3799. __le32 tim_mcast;
  3800. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  3801. __le32 tim_changed;
  3802. __le32 tim_num_ps_pending;
  3803. } __packed;
  3804. /* Maximum number of NOA Descriptors supported */
  3805. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  3806. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  3807. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  3808. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  3809. struct wmi_p2p_noa_info {
  3810. /* Bit 0 - Flag to indicate an update in NOA schedule
  3811. Bits 7-1 - Reserved */
  3812. u8 changed;
  3813. /* NOA index */
  3814. u8 index;
  3815. /* Bit 0 - Opp PS state of the AP
  3816. Bits 1-7 - Ctwindow in TUs */
  3817. u8 ctwindow_oppps;
  3818. /* Number of NOA descriptors */
  3819. u8 num_descriptors;
  3820. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  3821. } __packed;
  3822. struct wmi_bcn_info {
  3823. struct wmi_tim_info tim_info;
  3824. struct wmi_p2p_noa_info p2p_noa_info;
  3825. } __packed;
  3826. struct wmi_host_swba_event {
  3827. __le32 vdev_map;
  3828. struct wmi_bcn_info bcn_info[0];
  3829. } __packed;
  3830. #define WMI_MAX_AP_VDEV 16
  3831. struct wmi_tbtt_offset_event {
  3832. __le32 vdev_map;
  3833. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  3834. } __packed;
  3835. struct wmi_peer_create_cmd {
  3836. __le32 vdev_id;
  3837. struct wmi_mac_addr peer_macaddr;
  3838. } __packed;
  3839. struct wmi_peer_delete_cmd {
  3840. __le32 vdev_id;
  3841. struct wmi_mac_addr peer_macaddr;
  3842. } __packed;
  3843. struct wmi_peer_flush_tids_cmd {
  3844. __le32 vdev_id;
  3845. struct wmi_mac_addr peer_macaddr;
  3846. __le32 peer_tid_bitmap;
  3847. } __packed;
  3848. struct wmi_fixed_rate {
  3849. /*
  3850. * rate mode . 0: disable fixed rate (auto rate)
  3851. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  3852. * 2: ht20 11n rate specified as mcs index
  3853. * 3: ht40 11n rate specified as mcs index
  3854. */
  3855. __le32 rate_mode;
  3856. /*
  3857. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  3858. * and series 3 is stored at byte 3 (MSB)
  3859. */
  3860. __le32 rate_series;
  3861. /*
  3862. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  3863. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  3864. * (MSB)
  3865. */
  3866. __le32 rate_retries;
  3867. } __packed;
  3868. struct wmi_peer_fixed_rate_cmd {
  3869. /* unique id identifying the VDEV, generated by the caller */
  3870. __le32 vdev_id;
  3871. /* peer MAC address */
  3872. struct wmi_mac_addr peer_macaddr;
  3873. /* fixed rate */
  3874. struct wmi_fixed_rate peer_fixed_rate;
  3875. } __packed;
  3876. #define WMI_MGMT_TID 17
  3877. struct wmi_addba_clear_resp_cmd {
  3878. /* unique id identifying the VDEV, generated by the caller */
  3879. __le32 vdev_id;
  3880. /* peer MAC address */
  3881. struct wmi_mac_addr peer_macaddr;
  3882. } __packed;
  3883. struct wmi_addba_send_cmd {
  3884. /* unique id identifying the VDEV, generated by the caller */
  3885. __le32 vdev_id;
  3886. /* peer MAC address */
  3887. struct wmi_mac_addr peer_macaddr;
  3888. /* Tid number */
  3889. __le32 tid;
  3890. /* Buffer/Window size*/
  3891. __le32 buffersize;
  3892. } __packed;
  3893. struct wmi_delba_send_cmd {
  3894. /* unique id identifying the VDEV, generated by the caller */
  3895. __le32 vdev_id;
  3896. /* peer MAC address */
  3897. struct wmi_mac_addr peer_macaddr;
  3898. /* Tid number */
  3899. __le32 tid;
  3900. /* Is Initiator */
  3901. __le32 initiator;
  3902. /* Reason code */
  3903. __le32 reasoncode;
  3904. } __packed;
  3905. struct wmi_addba_setresponse_cmd {
  3906. /* unique id identifying the vdev, generated by the caller */
  3907. __le32 vdev_id;
  3908. /* peer mac address */
  3909. struct wmi_mac_addr peer_macaddr;
  3910. /* Tid number */
  3911. __le32 tid;
  3912. /* status code */
  3913. __le32 statuscode;
  3914. } __packed;
  3915. struct wmi_send_singleamsdu_cmd {
  3916. /* unique id identifying the vdev, generated by the caller */
  3917. __le32 vdev_id;
  3918. /* peer mac address */
  3919. struct wmi_mac_addr peer_macaddr;
  3920. /* Tid number */
  3921. __le32 tid;
  3922. } __packed;
  3923. enum wmi_peer_smps_state {
  3924. WMI_PEER_SMPS_PS_NONE = 0x0,
  3925. WMI_PEER_SMPS_STATIC = 0x1,
  3926. WMI_PEER_SMPS_DYNAMIC = 0x2
  3927. };
  3928. enum wmi_peer_chwidth {
  3929. WMI_PEER_CHWIDTH_20MHZ = 0,
  3930. WMI_PEER_CHWIDTH_40MHZ = 1,
  3931. WMI_PEER_CHWIDTH_80MHZ = 2,
  3932. };
  3933. enum wmi_peer_param {
  3934. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  3935. WMI_PEER_AMPDU = 0x2,
  3936. WMI_PEER_AUTHORIZE = 0x3,
  3937. WMI_PEER_CHAN_WIDTH = 0x4,
  3938. WMI_PEER_NSS = 0x5,
  3939. WMI_PEER_USE_4ADDR = 0x6,
  3940. WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
  3941. };
  3942. struct wmi_peer_set_param_cmd {
  3943. __le32 vdev_id;
  3944. struct wmi_mac_addr peer_macaddr;
  3945. __le32 param_id;
  3946. __le32 param_value;
  3947. } __packed;
  3948. #define MAX_SUPPORTED_RATES 128
  3949. struct wmi_rate_set {
  3950. /* total number of rates */
  3951. __le32 num_rates;
  3952. /*
  3953. * rates (each 8bit value) packed into a 32 bit word.
  3954. * the rates are filled from least significant byte to most
  3955. * significant byte.
  3956. */
  3957. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  3958. } __packed;
  3959. struct wmi_rate_set_arg {
  3960. unsigned int num_rates;
  3961. u8 rates[MAX_SUPPORTED_RATES];
  3962. };
  3963. /*
  3964. * NOTE: It would bea good idea to represent the Tx MCS
  3965. * info in one word and Rx in another word. This is split
  3966. * into multiple words for convenience
  3967. */
  3968. struct wmi_vht_rate_set {
  3969. __le32 rx_max_rate; /* Max Rx data rate */
  3970. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  3971. __le32 tx_max_rate; /* Max Tx data rate */
  3972. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  3973. } __packed;
  3974. struct wmi_vht_rate_set_arg {
  3975. u32 rx_max_rate;
  3976. u32 rx_mcs_set;
  3977. u32 tx_max_rate;
  3978. u32 tx_mcs_set;
  3979. };
  3980. struct wmi_peer_set_rates_cmd {
  3981. /* peer MAC address */
  3982. struct wmi_mac_addr peer_macaddr;
  3983. /* legacy rate set */
  3984. struct wmi_rate_set peer_legacy_rates;
  3985. /* ht rate set */
  3986. struct wmi_rate_set peer_ht_rates;
  3987. } __packed;
  3988. struct wmi_peer_set_q_empty_callback_cmd {
  3989. /* unique id identifying the VDEV, generated by the caller */
  3990. __le32 vdev_id;
  3991. /* peer MAC address */
  3992. struct wmi_mac_addr peer_macaddr;
  3993. __le32 callback_enable;
  3994. } __packed;
  3995. #define WMI_PEER_AUTH 0x00000001
  3996. #define WMI_PEER_QOS 0x00000002
  3997. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  3998. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  3999. #define WMI_PEER_APSD 0x00000800
  4000. #define WMI_PEER_HT 0x00001000
  4001. #define WMI_PEER_40MHZ 0x00002000
  4002. #define WMI_PEER_STBC 0x00008000
  4003. #define WMI_PEER_LDPC 0x00010000
  4004. #define WMI_PEER_DYN_MIMOPS 0x00020000
  4005. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  4006. #define WMI_PEER_SPATIAL_MUX 0x00200000
  4007. #define WMI_PEER_VHT 0x02000000
  4008. #define WMI_PEER_80MHZ 0x04000000
  4009. #define WMI_PEER_VHT_2G 0x08000000
  4010. /*
  4011. * Peer rate capabilities.
  4012. *
  4013. * This is of interest to the ratecontrol
  4014. * module which resides in the firmware. The bit definitions are
  4015. * consistent with that defined in if_athrate.c.
  4016. */
  4017. #define WMI_RC_DS_FLAG 0x01
  4018. #define WMI_RC_CW40_FLAG 0x02
  4019. #define WMI_RC_SGI_FLAG 0x04
  4020. #define WMI_RC_HT_FLAG 0x08
  4021. #define WMI_RC_RTSCTS_FLAG 0x10
  4022. #define WMI_RC_TX_STBC_FLAG 0x20
  4023. #define WMI_RC_RX_STBC_FLAG 0xC0
  4024. #define WMI_RC_RX_STBC_FLAG_S 6
  4025. #define WMI_RC_WEP_TKIP_FLAG 0x100
  4026. #define WMI_RC_TS_FLAG 0x200
  4027. #define WMI_RC_UAPSD_FLAG 0x400
  4028. /* Maximum listen interval supported by hw in units of beacon interval */
  4029. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  4030. struct wmi_common_peer_assoc_complete_cmd {
  4031. struct wmi_mac_addr peer_macaddr;
  4032. __le32 vdev_id;
  4033. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  4034. __le32 peer_associd; /* 16 LSBs */
  4035. __le32 peer_flags;
  4036. __le32 peer_caps; /* 16 LSBs */
  4037. __le32 peer_listen_intval;
  4038. __le32 peer_ht_caps;
  4039. __le32 peer_max_mpdu;
  4040. __le32 peer_mpdu_density; /* 0..16 */
  4041. __le32 peer_rate_caps;
  4042. struct wmi_rate_set peer_legacy_rates;
  4043. struct wmi_rate_set peer_ht_rates;
  4044. __le32 peer_nss; /* num of spatial streams */
  4045. __le32 peer_vht_caps;
  4046. __le32 peer_phymode;
  4047. struct wmi_vht_rate_set peer_vht_rates;
  4048. };
  4049. struct wmi_main_peer_assoc_complete_cmd {
  4050. struct wmi_common_peer_assoc_complete_cmd cmd;
  4051. /* HT Operation Element of the peer. Five bytes packed in 2
  4052. * INT32 array and filled from lsb to msb. */
  4053. __le32 peer_ht_info[2];
  4054. } __packed;
  4055. struct wmi_10_1_peer_assoc_complete_cmd {
  4056. struct wmi_common_peer_assoc_complete_cmd cmd;
  4057. } __packed;
  4058. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
  4059. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
  4060. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
  4061. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
  4062. struct wmi_10_2_peer_assoc_complete_cmd {
  4063. struct wmi_common_peer_assoc_complete_cmd cmd;
  4064. __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  4065. } __packed;
  4066. struct wmi_peer_assoc_complete_arg {
  4067. u8 addr[ETH_ALEN];
  4068. u32 vdev_id;
  4069. bool peer_reassoc;
  4070. u16 peer_aid;
  4071. u32 peer_flags; /* see %WMI_PEER_ */
  4072. u16 peer_caps;
  4073. u32 peer_listen_intval;
  4074. u32 peer_ht_caps;
  4075. u32 peer_max_mpdu;
  4076. u32 peer_mpdu_density; /* 0..16 */
  4077. u32 peer_rate_caps; /* see %WMI_RC_ */
  4078. struct wmi_rate_set_arg peer_legacy_rates;
  4079. struct wmi_rate_set_arg peer_ht_rates;
  4080. u32 peer_num_spatial_streams;
  4081. u32 peer_vht_caps;
  4082. enum wmi_phy_mode peer_phymode;
  4083. struct wmi_vht_rate_set_arg peer_vht_rates;
  4084. };
  4085. struct wmi_peer_add_wds_entry_cmd {
  4086. /* peer MAC address */
  4087. struct wmi_mac_addr peer_macaddr;
  4088. /* wds MAC addr */
  4089. struct wmi_mac_addr wds_macaddr;
  4090. } __packed;
  4091. struct wmi_peer_remove_wds_entry_cmd {
  4092. /* wds MAC addr */
  4093. struct wmi_mac_addr wds_macaddr;
  4094. } __packed;
  4095. struct wmi_peer_q_empty_callback_event {
  4096. /* peer MAC address */
  4097. struct wmi_mac_addr peer_macaddr;
  4098. } __packed;
  4099. /*
  4100. * Channel info WMI event
  4101. */
  4102. struct wmi_chan_info_event {
  4103. __le32 err_code;
  4104. __le32 freq;
  4105. __le32 cmd_flags;
  4106. __le32 noise_floor;
  4107. __le32 rx_clear_count;
  4108. __le32 cycle_count;
  4109. } __packed;
  4110. struct wmi_peer_sta_kickout_event {
  4111. struct wmi_mac_addr peer_macaddr;
  4112. } __packed;
  4113. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  4114. /* FIXME: empirically extrapolated */
  4115. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  4116. /* Beacon filter wmi command info */
  4117. #define BCN_FLT_MAX_SUPPORTED_IES 256
  4118. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  4119. struct bss_bcn_stats {
  4120. __le32 vdev_id;
  4121. __le32 bss_bcnsdropped;
  4122. __le32 bss_bcnsdelivered;
  4123. } __packed;
  4124. struct bcn_filter_stats {
  4125. __le32 bcns_dropped;
  4126. __le32 bcns_delivered;
  4127. __le32 activefilters;
  4128. struct bss_bcn_stats bss_stats;
  4129. } __packed;
  4130. struct wmi_add_bcn_filter_cmd {
  4131. u32 vdev_id;
  4132. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  4133. } __packed;
  4134. enum wmi_sta_keepalive_method {
  4135. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  4136. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  4137. };
  4138. #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
  4139. /* Firmware crashes if keepalive interval exceeds this limit */
  4140. #define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
  4141. /* note: ip4 addresses are in network byte order, i.e. big endian */
  4142. struct wmi_sta_keepalive_arp_resp {
  4143. __be32 src_ip4_addr;
  4144. __be32 dest_ip4_addr;
  4145. struct wmi_mac_addr dest_mac_addr;
  4146. } __packed;
  4147. struct wmi_sta_keepalive_cmd {
  4148. __le32 vdev_id;
  4149. __le32 enabled;
  4150. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  4151. __le32 interval; /* in seconds */
  4152. struct wmi_sta_keepalive_arp_resp arp_resp;
  4153. } __packed;
  4154. struct wmi_sta_keepalive_arg {
  4155. u32 vdev_id;
  4156. u32 enabled;
  4157. u32 method;
  4158. u32 interval;
  4159. __be32 src_ip4_addr;
  4160. __be32 dest_ip4_addr;
  4161. const u8 dest_mac_addr[ETH_ALEN];
  4162. };
  4163. enum wmi_force_fw_hang_type {
  4164. WMI_FORCE_FW_HANG_ASSERT = 1,
  4165. WMI_FORCE_FW_HANG_NO_DETECT,
  4166. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  4167. WMI_FORCE_FW_HANG_EMPTY_POINT,
  4168. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  4169. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  4170. };
  4171. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  4172. struct wmi_force_fw_hang_cmd {
  4173. __le32 type;
  4174. __le32 delay_ms;
  4175. } __packed;
  4176. enum ath10k_dbglog_level {
  4177. ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
  4178. ATH10K_DBGLOG_LEVEL_INFO = 1,
  4179. ATH10K_DBGLOG_LEVEL_WARN = 2,
  4180. ATH10K_DBGLOG_LEVEL_ERR = 3,
  4181. };
  4182. /* VAP ids to enable dbglog */
  4183. #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
  4184. #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
  4185. /* to enable dbglog in the firmware */
  4186. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
  4187. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
  4188. /* timestamp resolution */
  4189. #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
  4190. #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
  4191. /* number of queued messages before sending them to the host */
  4192. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
  4193. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
  4194. /*
  4195. * Log levels to enable. This defines the minimum level to enable, this is
  4196. * not a bitmask. See enum ath10k_dbglog_level for the values.
  4197. */
  4198. #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
  4199. #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
  4200. /*
  4201. * Note: this is a cleaned up version of a struct firmware uses. For
  4202. * example, config_valid was hidden inside an array.
  4203. */
  4204. struct wmi_dbglog_cfg_cmd {
  4205. /* bitmask to hold mod id config*/
  4206. __le32 module_enable;
  4207. /* see ATH10K_DBGLOG_CFG_ */
  4208. __le32 config_enable;
  4209. /* mask of module id bits to be changed */
  4210. __le32 module_valid;
  4211. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  4212. __le32 config_valid;
  4213. } __packed;
  4214. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  4215. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  4216. #define WMI_MAX_EVENT 0x1000
  4217. /* Maximum number of pending TXed WMI packets */
  4218. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  4219. /* By default disable power save for IBSS */
  4220. #define ATH10K_DEFAULT_ATIM 0
  4221. #define WMI_MAX_MEM_REQS 16
  4222. struct wmi_scan_ev_arg {
  4223. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  4224. __le32 reason; /* %WMI_SCAN_REASON_ */
  4225. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  4226. __le32 scan_req_id;
  4227. __le32 scan_id;
  4228. __le32 vdev_id;
  4229. };
  4230. struct wmi_mgmt_rx_ev_arg {
  4231. __le32 channel;
  4232. __le32 snr;
  4233. __le32 rate;
  4234. __le32 phy_mode;
  4235. __le32 buf_len;
  4236. __le32 status; /* %WMI_RX_STATUS_ */
  4237. };
  4238. struct wmi_ch_info_ev_arg {
  4239. __le32 err_code;
  4240. __le32 freq;
  4241. __le32 cmd_flags;
  4242. __le32 noise_floor;
  4243. __le32 rx_clear_count;
  4244. __le32 cycle_count;
  4245. };
  4246. struct wmi_vdev_start_ev_arg {
  4247. __le32 vdev_id;
  4248. __le32 req_id;
  4249. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  4250. __le32 status;
  4251. };
  4252. struct wmi_peer_kick_ev_arg {
  4253. const u8 *mac_addr;
  4254. };
  4255. struct wmi_swba_ev_arg {
  4256. __le32 vdev_map;
  4257. const struct wmi_tim_info *tim_info[WMI_MAX_AP_VDEV];
  4258. const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
  4259. };
  4260. struct wmi_phyerr_ev_arg {
  4261. __le32 num_phyerrs;
  4262. __le32 tsf_l32;
  4263. __le32 tsf_u32;
  4264. __le32 buf_len;
  4265. const struct wmi_phyerr *phyerrs;
  4266. };
  4267. struct wmi_svc_rdy_ev_arg {
  4268. __le32 min_tx_power;
  4269. __le32 max_tx_power;
  4270. __le32 ht_cap;
  4271. __le32 vht_cap;
  4272. __le32 sw_ver0;
  4273. __le32 sw_ver1;
  4274. __le32 fw_build;
  4275. __le32 phy_capab;
  4276. __le32 num_rf_chains;
  4277. __le32 eeprom_rd;
  4278. __le32 num_mem_reqs;
  4279. const __le32 *service_map;
  4280. size_t service_map_len;
  4281. const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
  4282. };
  4283. struct wmi_rdy_ev_arg {
  4284. __le32 sw_version;
  4285. __le32 abi_version;
  4286. __le32 status;
  4287. const u8 *mac_addr;
  4288. };
  4289. struct wmi_pdev_temperature_event {
  4290. /* temperature value in Celcius degree */
  4291. __le32 temperature;
  4292. } __packed;
  4293. struct ath10k;
  4294. struct ath10k_vif;
  4295. struct ath10k_fw_stats_pdev;
  4296. struct ath10k_fw_stats_peer;
  4297. int ath10k_wmi_attach(struct ath10k *ar);
  4298. void ath10k_wmi_detach(struct ath10k *ar);
  4299. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  4300. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  4301. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  4302. int ath10k_wmi_connect(struct ath10k *ar);
  4303. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  4304. int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
  4305. int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
  4306. u32 cmd_id);
  4307. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  4308. void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
  4309. struct ath10k_fw_stats_pdev *dst);
  4310. void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
  4311. struct ath10k_fw_stats_pdev *dst);
  4312. void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
  4313. struct ath10k_fw_stats_pdev *dst);
  4314. void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
  4315. struct ath10k_fw_stats_pdev *dst);
  4316. void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
  4317. struct ath10k_fw_stats_peer *dst);
  4318. void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
  4319. struct wmi_host_mem_chunks *chunks);
  4320. void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
  4321. const struct wmi_start_scan_arg *arg);
  4322. void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
  4323. const struct wmi_wmm_params_arg *arg);
  4324. void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
  4325. const struct wmi_channel_arg *arg);
  4326. int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
  4327. int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
  4328. int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
  4329. void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
  4330. void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
  4331. int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
  4332. void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
  4333. void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
  4334. void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
  4335. void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
  4336. void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
  4337. void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
  4338. void ath10k_wmi_event_dfs(struct ath10k *ar,
  4339. const struct wmi_phyerr *phyerr, u64 tsf);
  4340. void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
  4341. const struct wmi_phyerr *phyerr,
  4342. u64 tsf);
  4343. void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
  4344. void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
  4345. void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
  4346. void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
  4347. void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
  4348. void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
  4349. void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
  4350. struct sk_buff *skb);
  4351. void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
  4352. struct sk_buff *skb);
  4353. void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
  4354. void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
  4355. void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
  4356. void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
  4357. void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
  4358. void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
  4359. struct sk_buff *skb);
  4360. void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
  4361. void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
  4362. void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
  4363. void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
  4364. struct sk_buff *skb);
  4365. void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
  4366. void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
  4367. void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
  4368. void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
  4369. int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
  4370. #endif /* _WMI_H_ */