hal.h 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659
  1. /*
  2. * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com>
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _HAL_H_
  17. #define _HAL_H_
  18. /*---------------------------------------------------------------------------
  19. API VERSIONING INFORMATION
  20. The RIVA API is versioned as MAJOR.MINOR.VERSION.REVISION
  21. The MAJOR is incremented for major product/architecture changes
  22. (and then MINOR/VERSION/REVISION are zeroed)
  23. The MINOR is incremented for minor product/architecture changes
  24. (and then VERSION/REVISION are zeroed)
  25. The VERSION is incremented if a significant API change occurs
  26. (and then REVISION is zeroed)
  27. The REVISION is incremented if an insignificant API change occurs
  28. or if a new API is added
  29. All values are in the range 0..255 (ie they are 8-bit values)
  30. ---------------------------------------------------------------------------*/
  31. #define WCN36XX_HAL_VER_MAJOR 1
  32. #define WCN36XX_HAL_VER_MINOR 4
  33. #define WCN36XX_HAL_VER_VERSION 1
  34. #define WCN36XX_HAL_VER_REVISION 2
  35. /* This is to force compiler to use the maximum of an int ( 4 bytes ) */
  36. #define WCN36XX_HAL_MAX_ENUM_SIZE 0x7FFFFFFF
  37. #define WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
  38. /* Max no. of transmit categories */
  39. #define STACFG_MAX_TC 8
  40. /* The maximum value of access category */
  41. #define WCN36XX_HAL_MAX_AC 4
  42. #define WCN36XX_HAL_IPV4_ADDR_LEN 4
  43. #define WALN_HAL_STA_INVALID_IDX 0xFF
  44. #define WCN36XX_HAL_BSS_INVALID_IDX 0xFF
  45. /* Default Beacon template size */
  46. #define BEACON_TEMPLATE_SIZE 0x180
  47. /* Param Change Bitmap sent to HAL */
  48. #define PARAM_BCN_INTERVAL_CHANGED (1 << 0)
  49. #define PARAM_SHORT_PREAMBLE_CHANGED (1 << 1)
  50. #define PARAM_SHORT_SLOT_TIME_CHANGED (1 << 2)
  51. #define PARAM_llACOEXIST_CHANGED (1 << 3)
  52. #define PARAM_llBCOEXIST_CHANGED (1 << 4)
  53. #define PARAM_llGCOEXIST_CHANGED (1 << 5)
  54. #define PARAM_HT20MHZCOEXIST_CHANGED (1<<6)
  55. #define PARAM_NON_GF_DEVICES_PRESENT_CHANGED (1<<7)
  56. #define PARAM_RIFS_MODE_CHANGED (1<<8)
  57. #define PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED (1<<9)
  58. #define PARAM_OBSS_MODE_CHANGED (1<<10)
  59. #define PARAM_BEACON_UPDATE_MASK \
  60. (PARAM_BCN_INTERVAL_CHANGED | \
  61. PARAM_SHORT_PREAMBLE_CHANGED | \
  62. PARAM_SHORT_SLOT_TIME_CHANGED | \
  63. PARAM_llACOEXIST_CHANGED | \
  64. PARAM_llBCOEXIST_CHANGED | \
  65. PARAM_llGCOEXIST_CHANGED | \
  66. PARAM_HT20MHZCOEXIST_CHANGED | \
  67. PARAM_NON_GF_DEVICES_PRESENT_CHANGED | \
  68. PARAM_RIFS_MODE_CHANGED | \
  69. PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED | \
  70. PARAM_OBSS_MODE_CHANGED)
  71. /* dump command response Buffer size */
  72. #define DUMPCMD_RSP_BUFFER 100
  73. /* version string max length (including NULL) */
  74. #define WCN36XX_HAL_VERSION_LENGTH 64
  75. /* message types for messages exchanged between WDI and HAL */
  76. enum wcn36xx_hal_host_msg_type {
  77. /* Init/De-Init */
  78. WCN36XX_HAL_START_REQ = 0,
  79. WCN36XX_HAL_START_RSP = 1,
  80. WCN36XX_HAL_STOP_REQ = 2,
  81. WCN36XX_HAL_STOP_RSP = 3,
  82. /* Scan */
  83. WCN36XX_HAL_INIT_SCAN_REQ = 4,
  84. WCN36XX_HAL_INIT_SCAN_RSP = 5,
  85. WCN36XX_HAL_START_SCAN_REQ = 6,
  86. WCN36XX_HAL_START_SCAN_RSP = 7,
  87. WCN36XX_HAL_END_SCAN_REQ = 8,
  88. WCN36XX_HAL_END_SCAN_RSP = 9,
  89. WCN36XX_HAL_FINISH_SCAN_REQ = 10,
  90. WCN36XX_HAL_FINISH_SCAN_RSP = 11,
  91. /* HW STA configuration/deconfiguration */
  92. WCN36XX_HAL_CONFIG_STA_REQ = 12,
  93. WCN36XX_HAL_CONFIG_STA_RSP = 13,
  94. WCN36XX_HAL_DELETE_STA_REQ = 14,
  95. WCN36XX_HAL_DELETE_STA_RSP = 15,
  96. WCN36XX_HAL_CONFIG_BSS_REQ = 16,
  97. WCN36XX_HAL_CONFIG_BSS_RSP = 17,
  98. WCN36XX_HAL_DELETE_BSS_REQ = 18,
  99. WCN36XX_HAL_DELETE_BSS_RSP = 19,
  100. /* Infra STA asscoiation */
  101. WCN36XX_HAL_JOIN_REQ = 20,
  102. WCN36XX_HAL_JOIN_RSP = 21,
  103. WCN36XX_HAL_POST_ASSOC_REQ = 22,
  104. WCN36XX_HAL_POST_ASSOC_RSP = 23,
  105. /* Security */
  106. WCN36XX_HAL_SET_BSSKEY_REQ = 24,
  107. WCN36XX_HAL_SET_BSSKEY_RSP = 25,
  108. WCN36XX_HAL_SET_STAKEY_REQ = 26,
  109. WCN36XX_HAL_SET_STAKEY_RSP = 27,
  110. WCN36XX_HAL_RMV_BSSKEY_REQ = 28,
  111. WCN36XX_HAL_RMV_BSSKEY_RSP = 29,
  112. WCN36XX_HAL_RMV_STAKEY_REQ = 30,
  113. WCN36XX_HAL_RMV_STAKEY_RSP = 31,
  114. /* Qos Related */
  115. WCN36XX_HAL_ADD_TS_REQ = 32,
  116. WCN36XX_HAL_ADD_TS_RSP = 33,
  117. WCN36XX_HAL_DEL_TS_REQ = 34,
  118. WCN36XX_HAL_DEL_TS_RSP = 35,
  119. WCN36XX_HAL_UPD_EDCA_PARAMS_REQ = 36,
  120. WCN36XX_HAL_UPD_EDCA_PARAMS_RSP = 37,
  121. WCN36XX_HAL_ADD_BA_REQ = 38,
  122. WCN36XX_HAL_ADD_BA_RSP = 39,
  123. WCN36XX_HAL_DEL_BA_REQ = 40,
  124. WCN36XX_HAL_DEL_BA_RSP = 41,
  125. WCN36XX_HAL_CH_SWITCH_REQ = 42,
  126. WCN36XX_HAL_CH_SWITCH_RSP = 43,
  127. WCN36XX_HAL_SET_LINK_ST_REQ = 44,
  128. WCN36XX_HAL_SET_LINK_ST_RSP = 45,
  129. WCN36XX_HAL_GET_STATS_REQ = 46,
  130. WCN36XX_HAL_GET_STATS_RSP = 47,
  131. WCN36XX_HAL_UPDATE_CFG_REQ = 48,
  132. WCN36XX_HAL_UPDATE_CFG_RSP = 49,
  133. WCN36XX_HAL_MISSED_BEACON_IND = 50,
  134. WCN36XX_HAL_UNKNOWN_ADDR2_FRAME_RX_IND = 51,
  135. WCN36XX_HAL_MIC_FAILURE_IND = 52,
  136. WCN36XX_HAL_FATAL_ERROR_IND = 53,
  137. WCN36XX_HAL_SET_KEYDONE_MSG = 54,
  138. /* NV Interface */
  139. WCN36XX_HAL_DOWNLOAD_NV_REQ = 55,
  140. WCN36XX_HAL_DOWNLOAD_NV_RSP = 56,
  141. WCN36XX_HAL_ADD_BA_SESSION_REQ = 57,
  142. WCN36XX_HAL_ADD_BA_SESSION_RSP = 58,
  143. WCN36XX_HAL_TRIGGER_BA_REQ = 59,
  144. WCN36XX_HAL_TRIGGER_BA_RSP = 60,
  145. WCN36XX_HAL_UPDATE_BEACON_REQ = 61,
  146. WCN36XX_HAL_UPDATE_BEACON_RSP = 62,
  147. WCN36XX_HAL_SEND_BEACON_REQ = 63,
  148. WCN36XX_HAL_SEND_BEACON_RSP = 64,
  149. WCN36XX_HAL_SET_BCASTKEY_REQ = 65,
  150. WCN36XX_HAL_SET_BCASTKEY_RSP = 66,
  151. WCN36XX_HAL_DELETE_STA_CONTEXT_IND = 67,
  152. WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ = 68,
  153. WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP = 69,
  154. /* PTT interface support */
  155. WCN36XX_HAL_PROCESS_PTT_REQ = 70,
  156. WCN36XX_HAL_PROCESS_PTT_RSP = 71,
  157. /* BTAMP related events */
  158. WCN36XX_HAL_SIGNAL_BTAMP_EVENT_REQ = 72,
  159. WCN36XX_HAL_SIGNAL_BTAMP_EVENT_RSP = 73,
  160. WCN36XX_HAL_TL_HAL_FLUSH_AC_REQ = 74,
  161. WCN36XX_HAL_TL_HAL_FLUSH_AC_RSP = 75,
  162. WCN36XX_HAL_ENTER_IMPS_REQ = 76,
  163. WCN36XX_HAL_EXIT_IMPS_REQ = 77,
  164. WCN36XX_HAL_ENTER_BMPS_REQ = 78,
  165. WCN36XX_HAL_EXIT_BMPS_REQ = 79,
  166. WCN36XX_HAL_ENTER_UAPSD_REQ = 80,
  167. WCN36XX_HAL_EXIT_UAPSD_REQ = 81,
  168. WCN36XX_HAL_UPDATE_UAPSD_PARAM_REQ = 82,
  169. WCN36XX_HAL_CONFIGURE_RXP_FILTER_REQ = 83,
  170. WCN36XX_HAL_ADD_BCN_FILTER_REQ = 84,
  171. WCN36XX_HAL_REM_BCN_FILTER_REQ = 85,
  172. WCN36XX_HAL_ADD_WOWL_BCAST_PTRN = 86,
  173. WCN36XX_HAL_DEL_WOWL_BCAST_PTRN = 87,
  174. WCN36XX_HAL_ENTER_WOWL_REQ = 88,
  175. WCN36XX_HAL_EXIT_WOWL_REQ = 89,
  176. WCN36XX_HAL_HOST_OFFLOAD_REQ = 90,
  177. WCN36XX_HAL_SET_RSSI_THRESH_REQ = 91,
  178. WCN36XX_HAL_GET_RSSI_REQ = 92,
  179. WCN36XX_HAL_SET_UAPSD_AC_PARAMS_REQ = 93,
  180. WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ = 94,
  181. WCN36XX_HAL_ENTER_IMPS_RSP = 95,
  182. WCN36XX_HAL_EXIT_IMPS_RSP = 96,
  183. WCN36XX_HAL_ENTER_BMPS_RSP = 97,
  184. WCN36XX_HAL_EXIT_BMPS_RSP = 98,
  185. WCN36XX_HAL_ENTER_UAPSD_RSP = 99,
  186. WCN36XX_HAL_EXIT_UAPSD_RSP = 100,
  187. WCN36XX_HAL_SET_UAPSD_AC_PARAMS_RSP = 101,
  188. WCN36XX_HAL_UPDATE_UAPSD_PARAM_RSP = 102,
  189. WCN36XX_HAL_CONFIGURE_RXP_FILTER_RSP = 103,
  190. WCN36XX_HAL_ADD_BCN_FILTER_RSP = 104,
  191. WCN36XX_HAL_REM_BCN_FILTER_RSP = 105,
  192. WCN36XX_HAL_SET_RSSI_THRESH_RSP = 106,
  193. WCN36XX_HAL_HOST_OFFLOAD_RSP = 107,
  194. WCN36XX_HAL_ADD_WOWL_BCAST_PTRN_RSP = 108,
  195. WCN36XX_HAL_DEL_WOWL_BCAST_PTRN_RSP = 109,
  196. WCN36XX_HAL_ENTER_WOWL_RSP = 110,
  197. WCN36XX_HAL_EXIT_WOWL_RSP = 111,
  198. WCN36XX_HAL_RSSI_NOTIFICATION_IND = 112,
  199. WCN36XX_HAL_GET_RSSI_RSP = 113,
  200. WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP = 114,
  201. /* 11k related events */
  202. WCN36XX_HAL_SET_MAX_TX_POWER_REQ = 115,
  203. WCN36XX_HAL_SET_MAX_TX_POWER_RSP = 116,
  204. /* 11R related msgs */
  205. WCN36XX_HAL_AGGR_ADD_TS_REQ = 117,
  206. WCN36XX_HAL_AGGR_ADD_TS_RSP = 118,
  207. /* P2P WLAN_FEATURE_P2P */
  208. WCN36XX_HAL_SET_P2P_GONOA_REQ = 119,
  209. WCN36XX_HAL_SET_P2P_GONOA_RSP = 120,
  210. /* WLAN Dump commands */
  211. WCN36XX_HAL_DUMP_COMMAND_REQ = 121,
  212. WCN36XX_HAL_DUMP_COMMAND_RSP = 122,
  213. /* OEM_DATA FEATURE SUPPORT */
  214. WCN36XX_HAL_START_OEM_DATA_REQ = 123,
  215. WCN36XX_HAL_START_OEM_DATA_RSP = 124,
  216. /* ADD SELF STA REQ and RSP */
  217. WCN36XX_HAL_ADD_STA_SELF_REQ = 125,
  218. WCN36XX_HAL_ADD_STA_SELF_RSP = 126,
  219. /* DEL SELF STA SUPPORT */
  220. WCN36XX_HAL_DEL_STA_SELF_REQ = 127,
  221. WCN36XX_HAL_DEL_STA_SELF_RSP = 128,
  222. /* Coex Indication */
  223. WCN36XX_HAL_COEX_IND = 129,
  224. /* Tx Complete Indication */
  225. WCN36XX_HAL_OTA_TX_COMPL_IND = 130,
  226. /* Host Suspend/resume messages */
  227. WCN36XX_HAL_HOST_SUSPEND_IND = 131,
  228. WCN36XX_HAL_HOST_RESUME_REQ = 132,
  229. WCN36XX_HAL_HOST_RESUME_RSP = 133,
  230. WCN36XX_HAL_SET_TX_POWER_REQ = 134,
  231. WCN36XX_HAL_SET_TX_POWER_RSP = 135,
  232. WCN36XX_HAL_GET_TX_POWER_REQ = 136,
  233. WCN36XX_HAL_GET_TX_POWER_RSP = 137,
  234. WCN36XX_HAL_P2P_NOA_ATTR_IND = 138,
  235. WCN36XX_HAL_ENABLE_RADAR_DETECT_REQ = 139,
  236. WCN36XX_HAL_ENABLE_RADAR_DETECT_RSP = 140,
  237. WCN36XX_HAL_GET_TPC_REPORT_REQ = 141,
  238. WCN36XX_HAL_GET_TPC_REPORT_RSP = 142,
  239. WCN36XX_HAL_RADAR_DETECT_IND = 143,
  240. WCN36XX_HAL_RADAR_DETECT_INTR_IND = 144,
  241. WCN36XX_HAL_KEEP_ALIVE_REQ = 145,
  242. WCN36XX_HAL_KEEP_ALIVE_RSP = 146,
  243. /* PNO messages */
  244. WCN36XX_HAL_SET_PREF_NETWORK_REQ = 147,
  245. WCN36XX_HAL_SET_PREF_NETWORK_RSP = 148,
  246. WCN36XX_HAL_SET_RSSI_FILTER_REQ = 149,
  247. WCN36XX_HAL_SET_RSSI_FILTER_RSP = 150,
  248. WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ = 151,
  249. WCN36XX_HAL_UPDATE_SCAN_PARAM_RSP = 152,
  250. WCN36XX_HAL_PREF_NETW_FOUND_IND = 153,
  251. WCN36XX_HAL_SET_TX_PER_TRACKING_REQ = 154,
  252. WCN36XX_HAL_SET_TX_PER_TRACKING_RSP = 155,
  253. WCN36XX_HAL_TX_PER_HIT_IND = 156,
  254. WCN36XX_HAL_8023_MULTICAST_LIST_REQ = 157,
  255. WCN36XX_HAL_8023_MULTICAST_LIST_RSP = 158,
  256. WCN36XX_HAL_SET_PACKET_FILTER_REQ = 159,
  257. WCN36XX_HAL_SET_PACKET_FILTER_RSP = 160,
  258. WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_REQ = 161,
  259. WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_RSP = 162,
  260. WCN36XX_HAL_CLEAR_PACKET_FILTER_REQ = 163,
  261. WCN36XX_HAL_CLEAR_PACKET_FILTER_RSP = 164,
  262. /*
  263. * This is temp fix. Should be removed once Host and Riva code is
  264. * in sync.
  265. */
  266. WCN36XX_HAL_INIT_SCAN_CON_REQ = 165,
  267. WCN36XX_HAL_SET_POWER_PARAMS_REQ = 166,
  268. WCN36XX_HAL_SET_POWER_PARAMS_RSP = 167,
  269. WCN36XX_HAL_TSM_STATS_REQ = 168,
  270. WCN36XX_HAL_TSM_STATS_RSP = 169,
  271. /* wake reason indication (WOW) */
  272. WCN36XX_HAL_WAKE_REASON_IND = 170,
  273. /* GTK offload support */
  274. WCN36XX_HAL_GTK_OFFLOAD_REQ = 171,
  275. WCN36XX_HAL_GTK_OFFLOAD_RSP = 172,
  276. WCN36XX_HAL_GTK_OFFLOAD_GETINFO_REQ = 173,
  277. WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP = 174,
  278. WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ = 175,
  279. WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_RSP = 176,
  280. WCN36XX_HAL_EXCLUDE_UNENCRYPTED_IND = 177,
  281. WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ = 178,
  282. WCN36XX_HAL_SET_THERMAL_MITIGATION_RSP = 179,
  283. WCN36XX_HAL_UPDATE_VHT_OP_MODE_REQ = 182,
  284. WCN36XX_HAL_UPDATE_VHT_OP_MODE_RSP = 183,
  285. WCN36XX_HAL_P2P_NOA_START_IND = 184,
  286. WCN36XX_HAL_GET_ROAM_RSSI_REQ = 185,
  287. WCN36XX_HAL_GET_ROAM_RSSI_RSP = 186,
  288. WCN36XX_HAL_CLASS_B_STATS_IND = 187,
  289. WCN36XX_HAL_DEL_BA_IND = 188,
  290. WCN36XX_HAL_DHCP_START_IND = 189,
  291. WCN36XX_HAL_DHCP_STOP_IND = 190,
  292. WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE
  293. };
  294. /* Enumeration for Version */
  295. enum wcn36xx_hal_host_msg_version {
  296. WCN36XX_HAL_MSG_VERSION0 = 0,
  297. WCN36XX_HAL_MSG_VERSION1 = 1,
  298. /* define as 2 bytes data */
  299. WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF,
  300. WCN36XX_HAL_MSG_VERSION_MAX_FIELD = WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION
  301. };
  302. enum driver_type {
  303. DRIVER_TYPE_PRODUCTION = 0,
  304. DRIVER_TYPE_MFG = 1,
  305. DRIVER_TYPE_DVT = 2,
  306. DRIVER_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  307. };
  308. enum wcn36xx_hal_stop_type {
  309. HAL_STOP_TYPE_SYS_RESET,
  310. HAL_STOP_TYPE_SYS_DEEP_SLEEP,
  311. HAL_STOP_TYPE_RF_KILL,
  312. HAL_STOP_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  313. };
  314. enum wcn36xx_hal_sys_mode {
  315. HAL_SYS_MODE_NORMAL,
  316. HAL_SYS_MODE_LEARN,
  317. HAL_SYS_MODE_SCAN,
  318. HAL_SYS_MODE_PROMISC,
  319. HAL_SYS_MODE_SUSPEND_LINK,
  320. HAL_SYS_MODE_ROAM_SCAN,
  321. HAL_SYS_MODE_ROAM_SUSPEND_LINK,
  322. HAL_SYS_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  323. };
  324. enum phy_chan_bond_state {
  325. /* 20MHz IF bandwidth centered on IF carrier */
  326. PHY_SINGLE_CHANNEL_CENTERED = 0,
  327. /* 40MHz IF bandwidth with lower 20MHz supporting the primary channel */
  328. PHY_DOUBLE_CHANNEL_LOW_PRIMARY = 1,
  329. /* 40MHz IF bandwidth centered on IF carrier */
  330. PHY_DOUBLE_CHANNEL_CENTERED = 2,
  331. /* 40MHz IF bandwidth with higher 20MHz supporting the primary ch */
  332. PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3,
  333. /* 20/40MHZ offset LOW 40/80MHZ offset CENTERED */
  334. PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED = 4,
  335. /* 20/40MHZ offset CENTERED 40/80MHZ offset CENTERED */
  336. PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED = 5,
  337. /* 20/40MHZ offset HIGH 40/80MHZ offset CENTERED */
  338. PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED = 6,
  339. /* 20/40MHZ offset LOW 40/80MHZ offset LOW */
  340. PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW = 7,
  341. /* 20/40MHZ offset HIGH 40/80MHZ offset LOW */
  342. PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW = 8,
  343. /* 20/40MHZ offset LOW 40/80MHZ offset HIGH */
  344. PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH = 9,
  345. /* 20/40MHZ offset-HIGH 40/80MHZ offset HIGH */
  346. PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH = 10,
  347. PHY_CHANNEL_BONDING_STATE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  348. };
  349. /* Spatial Multiplexing(SM) Power Save mode */
  350. enum wcn36xx_hal_ht_mimo_state {
  351. /* Static SM Power Save mode */
  352. WCN36XX_HAL_HT_MIMO_PS_STATIC = 0,
  353. /* Dynamic SM Power Save mode */
  354. WCN36XX_HAL_HT_MIMO_PS_DYNAMIC = 1,
  355. /* reserved */
  356. WCN36XX_HAL_HT_MIMO_PS_NA = 2,
  357. /* SM Power Save disabled */
  358. WCN36XX_HAL_HT_MIMO_PS_NO_LIMIT = 3,
  359. WCN36XX_HAL_HT_MIMO_PS_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  360. };
  361. /* each station added has a rate mode which specifies the sta attributes */
  362. enum sta_rate_mode {
  363. STA_TAURUS = 0,
  364. STA_TITAN,
  365. STA_POLARIS,
  366. STA_11b,
  367. STA_11bg,
  368. STA_11a,
  369. STA_11n,
  370. STA_11ac,
  371. STA_INVALID_RATE_MODE = WCN36XX_HAL_MAX_ENUM_SIZE
  372. };
  373. /* 1,2,5.5,11 */
  374. #define WCN36XX_HAL_NUM_DSSS_RATES 4
  375. /* 6,9,12,18,24,36,48,54 */
  376. #define WCN36XX_HAL_NUM_OFDM_RATES 8
  377. /* 72,96,108 */
  378. #define WCN36XX_HAL_NUM_POLARIS_RATES 3
  379. #define WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET 16
  380. enum wcn36xx_hal_bss_type {
  381. WCN36XX_HAL_INFRASTRUCTURE_MODE,
  382. /* Added for softAP support */
  383. WCN36XX_HAL_INFRA_AP_MODE,
  384. WCN36XX_HAL_IBSS_MODE,
  385. /* Added for BT-AMP support */
  386. WCN36XX_HAL_BTAMP_STA_MODE,
  387. /* Added for BT-AMP support */
  388. WCN36XX_HAL_BTAMP_AP_MODE,
  389. WCN36XX_HAL_AUTO_MODE,
  390. WCN36XX_HAL_DONOT_USE_BSS_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE
  391. };
  392. enum wcn36xx_hal_nw_type {
  393. WCN36XX_HAL_11A_NW_TYPE,
  394. WCN36XX_HAL_11B_NW_TYPE,
  395. WCN36XX_HAL_11G_NW_TYPE,
  396. WCN36XX_HAL_11N_NW_TYPE,
  397. WCN36XX_HAL_DONOT_USE_NW_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE
  398. };
  399. #define WCN36XX_HAL_MAC_RATESET_EID_MAX 12
  400. enum wcn36xx_hal_ht_operating_mode {
  401. /* No Protection */
  402. WCN36XX_HAL_HT_OP_MODE_PURE,
  403. /* Overlap Legacy device present, protection is optional */
  404. WCN36XX_HAL_HT_OP_MODE_OVERLAP_LEGACY,
  405. /* No legacy device, but 20 MHz HT present */
  406. WCN36XX_HAL_HT_OP_MODE_NO_LEGACY_20MHZ_HT,
  407. /* Protection is required */
  408. WCN36XX_HAL_HT_OP_MODE_MIXED,
  409. WCN36XX_HAL_HT_OP_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  410. };
  411. /* Encryption type enum used with peer */
  412. enum ani_ed_type {
  413. WCN36XX_HAL_ED_NONE,
  414. WCN36XX_HAL_ED_WEP40,
  415. WCN36XX_HAL_ED_WEP104,
  416. WCN36XX_HAL_ED_TKIP,
  417. WCN36XX_HAL_ED_CCMP,
  418. WCN36XX_HAL_ED_WPI,
  419. WCN36XX_HAL_ED_AES_128_CMAC,
  420. WCN36XX_HAL_ED_NOT_IMPLEMENTED = WCN36XX_HAL_MAX_ENUM_SIZE
  421. };
  422. #define WLAN_MAX_KEY_RSC_LEN 16
  423. #define WLAN_WAPI_KEY_RSC_LEN 16
  424. /* MAX key length when ULA is used */
  425. #define WCN36XX_HAL_MAC_MAX_KEY_LENGTH 32
  426. #define WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS 4
  427. /*
  428. * Enum to specify whether key is used for TX only, RX only or both.
  429. */
  430. enum ani_key_direction {
  431. WCN36XX_HAL_TX_ONLY,
  432. WCN36XX_HAL_RX_ONLY,
  433. WCN36XX_HAL_TX_RX,
  434. WCN36XX_HAL_TX_DEFAULT,
  435. WCN36XX_HAL_DONOT_USE_KEY_DIRECTION = WCN36XX_HAL_MAX_ENUM_SIZE
  436. };
  437. enum ani_wep_type {
  438. WCN36XX_HAL_WEP_STATIC,
  439. WCN36XX_HAL_WEP_DYNAMIC,
  440. WCN36XX_HAL_WEP_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  441. };
  442. enum wcn36xx_hal_link_state {
  443. WCN36XX_HAL_LINK_IDLE_STATE = 0,
  444. WCN36XX_HAL_LINK_PREASSOC_STATE = 1,
  445. WCN36XX_HAL_LINK_POSTASSOC_STATE = 2,
  446. WCN36XX_HAL_LINK_AP_STATE = 3,
  447. WCN36XX_HAL_LINK_IBSS_STATE = 4,
  448. /* BT-AMP Case */
  449. WCN36XX_HAL_LINK_BTAMP_PREASSOC_STATE = 5,
  450. WCN36XX_HAL_LINK_BTAMP_POSTASSOC_STATE = 6,
  451. WCN36XX_HAL_LINK_BTAMP_AP_STATE = 7,
  452. WCN36XX_HAL_LINK_BTAMP_STA_STATE = 8,
  453. /* Reserved for HAL Internal Use */
  454. WCN36XX_HAL_LINK_LEARN_STATE = 9,
  455. WCN36XX_HAL_LINK_SCAN_STATE = 10,
  456. WCN36XX_HAL_LINK_FINISH_SCAN_STATE = 11,
  457. WCN36XX_HAL_LINK_INIT_CAL_STATE = 12,
  458. WCN36XX_HAL_LINK_FINISH_CAL_STATE = 13,
  459. WCN36XX_HAL_LINK_LISTEN_STATE = 14,
  460. WCN36XX_HAL_LINK_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  461. };
  462. enum wcn36xx_hal_stats_mask {
  463. HAL_SUMMARY_STATS_INFO = 0x00000001,
  464. HAL_GLOBAL_CLASS_A_STATS_INFO = 0x00000002,
  465. HAL_GLOBAL_CLASS_B_STATS_INFO = 0x00000004,
  466. HAL_GLOBAL_CLASS_C_STATS_INFO = 0x00000008,
  467. HAL_GLOBAL_CLASS_D_STATS_INFO = 0x00000010,
  468. HAL_PER_STA_STATS_INFO = 0x00000020
  469. };
  470. /* BT-AMP events type */
  471. enum bt_amp_event_type {
  472. BTAMP_EVENT_CONNECTION_START,
  473. BTAMP_EVENT_CONNECTION_STOP,
  474. BTAMP_EVENT_CONNECTION_TERMINATED,
  475. /* This and beyond are invalid values */
  476. BTAMP_EVENT_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
  477. };
  478. /* PE Statistics */
  479. enum pe_stats_mask {
  480. PE_SUMMARY_STATS_INFO = 0x00000001,
  481. PE_GLOBAL_CLASS_A_STATS_INFO = 0x00000002,
  482. PE_GLOBAL_CLASS_B_STATS_INFO = 0x00000004,
  483. PE_GLOBAL_CLASS_C_STATS_INFO = 0x00000008,
  484. PE_GLOBAL_CLASS_D_STATS_INFO = 0x00000010,
  485. PE_PER_STA_STATS_INFO = 0x00000020,
  486. /* This and beyond are invalid values */
  487. PE_STATS_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  488. };
  489. /*
  490. * Configuration Parameter IDs
  491. */
  492. #define WCN36XX_HAL_CFG_STA_ID 0
  493. #define WCN36XX_HAL_CFG_CURRENT_TX_ANTENNA 1
  494. #define WCN36XX_HAL_CFG_CURRENT_RX_ANTENNA 2
  495. #define WCN36XX_HAL_CFG_LOW_GAIN_OVERRIDE 3
  496. #define WCN36XX_HAL_CFG_POWER_STATE_PER_CHAIN 4
  497. #define WCN36XX_HAL_CFG_CAL_PERIOD 5
  498. #define WCN36XX_HAL_CFG_CAL_CONTROL 6
  499. #define WCN36XX_HAL_CFG_PROXIMITY 7
  500. #define WCN36XX_HAL_CFG_NETWORK_DENSITY 8
  501. #define WCN36XX_HAL_CFG_MAX_MEDIUM_TIME 9
  502. #define WCN36XX_HAL_CFG_MAX_MPDUS_IN_AMPDU 10
  503. #define WCN36XX_HAL_CFG_RTS_THRESHOLD 11
  504. #define WCN36XX_HAL_CFG_SHORT_RETRY_LIMIT 12
  505. #define WCN36XX_HAL_CFG_LONG_RETRY_LIMIT 13
  506. #define WCN36XX_HAL_CFG_FRAGMENTATION_THRESHOLD 14
  507. #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ZERO 15
  508. #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ONE 16
  509. #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_TWO 17
  510. #define WCN36XX_HAL_CFG_FIXED_RATE 18
  511. #define WCN36XX_HAL_CFG_RETRYRATE_POLICY 19
  512. #define WCN36XX_HAL_CFG_RETRYRATE_SECONDARY 20
  513. #define WCN36XX_HAL_CFG_RETRYRATE_TERTIARY 21
  514. #define WCN36XX_HAL_CFG_FORCE_POLICY_PROTECTION 22
  515. #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ 23
  516. #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ 24
  517. #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ 25
  518. #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ 26
  519. #define WCN36XX_HAL_CFG_MAX_BA_SESSIONS 27
  520. #define WCN36XX_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT 28
  521. #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_FILTER 29
  522. #define WCN36XX_HAL_CFG_PS_ENABLE_RSSI_MONITOR 30
  523. #define WCN36XX_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE 31
  524. #define WCN36XX_HAL_CFG_STATS_PERIOD 32
  525. #define WCN36XX_HAL_CFG_CFP_MAX_DURATION 33
  526. #define WCN36XX_HAL_CFG_FRAME_TRANS_ENABLED 34
  527. #define WCN36XX_HAL_CFG_DTIM_PERIOD 35
  528. #define WCN36XX_HAL_CFG_EDCA_WMM_ACBK 36
  529. #define WCN36XX_HAL_CFG_EDCA_WMM_ACBE 37
  530. #define WCN36XX_HAL_CFG_EDCA_WMM_ACVO 38
  531. #define WCN36XX_HAL_CFG_EDCA_WMM_ACVI 39
  532. #define WCN36XX_HAL_CFG_BA_THRESHOLD_HIGH 40
  533. #define WCN36XX_HAL_CFG_MAX_BA_BUFFERS 41
  534. #define WCN36XX_HAL_CFG_RPE_POLLING_THRESHOLD 42
  535. #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG 43
  536. #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG 44
  537. #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG 45
  538. #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG 46
  539. #define WCN36XX_HAL_CFG_NO_OF_ONCHIP_REORDER_SESSIONS 47
  540. #define WCN36XX_HAL_CFG_PS_LISTEN_INTERVAL 48
  541. #define WCN36XX_HAL_CFG_PS_HEART_BEAT_THRESHOLD 49
  542. #define WCN36XX_HAL_CFG_PS_NTH_BEACON_FILTER 50
  543. #define WCN36XX_HAL_CFG_PS_MAX_PS_POLL 51
  544. #define WCN36XX_HAL_CFG_PS_MIN_RSSI_THRESHOLD 52
  545. #define WCN36XX_HAL_CFG_PS_RSSI_FILTER_PERIOD 53
  546. #define WCN36XX_HAL_CFG_PS_BROADCAST_FRAME_FILTER_ENABLE 54
  547. #define WCN36XX_HAL_CFG_PS_IGNORE_DTIM 55
  548. #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_EARLY_TERM 56
  549. #define WCN36XX_HAL_CFG_DYNAMIC_PS_POLL_VALUE 57
  550. #define WCN36XX_HAL_CFG_PS_NULLDATA_AP_RESP_TIMEOUT 58
  551. #define WCN36XX_HAL_CFG_TELE_BCN_WAKEUP_EN 59
  552. #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI 60
  553. #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS 61
  554. #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI 62
  555. #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS 63
  556. #define WCN36XX_HAL_CFG_TX_PWR_CTRL_ENABLE 64
  557. #define WCN36XX_HAL_CFG_VALID_RADAR_CHANNEL_LIST 65
  558. #define WCN36XX_HAL_CFG_TX_POWER_24_20 66
  559. #define WCN36XX_HAL_CFG_TX_POWER_24_40 67
  560. #define WCN36XX_HAL_CFG_TX_POWER_50_20 68
  561. #define WCN36XX_HAL_CFG_TX_POWER_50_40 69
  562. #define WCN36XX_HAL_CFG_MCAST_BCAST_FILTER_SETTING 70
  563. #define WCN36XX_HAL_CFG_BCN_EARLY_TERM_WAKEUP_INTERVAL 71
  564. #define WCN36XX_HAL_CFG_MAX_TX_POWER_2_4 72
  565. #define WCN36XX_HAL_CFG_MAX_TX_POWER_5 73
  566. #define WCN36XX_HAL_CFG_INFRA_STA_KEEP_ALIVE_PERIOD 74
  567. #define WCN36XX_HAL_CFG_ENABLE_CLOSE_LOOP 75
  568. #define WCN36XX_HAL_CFG_BTC_EXECUTION_MODE 76
  569. #define WCN36XX_HAL_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK 77
  570. #define WCN36XX_HAL_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS 78
  571. #define WCN36XX_HAL_CFG_PS_TX_INACTIVITY_TIMEOUT 79
  572. #define WCN36XX_HAL_CFG_WCNSS_API_VERSION 80
  573. #define WCN36XX_HAL_CFG_AP_KEEPALIVE_TIMEOUT 81
  574. #define WCN36XX_HAL_CFG_GO_KEEPALIVE_TIMEOUT 82
  575. #define WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST 83
  576. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_BT 84
  577. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_BT 85
  578. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_BT 86
  579. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_BT 87
  580. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_WLAN 88
  581. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_WLAN 89
  582. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_WLAN 90
  583. #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_WLAN 91
  584. #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_BT 92
  585. #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_WLAN 93
  586. #define WCN36XX_HAL_CFG_BTC_MAX_SCO_BLOCK_PERC 94
  587. #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_A2DP 95
  588. #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_SCO 96
  589. #define WCN36XX_HAL_CFG_ENABLE_UNICAST_FILTER 97
  590. #define WCN36XX_HAL_CFG_MAX_ASSOC_LIMIT 98
  591. #define WCN36XX_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION 99
  592. #define WCN36XX_HAL_CFG_ENABLE_MCC_ADAPTIVE_SCHEDULER 100
  593. #define WCN36XX_HAL_CFG_ENABLE_DETECT_PS_SUPPORT 101
  594. #define WCN36XX_HAL_CFG_AP_LINK_MONITOR_TIMEOUT 102
  595. #define WCN36XX_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER 103
  596. #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE 104
  597. #define WCN36XX_HAL_CFG_MAX_PARAMS 105
  598. /* Message definitons - All the messages below need to be packed */
  599. /* Definition for HAL API Version. */
  600. struct wcnss_wlan_version {
  601. u8 revision;
  602. u8 version;
  603. u8 minor;
  604. u8 major;
  605. } __packed;
  606. /* Definition for Encryption Keys */
  607. struct wcn36xx_hal_keys {
  608. u8 id;
  609. /* 0 for multicast */
  610. u8 unicast;
  611. enum ani_key_direction direction;
  612. /* Usage is unknown */
  613. u8 rsc[WLAN_MAX_KEY_RSC_LEN];
  614. /* =1 for authenticator,=0 for supplicant */
  615. u8 pae_role;
  616. u16 length;
  617. u8 key[WCN36XX_HAL_MAC_MAX_KEY_LENGTH];
  618. } __packed;
  619. /*
  620. * set_sta_key_params Moving here since it is shared by
  621. * configbss/setstakey msgs
  622. */
  623. struct wcn36xx_hal_set_sta_key_params {
  624. /* STA Index */
  625. u16 sta_index;
  626. /* Encryption Type used with peer */
  627. enum ani_ed_type enc_type;
  628. /* STATIC/DYNAMIC - valid only for WEP */
  629. enum ani_wep_type wep_type;
  630. /* Default WEP key, valid only for static WEP, must between 0 and 3. */
  631. u8 def_wep_idx;
  632. /* valid only for non-static WEP encyrptions */
  633. struct wcn36xx_hal_keys key[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS];
  634. /*
  635. * Control for Replay Count, 1= Single TID based replay count on Tx
  636. * 0 = Per TID based replay count on TX
  637. */
  638. u8 single_tid_rc;
  639. } __packed;
  640. /* 4-byte control message header used by HAL*/
  641. struct wcn36xx_hal_msg_header {
  642. enum wcn36xx_hal_host_msg_type msg_type:16;
  643. enum wcn36xx_hal_host_msg_version msg_version:16;
  644. u32 len;
  645. } __packed;
  646. /* Config format required by HAL for each CFG item*/
  647. struct wcn36xx_hal_cfg {
  648. /* Cfg Id. The Id required by HAL is exported by HAL
  649. * in shared header file between UMAC and HAL.*/
  650. u16 id;
  651. /* Length of the Cfg. This parameter is used to go to next cfg
  652. * in the TLV format.*/
  653. u16 len;
  654. /* Padding bytes for unaligned address's */
  655. u16 pad_bytes;
  656. /* Reserve bytes for making cfgVal to align address */
  657. u16 reserve;
  658. /* Following the uCfgLen field there should be a 'uCfgLen' bytes
  659. * containing the uCfgValue ; u8 uCfgValue[uCfgLen] */
  660. } __packed;
  661. struct wcn36xx_hal_mac_start_parameters {
  662. /* Drive Type - Production or FTM etc */
  663. enum driver_type type;
  664. /* Length of the config buffer */
  665. u32 len;
  666. /* Following this there is a TLV formatted buffer of length
  667. * "len" bytes containing all config values.
  668. * The TLV is expected to be formatted like this:
  669. * 0 15 31 31+CFG_LEN-1 length-1
  670. * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
  671. */
  672. } __packed;
  673. struct wcn36xx_hal_mac_start_req_msg {
  674. /* config buffer must start in TLV format just here */
  675. struct wcn36xx_hal_msg_header header;
  676. struct wcn36xx_hal_mac_start_parameters params;
  677. } __packed;
  678. struct wcn36xx_hal_mac_start_rsp_params {
  679. /* success or failure */
  680. u16 status;
  681. /* Max number of STA supported by the device */
  682. u8 stations;
  683. /* Max number of BSS supported by the device */
  684. u8 bssids;
  685. /* API Version */
  686. struct wcnss_wlan_version version;
  687. /* CRM build information */
  688. u8 crm_version[WCN36XX_HAL_VERSION_LENGTH];
  689. /* hardware/chipset/misc version information */
  690. u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH];
  691. } __packed;
  692. struct wcn36xx_hal_mac_start_rsp_msg {
  693. struct wcn36xx_hal_msg_header header;
  694. struct wcn36xx_hal_mac_start_rsp_params start_rsp_params;
  695. } __packed;
  696. struct wcn36xx_hal_mac_stop_req_params {
  697. /* The reason for which the device is being stopped */
  698. enum wcn36xx_hal_stop_type reason;
  699. } __packed;
  700. struct wcn36xx_hal_mac_stop_req_msg {
  701. struct wcn36xx_hal_msg_header header;
  702. struct wcn36xx_hal_mac_stop_req_params stop_req_params;
  703. } __packed;
  704. struct wcn36xx_hal_mac_stop_rsp_msg {
  705. struct wcn36xx_hal_msg_header header;
  706. /* success or failure */
  707. u32 status;
  708. } __packed;
  709. struct wcn36xx_hal_update_cfg_req_msg {
  710. /*
  711. * Note: The length specified in tHalUpdateCfgReqMsg messages should be
  712. * header.msgLen = sizeof(tHalUpdateCfgReqMsg) + uConfigBufferLen
  713. */
  714. struct wcn36xx_hal_msg_header header;
  715. /* Length of the config buffer. Allows UMAC to update multiple CFGs */
  716. u32 len;
  717. /*
  718. * Following this there is a TLV formatted buffer of length
  719. * "uConfigBufferLen" bytes containing all config values.
  720. * The TLV is expected to be formatted like this:
  721. * 0 15 31 31+CFG_LEN-1 length-1
  722. * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
  723. */
  724. } __packed;
  725. struct wcn36xx_hal_update_cfg_rsp_msg {
  726. struct wcn36xx_hal_msg_header header;
  727. /* success or failure */
  728. u32 status;
  729. } __packed;
  730. /* Frame control field format (2 bytes) */
  731. struct wcn36xx_hal_mac_frame_ctl {
  732. #ifndef ANI_LITTLE_BIT_ENDIAN
  733. u8 subType:4;
  734. u8 type:2;
  735. u8 protVer:2;
  736. u8 order:1;
  737. u8 wep:1;
  738. u8 moreData:1;
  739. u8 powerMgmt:1;
  740. u8 retry:1;
  741. u8 moreFrag:1;
  742. u8 fromDS:1;
  743. u8 toDS:1;
  744. #else
  745. u8 protVer:2;
  746. u8 type:2;
  747. u8 subType:4;
  748. u8 toDS:1;
  749. u8 fromDS:1;
  750. u8 moreFrag:1;
  751. u8 retry:1;
  752. u8 powerMgmt:1;
  753. u8 moreData:1;
  754. u8 wep:1;
  755. u8 order:1;
  756. #endif
  757. };
  758. /* Sequence control field */
  759. struct wcn36xx_hal_mac_seq_ctl {
  760. u8 fragNum:4;
  761. u8 seqNumLo:4;
  762. u8 seqNumHi:8;
  763. };
  764. /* Management header format */
  765. struct wcn36xx_hal_mac_mgmt_hdr {
  766. struct wcn36xx_hal_mac_frame_ctl fc;
  767. u8 durationLo;
  768. u8 durationHi;
  769. u8 da[6];
  770. u8 sa[6];
  771. u8 bssId[6];
  772. struct wcn36xx_hal_mac_seq_ctl seqControl;
  773. };
  774. /* FIXME: pronto v1 apparently has 4 */
  775. #define WCN36XX_HAL_NUM_BSSID 2
  776. /* Scan Entry to hold active BSS idx's */
  777. struct wcn36xx_hal_scan_entry {
  778. u8 bss_index[WCN36XX_HAL_NUM_BSSID];
  779. u8 active_bss_count;
  780. };
  781. struct wcn36xx_hal_init_scan_req_msg {
  782. struct wcn36xx_hal_msg_header header;
  783. /* LEARN - AP Role
  784. SCAN - STA Role */
  785. enum wcn36xx_hal_sys_mode mode;
  786. /* BSSID of the BSS */
  787. u8 bssid[ETH_ALEN];
  788. /* Whether BSS needs to be notified */
  789. u8 notify;
  790. /* Kind of frame to be used for notifying the BSS (Data Null, QoS
  791. * Null, or CTS to Self). Must always be a valid frame type. */
  792. u8 frame_type;
  793. /* UMAC has the option of passing the MAC frame to be used for
  794. * notifying the BSS. If non-zero, HAL will use the MAC frame
  795. * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
  796. * appropriate MAC frame based on frameType. */
  797. u8 frame_len;
  798. /* Following the framelength there is a MAC frame buffer if
  799. * frameLength is non-zero. */
  800. struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
  801. /* Entry to hold number of active BSS idx's */
  802. struct wcn36xx_hal_scan_entry scan_entry;
  803. };
  804. struct wcn36xx_hal_init_scan_con_req_msg {
  805. struct wcn36xx_hal_msg_header header;
  806. /* LEARN - AP Role
  807. SCAN - STA Role */
  808. enum wcn36xx_hal_sys_mode mode;
  809. /* BSSID of the BSS */
  810. u8 bssid[ETH_ALEN];
  811. /* Whether BSS needs to be notified */
  812. u8 notify;
  813. /* Kind of frame to be used for notifying the BSS (Data Null, QoS
  814. * Null, or CTS to Self). Must always be a valid frame type. */
  815. u8 frame_type;
  816. /* UMAC has the option of passing the MAC frame to be used for
  817. * notifying the BSS. If non-zero, HAL will use the MAC frame
  818. * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
  819. * appropriate MAC frame based on frameType. */
  820. u8 frame_length;
  821. /* Following the framelength there is a MAC frame buffer if
  822. * frameLength is non-zero. */
  823. struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
  824. /* Entry to hold number of active BSS idx's */
  825. struct wcn36xx_hal_scan_entry scan_entry;
  826. /* Single NoA usage in Scanning */
  827. u8 use_noa;
  828. /* Indicates the scan duration (in ms) */
  829. u16 scan_duration;
  830. };
  831. struct wcn36xx_hal_init_scan_rsp_msg {
  832. struct wcn36xx_hal_msg_header header;
  833. /* success or failure */
  834. u32 status;
  835. } __packed;
  836. struct wcn36xx_hal_start_scan_req_msg {
  837. struct wcn36xx_hal_msg_header header;
  838. /* Indicates the channel to scan */
  839. u8 scan_channel;
  840. } __packed;
  841. struct wcn36xx_hal_start_rsp_msg {
  842. struct wcn36xx_hal_msg_header header;
  843. /* success or failure */
  844. u32 status;
  845. u32 start_tsf[2];
  846. u8 tx_mgmt_power;
  847. } __packed;
  848. struct wcn36xx_hal_end_scan_req_msg {
  849. struct wcn36xx_hal_msg_header header;
  850. /* Indicates the channel to stop scanning. Not used really. But
  851. * retained for symmetry with "start Scan" message. It can also
  852. * help in error check if needed. */
  853. u8 scan_channel;
  854. } __packed;
  855. struct wcn36xx_hal_end_scan_rsp_msg {
  856. struct wcn36xx_hal_msg_header header;
  857. /* success or failure */
  858. u32 status;
  859. } __packed;
  860. struct wcn36xx_hal_finish_scan_req_msg {
  861. struct wcn36xx_hal_msg_header header;
  862. /* Identifies the operational state of the AP/STA
  863. * LEARN - AP Role SCAN - STA Role */
  864. enum wcn36xx_hal_sys_mode mode;
  865. /* Operating channel to tune to. */
  866. u8 oper_channel;
  867. /* Channel Bonding state If 20/40 MHz is operational, this will
  868. * indicate the 40 MHz extension channel in combination with the
  869. * control channel */
  870. enum phy_chan_bond_state cb_state;
  871. /* BSSID of the BSS */
  872. u8 bssid[ETH_ALEN];
  873. /* Whether BSS needs to be notified */
  874. u8 notify;
  875. /* Kind of frame to be used for notifying the BSS (Data Null, QoS
  876. * Null, or CTS to Self). Must always be a valid frame type. */
  877. u8 frame_type;
  878. /* UMAC has the option of passing the MAC frame to be used for
  879. * notifying the BSS. If non-zero, HAL will use the MAC frame
  880. * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
  881. * appropriate MAC frame based on frameType. */
  882. u8 frame_length;
  883. /* Following the framelength there is a MAC frame buffer if
  884. * frameLength is non-zero. */
  885. struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
  886. /* Entry to hold number of active BSS idx's */
  887. struct wcn36xx_hal_scan_entry scan_entry;
  888. } __packed;
  889. struct wcn36xx_hal_finish_scan_rsp_msg {
  890. struct wcn36xx_hal_msg_header header;
  891. /* success or failure */
  892. u32 status;
  893. } __packed;
  894. enum wcn36xx_hal_rate_index {
  895. HW_RATE_INDEX_1MBPS = 0x82,
  896. HW_RATE_INDEX_2MBPS = 0x84,
  897. HW_RATE_INDEX_5_5MBPS = 0x8B,
  898. HW_RATE_INDEX_6MBPS = 0x0C,
  899. HW_RATE_INDEX_9MBPS = 0x12,
  900. HW_RATE_INDEX_11MBPS = 0x96,
  901. HW_RATE_INDEX_12MBPS = 0x18,
  902. HW_RATE_INDEX_18MBPS = 0x24,
  903. HW_RATE_INDEX_24MBPS = 0x30,
  904. HW_RATE_INDEX_36MBPS = 0x48,
  905. HW_RATE_INDEX_48MBPS = 0x60,
  906. HW_RATE_INDEX_54MBPS = 0x6C
  907. };
  908. struct wcn36xx_hal_supported_rates {
  909. /*
  910. * For Self STA Entry: this represents Self Mode.
  911. * For Peer Stations, this represents the mode of the peer.
  912. * On Station:
  913. *
  914. * --this mode is updated when PE adds the Self Entry.
  915. *
  916. * -- OR when PE sends 'ADD_BSS' message and station context in BSS
  917. * is used to indicate the mode of the AP.
  918. *
  919. * ON AP:
  920. *
  921. * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry
  922. * for that BSS is used to indicate the self mode of the AP.
  923. *
  924. * -- OR when a station is associated, PE sends 'ADD_STA' message
  925. * with this mode updated.
  926. */
  927. enum sta_rate_mode op_rate_mode;
  928. /* 11b, 11a and aniLegacyRates are IE rates which gives rate in
  929. * unit of 500Kbps */
  930. u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
  931. u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
  932. u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
  933. u16 reserved;
  934. /* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be
  935. * supported) First 26 bits are reserved for those Titan rates and
  936. * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
  937. * reserved. */
  938. /* Titan and Taurus Rates */
  939. u32 enhanced_rate_bitmap;
  940. /*
  941. * 0-76 bits used, remaining reserved
  942. * bits 0-15 and 32 should be set.
  943. */
  944. u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
  945. /*
  946. * RX Highest Supported Data Rate defines the highest data
  947. * rate that the STA is able to receive, in unites of 1Mbps.
  948. * This value is derived from "Supported MCS Set field" inside
  949. * the HT capability element.
  950. */
  951. u16 rx_highest_data_rate;
  952. } __packed;
  953. struct wcn36xx_hal_config_sta_params {
  954. /* BSSID of STA */
  955. u8 bssid[ETH_ALEN];
  956. /* ASSOC ID, as assigned by UMAC */
  957. u16 aid;
  958. /* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */
  959. u8 type;
  960. /* Short Preamble Supported. */
  961. u8 short_preamble_supported;
  962. /* MAC Address of STA */
  963. u8 mac[ETH_ALEN];
  964. /* Listen interval of the STA */
  965. u16 listen_interval;
  966. /* Support for 11e/WMM */
  967. u8 wmm_enabled;
  968. /* 11n HT capable STA */
  969. u8 ht_capable;
  970. /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
  971. u8 tx_channel_width_set;
  972. /* RIFS mode 0 - NA, 1 - Allowed */
  973. u8 rifs_mode;
  974. /* L-SIG TXOP Protection mechanism
  975. 0 - No Support, 1 - Supported
  976. SG - there is global field */
  977. u8 lsig_txop_protection;
  978. /* Max Ampdu Size supported by STA. TPE programming.
  979. 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */
  980. u8 max_ampdu_size;
  981. /* Max Ampdu density. Used by RA. 3 : 0~7 : 2^(11nAMPDUdensity -4) */
  982. u8 max_ampdu_density;
  983. /* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */
  984. u8 max_amsdu_size;
  985. /* Short GI support for 40Mhz packets */
  986. u8 sgi_40mhz;
  987. /* Short GI support for 20Mhz packets */
  988. u8 sgi_20Mhz;
  989. /* TODO move this parameter to the end for 3680 */
  990. /* These rates are the intersection of peer and self capabilities. */
  991. struct wcn36xx_hal_supported_rates supported_rates;
  992. /* Robust Management Frame (RMF) enabled/disabled */
  993. u8 rmf;
  994. /* The unicast encryption type in the association */
  995. u32 encrypt_type;
  996. /* HAL should update the existing STA entry, if this flag is set. UMAC
  997. will set this flag in case of RE-ASSOC, where we want to reuse the
  998. old STA ID. 0 = Add, 1 = Update */
  999. u8 action;
  1000. /* U-APSD Flags: 1b per AC. Encoded as follows:
  1001. b7 b6 b5 b4 b3 b2 b1 b0 =
  1002. X X X X BE BK VI VO */
  1003. u8 uapsd;
  1004. /* Max SP Length */
  1005. u8 max_sp_len;
  1006. /* 11n Green Field preamble support
  1007. 0 - Not supported, 1 - Supported */
  1008. u8 green_field_capable;
  1009. /* MIMO Power Save mode */
  1010. enum wcn36xx_hal_ht_mimo_state mimo_ps;
  1011. /* Delayed BA Support */
  1012. u8 delayed_ba_support;
  1013. /* Max AMPDU duration in 32us */
  1014. u8 max_ampdu_duration;
  1015. /* HT STA should set it to 1 if it is enabled in BSS. HT STA should
  1016. * set it to 0 if AP does not support it. This indication is sent
  1017. * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
  1018. * rates. */
  1019. u8 dsss_cck_mode_40mhz;
  1020. /* Valid STA Idx when action=Update. Set to 0xFF when invalid!
  1021. * Retained for backward compalibity with existing HAL code */
  1022. u8 sta_index;
  1023. /* BSSID of BSS to which station is associated. Set to 0xFF when
  1024. * invalid. Retained for backward compalibity with existing HAL
  1025. * code */
  1026. u8 bssid_index;
  1027. u8 p2p;
  1028. /* TODO add this parameter for 3680. */
  1029. /* Reserved to align next field on a dword boundary */
  1030. /* u8 reserved; */
  1031. } __packed;
  1032. struct wcn36xx_hal_config_sta_req_msg {
  1033. struct wcn36xx_hal_msg_header header;
  1034. struct wcn36xx_hal_config_sta_params sta_params;
  1035. } __packed;
  1036. struct wcn36xx_hal_config_sta_params_v1 {
  1037. /* BSSID of STA */
  1038. u8 bssid[ETH_ALEN];
  1039. /* ASSOC ID, as assigned by UMAC */
  1040. u16 aid;
  1041. /* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */
  1042. u8 type;
  1043. /* Short Preamble Supported. */
  1044. u8 short_preamble_supported;
  1045. /* MAC Address of STA */
  1046. u8 mac[ETH_ALEN];
  1047. /* Listen interval of the STA */
  1048. u16 listen_interval;
  1049. /* Support for 11e/WMM */
  1050. u8 wmm_enabled;
  1051. /* 11n HT capable STA */
  1052. u8 ht_capable;
  1053. /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
  1054. u8 tx_channel_width_set;
  1055. /* RIFS mode 0 - NA, 1 - Allowed */
  1056. u8 rifs_mode;
  1057. /* L-SIG TXOP Protection mechanism
  1058. 0 - No Support, 1 - Supported
  1059. SG - there is global field */
  1060. u8 lsig_txop_protection;
  1061. /* Max Ampdu Size supported by STA. TPE programming.
  1062. 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */
  1063. u8 max_ampdu_size;
  1064. /* Max Ampdu density. Used by RA. 3 : 0~7 : 2^(11nAMPDUdensity -4) */
  1065. u8 max_ampdu_density;
  1066. /* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */
  1067. u8 max_amsdu_size;
  1068. /* Short GI support for 40Mhz packets */
  1069. u8 sgi_40mhz;
  1070. /* Short GI support for 20Mhz packets */
  1071. u8 sgi_20Mhz;
  1072. /* Robust Management Frame (RMF) enabled/disabled */
  1073. u8 rmf;
  1074. /* The unicast encryption type in the association */
  1075. u32 encrypt_type;
  1076. /* HAL should update the existing STA entry, if this flag is set. UMAC
  1077. will set this flag in case of RE-ASSOC, where we want to reuse the
  1078. old STA ID. 0 = Add, 1 = Update */
  1079. u8 action;
  1080. /* U-APSD Flags: 1b per AC. Encoded as follows:
  1081. b7 b6 b5 b4 b3 b2 b1 b0 =
  1082. X X X X BE BK VI VO */
  1083. u8 uapsd;
  1084. /* Max SP Length */
  1085. u8 max_sp_len;
  1086. /* 11n Green Field preamble support
  1087. 0 - Not supported, 1 - Supported */
  1088. u8 green_field_capable;
  1089. /* MIMO Power Save mode */
  1090. enum wcn36xx_hal_ht_mimo_state mimo_ps;
  1091. /* Delayed BA Support */
  1092. u8 delayed_ba_support;
  1093. /* Max AMPDU duration in 32us */
  1094. u8 max_ampdu_duration;
  1095. /* HT STA should set it to 1 if it is enabled in BSS. HT STA should
  1096. * set it to 0 if AP does not support it. This indication is sent
  1097. * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
  1098. * rates. */
  1099. u8 dsss_cck_mode_40mhz;
  1100. /* Valid STA Idx when action=Update. Set to 0xFF when invalid!
  1101. * Retained for backward compalibity with existing HAL code */
  1102. u8 sta_index;
  1103. /* BSSID of BSS to which station is associated. Set to 0xFF when
  1104. * invalid. Retained for backward compalibity with existing HAL
  1105. * code */
  1106. u8 bssid_index;
  1107. u8 p2p;
  1108. /* Reserved to align next field on a dword boundary */
  1109. u8 reserved;
  1110. /* These rates are the intersection of peer and self capabilities. */
  1111. struct wcn36xx_hal_supported_rates supported_rates;
  1112. } __packed;
  1113. struct wcn36xx_hal_config_sta_req_msg_v1 {
  1114. struct wcn36xx_hal_msg_header header;
  1115. struct wcn36xx_hal_config_sta_params_v1 sta_params;
  1116. } __packed;
  1117. struct config_sta_rsp_params {
  1118. /* success or failure */
  1119. u32 status;
  1120. /* Station index; valid only when 'status' field value SUCCESS */
  1121. u8 sta_index;
  1122. /* BSSID Index of BSS to which the station is associated */
  1123. u8 bssid_index;
  1124. /* DPU Index for PTK */
  1125. u8 dpu_index;
  1126. /* DPU Index for GTK */
  1127. u8 bcast_dpu_index;
  1128. /* DPU Index for IGTK */
  1129. u8 bcast_mgmt_dpu_idx;
  1130. /* PTK DPU signature */
  1131. u8 uc_ucast_sig;
  1132. /* GTK DPU isignature */
  1133. u8 uc_bcast_sig;
  1134. /* IGTK DPU signature */
  1135. u8 uc_mgmt_sig;
  1136. u8 p2p;
  1137. } __packed;
  1138. struct wcn36xx_hal_config_sta_rsp_msg {
  1139. struct wcn36xx_hal_msg_header header;
  1140. struct config_sta_rsp_params params;
  1141. } __packed;
  1142. /* Delete STA Request message */
  1143. struct wcn36xx_hal_delete_sta_req_msg {
  1144. struct wcn36xx_hal_msg_header header;
  1145. /* Index of STA to delete */
  1146. u8 sta_index;
  1147. } __packed;
  1148. /* Delete STA Response message */
  1149. struct wcn36xx_hal_delete_sta_rsp_msg {
  1150. struct wcn36xx_hal_msg_header header;
  1151. /* success or failure */
  1152. u32 status;
  1153. /* Index of STA deleted */
  1154. u8 sta_id;
  1155. } __packed;
  1156. /* 12 Bytes long because this structure can be used to represent rate and
  1157. * extended rate set IEs. The parser assume this to be at least 12 */
  1158. struct wcn36xx_hal_rate_set {
  1159. u8 num_rates;
  1160. u8 rate[WCN36XX_HAL_MAC_RATESET_EID_MAX];
  1161. } __packed;
  1162. /* access category record */
  1163. struct wcn36xx_hal_aci_aifsn {
  1164. #ifndef ANI_LITTLE_BIT_ENDIAN
  1165. u8 rsvd:1;
  1166. u8 aci:2;
  1167. u8 acm:1;
  1168. u8 aifsn:4;
  1169. #else
  1170. u8 aifsn:4;
  1171. u8 acm:1;
  1172. u8 aci:2;
  1173. u8 rsvd:1;
  1174. #endif
  1175. } __packed;
  1176. /* contention window size */
  1177. struct wcn36xx_hal_mac_cw {
  1178. #ifndef ANI_LITTLE_BIT_ENDIAN
  1179. u8 max:4;
  1180. u8 min:4;
  1181. #else
  1182. u8 min:4;
  1183. u8 max:4;
  1184. #endif
  1185. } __packed;
  1186. struct wcn36xx_hal_edca_param_record {
  1187. struct wcn36xx_hal_aci_aifsn aci;
  1188. struct wcn36xx_hal_mac_cw cw;
  1189. u16 txop_limit;
  1190. } __packed;
  1191. struct wcn36xx_hal_mac_ssid {
  1192. u8 length;
  1193. u8 ssid[32];
  1194. } __packed;
  1195. /* Concurrency role. These are generic IDs that identify the various roles
  1196. * in the software system. */
  1197. enum wcn36xx_hal_con_mode {
  1198. WCN36XX_HAL_STA_MODE = 0,
  1199. /* to support softAp mode . This is misleading.
  1200. It means AP MODE only. */
  1201. WCN36XX_HAL_STA_SAP_MODE = 1,
  1202. WCN36XX_HAL_P2P_CLIENT_MODE,
  1203. WCN36XX_HAL_P2P_GO_MODE,
  1204. WCN36XX_HAL_MONITOR_MODE,
  1205. };
  1206. /* This is a bit pattern to be set for each mode
  1207. * bit 0 - sta mode
  1208. * bit 1 - ap mode
  1209. * bit 2 - p2p client mode
  1210. * bit 3 - p2p go mode */
  1211. enum wcn36xx_hal_concurrency_mode {
  1212. HAL_STA = 1,
  1213. HAL_SAP = 2,
  1214. /* to support sta, softAp mode . This means STA+AP mode */
  1215. HAL_STA_SAP = 3,
  1216. HAL_P2P_CLIENT = 4,
  1217. HAL_P2P_GO = 8,
  1218. HAL_MAX_CONCURRENCY_PERSONA = 4
  1219. };
  1220. struct wcn36xx_hal_config_bss_params {
  1221. /* BSSID */
  1222. u8 bssid[ETH_ALEN];
  1223. /* Self Mac Address */
  1224. u8 self_mac_addr[ETH_ALEN];
  1225. /* BSS type */
  1226. enum wcn36xx_hal_bss_type bss_type;
  1227. /* Operational Mode: AP =0, STA = 1 */
  1228. u8 oper_mode;
  1229. /* Network Type */
  1230. enum wcn36xx_hal_nw_type nw_type;
  1231. /* Used to classify PURE_11G/11G_MIXED to program MTU */
  1232. u8 short_slot_time_supported;
  1233. /* Co-exist with 11a STA */
  1234. u8 lla_coexist;
  1235. /* Co-exist with 11b STA */
  1236. u8 llb_coexist;
  1237. /* Co-exist with 11g STA */
  1238. u8 llg_coexist;
  1239. /* Coexistence with 11n STA */
  1240. u8 ht20_coexist;
  1241. /* Non GF coexist flag */
  1242. u8 lln_non_gf_coexist;
  1243. /* TXOP protection support */
  1244. u8 lsig_tx_op_protection_full_support;
  1245. /* RIFS mode */
  1246. u8 rifs_mode;
  1247. /* Beacon Interval in TU */
  1248. u16 beacon_interval;
  1249. /* DTIM period */
  1250. u8 dtim_period;
  1251. /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
  1252. u8 tx_channel_width_set;
  1253. /* Operating channel */
  1254. u8 oper_channel;
  1255. /* Extension channel for channel bonding */
  1256. u8 ext_channel;
  1257. /* Reserved to align next field on a dword boundary */
  1258. u8 reserved;
  1259. /* TODO move sta to the end for 3680 */
  1260. /* Context of the station being added in HW
  1261. * Add a STA entry for "itself" -
  1262. *
  1263. * On AP - Add the AP itself in an "STA context"
  1264. *
  1265. * On STA - Add the AP to which this STA is joining in an
  1266. * "STA context"
  1267. */
  1268. struct wcn36xx_hal_config_sta_params sta;
  1269. /* SSID of the BSS */
  1270. struct wcn36xx_hal_mac_ssid ssid;
  1271. /* HAL should update the existing BSS entry, if this flag is set.
  1272. * UMAC will set this flag in case of reassoc, where we want to
  1273. * resue the the old BSSID and still return success 0 = Add, 1 =
  1274. * Update */
  1275. u8 action;
  1276. /* MAC Rate Set */
  1277. struct wcn36xx_hal_rate_set rateset;
  1278. /* Enable/Disable HT capabilities of the BSS */
  1279. u8 ht;
  1280. /* Enable/Disable OBSS protection */
  1281. u8 obss_prot_enabled;
  1282. /* RMF enabled/disabled */
  1283. u8 rmf;
  1284. /* HT Operating Mode operating mode of the 802.11n STA */
  1285. enum wcn36xx_hal_ht_operating_mode ht_oper_mode;
  1286. /* Dual CTS Protection: 0 - Unused, 1 - Used */
  1287. u8 dual_cts_protection;
  1288. /* Probe Response Max retries */
  1289. u8 max_probe_resp_retry_limit;
  1290. /* To Enable Hidden ssid */
  1291. u8 hidden_ssid;
  1292. /* To Enable Disable FW Proxy Probe Resp */
  1293. u8 proxy_probe_resp;
  1294. /* Boolean to indicate if EDCA params are valid. UMAC might not
  1295. * have valid EDCA params or might not desire to apply EDCA params
  1296. * during config BSS. 0 implies Not Valid ; Non-Zero implies
  1297. * valid */
  1298. u8 edca_params_valid;
  1299. /* EDCA Parameters for Best Effort Access Category */
  1300. struct wcn36xx_hal_edca_param_record acbe;
  1301. /* EDCA Parameters forBackground Access Category */
  1302. struct wcn36xx_hal_edca_param_record acbk;
  1303. /* EDCA Parameters for Video Access Category */
  1304. struct wcn36xx_hal_edca_param_record acvi;
  1305. /* EDCA Parameters for Voice Access Category */
  1306. struct wcn36xx_hal_edca_param_record acvo;
  1307. /* Ext Bss Config Msg if set */
  1308. u8 ext_set_sta_key_param_valid;
  1309. /* SetStaKeyParams for ext bss msg */
  1310. struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
  1311. /* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum
  1312. * wcn36xx_hal_con_mode */
  1313. u8 wcn36xx_hal_persona;
  1314. u8 spectrum_mgt_enable;
  1315. /* HAL fills in the tx power used for mgmt frames in txMgmtPower */
  1316. s8 tx_mgmt_power;
  1317. /* maxTxPower has max power to be used after applying the power
  1318. * constraint if any */
  1319. s8 max_tx_power;
  1320. } __packed;
  1321. struct wcn36xx_hal_config_bss_req_msg {
  1322. struct wcn36xx_hal_msg_header header;
  1323. struct wcn36xx_hal_config_bss_params bss_params;
  1324. } __packed;
  1325. struct wcn36xx_hal_config_bss_params_v1 {
  1326. /* BSSID */
  1327. u8 bssid[ETH_ALEN];
  1328. /* Self Mac Address */
  1329. u8 self_mac_addr[ETH_ALEN];
  1330. /* BSS type */
  1331. enum wcn36xx_hal_bss_type bss_type;
  1332. /* Operational Mode: AP =0, STA = 1 */
  1333. u8 oper_mode;
  1334. /* Network Type */
  1335. enum wcn36xx_hal_nw_type nw_type;
  1336. /* Used to classify PURE_11G/11G_MIXED to program MTU */
  1337. u8 short_slot_time_supported;
  1338. /* Co-exist with 11a STA */
  1339. u8 lla_coexist;
  1340. /* Co-exist with 11b STA */
  1341. u8 llb_coexist;
  1342. /* Co-exist with 11g STA */
  1343. u8 llg_coexist;
  1344. /* Coexistence with 11n STA */
  1345. u8 ht20_coexist;
  1346. /* Non GF coexist flag */
  1347. u8 lln_non_gf_coexist;
  1348. /* TXOP protection support */
  1349. u8 lsig_tx_op_protection_full_support;
  1350. /* RIFS mode */
  1351. u8 rifs_mode;
  1352. /* Beacon Interval in TU */
  1353. u16 beacon_interval;
  1354. /* DTIM period */
  1355. u8 dtim_period;
  1356. /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */
  1357. u8 tx_channel_width_set;
  1358. /* Operating channel */
  1359. u8 oper_channel;
  1360. /* Extension channel for channel bonding */
  1361. u8 ext_channel;
  1362. /* Reserved to align next field on a dword boundary */
  1363. u8 reserved;
  1364. /* SSID of the BSS */
  1365. struct wcn36xx_hal_mac_ssid ssid;
  1366. /* HAL should update the existing BSS entry, if this flag is set.
  1367. * UMAC will set this flag in case of reassoc, where we want to
  1368. * resue the the old BSSID and still return success 0 = Add, 1 =
  1369. * Update */
  1370. u8 action;
  1371. /* MAC Rate Set */
  1372. struct wcn36xx_hal_rate_set rateset;
  1373. /* Enable/Disable HT capabilities of the BSS */
  1374. u8 ht;
  1375. /* Enable/Disable OBSS protection */
  1376. u8 obss_prot_enabled;
  1377. /* RMF enabled/disabled */
  1378. u8 rmf;
  1379. /* HT Operating Mode operating mode of the 802.11n STA */
  1380. enum wcn36xx_hal_ht_operating_mode ht_oper_mode;
  1381. /* Dual CTS Protection: 0 - Unused, 1 - Used */
  1382. u8 dual_cts_protection;
  1383. /* Probe Response Max retries */
  1384. u8 max_probe_resp_retry_limit;
  1385. /* To Enable Hidden ssid */
  1386. u8 hidden_ssid;
  1387. /* To Enable Disable FW Proxy Probe Resp */
  1388. u8 proxy_probe_resp;
  1389. /* Boolean to indicate if EDCA params are valid. UMAC might not
  1390. * have valid EDCA params or might not desire to apply EDCA params
  1391. * during config BSS. 0 implies Not Valid ; Non-Zero implies
  1392. * valid */
  1393. u8 edca_params_valid;
  1394. /* EDCA Parameters for Best Effort Access Category */
  1395. struct wcn36xx_hal_edca_param_record acbe;
  1396. /* EDCA Parameters forBackground Access Category */
  1397. struct wcn36xx_hal_edca_param_record acbk;
  1398. /* EDCA Parameters for Video Access Category */
  1399. struct wcn36xx_hal_edca_param_record acvi;
  1400. /* EDCA Parameters for Voice Access Category */
  1401. struct wcn36xx_hal_edca_param_record acvo;
  1402. /* Ext Bss Config Msg if set */
  1403. u8 ext_set_sta_key_param_valid;
  1404. /* SetStaKeyParams for ext bss msg */
  1405. struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
  1406. /* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum
  1407. * wcn36xx_hal_con_mode */
  1408. u8 wcn36xx_hal_persona;
  1409. u8 spectrum_mgt_enable;
  1410. /* HAL fills in the tx power used for mgmt frames in txMgmtPower */
  1411. s8 tx_mgmt_power;
  1412. /* maxTxPower has max power to be used after applying the power
  1413. * constraint if any */
  1414. s8 max_tx_power;
  1415. /* Context of the station being added in HW
  1416. * Add a STA entry for "itself" -
  1417. *
  1418. * On AP - Add the AP itself in an "STA context"
  1419. *
  1420. * On STA - Add the AP to which this STA is joining in an
  1421. * "STA context"
  1422. */
  1423. struct wcn36xx_hal_config_sta_params_v1 sta;
  1424. } __packed;
  1425. struct wcn36xx_hal_config_bss_req_msg_v1 {
  1426. struct wcn36xx_hal_msg_header header;
  1427. struct wcn36xx_hal_config_bss_params_v1 bss_params;
  1428. } __packed;
  1429. struct wcn36xx_hal_config_bss_rsp_params {
  1430. /* Success or Failure */
  1431. u32 status;
  1432. /* BSS index allocated by HAL */
  1433. u8 bss_index;
  1434. /* DPU descriptor index for PTK */
  1435. u8 dpu_desc_index;
  1436. /* PTK DPU signature */
  1437. u8 ucast_dpu_signature;
  1438. /* DPU descriptor index for GTK */
  1439. u8 bcast_dpu_desc_indx;
  1440. /* GTK DPU signature */
  1441. u8 bcast_dpu_signature;
  1442. /* DPU descriptor for IGTK */
  1443. u8 mgmt_dpu_desc_index;
  1444. /* IGTK DPU signature */
  1445. u8 mgmt_dpu_signature;
  1446. /* Station Index for BSS entry */
  1447. u8 bss_sta_index;
  1448. /* Self station index for this BSS */
  1449. u8 bss_self_sta_index;
  1450. /* Bcast station for buffering bcast frames in AP role */
  1451. u8 bss_bcast_sta_idx;
  1452. /* MAC Address of STA(PEER/SELF) in staContext of configBSSReq */
  1453. u8 mac[ETH_ALEN];
  1454. /* HAL fills in the tx power used for mgmt frames in this field. */
  1455. s8 tx_mgmt_power;
  1456. } __packed;
  1457. struct wcn36xx_hal_config_bss_rsp_msg {
  1458. struct wcn36xx_hal_msg_header header;
  1459. struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
  1460. } __packed;
  1461. struct wcn36xx_hal_delete_bss_req_msg {
  1462. struct wcn36xx_hal_msg_header header;
  1463. /* BSS index to be deleted */
  1464. u8 bss_index;
  1465. } __packed;
  1466. struct wcn36xx_hal_delete_bss_rsp_msg {
  1467. struct wcn36xx_hal_msg_header header;
  1468. /* Success or Failure */
  1469. u32 status;
  1470. /* BSS index that has been deleted */
  1471. u8 bss_index;
  1472. } __packed;
  1473. struct wcn36xx_hal_join_req_msg {
  1474. struct wcn36xx_hal_msg_header header;
  1475. /* Indicates the BSSID to which STA is going to associate */
  1476. u8 bssid[ETH_ALEN];
  1477. /* Indicates the channel to switch to. */
  1478. u8 channel;
  1479. /* Self STA MAC */
  1480. u8 self_sta_mac_addr[ETH_ALEN];
  1481. /* Local power constraint */
  1482. u8 local_power_constraint;
  1483. /* Secondary channel offset */
  1484. enum phy_chan_bond_state secondary_channel_offset;
  1485. /* link State */
  1486. enum wcn36xx_hal_link_state link_state;
  1487. /* Max TX power */
  1488. s8 max_tx_power;
  1489. } __packed;
  1490. struct wcn36xx_hal_join_rsp_msg {
  1491. struct wcn36xx_hal_msg_header header;
  1492. /* success or failure */
  1493. u32 status;
  1494. /* HAL fills in the tx power used for mgmt frames in this field */
  1495. u8 tx_mgmt_power;
  1496. } __packed;
  1497. struct post_assoc_req_msg {
  1498. struct wcn36xx_hal_msg_header header;
  1499. struct wcn36xx_hal_config_sta_params sta_params;
  1500. struct wcn36xx_hal_config_bss_params bss_params;
  1501. };
  1502. struct post_assoc_rsp_msg {
  1503. struct wcn36xx_hal_msg_header header;
  1504. struct config_sta_rsp_params sta_rsp_params;
  1505. struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params;
  1506. };
  1507. /* This is used to create a set of WEP keys for a given BSS. */
  1508. struct wcn36xx_hal_set_bss_key_req_msg {
  1509. struct wcn36xx_hal_msg_header header;
  1510. /* BSS Index of the BSS */
  1511. u8 bss_idx;
  1512. /* Encryption Type used with peer */
  1513. enum ani_ed_type enc_type;
  1514. /* Number of keys */
  1515. u8 num_keys;
  1516. /* Array of keys. */
  1517. struct wcn36xx_hal_keys keys[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS];
  1518. /* Control for Replay Count, 1= Single TID based replay count on Tx
  1519. * 0 = Per TID based replay count on TX */
  1520. u8 single_tid_rc;
  1521. } __packed;
  1522. /* tagged version of set bss key */
  1523. struct wcn36xx_hal_set_bss_key_req_msg_tagged {
  1524. struct wcn36xx_hal_set_bss_key_req_msg Msg;
  1525. u32 tag;
  1526. } __packed;
  1527. struct wcn36xx_hal_set_bss_key_rsp_msg {
  1528. struct wcn36xx_hal_msg_header header;
  1529. /* success or failure */
  1530. u32 status;
  1531. } __packed;
  1532. /*
  1533. * This is used configure the key information on a given station.
  1534. * When the sec_type is WEP40 or WEP104, the def_wep_idx is used to locate
  1535. * a preconfigured key from a BSS the station assoicated with; otherwise
  1536. * a new key descriptor is created based on the key field.
  1537. */
  1538. struct wcn36xx_hal_set_sta_key_req_msg {
  1539. struct wcn36xx_hal_msg_header header;
  1540. struct wcn36xx_hal_set_sta_key_params set_sta_key_params;
  1541. } __packed;
  1542. struct wcn36xx_hal_set_sta_key_rsp_msg {
  1543. struct wcn36xx_hal_msg_header header;
  1544. /* success or failure */
  1545. u32 status;
  1546. } __packed;
  1547. struct wcn36xx_hal_remove_bss_key_req_msg {
  1548. struct wcn36xx_hal_msg_header header;
  1549. /* BSS Index of the BSS */
  1550. u8 bss_idx;
  1551. /* Encryption Type used with peer */
  1552. enum ani_ed_type enc_type;
  1553. /* Key Id */
  1554. u8 key_id;
  1555. /* STATIC/DYNAMIC. Used in Nullifying in Key Descriptors for
  1556. * Static/Dynamic keys */
  1557. enum ani_wep_type wep_type;
  1558. } __packed;
  1559. struct wcn36xx_hal_remove_bss_key_rsp_msg {
  1560. struct wcn36xx_hal_msg_header header;
  1561. /* success or failure */
  1562. u32 status;
  1563. } __packed;
  1564. /*
  1565. * This is used by PE to Remove the key information on a given station.
  1566. */
  1567. struct wcn36xx_hal_remove_sta_key_req_msg {
  1568. struct wcn36xx_hal_msg_header header;
  1569. /* STA Index */
  1570. u16 sta_idx;
  1571. /* Encryption Type used with peer */
  1572. enum ani_ed_type enc_type;
  1573. /* Key Id */
  1574. u8 key_id;
  1575. /* Whether to invalidate the Broadcast key or Unicast key. In case
  1576. * of WEP, the same key is used for both broadcast and unicast. */
  1577. u8 unicast;
  1578. } __packed;
  1579. struct wcn36xx_hal_remove_sta_key_rsp_msg {
  1580. struct wcn36xx_hal_msg_header header;
  1581. /*success or failure */
  1582. u32 status;
  1583. } __packed;
  1584. #ifdef FEATURE_OEM_DATA_SUPPORT
  1585. #ifndef OEM_DATA_REQ_SIZE
  1586. #define OEM_DATA_REQ_SIZE 134
  1587. #endif
  1588. #ifndef OEM_DATA_RSP_SIZE
  1589. #define OEM_DATA_RSP_SIZE 1968
  1590. #endif
  1591. struct start_oem_data_req_msg {
  1592. struct wcn36xx_hal_msg_header header;
  1593. u32 status;
  1594. tSirMacAddr self_mac_addr;
  1595. u8 oem_data_req[OEM_DATA_REQ_SIZE];
  1596. };
  1597. struct start_oem_data_rsp_msg {
  1598. struct wcn36xx_hal_msg_header header;
  1599. u8 oem_data_rsp[OEM_DATA_RSP_SIZE];
  1600. };
  1601. #endif
  1602. struct wcn36xx_hal_switch_channel_req_msg {
  1603. struct wcn36xx_hal_msg_header header;
  1604. /* Channel number */
  1605. u8 channel_number;
  1606. /* Local power constraint */
  1607. u8 local_power_constraint;
  1608. /* Secondary channel offset */
  1609. enum phy_chan_bond_state secondary_channel_offset;
  1610. /* HAL fills in the tx power used for mgmt frames in this field. */
  1611. u8 tx_mgmt_power;
  1612. /* Max TX power */
  1613. u8 max_tx_power;
  1614. /* Self STA MAC */
  1615. u8 self_sta_mac_addr[ETH_ALEN];
  1616. /* VO WIFI comment: BSSID needed to identify session. As the
  1617. * request has power constraints, this should be applied only to
  1618. * that session Since MTU timing and EDCA are sessionized, this
  1619. * struct needs to be sessionized and bssid needs to be out of the
  1620. * VOWifi feature flag V IMP: Keep bssId field at the end of this
  1621. * msg. It is used to mantain backward compatbility by way of
  1622. * ignoring if using new host/old FW or old host/new FW since it is
  1623. * at the end of this struct
  1624. */
  1625. u8 bssid[ETH_ALEN];
  1626. } __packed;
  1627. struct wcn36xx_hal_switch_channel_rsp_msg {
  1628. struct wcn36xx_hal_msg_header header;
  1629. /* Status */
  1630. u32 status;
  1631. /* Channel number - same as in request */
  1632. u8 channel_number;
  1633. /* HAL fills in the tx power used for mgmt frames in this field */
  1634. u8 tx_mgmt_power;
  1635. /* BSSID needed to identify session - same as in request */
  1636. u8 bssid[ETH_ALEN];
  1637. } __packed;
  1638. struct update_edca_params_req_msg {
  1639. struct wcn36xx_hal_msg_header header;
  1640. /*BSS Index */
  1641. u16 bss_index;
  1642. /* Best Effort */
  1643. struct wcn36xx_hal_edca_param_record acbe;
  1644. /* Background */
  1645. struct wcn36xx_hal_edca_param_record acbk;
  1646. /* Video */
  1647. struct wcn36xx_hal_edca_param_record acvi;
  1648. /* Voice */
  1649. struct wcn36xx_hal_edca_param_record acvo;
  1650. };
  1651. struct update_edca_params_rsp_msg {
  1652. struct wcn36xx_hal_msg_header header;
  1653. /* success or failure */
  1654. u32 status;
  1655. };
  1656. struct dpu_stats_params {
  1657. /* Index of STA to which the statistics */
  1658. u16 sta_index;
  1659. /* Encryption mode */
  1660. u8 enc_mode;
  1661. /* status */
  1662. u32 status;
  1663. /* Statistics */
  1664. u32 send_blocks;
  1665. u32 recv_blocks;
  1666. u32 replays;
  1667. u8 mic_error_cnt;
  1668. u32 prot_excl_cnt;
  1669. u16 format_err_cnt;
  1670. u16 un_decryptable_cnt;
  1671. u32 decrypt_err_cnt;
  1672. u32 decrypt_ok_cnt;
  1673. };
  1674. struct wcn36xx_hal_stats_req_msg {
  1675. struct wcn36xx_hal_msg_header header;
  1676. /* Valid STA Idx for per STA stats request */
  1677. u32 sta_id;
  1678. /* Categories of stats requested as specified in eHalStatsMask */
  1679. u32 stats_mask;
  1680. };
  1681. struct ani_summary_stats_info {
  1682. /* Total number of packets(per AC) that were successfully
  1683. * transmitted with retries */
  1684. u32 retry_cnt[4];
  1685. /* The number of MSDU packets and MMPDU frames per AC that the
  1686. * 802.11 station successfully transmitted after more than one
  1687. * retransmission attempt */
  1688. u32 multiple_retry_cnt[4];
  1689. /* Total number of packets(per AC) that were successfully
  1690. * transmitted (with and without retries, including multi-cast,
  1691. * broadcast) */
  1692. u32 tx_frm_cnt[4];
  1693. /* Total number of packets that were successfully received (after
  1694. * appropriate filter rules including multi-cast, broadcast) */
  1695. u32 rx_frm_cnt;
  1696. /* Total number of duplicate frames received successfully */
  1697. u32 frm_dup_cnt;
  1698. /* Total number packets(per AC) failed to transmit */
  1699. u32 fail_cnt[4];
  1700. /* Total number of RTS/CTS sequence failures for transmission of a
  1701. * packet */
  1702. u32 rts_fail_cnt;
  1703. /* Total number packets failed transmit because of no ACK from the
  1704. * remote entity */
  1705. u32 ack_fail_cnt;
  1706. /* Total number of RTS/CTS sequence success for transmission of a
  1707. * packet */
  1708. u32 rts_succ_cnt;
  1709. /* The sum of the receive error count and dropped-receive-buffer
  1710. * error count. HAL will provide this as a sum of (FCS error) +
  1711. * (Fail get BD/PDU in HW) */
  1712. u32 rx_discard_cnt;
  1713. /*
  1714. * The receive error count. HAL will provide the RxP FCS error
  1715. * global counter. */
  1716. u32 rx_error_cnt;
  1717. /* The sum of the transmit-directed byte count, transmit-multicast
  1718. * byte count and transmit-broadcast byte count. HAL will sum TPE
  1719. * UC/MC/BCAST global counters to provide this. */
  1720. u32 tx_byte_cnt;
  1721. };
  1722. /* defines tx_rate_flags */
  1723. enum tx_rate_info {
  1724. /* Legacy rates */
  1725. HAL_TX_RATE_LEGACY = 0x1,
  1726. /* HT20 rates */
  1727. HAL_TX_RATE_HT20 = 0x2,
  1728. /* HT40 rates */
  1729. HAL_TX_RATE_HT40 = 0x4,
  1730. /* Rate with Short guard interval */
  1731. HAL_TX_RATE_SGI = 0x8,
  1732. /* Rate with Long guard interval */
  1733. HAL_TX_RATE_LGI = 0x10
  1734. };
  1735. struct ani_global_class_a_stats_info {
  1736. /* The number of MPDU frames received by the 802.11 station for
  1737. * MSDU packets or MMPDU frames */
  1738. u32 rx_frag_cnt;
  1739. /* The number of MPDU frames received by the 802.11 station for
  1740. * MSDU packets or MMPDU frames when a promiscuous packet filter
  1741. * was enabled */
  1742. u32 promiscuous_rx_frag_cnt;
  1743. /* The receiver input sensitivity referenced to a FER of 8% at an
  1744. * MPDU length of 1024 bytes at the antenna connector. Each element
  1745. * of the array shall correspond to a supported rate and the order
  1746. * shall be the same as the supporteRates parameter. */
  1747. u32 rx_input_sensitivity;
  1748. /* The maximum transmit power in dBm upto one decimal. for eg: if
  1749. * it is 10.5dBm, the value would be 105 */
  1750. u32 max_pwr;
  1751. /* Number of times the receiver failed to synchronize with the
  1752. * incoming signal after detecting the sync in the preamble of the
  1753. * transmitted PLCP protocol data unit. */
  1754. u32 sync_fail_cnt;
  1755. /* Legacy transmit rate, in units of 500 kbit/sec, for the most
  1756. * recently transmitted frame */
  1757. u32 tx_rate;
  1758. /* mcs index for HT20 and HT40 rates */
  1759. u32 mcs_index;
  1760. /* to differentiate between HT20 and HT40 rates; short and long
  1761. * guard interval */
  1762. u32 tx_rate_flags;
  1763. };
  1764. struct ani_global_security_stats {
  1765. /* The number of unencrypted received MPDU frames that the MAC
  1766. * layer discarded when the IEEE 802.11 dot11ExcludeUnencrypted
  1767. * management information base (MIB) object is enabled */
  1768. u32 rx_wep_unencrypted_frm_cnt;
  1769. /* The number of received MSDU packets that that the 802.11 station
  1770. * discarded because of MIC failures */
  1771. u32 rx_mic_fail_cnt;
  1772. /* The number of encrypted MPDU frames that the 802.11 station
  1773. * failed to decrypt because of a TKIP ICV error */
  1774. u32 tkip_icv_err;
  1775. /* The number of received MPDU frames that the 802.11 discarded
  1776. * because of an invalid AES-CCMP format */
  1777. u32 aes_ccmp_format_err;
  1778. /* The number of received MPDU frames that the 802.11 station
  1779. * discarded because of the AES-CCMP replay protection procedure */
  1780. u32 aes_ccmp_replay_cnt;
  1781. /* The number of received MPDU frames that the 802.11 station
  1782. * discarded because of errors detected by the AES-CCMP decryption
  1783. * algorithm */
  1784. u32 aes_ccmp_decrpt_err;
  1785. /* The number of encrypted MPDU frames received for which a WEP
  1786. * decryption key was not available on the 802.11 station */
  1787. u32 wep_undecryptable_cnt;
  1788. /* The number of encrypted MPDU frames that the 802.11 station
  1789. * failed to decrypt because of a WEP ICV error */
  1790. u32 wep_icv_err;
  1791. /* The number of received encrypted packets that the 802.11 station
  1792. * successfully decrypted */
  1793. u32 rx_decrypt_succ_cnt;
  1794. /* The number of encrypted packets that the 802.11 station failed
  1795. * to decrypt */
  1796. u32 rx_decrypt_fail_cnt;
  1797. };
  1798. struct ani_global_class_b_stats_info {
  1799. struct ani_global_security_stats uc_stats;
  1800. struct ani_global_security_stats mc_bc_stats;
  1801. };
  1802. struct ani_global_class_c_stats_info {
  1803. /* This counter shall be incremented for a received A-MSDU frame
  1804. * with the stations MAC address in the address 1 field or an
  1805. * A-MSDU frame with a group address in the address 1 field */
  1806. u32 rx_amsdu_cnt;
  1807. /* This counter shall be incremented when the MAC receives an AMPDU
  1808. * from the PHY */
  1809. u32 rx_ampdu_cnt;
  1810. /* This counter shall be incremented when a Frame is transmitted
  1811. * only on the primary channel */
  1812. u32 tx_20_frm_cnt;
  1813. /* This counter shall be incremented when a Frame is received only
  1814. * on the primary channel */
  1815. u32 rx_20_frm_cnt;
  1816. /* This counter shall be incremented by the number of MPDUs
  1817. * received in the A-MPDU when an A-MPDU is received */
  1818. u32 rx_mpdu_in_ampdu_cnt;
  1819. /* This counter shall be incremented when an MPDU delimiter has a
  1820. * CRC error when this is the first CRC error in the received AMPDU
  1821. * or when the previous delimiter has been decoded correctly */
  1822. u32 ampdu_delimiter_crc_err;
  1823. };
  1824. struct ani_per_sta_stats_info {
  1825. /* The number of MPDU frames that the 802.11 station transmitted
  1826. * and acknowledged through a received 802.11 ACK frame */
  1827. u32 tx_frag_cnt[4];
  1828. /* This counter shall be incremented when an A-MPDU is transmitted */
  1829. u32 tx_ampdu_cnt;
  1830. /* This counter shall increment by the number of MPDUs in the AMPDU
  1831. * when an A-MPDU is transmitted */
  1832. u32 tx_mpdu_in_ampdu_cnt;
  1833. };
  1834. struct wcn36xx_hal_stats_rsp_msg {
  1835. struct wcn36xx_hal_msg_header header;
  1836. /* Success or Failure */
  1837. u32 status;
  1838. /* STA Idx */
  1839. u32 sta_index;
  1840. /* Categories of STATS being returned as per eHalStatsMask */
  1841. u32 stats_mask;
  1842. /* message type is same as the request type */
  1843. u16 msg_type;
  1844. /* length of the entire request, includes the pStatsBuf length too */
  1845. u16 msg_len;
  1846. };
  1847. struct wcn36xx_hal_set_link_state_req_msg {
  1848. struct wcn36xx_hal_msg_header header;
  1849. u8 bssid[ETH_ALEN];
  1850. enum wcn36xx_hal_link_state state;
  1851. u8 self_mac_addr[ETH_ALEN];
  1852. } __packed;
  1853. struct set_link_state_rsp_msg {
  1854. struct wcn36xx_hal_msg_header header;
  1855. /* success or failure */
  1856. u32 status;
  1857. };
  1858. /* TSPEC Params */
  1859. struct wcn36xx_hal_ts_info_tfc {
  1860. #ifndef ANI_LITTLE_BIT_ENDIAN
  1861. u16 ackPolicy:2;
  1862. u16 userPrio:3;
  1863. u16 psb:1;
  1864. u16 aggregation:1;
  1865. u16 accessPolicy:2;
  1866. u16 direction:2;
  1867. u16 tsid:4;
  1868. u16 trafficType:1;
  1869. #else
  1870. u16 trafficType:1;
  1871. u16 tsid:4;
  1872. u16 direction:2;
  1873. u16 accessPolicy:2;
  1874. u16 aggregation:1;
  1875. u16 psb:1;
  1876. u16 userPrio:3;
  1877. u16 ackPolicy:2;
  1878. #endif
  1879. };
  1880. /* Flag to schedule the traffic type */
  1881. struct wcn36xx_hal_ts_info_sch {
  1882. #ifndef ANI_LITTLE_BIT_ENDIAN
  1883. u8 rsvd:7;
  1884. u8 schedule:1;
  1885. #else
  1886. u8 schedule:1;
  1887. u8 rsvd:7;
  1888. #endif
  1889. };
  1890. /* Traffic and scheduling info */
  1891. struct wcn36xx_hal_ts_info {
  1892. struct wcn36xx_hal_ts_info_tfc traffic;
  1893. struct wcn36xx_hal_ts_info_sch schedule;
  1894. };
  1895. /* Information elements */
  1896. struct wcn36xx_hal_tspec_ie {
  1897. u8 type;
  1898. u8 length;
  1899. struct wcn36xx_hal_ts_info ts_info;
  1900. u16 nom_msdu_size;
  1901. u16 max_msdu_size;
  1902. u32 min_svc_interval;
  1903. u32 max_svc_interval;
  1904. u32 inact_interval;
  1905. u32 suspend_interval;
  1906. u32 svc_start_time;
  1907. u32 min_data_rate;
  1908. u32 mean_data_rate;
  1909. u32 peak_data_rate;
  1910. u32 max_burst_sz;
  1911. u32 delay_bound;
  1912. u32 min_phy_rate;
  1913. u16 surplus_bw;
  1914. u16 medium_time;
  1915. };
  1916. struct add_ts_req_msg {
  1917. struct wcn36xx_hal_msg_header header;
  1918. /* Station Index */
  1919. u16 sta_index;
  1920. /* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS */
  1921. u16 tspec_index;
  1922. /* To program TPE with required parameters */
  1923. struct wcn36xx_hal_tspec_ie tspec;
  1924. /* U-APSD Flags: 1b per AC. Encoded as follows:
  1925. b7 b6 b5 b4 b3 b2 b1 b0 =
  1926. X X X X BE BK VI VO */
  1927. u8 uapsd;
  1928. /* These parameters are for all the access categories */
  1929. /* Service Interval */
  1930. u32 service_interval[WCN36XX_HAL_MAX_AC];
  1931. /* Suspend Interval */
  1932. u32 suspend_interval[WCN36XX_HAL_MAX_AC];
  1933. /* Delay Interval */
  1934. u32 delay_interval[WCN36XX_HAL_MAX_AC];
  1935. };
  1936. struct add_rs_rsp_msg {
  1937. struct wcn36xx_hal_msg_header header;
  1938. /* success or failure */
  1939. u32 status;
  1940. };
  1941. struct del_ts_req_msg {
  1942. struct wcn36xx_hal_msg_header header;
  1943. /* Station Index */
  1944. u16 sta_index;
  1945. /* TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS */
  1946. u16 tspec_index;
  1947. /* To lookup station id using the mac address */
  1948. u8 bssid[ETH_ALEN];
  1949. };
  1950. struct del_ts_rsp_msg {
  1951. struct wcn36xx_hal_msg_header header;
  1952. /* success or failure */
  1953. u32 status;
  1954. };
  1955. /* End of TSpec Parameters */
  1956. /* Start of BLOCK ACK related Parameters */
  1957. struct wcn36xx_hal_add_ba_session_req_msg {
  1958. struct wcn36xx_hal_msg_header header;
  1959. /* Station Index */
  1960. u16 sta_index;
  1961. /* Peer MAC Address */
  1962. u8 mac_addr[ETH_ALEN];
  1963. /* ADDBA Action Frame dialog token
  1964. HAL will not interpret this object */
  1965. u8 dialog_token;
  1966. /* TID for which the BA is being setup
  1967. This identifies the TC or TS of interest */
  1968. u8 tid;
  1969. /* 0 - Delayed BA (Not supported)
  1970. 1 - Immediate BA */
  1971. u8 policy;
  1972. /* Indicates the number of buffers for this TID (baTID)
  1973. NOTE - This is the requested buffer size. When this
  1974. is processed by HAL and subsequently by HDD, it is
  1975. possible that HDD may change this buffer size. Any
  1976. change in the buffer size should be noted by PE and
  1977. advertized appropriately in the ADDBA response */
  1978. u16 buffer_size;
  1979. /* BA timeout in TU's 0 means no timeout will occur */
  1980. u16 timeout;
  1981. /* b0..b3 - Fragment Number - Always set to 0
  1982. b4..b15 - Starting Sequence Number of first MSDU
  1983. for which this BA is setup */
  1984. u16 ssn;
  1985. /* ADDBA direction
  1986. 1 - Originator
  1987. 0 - Recipient */
  1988. u8 direction;
  1989. } __packed;
  1990. struct wcn36xx_hal_add_ba_session_rsp_msg {
  1991. struct wcn36xx_hal_msg_header header;
  1992. /* success or failure */
  1993. u32 status;
  1994. /* Dialog token */
  1995. u8 dialog_token;
  1996. /* TID for which the BA session has been setup */
  1997. u8 ba_tid;
  1998. /* BA Buffer Size allocated for the current BA session */
  1999. u8 ba_buffer_size;
  2000. u8 ba_session_id;
  2001. /* Reordering Window buffer */
  2002. u8 win_size;
  2003. /* Station Index to id the sta */
  2004. u8 sta_index;
  2005. /* Starting Sequence Number */
  2006. u16 ssn;
  2007. } __packed;
  2008. struct wcn36xx_hal_add_ba_req_msg {
  2009. struct wcn36xx_hal_msg_header header;
  2010. /* Session Id */
  2011. u8 session_id;
  2012. /* Reorder Window Size */
  2013. u8 win_size;
  2014. /* Old FW 1.2.2.4 does not support this*/
  2015. #ifdef FEATURE_ON_CHIP_REORDERING
  2016. u8 reordering_done_on_chip;
  2017. #endif
  2018. } __packed;
  2019. struct wcn36xx_hal_add_ba_rsp_msg {
  2020. struct wcn36xx_hal_msg_header header;
  2021. /* success or failure */
  2022. u32 status;
  2023. /* Dialog token */
  2024. u8 dialog_token;
  2025. } __packed;
  2026. struct add_ba_info {
  2027. u16 ba_enable:1;
  2028. u16 starting_seq_num:12;
  2029. u16 reserved:3;
  2030. };
  2031. struct wcn36xx_hal_trigger_ba_rsp_candidate {
  2032. u8 sta_addr[ETH_ALEN];
  2033. struct add_ba_info ba_info[STACFG_MAX_TC];
  2034. } __packed;
  2035. struct wcn36xx_hal_trigger_ba_req_candidate {
  2036. u8 sta_index;
  2037. u8 tid_bitmap;
  2038. } __packed;
  2039. struct wcn36xx_hal_trigger_ba_req_msg {
  2040. struct wcn36xx_hal_msg_header header;
  2041. /* Session Id */
  2042. u8 session_id;
  2043. /* baCandidateCnt is followed by trigger BA
  2044. * Candidate List(tTriggerBaCandidate)
  2045. */
  2046. u16 candidate_cnt;
  2047. } __packed;
  2048. struct wcn36xx_hal_trigger_ba_rsp_msg {
  2049. struct wcn36xx_hal_msg_header header;
  2050. /* TO SUPPORT BT-AMP */
  2051. u8 bssid[ETH_ALEN];
  2052. /* success or failure */
  2053. u32 status;
  2054. /* baCandidateCnt is followed by trigger BA
  2055. * Rsp Candidate List(tTriggerRspBaCandidate)
  2056. */
  2057. u16 candidate_cnt;
  2058. } __packed;
  2059. struct wcn36xx_hal_del_ba_req_msg {
  2060. struct wcn36xx_hal_msg_header header;
  2061. /* Station Index */
  2062. u16 sta_index;
  2063. /* TID for which the BA session is being deleted */
  2064. u8 tid;
  2065. /* DELBA direction
  2066. 1 - Originator
  2067. 0 - Recipient */
  2068. u8 direction;
  2069. } __packed;
  2070. struct wcn36xx_hal_del_ba_rsp_msg {
  2071. struct wcn36xx_hal_msg_header header;
  2072. /* success or failure */
  2073. u32 status;
  2074. } __packed;
  2075. struct tsm_stats_req_msg {
  2076. struct wcn36xx_hal_msg_header header;
  2077. /* Traffic Id */
  2078. u8 tid;
  2079. u8 bssid[ETH_ALEN];
  2080. };
  2081. struct tsm_stats_rsp_msg {
  2082. struct wcn36xx_hal_msg_header header;
  2083. /*success or failure */
  2084. u32 status;
  2085. /* Uplink Packet Queue delay */
  2086. u16 uplink_pkt_queue_delay;
  2087. /* Uplink Packet Queue delay histogram */
  2088. u16 uplink_pkt_queue_delay_hist[4];
  2089. /* Uplink Packet Transmit delay */
  2090. u32 uplink_pkt_tx_delay;
  2091. /* Uplink Packet loss */
  2092. u16 uplink_pkt_loss;
  2093. /* Uplink Packet count */
  2094. u16 uplink_pkt_count;
  2095. /* Roaming count */
  2096. u8 roaming_count;
  2097. /* Roaming Delay */
  2098. u16 roaming_delay;
  2099. };
  2100. struct set_key_done_msg {
  2101. struct wcn36xx_hal_msg_header header;
  2102. /*bssid of the keys */
  2103. u8 bssidx;
  2104. u8 enc_type;
  2105. };
  2106. struct wcn36xx_hal_nv_img_download_req_msg {
  2107. /* Note: The length specified in wcn36xx_hal_nv_img_download_req_msg
  2108. * messages should be
  2109. * header.len = sizeof(wcn36xx_hal_nv_img_download_req_msg) +
  2110. * nv_img_buffer_size */
  2111. struct wcn36xx_hal_msg_header header;
  2112. /* Fragment sequence number of the NV Image. Note that NV Image
  2113. * might not fit into one message due to size limitation of the SMD
  2114. * channel FIFO. UMAC can hence choose to chop the NV blob into
  2115. * multiple fragments starting with seqeunce number 0, 1, 2 etc.
  2116. * The last fragment MUST be indicated by marking the
  2117. * isLastFragment field to 1. Note that all the NV blobs would be
  2118. * concatenated together by HAL without any padding bytes in
  2119. * between.*/
  2120. u16 frag_number;
  2121. /* Is this the last fragment? When set to 1 it indicates that no
  2122. * more fragments will be sent by UMAC and HAL can concatenate all
  2123. * the NV blobs rcvd & proceed with the parsing. HAL would generate
  2124. * a WCN36XX_HAL_DOWNLOAD_NV_RSP to the WCN36XX_HAL_DOWNLOAD_NV_REQ
  2125. * after it receives each fragment */
  2126. u16 last_fragment;
  2127. /* NV Image size (number of bytes) */
  2128. u32 nv_img_buffer_size;
  2129. /* Following the 'nv_img_buffer_size', there should be
  2130. * nv_img_buffer_size bytes of NV Image i.e.
  2131. * u8[nv_img_buffer_size] */
  2132. } __packed;
  2133. struct wcn36xx_hal_nv_img_download_rsp_msg {
  2134. struct wcn36xx_hal_msg_header header;
  2135. /* Success or Failure. HAL would generate a
  2136. * WCN36XX_HAL_DOWNLOAD_NV_RSP after each fragment */
  2137. u32 status;
  2138. } __packed;
  2139. struct wcn36xx_hal_nv_store_ind {
  2140. /* Note: The length specified in tHalNvStoreInd messages should be
  2141. * header.msgLen = sizeof(tHalNvStoreInd) + nvBlobSize */
  2142. struct wcn36xx_hal_msg_header header;
  2143. /* NV Item */
  2144. u32 table_id;
  2145. /* Size of NV Blob */
  2146. u32 nv_blob_size;
  2147. /* Following the 'nvBlobSize', there should be nvBlobSize bytes of
  2148. * NV blob i.e. u8[nvBlobSize] */
  2149. };
  2150. /* End of Block Ack Related Parameters */
  2151. #define WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE 6
  2152. /* Definition for MIC failure indication MAC reports this each time a MIC
  2153. * failure occures on Rx TKIP packet
  2154. */
  2155. struct mic_failure_ind_msg {
  2156. struct wcn36xx_hal_msg_header header;
  2157. u8 bssid[ETH_ALEN];
  2158. /* address used to compute MIC */
  2159. u8 src_addr[ETH_ALEN];
  2160. /* transmitter address */
  2161. u8 ta_addr[ETH_ALEN];
  2162. u8 dst_addr[ETH_ALEN];
  2163. u8 multicast;
  2164. /* first byte of IV */
  2165. u8 iv1;
  2166. /* second byte of IV */
  2167. u8 key_id;
  2168. /* sequence number */
  2169. u8 tsc[WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE];
  2170. /* receive address */
  2171. u8 rx_addr[ETH_ALEN];
  2172. };
  2173. struct update_vht_op_mode_req_msg {
  2174. struct wcn36xx_hal_msg_header header;
  2175. u16 op_mode;
  2176. u16 sta_id;
  2177. };
  2178. struct update_vht_op_mode_params_rsp_msg {
  2179. struct wcn36xx_hal_msg_header header;
  2180. u32 status;
  2181. };
  2182. struct update_beacon_req_msg {
  2183. struct wcn36xx_hal_msg_header header;
  2184. u8 bss_index;
  2185. /* shortPreamble mode. HAL should update all the STA rates when it
  2186. * receives this message */
  2187. u8 short_preamble;
  2188. /* short Slot time. */
  2189. u8 short_slot_time;
  2190. /* Beacon Interval */
  2191. u16 beacon_interval;
  2192. /* Protection related */
  2193. u8 lla_coexist;
  2194. u8 llb_coexist;
  2195. u8 llg_coexist;
  2196. u8 ht20_coexist;
  2197. u8 lln_non_gf_coexist;
  2198. u8 lsig_tx_op_protection_full_support;
  2199. u8 rifs_mode;
  2200. u16 param_change_bitmap;
  2201. };
  2202. struct update_beacon_rsp_msg {
  2203. struct wcn36xx_hal_msg_header header;
  2204. u32 status;
  2205. };
  2206. struct wcn36xx_hal_send_beacon_req_msg {
  2207. struct wcn36xx_hal_msg_header header;
  2208. /* length of the template. */
  2209. u32 beacon_length;
  2210. /* Beacon data. */
  2211. u8 beacon[BEACON_TEMPLATE_SIZE];
  2212. u8 bssid[ETH_ALEN];
  2213. /* TIM IE offset from the beginning of the template. */
  2214. u32 tim_ie_offset;
  2215. /* P2P IE offset from the begining of the template */
  2216. u16 p2p_ie_offset;
  2217. } __packed;
  2218. struct send_beacon_rsp_msg {
  2219. struct wcn36xx_hal_msg_header header;
  2220. u32 status;
  2221. } __packed;
  2222. struct enable_radar_req_msg {
  2223. struct wcn36xx_hal_msg_header header;
  2224. u8 bssid[ETH_ALEN];
  2225. u8 channel;
  2226. };
  2227. struct enable_radar_rsp_msg {
  2228. struct wcn36xx_hal_msg_header header;
  2229. /* Link Parameters */
  2230. u8 bssid[ETH_ALEN];
  2231. /* success or failure */
  2232. u32 status;
  2233. };
  2234. struct radar_detect_intr_ind_msg {
  2235. struct wcn36xx_hal_msg_header header;
  2236. u8 radar_det_channel;
  2237. };
  2238. struct radar_detect_ind_msg {
  2239. struct wcn36xx_hal_msg_header header;
  2240. /* channel number in which the RADAR detected */
  2241. u8 channel_number;
  2242. /* RADAR pulse width in usecond */
  2243. u16 radar_pulse_width;
  2244. /* Number of RADAR pulses */
  2245. u16 num_radar_pulse;
  2246. };
  2247. struct wcn36xx_hal_get_tpc_report_req_msg {
  2248. struct wcn36xx_hal_msg_header header;
  2249. u8 sta[ETH_ALEN];
  2250. u8 dialog_token;
  2251. u8 txpower;
  2252. };
  2253. struct wcn36xx_hal_get_tpc_report_rsp_msg {
  2254. struct wcn36xx_hal_msg_header header;
  2255. /* success or failure */
  2256. u32 status;
  2257. };
  2258. struct wcn36xx_hal_send_probe_resp_req_msg {
  2259. struct wcn36xx_hal_msg_header header;
  2260. u8 probe_resp_template[BEACON_TEMPLATE_SIZE];
  2261. u32 probe_resp_template_len;
  2262. u32 proxy_probe_req_valid_ie_bmap[8];
  2263. u8 bssid[ETH_ALEN];
  2264. };
  2265. struct send_probe_resp_rsp_msg {
  2266. struct wcn36xx_hal_msg_header header;
  2267. /* success or failure */
  2268. u32 status;
  2269. };
  2270. struct send_unknown_frame_rx_ind_msg {
  2271. struct wcn36xx_hal_msg_header header;
  2272. /* success or failure */
  2273. u32 status;
  2274. };
  2275. struct wcn36xx_hal_delete_sta_context_ind_msg {
  2276. struct wcn36xx_hal_msg_header header;
  2277. u16 aid;
  2278. u16 sta_id;
  2279. /* TO SUPPORT BT-AMP */
  2280. u8 bssid[ETH_ALEN];
  2281. /* HAL copies bssid from the sta table. */
  2282. u8 addr2[ETH_ALEN];
  2283. /* To unify the keepalive / unknown A2 / tim-based disa */
  2284. u16 reason_code;
  2285. } __packed;
  2286. struct indicate_del_sta {
  2287. struct wcn36xx_hal_msg_header header;
  2288. u8 aid;
  2289. u8 sta_index;
  2290. u8 bss_index;
  2291. u8 reason_code;
  2292. u32 status;
  2293. };
  2294. struct bt_amp_event_msg {
  2295. struct wcn36xx_hal_msg_header header;
  2296. enum bt_amp_event_type btAmpEventType;
  2297. };
  2298. struct bt_amp_event_rsp {
  2299. struct wcn36xx_hal_msg_header header;
  2300. /* success or failure */
  2301. u32 status;
  2302. };
  2303. struct tl_hal_flush_ac_req_msg {
  2304. struct wcn36xx_hal_msg_header header;
  2305. /* Station Index. originates from HAL */
  2306. u8 sta_id;
  2307. /* TID for which the transmit queue is being flushed */
  2308. u8 tid;
  2309. };
  2310. struct tl_hal_flush_ac_rsp_msg {
  2311. struct wcn36xx_hal_msg_header header;
  2312. /* Station Index. originates from HAL */
  2313. u8 sta_id;
  2314. /* TID for which the transmit queue is being flushed */
  2315. u8 tid;
  2316. /* success or failure */
  2317. u32 status;
  2318. };
  2319. struct wcn36xx_hal_enter_imps_req_msg {
  2320. struct wcn36xx_hal_msg_header header;
  2321. };
  2322. struct wcn36xx_hal_exit_imps_req {
  2323. struct wcn36xx_hal_msg_header header;
  2324. };
  2325. struct wcn36xx_hal_enter_bmps_req_msg {
  2326. struct wcn36xx_hal_msg_header header;
  2327. u8 bss_index;
  2328. /* TBTT value derived from the last beacon */
  2329. #ifndef BUILD_QWPTTSTATIC
  2330. u64 tbtt;
  2331. #endif
  2332. u8 dtim_count;
  2333. /* DTIM period given to HAL during association may not be valid, if
  2334. * association is based on ProbeRsp instead of beacon. */
  2335. u8 dtim_period;
  2336. /* For CCX and 11R Roaming */
  2337. u32 rssi_filter_period;
  2338. u32 num_beacon_per_rssi_average;
  2339. u8 rssi_filter_enable;
  2340. } __packed;
  2341. struct wcn36xx_hal_exit_bmps_req_msg {
  2342. struct wcn36xx_hal_msg_header header;
  2343. u8 send_data_null;
  2344. u8 bss_index;
  2345. } __packed;
  2346. struct wcn36xx_hal_missed_beacon_ind_msg {
  2347. struct wcn36xx_hal_msg_header header;
  2348. u8 bss_index;
  2349. } __packed;
  2350. /* Beacon Filtering data structures */
  2351. /* The above structure would be followed by multiple of below mentioned
  2352. * structure
  2353. */
  2354. struct beacon_filter_ie {
  2355. u8 element_id;
  2356. u8 check_ie_presence;
  2357. u8 offset;
  2358. u8 value;
  2359. u8 bitmask;
  2360. u8 ref;
  2361. };
  2362. struct wcn36xx_hal_add_bcn_filter_req_msg {
  2363. struct wcn36xx_hal_msg_header header;
  2364. u16 capability_info;
  2365. u16 capability_mask;
  2366. u16 beacon_interval;
  2367. u16 ie_num;
  2368. u8 bss_index;
  2369. u8 reserved;
  2370. };
  2371. struct wcn36xx_hal_rem_bcn_filter_req {
  2372. struct wcn36xx_hal_msg_header header;
  2373. u8 ie_Count;
  2374. u8 rem_ie_id[1];
  2375. };
  2376. #define WCN36XX_HAL_IPV4_ARP_REPLY_OFFLOAD 0
  2377. #define WCN36XX_HAL_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
  2378. #define WCN36XX_HAL_IPV6_NS_OFFLOAD 2
  2379. #define WCN36XX_HAL_IPV6_ADDR_LEN 16
  2380. #define WCN36XX_HAL_OFFLOAD_DISABLE 0
  2381. #define WCN36XX_HAL_OFFLOAD_ENABLE 1
  2382. #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2
  2383. #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \
  2384. (HAL_OFFLOAD_ENABLE|HAL_OFFLOAD_BCAST_FILTER_ENABLE)
  2385. struct wcn36xx_hal_ns_offload_params {
  2386. u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
  2387. u8 self_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
  2388. /* Only support 2 possible Network Advertisement IPv6 address */
  2389. u8 target_ipv6_addr1[WCN36XX_HAL_IPV6_ADDR_LEN];
  2390. u8 target_ipv6_addr2[WCN36XX_HAL_IPV6_ADDR_LEN];
  2391. u8 self_addr[ETH_ALEN];
  2392. u8 src_ipv6_addr_valid:1;
  2393. u8 target_ipv6_addr1_valid:1;
  2394. u8 target_ipv6_addr2_valid:1;
  2395. u8 reserved1:5;
  2396. /* make it DWORD aligned */
  2397. u8 reserved2;
  2398. /* slot index for this offload */
  2399. u32 slot_index;
  2400. u8 bss_index;
  2401. };
  2402. struct wcn36xx_hal_host_offload_req {
  2403. u8 offload_Type;
  2404. /* enable or disable */
  2405. u8 enable;
  2406. union {
  2407. u8 host_ipv4_addr[4];
  2408. u8 host_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN];
  2409. } u;
  2410. };
  2411. struct wcn36xx_hal_host_offload_req_msg {
  2412. struct wcn36xx_hal_msg_header header;
  2413. struct wcn36xx_hal_host_offload_req host_offload_params;
  2414. struct wcn36xx_hal_ns_offload_params ns_offload_params;
  2415. };
  2416. /* Packet Types. */
  2417. #define WCN36XX_HAL_KEEP_ALIVE_NULL_PKT 1
  2418. #define WCN36XX_HAL_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
  2419. /* Enable or disable keep alive */
  2420. #define WCN36XX_HAL_KEEP_ALIVE_DISABLE 0
  2421. #define WCN36XX_HAL_KEEP_ALIVE_ENABLE 1
  2422. #define WCN36XX_KEEP_ALIVE_TIME_PERIOD 30 /* unit: s */
  2423. /* Keep Alive request. */
  2424. struct wcn36xx_hal_keep_alive_req_msg {
  2425. struct wcn36xx_hal_msg_header header;
  2426. u8 packet_type;
  2427. u32 time_period;
  2428. u8 host_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN];
  2429. u8 dest_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN];
  2430. u8 dest_addr[ETH_ALEN];
  2431. u8 bss_index;
  2432. } __packed;
  2433. struct wcn36xx_hal_rssi_threshold_req_msg {
  2434. struct wcn36xx_hal_msg_header header;
  2435. s8 threshold1:8;
  2436. s8 threshold2:8;
  2437. s8 threshold3:8;
  2438. u8 thres1_pos_notify:1;
  2439. u8 thres1_neg_notify:1;
  2440. u8 thres2_pos_notify:1;
  2441. u8 thres2_neg_notify:1;
  2442. u8 thres3_pos_notify:1;
  2443. u8 thres3_neg_notify:1;
  2444. u8 reserved10:2;
  2445. };
  2446. struct wcn36xx_hal_enter_uapsd_req_msg {
  2447. struct wcn36xx_hal_msg_header header;
  2448. u8 bk_delivery:1;
  2449. u8 be_delivery:1;
  2450. u8 vi_delivery:1;
  2451. u8 vo_delivery:1;
  2452. u8 bk_trigger:1;
  2453. u8 be_trigger:1;
  2454. u8 vi_trigger:1;
  2455. u8 vo_trigger:1;
  2456. u8 bss_index;
  2457. };
  2458. struct wcn36xx_hal_exit_uapsd_req_msg {
  2459. struct wcn36xx_hal_msg_header header;
  2460. u8 bss_index;
  2461. };
  2462. #define WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE 128
  2463. #define WCN36XX_HAL_WOWL_BCAST_MAX_NUM_PATTERNS 16
  2464. struct wcn36xx_hal_wowl_add_bcast_ptrn_req_msg {
  2465. struct wcn36xx_hal_msg_header header;
  2466. /* Pattern ID */
  2467. u8 id;
  2468. /* Pattern byte offset from beginning of the 802.11 packet to start
  2469. * of the wake-up pattern */
  2470. u8 byte_Offset;
  2471. /* Non-Zero Pattern size */
  2472. u8 size;
  2473. /* Pattern */
  2474. u8 pattern[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
  2475. /* Non-zero pattern mask size */
  2476. u8 mask_size;
  2477. /* Pattern mask */
  2478. u8 mask[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
  2479. /* Extra pattern */
  2480. u8 extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
  2481. /* Extra pattern mask */
  2482. u8 mask_extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE];
  2483. u8 bss_index;
  2484. };
  2485. struct wcn36xx_hal_wow_del_bcast_ptrn_req_msg {
  2486. struct wcn36xx_hal_msg_header header;
  2487. /* Pattern ID of the wakeup pattern to be deleted */
  2488. u8 id;
  2489. u8 bss_index;
  2490. };
  2491. struct wcn36xx_hal_wowl_enter_req_msg {
  2492. struct wcn36xx_hal_msg_header header;
  2493. /* Enables/disables magic packet filtering */
  2494. u8 magic_packet_enable;
  2495. /* Magic pattern */
  2496. u8 magic_pattern[ETH_ALEN];
  2497. /* Enables/disables packet pattern filtering in firmware. Enabling
  2498. * this flag enables broadcast pattern matching in Firmware. If
  2499. * unicast pattern matching is also desired,
  2500. * ucUcastPatternFilteringEnable flag must be set tot true as well
  2501. */
  2502. u8 pattern_filtering_enable;
  2503. /* Enables/disables unicast packet pattern filtering. This flag
  2504. * specifies whether we want to do pattern match on unicast packets
  2505. * as well and not just broadcast packets. This flag has no effect
  2506. * if the ucPatternFilteringEnable (main controlling flag) is set
  2507. * to false
  2508. */
  2509. u8 ucast_pattern_filtering_enable;
  2510. /* This configuration is valid only when magicPktEnable=1. It
  2511. * requests hardware to wake up when it receives the Channel Switch
  2512. * Action Frame.
  2513. */
  2514. u8 wow_channel_switch_receive;
  2515. /* This configuration is valid only when magicPktEnable=1. It
  2516. * requests hardware to wake up when it receives the
  2517. * Deauthentication Frame.
  2518. */
  2519. u8 wow_deauth_receive;
  2520. /* This configuration is valid only when magicPktEnable=1. It
  2521. * requests hardware to wake up when it receives the Disassociation
  2522. * Frame.
  2523. */
  2524. u8 wow_disassoc_receive;
  2525. /* This configuration is valid only when magicPktEnable=1. It
  2526. * requests hardware to wake up when it has missed consecutive
  2527. * beacons. This is a hardware register configuration (NOT a
  2528. * firmware configuration).
  2529. */
  2530. u8 wow_max_missed_beacons;
  2531. /* This configuration is valid only when magicPktEnable=1. This is
  2532. * a timeout value in units of microsec. It requests hardware to
  2533. * unconditionally wake up after it has stayed in WoWLAN mode for
  2534. * some time. Set 0 to disable this feature.
  2535. */
  2536. u8 wow_max_sleep;
  2537. /* This configuration directs the WoW packet filtering to look for
  2538. * EAP-ID requests embedded in EAPOL frames and use this as a wake
  2539. * source.
  2540. */
  2541. u8 wow_eap_id_request_enable;
  2542. /* This configuration directs the WoW packet filtering to look for
  2543. * EAPOL-4WAY requests and use this as a wake source.
  2544. */
  2545. u8 wow_eapol_4way_enable;
  2546. /* This configuration allows a host wakeup on an network scan
  2547. * offload match.
  2548. */
  2549. u8 wow_net_scan_offload_match;
  2550. /* This configuration allows a host wakeup on any GTK rekeying
  2551. * error.
  2552. */
  2553. u8 wow_gtk_rekey_error;
  2554. /* This configuration allows a host wakeup on BSS connection loss.
  2555. */
  2556. u8 wow_bss_connection_loss;
  2557. u8 bss_index;
  2558. };
  2559. struct wcn36xx_hal_wowl_exit_req_msg {
  2560. struct wcn36xx_hal_msg_header header;
  2561. u8 bss_index;
  2562. };
  2563. struct wcn36xx_hal_get_rssi_req_msg {
  2564. struct wcn36xx_hal_msg_header header;
  2565. };
  2566. struct wcn36xx_hal_get_roam_rssi_req_msg {
  2567. struct wcn36xx_hal_msg_header header;
  2568. /* Valid STA Idx for per STA stats request */
  2569. u32 sta_id;
  2570. };
  2571. struct wcn36xx_hal_set_uapsd_ac_params_req_msg {
  2572. struct wcn36xx_hal_msg_header header;
  2573. /* STA index */
  2574. u8 sta_idx;
  2575. /* Access Category */
  2576. u8 ac;
  2577. /* User Priority */
  2578. u8 up;
  2579. /* Service Interval */
  2580. u32 service_interval;
  2581. /* Suspend Interval */
  2582. u32 suspend_interval;
  2583. /* Delay Interval */
  2584. u32 delay_interval;
  2585. };
  2586. struct wcn36xx_hal_configure_rxp_filter_req_msg {
  2587. struct wcn36xx_hal_msg_header header;
  2588. u8 set_mcst_bcst_filter_setting;
  2589. u8 set_mcst_bcst_filter;
  2590. };
  2591. struct wcn36xx_hal_enter_imps_rsp_msg {
  2592. struct wcn36xx_hal_msg_header header;
  2593. /* success or failure */
  2594. u32 status;
  2595. };
  2596. struct wcn36xx_hal_exit_imps_rsp_msg {
  2597. struct wcn36xx_hal_msg_header header;
  2598. /* success or failure */
  2599. u32 status;
  2600. };
  2601. struct wcn36xx_hal_enter_bmps_rsp_msg {
  2602. struct wcn36xx_hal_msg_header header;
  2603. /* success or failure */
  2604. u32 status;
  2605. u8 bss_index;
  2606. } __packed;
  2607. struct wcn36xx_hal_exit_bmps_rsp_msg {
  2608. struct wcn36xx_hal_msg_header header;
  2609. /* success or failure */
  2610. u32 status;
  2611. u8 bss_index;
  2612. } __packed;
  2613. struct wcn36xx_hal_enter_uapsd_rsp_msg {
  2614. struct wcn36xx_hal_msg_header header;
  2615. /* success or failure */
  2616. u32 status;
  2617. u8 bss_index;
  2618. };
  2619. struct wcn36xx_hal_exit_uapsd_rsp_msg {
  2620. struct wcn36xx_hal_msg_header header;
  2621. /* success or failure */
  2622. u32 status;
  2623. u8 bss_index;
  2624. };
  2625. struct wcn36xx_hal_rssi_notification_ind_msg {
  2626. struct wcn36xx_hal_msg_header header;
  2627. u32 rssi_thres1_pos_cross:1;
  2628. u32 rssi_thres1_neg_cross:1;
  2629. u32 rssi_thres2_pos_cross:1;
  2630. u32 rssi_thres2_neg_cross:1;
  2631. u32 rssi_thres3_pos_cross:1;
  2632. u32 rssi_thres3_neg_cross:1;
  2633. u32 avg_rssi:8;
  2634. u32 reserved:18;
  2635. };
  2636. struct wcn36xx_hal_get_rssio_rsp_msg {
  2637. struct wcn36xx_hal_msg_header header;
  2638. /* success or failure */
  2639. u32 status;
  2640. s8 rssi;
  2641. };
  2642. struct wcn36xx_hal_get_roam_rssi_rsp_msg {
  2643. struct wcn36xx_hal_msg_header header;
  2644. /* success or failure */
  2645. u32 status;
  2646. u8 sta_id;
  2647. s8 rssi;
  2648. };
  2649. struct wcn36xx_hal_wowl_enter_rsp_msg {
  2650. struct wcn36xx_hal_msg_header header;
  2651. /* success or failure */
  2652. u32 status;
  2653. u8 bss_index;
  2654. };
  2655. struct wcn36xx_hal_wowl_exit_rsp_msg {
  2656. struct wcn36xx_hal_msg_header header;
  2657. /* success or failure */
  2658. u32 status;
  2659. u8 bss_index;
  2660. };
  2661. struct wcn36xx_hal_add_bcn_filter_rsp_msg {
  2662. struct wcn36xx_hal_msg_header header;
  2663. /* success or failure */
  2664. u32 status;
  2665. };
  2666. struct wcn36xx_hal_rem_bcn_filter_rsp_msg {
  2667. struct wcn36xx_hal_msg_header header;
  2668. /* success or failure */
  2669. u32 status;
  2670. };
  2671. struct wcn36xx_hal_add_wowl_bcast_ptrn_rsp_msg {
  2672. struct wcn36xx_hal_msg_header header;
  2673. /* success or failure */
  2674. u32 status;
  2675. u8 bss_index;
  2676. };
  2677. struct wcn36xx_hal_del_wowl_bcast_ptrn_rsp_msg {
  2678. struct wcn36xx_hal_msg_header header;
  2679. /* success or failure */
  2680. u32 status;
  2681. u8 bss_index;
  2682. };
  2683. struct wcn36xx_hal_host_offload_rsp_msg {
  2684. struct wcn36xx_hal_msg_header header;
  2685. /* success or failure */
  2686. u32 status;
  2687. };
  2688. struct wcn36xx_hal_keep_alive_rsp_msg {
  2689. struct wcn36xx_hal_msg_header header;
  2690. /* success or failure */
  2691. u32 status;
  2692. };
  2693. struct wcn36xx_hal_set_rssi_thresh_rsp_msg {
  2694. struct wcn36xx_hal_msg_header header;
  2695. /* success or failure */
  2696. u32 status;
  2697. };
  2698. struct wcn36xx_hal_set_uapsd_ac_params_rsp_msg {
  2699. struct wcn36xx_hal_msg_header header;
  2700. /* success or failure */
  2701. u32 status;
  2702. };
  2703. struct wcn36xx_hal_configure_rxp_filter_rsp_msg {
  2704. struct wcn36xx_hal_msg_header header;
  2705. /* success or failure */
  2706. u32 status;
  2707. };
  2708. struct set_max_tx_pwr_req {
  2709. struct wcn36xx_hal_msg_header header;
  2710. /* BSSID is needed to identify which session issued this request.
  2711. * As the request has power constraints, this should be applied
  2712. * only to that session */
  2713. u8 bssid[ETH_ALEN];
  2714. u8 self_addr[ETH_ALEN];
  2715. /* In request, power == MaxTx power to be used. */
  2716. u8 power;
  2717. };
  2718. struct set_max_tx_pwr_rsp_msg {
  2719. struct wcn36xx_hal_msg_header header;
  2720. /* power == tx power used for management frames */
  2721. u8 power;
  2722. /* success or failure */
  2723. u32 status;
  2724. };
  2725. struct set_tx_pwr_req_msg {
  2726. struct wcn36xx_hal_msg_header header;
  2727. /* TX Power in milli watts */
  2728. u32 tx_power;
  2729. u8 bss_index;
  2730. };
  2731. struct set_tx_pwr_rsp_msg {
  2732. struct wcn36xx_hal_msg_header header;
  2733. /* success or failure */
  2734. u32 status;
  2735. };
  2736. struct get_tx_pwr_req_msg {
  2737. struct wcn36xx_hal_msg_header header;
  2738. u8 sta_id;
  2739. };
  2740. struct get_tx_pwr_rsp_msg {
  2741. struct wcn36xx_hal_msg_header header;
  2742. /* success or failure */
  2743. u32 status;
  2744. /* TX Power in milli watts */
  2745. u32 tx_power;
  2746. };
  2747. struct set_p2p_gonoa_req_msg {
  2748. struct wcn36xx_hal_msg_header header;
  2749. u8 opp_ps;
  2750. u32 ct_window;
  2751. u8 count;
  2752. u32 duration;
  2753. u32 interval;
  2754. u32 single_noa_duration;
  2755. u8 ps_selection;
  2756. };
  2757. struct set_p2p_gonoa_rsp_msg {
  2758. struct wcn36xx_hal_msg_header header;
  2759. /* success or failure */
  2760. u32 status;
  2761. };
  2762. struct wcn36xx_hal_add_sta_self_req {
  2763. struct wcn36xx_hal_msg_header header;
  2764. u8 self_addr[ETH_ALEN];
  2765. u32 status;
  2766. } __packed;
  2767. struct wcn36xx_hal_add_sta_self_rsp_msg {
  2768. struct wcn36xx_hal_msg_header header;
  2769. /* success or failure */
  2770. u32 status;
  2771. /* Self STA Index */
  2772. u8 self_sta_index;
  2773. /* DPU Index (IGTK, PTK, GTK all same) */
  2774. u8 dpu_index;
  2775. /* DPU Signature */
  2776. u8 dpu_signature;
  2777. } __packed;
  2778. struct wcn36xx_hal_del_sta_self_req_msg {
  2779. struct wcn36xx_hal_msg_header header;
  2780. u8 self_addr[ETH_ALEN];
  2781. } __packed;
  2782. struct wcn36xx_hal_del_sta_self_rsp_msg {
  2783. struct wcn36xx_hal_msg_header header;
  2784. /*success or failure */
  2785. u32 status;
  2786. u8 self_addr[ETH_ALEN];
  2787. } __packed;
  2788. struct aggr_add_ts_req {
  2789. struct wcn36xx_hal_msg_header header;
  2790. /* Station Index */
  2791. u16 sta_idx;
  2792. /* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS.
  2793. * This will carry the bitmap with the bit positions representing
  2794. * different AC.s */
  2795. u16 tspec_index;
  2796. /* Tspec info per AC To program TPE with required parameters */
  2797. struct wcn36xx_hal_tspec_ie tspec[WCN36XX_HAL_MAX_AC];
  2798. /* U-APSD Flags: 1b per AC. Encoded as follows:
  2799. b7 b6 b5 b4 b3 b2 b1 b0 =
  2800. X X X X BE BK VI VO */
  2801. u8 uapsd;
  2802. /* These parameters are for all the access categories */
  2803. /* Service Interval */
  2804. u32 service_interval[WCN36XX_HAL_MAX_AC];
  2805. /* Suspend Interval */
  2806. u32 suspend_interval[WCN36XX_HAL_MAX_AC];
  2807. /* Delay Interval */
  2808. u32 delay_interval[WCN36XX_HAL_MAX_AC];
  2809. };
  2810. struct aggr_add_ts_rsp_msg {
  2811. struct wcn36xx_hal_msg_header header;
  2812. /* success or failure */
  2813. u32 status0;
  2814. /* FIXME PRIMA for future use for 11R */
  2815. u32 status1;
  2816. };
  2817. struct wcn36xx_hal_configure_apps_cpu_wakeup_state_req_msg {
  2818. struct wcn36xx_hal_msg_header header;
  2819. u8 is_apps_cpu_awake;
  2820. };
  2821. struct wcn36xx_hal_configure_apps_cpu_wakeup_state_rsp_msg {
  2822. struct wcn36xx_hal_msg_header header;
  2823. /* success or failure */
  2824. u32 status;
  2825. };
  2826. struct wcn36xx_hal_dump_cmd_req_msg {
  2827. struct wcn36xx_hal_msg_header header;
  2828. u32 arg1;
  2829. u32 arg2;
  2830. u32 arg3;
  2831. u32 arg4;
  2832. u32 arg5;
  2833. } __packed;
  2834. struct wcn36xx_hal_dump_cmd_rsp_msg {
  2835. struct wcn36xx_hal_msg_header header;
  2836. /* success or failure */
  2837. u32 status;
  2838. /* Length of the responce message */
  2839. u32 rsp_length;
  2840. /* FIXME: Currently considering the the responce will be less than
  2841. * 100bytes */
  2842. u8 rsp_buffer[DUMPCMD_RSP_BUFFER];
  2843. } __packed;
  2844. #define WLAN_COEX_IND_DATA_SIZE (4)
  2845. #define WLAN_COEX_IND_TYPE_DISABLE_HB_MONITOR (0)
  2846. #define WLAN_COEX_IND_TYPE_ENABLE_HB_MONITOR (1)
  2847. struct coex_ind_msg {
  2848. struct wcn36xx_hal_msg_header header;
  2849. /* Coex Indication Type */
  2850. u32 type;
  2851. /* Coex Indication Data */
  2852. u32 data[WLAN_COEX_IND_DATA_SIZE];
  2853. };
  2854. struct wcn36xx_hal_tx_compl_ind_msg {
  2855. struct wcn36xx_hal_msg_header header;
  2856. /* Tx Complete Indication Success or Failure */
  2857. u32 status;
  2858. };
  2859. struct wcn36xx_hal_wlan_host_suspend_ind_msg {
  2860. struct wcn36xx_hal_msg_header header;
  2861. u32 configured_mcst_bcst_filter_setting;
  2862. u32 active_session_count;
  2863. };
  2864. struct wcn36xx_hal_wlan_exclude_unencrpted_ind_msg {
  2865. struct wcn36xx_hal_msg_header header;
  2866. u8 dot11_exclude_unencrypted;
  2867. u8 bssid[ETH_ALEN];
  2868. };
  2869. struct noa_attr_ind_msg {
  2870. struct wcn36xx_hal_msg_header header;
  2871. u8 index;
  2872. u8 opp_ps_flag;
  2873. u16 ctwin;
  2874. u16 noa1_interval_count;
  2875. u16 bss_index;
  2876. u32 noa1_duration;
  2877. u32 noa1_interval;
  2878. u32 noa1_starttime;
  2879. u16 noa2_interval_count;
  2880. u16 reserved2;
  2881. u32 noa2_duration;
  2882. u32 noa2_interval;
  2883. u32 noa2_start_time;
  2884. u32 status;
  2885. };
  2886. struct noa_start_ind_msg {
  2887. struct wcn36xx_hal_msg_header header;
  2888. u32 status;
  2889. u32 bss_index;
  2890. };
  2891. struct wcn36xx_hal_wlan_host_resume_req_msg {
  2892. struct wcn36xx_hal_msg_header header;
  2893. u8 configured_mcst_bcst_filter_setting;
  2894. };
  2895. struct wcn36xx_hal_host_resume_rsp_msg {
  2896. struct wcn36xx_hal_msg_header header;
  2897. /* success or failure */
  2898. u32 status;
  2899. };
  2900. struct wcn36xx_hal_del_ba_ind_msg {
  2901. struct wcn36xx_hal_msg_header header;
  2902. u16 sta_idx;
  2903. /* Peer MAC Address, whose BA session has timed out */
  2904. u8 peer_addr[ETH_ALEN];
  2905. /* TID for which a BA session timeout is being triggered */
  2906. u8 ba_tid;
  2907. /* DELBA direction
  2908. * 1 - Originator
  2909. * 0 - Recipient
  2910. */
  2911. u8 direction;
  2912. u32 reason_code;
  2913. /* TO SUPPORT BT-AMP */
  2914. u8 bssid[ETH_ALEN];
  2915. };
  2916. /* PNO Messages */
  2917. /* Max number of channels that a network can be found on */
  2918. #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS 26
  2919. /* Max number of channels that a network can be found on */
  2920. #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX 60
  2921. /* Maximum numbers of networks supported by PNO */
  2922. #define WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS 16
  2923. /* The number of scan time intervals that can be programmed into PNO */
  2924. #define WCN36XX_HAL_PNO_MAX_SCAN_TIMERS 10
  2925. /* Maximum size of the probe template */
  2926. #define WCN36XX_HAL_PNO_MAX_PROBE_SIZE 450
  2927. /* Type of PNO enabling:
  2928. *
  2929. * Immediate - scanning will start immediately and PNO procedure will be
  2930. * repeated based on timer
  2931. *
  2932. * Suspend - scanning will start at suspend
  2933. *
  2934. * Resume - scanning will start on system resume
  2935. */
  2936. enum pno_mode {
  2937. PNO_MODE_IMMEDIATE,
  2938. PNO_MODE_ON_SUSPEND,
  2939. PNO_MODE_ON_RESUME,
  2940. PNO_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  2941. };
  2942. /* Authentication type */
  2943. enum auth_type {
  2944. AUTH_TYPE_ANY = 0,
  2945. AUTH_TYPE_OPEN_SYSTEM = 1,
  2946. /* Upper layer authentication types */
  2947. AUTH_TYPE_WPA = 2,
  2948. AUTH_TYPE_WPA_PSK = 3,
  2949. AUTH_TYPE_RSN = 4,
  2950. AUTH_TYPE_RSN_PSK = 5,
  2951. AUTH_TYPE_FT_RSN = 6,
  2952. AUTH_TYPE_FT_RSN_PSK = 7,
  2953. AUTH_TYPE_WAPI_WAI_CERTIFICATE = 8,
  2954. AUTH_TYPE_WAPI_WAI_PSK = 9,
  2955. AUTH_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  2956. };
  2957. /* Encryption type */
  2958. enum ed_type {
  2959. ED_ANY = 0,
  2960. ED_NONE = 1,
  2961. ED_WEP = 2,
  2962. ED_TKIP = 3,
  2963. ED_CCMP = 4,
  2964. ED_WPI = 5,
  2965. ED_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  2966. };
  2967. /* SSID broadcast type */
  2968. enum ssid_bcast_type {
  2969. BCAST_UNKNOWN = 0,
  2970. BCAST_NORMAL = 1,
  2971. BCAST_HIDDEN = 2,
  2972. BCAST_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE
  2973. };
  2974. /* The network description for which PNO will have to look for */
  2975. struct network_type {
  2976. /* SSID of the BSS */
  2977. struct wcn36xx_hal_mac_ssid ssid;
  2978. /* Authentication type for the network */
  2979. enum auth_type authentication;
  2980. /* Encryption type for the network */
  2981. enum ed_type encryption;
  2982. /* Indicate the channel on which the Network can be found 0 - if
  2983. * all channels */
  2984. u8 channel_count;
  2985. u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
  2986. /* Indicates the RSSI threshold for the network to be considered */
  2987. u8 rssi_threshold;
  2988. };
  2989. struct scan_timer {
  2990. /* How much it should wait */
  2991. u32 value;
  2992. /* How many times it should repeat that wait value 0 - keep using
  2993. * this timer until PNO is disabled */
  2994. u32 repeat;
  2995. /* e.g: 2 3 4 0 - it will wait 2s between consecutive scans for 3
  2996. * times - after that it will wait 4s between consecutive scans
  2997. * until disabled */
  2998. };
  2999. /* The network parameters to be sent to the PNO algorithm */
  3000. struct scan_timers_type {
  3001. /* set to 0 if you wish for PNO to use its default telescopic timer */
  3002. u8 count;
  3003. /* A set value represents the amount of time that PNO will wait
  3004. * between two consecutive scan procedures If the desired is for a
  3005. * uniform timer that fires always at the exact same interval - one
  3006. * single value is to be set If there is a desire for a more
  3007. * complex - telescopic like timer multiple values can be set -
  3008. * once PNO reaches the end of the array it will continue scanning
  3009. * at intervals presented by the last value */
  3010. struct scan_timer values[WCN36XX_HAL_PNO_MAX_SCAN_TIMERS];
  3011. };
  3012. /* Preferred network list request */
  3013. struct set_pref_netw_list_req {
  3014. struct wcn36xx_hal_msg_header header;
  3015. /* Enable PNO */
  3016. u32 enable;
  3017. /* Immediate, On Suspend, On Resume */
  3018. enum pno_mode mode;
  3019. /* Number of networks sent for PNO */
  3020. u32 networks_count;
  3021. /* The networks that PNO needs to look for */
  3022. struct network_type networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS];
  3023. /* The scan timers required for PNO */
  3024. struct scan_timers_type scan_timers;
  3025. /* Probe template for 2.4GHz band */
  3026. u16 band_24g_probe_size;
  3027. u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
  3028. /* Probe template for 5GHz band */
  3029. u16 band_5g_probe_size;
  3030. u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
  3031. };
  3032. /* The network description for which PNO will have to look for */
  3033. struct network_type_new {
  3034. /* SSID of the BSS */
  3035. struct wcn36xx_hal_mac_ssid ssid;
  3036. /* Authentication type for the network */
  3037. enum auth_type authentication;
  3038. /* Encryption type for the network */
  3039. enum ed_type encryption;
  3040. /* SSID broadcast type, normal, hidden or unknown */
  3041. enum ssid_bcast_type bcast_network_type;
  3042. /* Indicate the channel on which the Network can be found 0 - if
  3043. * all channels */
  3044. u8 channel_count;
  3045. u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
  3046. /* Indicates the RSSI threshold for the network to be considered */
  3047. u8 rssi_threshold;
  3048. };
  3049. /* Preferred network list request new */
  3050. struct set_pref_netw_list_req_new {
  3051. struct wcn36xx_hal_msg_header header;
  3052. /* Enable PNO */
  3053. u32 enable;
  3054. /* Immediate, On Suspend, On Resume */
  3055. enum pno_mode mode;
  3056. /* Number of networks sent for PNO */
  3057. u32 networks_count;
  3058. /* The networks that PNO needs to look for */
  3059. struct network_type_new networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS];
  3060. /* The scan timers required for PNO */
  3061. struct scan_timers_type scan_timers;
  3062. /* Probe template for 2.4GHz band */
  3063. u16 band_24g_probe_size;
  3064. u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
  3065. /* Probe template for 5GHz band */
  3066. u16 band_5g_probe_size;
  3067. u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE];
  3068. };
  3069. /* Preferred network list response */
  3070. struct set_pref_netw_list_resp {
  3071. struct wcn36xx_hal_msg_header header;
  3072. /* status of the request - just to indicate that PNO has
  3073. * acknowledged the request and will start scanning */
  3074. u32 status;
  3075. };
  3076. /* Preferred network found indication */
  3077. struct pref_netw_found_ind {
  3078. struct wcn36xx_hal_msg_header header;
  3079. /* Network that was found with the highest RSSI */
  3080. struct wcn36xx_hal_mac_ssid ssid;
  3081. /* Indicates the RSSI */
  3082. u8 rssi;
  3083. };
  3084. /* RSSI Filter request */
  3085. struct set_rssi_filter_req {
  3086. struct wcn36xx_hal_msg_header header;
  3087. /* RSSI Threshold */
  3088. u8 rssi_threshold;
  3089. };
  3090. /* Set RSSI filter resp */
  3091. struct set_rssi_filter_resp {
  3092. struct wcn36xx_hal_msg_header header;
  3093. /* status of the request */
  3094. u32 status;
  3095. };
  3096. /* Update scan params - sent from host to PNO to be used during PNO
  3097. * scanningx */
  3098. struct wcn36xx_hal_update_scan_params_req {
  3099. struct wcn36xx_hal_msg_header header;
  3100. /* Host setting for 11d */
  3101. u8 dot11d_enabled;
  3102. /* Lets PNO know that host has determined the regulatory domain */
  3103. u8 dot11d_resolved;
  3104. /* Channels on which PNO is allowed to scan */
  3105. u8 channel_count;
  3106. u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS];
  3107. /* Minimum channel time */
  3108. u16 active_min_ch_time;
  3109. /* Maximum channel time */
  3110. u16 active_max_ch_time;
  3111. /* Minimum channel time */
  3112. u16 passive_min_ch_time;
  3113. /* Maximum channel time */
  3114. u16 passive_max_ch_time;
  3115. /* Cb State */
  3116. enum phy_chan_bond_state state;
  3117. } __packed;
  3118. /* Update scan params - sent from host to PNO to be used during PNO
  3119. * scanningx */
  3120. struct update_scan_params_req_ex {
  3121. struct wcn36xx_hal_msg_header header;
  3122. /* Host setting for 11d */
  3123. u8 dot11d_enabled;
  3124. /* Lets PNO know that host has determined the regulatory domain */
  3125. u8 dot11d_resolved;
  3126. /* Channels on which PNO is allowed to scan */
  3127. u8 channel_count;
  3128. u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX];
  3129. /* Minimum channel time */
  3130. u16 active_min_ch_time;
  3131. /* Maximum channel time */
  3132. u16 active_max_ch_time;
  3133. /* Minimum channel time */
  3134. u16 passive_min_ch_time;
  3135. /* Maximum channel time */
  3136. u16 passive_max_ch_time;
  3137. /* Cb State */
  3138. enum phy_chan_bond_state state;
  3139. };
  3140. /* Update scan params - sent from host to PNO to be used during PNO
  3141. * scanningx */
  3142. struct wcn36xx_hal_update_scan_params_resp {
  3143. struct wcn36xx_hal_msg_header header;
  3144. /* status of the request */
  3145. u32 status;
  3146. } __packed;
  3147. struct wcn36xx_hal_set_tx_per_tracking_req_msg {
  3148. struct wcn36xx_hal_msg_header header;
  3149. /* 0: disable, 1:enable */
  3150. u8 tx_per_tracking_enable;
  3151. /* Check period, unit is sec. */
  3152. u8 tx_per_tracking_period;
  3153. /* (Fail TX packet)/(Total TX packet) ratio, the unit is 10%. */
  3154. u8 tx_per_tracking_ratio;
  3155. /* A watermark of check number, once the tx packet exceed this
  3156. * number, we do the check, default is 5 */
  3157. u32 tx_per_tracking_watermark;
  3158. };
  3159. struct wcn36xx_hal_set_tx_per_tracking_rsp_msg {
  3160. struct wcn36xx_hal_msg_header header;
  3161. /* success or failure */
  3162. u32 status;
  3163. };
  3164. struct tx_per_hit_ind_msg {
  3165. struct wcn36xx_hal_msg_header header;
  3166. };
  3167. /* Packet Filtering Definitions Begin */
  3168. #define WCN36XX_HAL_PROTOCOL_DATA_LEN 8
  3169. #define WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS 240
  3170. #define WCN36XX_HAL_MAX_NUM_FILTERS 20
  3171. #define WCN36XX_HAL_MAX_CMP_PER_FILTER 10
  3172. enum wcn36xx_hal_receive_packet_filter_type {
  3173. HAL_RCV_FILTER_TYPE_INVALID,
  3174. HAL_RCV_FILTER_TYPE_FILTER_PKT,
  3175. HAL_RCV_FILTER_TYPE_BUFFER_PKT,
  3176. HAL_RCV_FILTER_TYPE_MAX_ENUM_SIZE
  3177. };
  3178. enum wcn36xx_hal_rcv_pkt_flt_protocol_type {
  3179. HAL_FILTER_PROTO_TYPE_INVALID,
  3180. HAL_FILTER_PROTO_TYPE_MAC,
  3181. HAL_FILTER_PROTO_TYPE_ARP,
  3182. HAL_FILTER_PROTO_TYPE_IPV4,
  3183. HAL_FILTER_PROTO_TYPE_IPV6,
  3184. HAL_FILTER_PROTO_TYPE_UDP,
  3185. HAL_FILTER_PROTO_TYPE_MAX
  3186. };
  3187. enum wcn36xx_hal_rcv_pkt_flt_cmp_flag_type {
  3188. HAL_FILTER_CMP_TYPE_INVALID,
  3189. HAL_FILTER_CMP_TYPE_EQUAL,
  3190. HAL_FILTER_CMP_TYPE_MASK_EQUAL,
  3191. HAL_FILTER_CMP_TYPE_NOT_EQUAL,
  3192. HAL_FILTER_CMP_TYPE_MAX
  3193. };
  3194. struct wcn36xx_hal_rcv_pkt_filter_params {
  3195. u8 protocol_layer;
  3196. u8 cmp_flag;
  3197. /* Length of the data to compare */
  3198. u16 data_length;
  3199. /* from start of the respective frame header */
  3200. u8 data_offset;
  3201. /* Reserved field */
  3202. u8 reserved;
  3203. /* Data to compare */
  3204. u8 compare_data[WCN36XX_HAL_PROTOCOL_DATA_LEN];
  3205. /* Mask to be applied on the received packet data before compare */
  3206. u8 data_mask[WCN36XX_HAL_PROTOCOL_DATA_LEN];
  3207. };
  3208. struct wcn36xx_hal_sessionized_rcv_pkt_filter_cfg_type {
  3209. u8 id;
  3210. u8 type;
  3211. u8 params_count;
  3212. u32 coleasce_time;
  3213. u8 bss_index;
  3214. struct wcn36xx_hal_rcv_pkt_filter_params params[1];
  3215. };
  3216. struct wcn36xx_hal_set_rcv_pkt_filter_req_msg {
  3217. struct wcn36xx_hal_msg_header header;
  3218. u8 id;
  3219. u8 type;
  3220. u8 params_count;
  3221. u32 coalesce_time;
  3222. struct wcn36xx_hal_rcv_pkt_filter_params params[1];
  3223. };
  3224. struct wcn36xx_hal_rcv_flt_mc_addr_list_type {
  3225. /* from start of the respective frame header */
  3226. u8 data_offset;
  3227. u32 mc_addr_count;
  3228. u8 mc_addr[ETH_ALEN][WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS];
  3229. u8 bss_index;
  3230. };
  3231. struct wcn36xx_hal_set_pkt_filter_rsp_msg {
  3232. struct wcn36xx_hal_msg_header header;
  3233. /* success or failure */
  3234. u32 status;
  3235. u8 bss_index;
  3236. };
  3237. struct wcn36xx_hal_rcv_flt_pkt_match_cnt_req_msg {
  3238. struct wcn36xx_hal_msg_header header;
  3239. u8 bss_index;
  3240. };
  3241. struct wcn36xx_hal_rcv_flt_pkt_match_cnt {
  3242. u8 id;
  3243. u32 match_cnt;
  3244. };
  3245. struct wcn36xx_hal_rcv_flt_pkt_match_cnt_rsp_msg {
  3246. struct wcn36xx_hal_msg_header header;
  3247. /* Success or Failure */
  3248. u32 status;
  3249. u32 match_count;
  3250. struct wcn36xx_hal_rcv_flt_pkt_match_cnt
  3251. matches[WCN36XX_HAL_MAX_NUM_FILTERS];
  3252. u8 bss_index;
  3253. };
  3254. struct wcn36xx_hal_rcv_flt_pkt_clear_param {
  3255. /* only valid for response message */
  3256. u32 status;
  3257. u8 id;
  3258. u8 bss_index;
  3259. };
  3260. struct wcn36xx_hal_rcv_flt_pkt_clear_req_msg {
  3261. struct wcn36xx_hal_msg_header header;
  3262. struct wcn36xx_hal_rcv_flt_pkt_clear_param param;
  3263. };
  3264. struct wcn36xx_hal_rcv_flt_pkt_clear_rsp_msg {
  3265. struct wcn36xx_hal_msg_header header;
  3266. struct wcn36xx_hal_rcv_flt_pkt_clear_param param;
  3267. };
  3268. struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_req_msg {
  3269. struct wcn36xx_hal_msg_header header;
  3270. struct wcn36xx_hal_rcv_flt_mc_addr_list_type mc_addr_list;
  3271. };
  3272. struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_rsp_msg {
  3273. struct wcn36xx_hal_msg_header header;
  3274. u32 status;
  3275. u8 bss_index;
  3276. };
  3277. /* Packet Filtering Definitions End */
  3278. struct wcn36xx_hal_set_power_params_req_msg {
  3279. struct wcn36xx_hal_msg_header header;
  3280. /* Ignore DTIM */
  3281. u32 ignore_dtim;
  3282. /* DTIM Period */
  3283. u32 dtim_period;
  3284. /* Listen Interval */
  3285. u32 listen_interval;
  3286. /* Broadcast Multicast Filter */
  3287. u32 bcast_mcast_filter;
  3288. /* Beacon Early Termination */
  3289. u32 enable_bet;
  3290. /* Beacon Early Termination Interval */
  3291. u32 bet_interval;
  3292. } __packed;
  3293. struct wcn36xx_hal_set_power_params_resp {
  3294. struct wcn36xx_hal_msg_header header;
  3295. /* status of the request */
  3296. u32 status;
  3297. } __packed;
  3298. /* Capability bitmap exchange definitions and macros starts */
  3299. enum place_holder_in_cap_bitmap {
  3300. MCC = 0,
  3301. P2P = 1,
  3302. DOT11AC = 2,
  3303. SLM_SESSIONIZATION = 3,
  3304. DOT11AC_OPMODE = 4,
  3305. SAP32STA = 5,
  3306. TDLS = 6,
  3307. P2P_GO_NOA_DECOUPLE_INIT_SCAN = 7,
  3308. WLANACTIVE_OFFLOAD = 8,
  3309. BEACON_OFFLOAD = 9,
  3310. SCAN_OFFLOAD = 10,
  3311. ROAM_OFFLOAD = 11,
  3312. BCN_MISS_OFFLOAD = 12,
  3313. STA_POWERSAVE = 13,
  3314. STA_ADVANCED_PWRSAVE = 14,
  3315. AP_UAPSD = 15,
  3316. AP_DFS = 16,
  3317. BLOCKACK = 17,
  3318. PHY_ERR = 18,
  3319. BCN_FILTER = 19,
  3320. RTT = 20,
  3321. RATECTRL = 21,
  3322. WOW = 22,
  3323. MAX_FEATURE_SUPPORTED = 128,
  3324. };
  3325. #define WCN36XX_HAL_CAPS_SIZE 4
  3326. struct wcn36xx_hal_feat_caps_msg {
  3327. struct wcn36xx_hal_msg_header header;
  3328. u32 feat_caps[WCN36XX_HAL_CAPS_SIZE];
  3329. } __packed;
  3330. /* status codes to help debug rekey failures */
  3331. enum gtk_rekey_status {
  3332. WCN36XX_HAL_GTK_REKEY_STATUS_SUCCESS = 0,
  3333. /* rekey detected, but not handled */
  3334. WCN36XX_HAL_GTK_REKEY_STATUS_NOT_HANDLED = 1,
  3335. /* MIC check error on M1 */
  3336. WCN36XX_HAL_GTK_REKEY_STATUS_MIC_ERROR = 2,
  3337. /* decryption error on M1 */
  3338. WCN36XX_HAL_GTK_REKEY_STATUS_DECRYPT_ERROR = 3,
  3339. /* M1 replay detected */
  3340. WCN36XX_HAL_GTK_REKEY_STATUS_REPLAY_ERROR = 4,
  3341. /* missing GTK key descriptor in M1 */
  3342. WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_KDE = 5,
  3343. /* missing iGTK key descriptor in M1 */
  3344. WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_IGTK_KDE = 6,
  3345. /* key installation error */
  3346. WCN36XX_HAL_GTK_REKEY_STATUS_INSTALL_ERROR = 7,
  3347. /* iGTK key installation error */
  3348. WCN36XX_HAL_GTK_REKEY_STATUS_IGTK_INSTALL_ERROR = 8,
  3349. /* GTK rekey M2 response TX error */
  3350. WCN36XX_HAL_GTK_REKEY_STATUS_RESP_TX_ERROR = 9,
  3351. /* non-specific general error */
  3352. WCN36XX_HAL_GTK_REKEY_STATUS_GEN_ERROR = 255
  3353. };
  3354. /* wake reason types */
  3355. enum wake_reason_type {
  3356. WCN36XX_HAL_WAKE_REASON_NONE = 0,
  3357. /* magic packet match */
  3358. WCN36XX_HAL_WAKE_REASON_MAGIC_PACKET = 1,
  3359. /* host defined pattern match */
  3360. WCN36XX_HAL_WAKE_REASON_PATTERN_MATCH = 2,
  3361. /* EAP-ID frame detected */
  3362. WCN36XX_HAL_WAKE_REASON_EAPID_PACKET = 3,
  3363. /* start of EAPOL 4-way handshake detected */
  3364. WCN36XX_HAL_WAKE_REASON_EAPOL4WAY_PACKET = 4,
  3365. /* network scan offload match */
  3366. WCN36XX_HAL_WAKE_REASON_NETSCAN_OFFL_MATCH = 5,
  3367. /* GTK rekey status wakeup (see status) */
  3368. WCN36XX_HAL_WAKE_REASON_GTK_REKEY_STATUS = 6,
  3369. /* BSS connection lost */
  3370. WCN36XX_HAL_WAKE_REASON_BSS_CONN_LOST = 7,
  3371. };
  3372. /*
  3373. Wake Packet which is saved at tWakeReasonParams.DataStart
  3374. This data is sent for any wake reasons that involve a packet-based wakeup :
  3375. WCN36XX_HAL_WAKE_REASON_TYPE_MAGIC_PACKET
  3376. WCN36XX_HAL_WAKE_REASON_TYPE_PATTERN_MATCH
  3377. WCN36XX_HAL_WAKE_REASON_TYPE_EAPID_PACKET
  3378. WCN36XX_HAL_WAKE_REASON_TYPE_EAPOL4WAY_PACKET
  3379. WCN36XX_HAL_WAKE_REASON_TYPE_GTK_REKEY_STATUS
  3380. The information is provided to the host for auditing and debug purposes
  3381. */
  3382. /* Wake reason indication */
  3383. struct wcn36xx_hal_wake_reason_ind {
  3384. struct wcn36xx_hal_msg_header header;
  3385. /* see tWakeReasonType */
  3386. u32 reason;
  3387. /* argument specific to the reason type */
  3388. u32 reason_arg;
  3389. /* length of optional data stored in this message, in case HAL
  3390. * truncates the data (i.e. data packets) this length will be less
  3391. * than the actual length */
  3392. u32 stored_data_len;
  3393. /* actual length of data */
  3394. u32 actual_data_len;
  3395. /* variable length start of data (length == storedDataLen) see
  3396. * specific wake type */
  3397. u8 data_start[1];
  3398. u32 bss_index:8;
  3399. u32 reserved:24;
  3400. };
  3401. #define WCN36XX_HAL_GTK_KEK_BYTES 16
  3402. #define WCN36XX_HAL_GTK_KCK_BYTES 16
  3403. #define WCN36XX_HAL_GTK_OFFLOAD_FLAGS_DISABLE (1 << 0)
  3404. #define GTK_SET_BSS_KEY_TAG 0x1234AA55
  3405. struct wcn36xx_hal_gtk_offload_req_msg {
  3406. struct wcn36xx_hal_msg_header header;
  3407. /* optional flags */
  3408. u32 flags;
  3409. /* Key confirmation key */
  3410. u8 kck[WCN36XX_HAL_GTK_KCK_BYTES];
  3411. /* key encryption key */
  3412. u8 kek[WCN36XX_HAL_GTK_KEK_BYTES];
  3413. /* replay counter */
  3414. u64 key_replay_counter;
  3415. u8 bss_index;
  3416. };
  3417. struct wcn36xx_hal_gtk_offload_rsp_msg {
  3418. struct wcn36xx_hal_msg_header header;
  3419. /* success or failure */
  3420. u32 status;
  3421. u8 bss_index;
  3422. };
  3423. struct wcn36xx_hal_gtk_offload_get_info_req_msg {
  3424. struct wcn36xx_hal_msg_header header;
  3425. u8 bss_index;
  3426. };
  3427. struct wcn36xx_hal_gtk_offload_get_info_rsp_msg {
  3428. struct wcn36xx_hal_msg_header header;
  3429. /* success or failure */
  3430. u32 status;
  3431. /* last rekey status when the rekey was offloaded */
  3432. u32 last_rekey_status;
  3433. /* current replay counter value */
  3434. u64 key_replay_counter;
  3435. /* total rekey attempts */
  3436. u32 total_rekey_count;
  3437. /* successful GTK rekeys */
  3438. u32 gtk_rekey_count;
  3439. /* successful iGTK rekeys */
  3440. u32 igtk_rekey_count;
  3441. u8 bss_index;
  3442. };
  3443. struct dhcp_info {
  3444. /* Indicates the device mode which indicates about the DHCP activity */
  3445. u8 device_mode;
  3446. u8 addr[ETH_ALEN];
  3447. };
  3448. struct dhcp_ind_status {
  3449. struct wcn36xx_hal_msg_header header;
  3450. /* success or failure */
  3451. u32 status;
  3452. };
  3453. /*
  3454. * Thermal Mitigation mode of operation.
  3455. *
  3456. * WCN36XX_HAL_THERMAL_MITIGATION_MODE_0 - Based on AMPDU disabling aggregation
  3457. *
  3458. * WCN36XX_HAL_THERMAL_MITIGATION_MODE_1 - Based on AMPDU disabling aggregation
  3459. * and reducing transmit power
  3460. *
  3461. * WCN36XX_HAL_THERMAL_MITIGATION_MODE_2 - Not supported */
  3462. enum wcn36xx_hal_thermal_mitigation_mode_type {
  3463. HAL_THERMAL_MITIGATION_MODE_INVALID = -1,
  3464. HAL_THERMAL_MITIGATION_MODE_0,
  3465. HAL_THERMAL_MITIGATION_MODE_1,
  3466. HAL_THERMAL_MITIGATION_MODE_2,
  3467. HAL_THERMAL_MITIGATION_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
  3468. };
  3469. /*
  3470. * Thermal Mitigation level.
  3471. * Note the levels are incremental i.e WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 =
  3472. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 +
  3473. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1
  3474. *
  3475. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 - lowest level of thermal mitigation.
  3476. * This level indicates normal mode of operation
  3477. *
  3478. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1 - 1st level of thermal mitigation
  3479. *
  3480. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 - 2nd level of thermal mitigation
  3481. *
  3482. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_3 - 3rd level of thermal mitigation
  3483. *
  3484. * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_4 - 4th level of thermal mitigation
  3485. */
  3486. enum wcn36xx_hal_thermal_mitigation_level_type {
  3487. HAL_THERMAL_MITIGATION_LEVEL_INVALID = -1,
  3488. HAL_THERMAL_MITIGATION_LEVEL_0,
  3489. HAL_THERMAL_MITIGATION_LEVEL_1,
  3490. HAL_THERMAL_MITIGATION_LEVEL_2,
  3491. HAL_THERMAL_MITIGATION_LEVEL_3,
  3492. HAL_THERMAL_MITIGATION_LEVEL_4,
  3493. HAL_THERMAL_MITIGATION_LEVEL_MAX = WCN36XX_HAL_MAX_ENUM_SIZE,
  3494. };
  3495. /* WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ */
  3496. struct set_thermal_mitigation_req_msg {
  3497. struct wcn36xx_hal_msg_header header;
  3498. /* Thermal Mitigation Operation Mode */
  3499. enum wcn36xx_hal_thermal_mitigation_mode_type mode;
  3500. /* Thermal Mitigation Level */
  3501. enum wcn36xx_hal_thermal_mitigation_level_type level;
  3502. };
  3503. struct set_thermal_mitigation_resp {
  3504. struct wcn36xx_hal_msg_header header;
  3505. /* status of the request */
  3506. u32 status;
  3507. };
  3508. /* Per STA Class B Statistics. Class B statistics are STA TX/RX stats
  3509. * provided to FW from Host via periodic messages */
  3510. struct stats_class_b_ind {
  3511. struct wcn36xx_hal_msg_header header;
  3512. /* Duration over which this stats was collected */
  3513. u32 duration;
  3514. /* Per STA Stats */
  3515. /* TX stats */
  3516. u32 tx_bytes_pushed;
  3517. u32 tx_packets_pushed;
  3518. /* RX stats */
  3519. u32 rx_bytes_rcvd;
  3520. u32 rx_packets_rcvd;
  3521. u32 rx_time_total;
  3522. };
  3523. #endif /* _HAL_H_ */