wlan_cfg.c 98 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #if defined(CONFIG_HL_SUPPORT)
  20. #include "wlan_tgt_def_config_hl.h"
  21. #else
  22. #include "wlan_tgt_def_config.h"
  23. #endif
  24. #include "qdf_trace.h"
  25. #include "qdf_mem.h"
  26. #include <cdp_txrx_ops.h>
  27. #include "wlan_cfg.h"
  28. #include "cfg_ucfg_api.h"
  29. #include "hal_api.h"
  30. #include "dp_types.h"
  31. #include <qdf_module.h>
  32. /*
  33. * The max allowed size for tx comp ring is 8191.
  34. * This is limited by h/w ring max size.
  35. * As this is not a power of 2 it does not work with nss offload so the
  36. * nearest available size which is power of 2 is 4096 chosen for nss
  37. */
  38. #define WLAN_CFG_TX_RING_MASK_0 BIT(0)
  39. #define WLAN_CFG_TX_RING_MASK_1 BIT(1)
  40. #define WLAN_CFG_TX_RING_MASK_2 BIT(2)
  41. #define WLAN_CFG_TX_RING_MASK_3 BIT(3)
  42. #define WLAN_CFG_TX_RING_MASK_4 BIT(4)
  43. #define WLAN_CFG_TX_RING_MASK_5 BIT(5)
  44. #define WLAN_CFG_TX_RING_MASK_6 BIT(6)
  45. #define WLAN_CFG_TX_RING_MASK_7 BIT(7)
  46. #define WLAN_CFG_RX_MON_RING_MASK_0 0x1
  47. #define WLAN_CFG_RX_MON_RING_MASK_1 0x2
  48. #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
  49. #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
  50. #define WLAN_CFG_TX_MON_RING_MASK_0 BIT(0)
  51. #define WLAN_CFG_TX_MON_RING_MASK_1 BIT(1)
  52. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
  53. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
  54. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
  55. #define WLAN_CFG_HOST2TXMON_RING_MASK_0 0x1
  56. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
  57. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
  58. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
  59. #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
  60. #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
  61. #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
  62. #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
  63. #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
  64. #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
  65. #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
  66. #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
  67. #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
  68. #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
  69. #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
  70. #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
  71. #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
  72. #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
  73. #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
  74. #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
  75. #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
  76. #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
  77. #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
  78. #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
  79. struct dp_int_mask_assignment {
  80. uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  81. uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  82. uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  83. uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  84. uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  85. uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  86. uint8_t rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  87. uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  88. uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  89. uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  90. uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  91. uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  92. uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  93. uint8_t host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  94. uint8_t tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  95. };
  96. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  97. /*
  98. * For BE, there are 18 available MSI interrupts, assigned in the manner
  99. * below.
  100. * TX(5) + RX(8) + (REO ERR + WBM ERR)(1) +
  101. * (REO status + RXDMA[0] + RXDMA[1])(1) + NEAR_Full_RX(2) + NEAR_Full_TX(1)
  102. * For IPA_OFFLOAD enabled case, 2 TX/RX rings would be assigned to IPA.
  103. */
  104. #ifdef CONFIG_BERYLLIUM
  105. #ifdef IPA_OFFLOAD
  106. /*
  107. * NEAR-FULL IRQ mask should be updated, if any change is made to
  108. * the below TX mask.
  109. */
  110. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  111. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_6,
  112. [2] = WLAN_CFG_TX_RING_MASK_7};
  113. #else
  114. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  115. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_4,
  116. [2] = WLAN_CFG_TX_RING_MASK_2, [3] = WLAN_CFG_TX_RING_MASK_6,
  117. [4] = WLAN_CFG_TX_RING_MASK_7};
  118. #endif /* IPA_OFFLOAD */
  119. static inline const
  120. uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
  121. {
  122. return &tx_ring_mask_msi[0];
  123. }
  124. #else
  125. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  126. [0] = WLAN_CFG_TX_RING_MASK_0};
  127. #ifdef TX_MULTI_TCL
  128. static const uint8_t multi_tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  129. [0] = WLAN_CFG_TX_RING_MASK_0, [4] = WLAN_CFG_TX_RING_MASK_2};
  130. #ifdef IPA_OFFLOAD
  131. static inline const
  132. uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
  133. {
  134. if (cfg_ctx->ipa_enabled)
  135. return &tx_ring_mask_msi[0];
  136. return &multi_tx_ring_mask_msi[0];
  137. }
  138. #else
  139. static inline const
  140. uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
  141. {
  142. return &multi_tx_ring_mask_msi[0];
  143. }
  144. #endif /* IPA_OFFLOAD */
  145. #else
  146. static inline const
  147. uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
  148. {
  149. return &tx_ring_mask_msi[0];
  150. }
  151. #endif /* TX_MULTI_TCL */
  152. #endif /* CONFIG_BERYLLIUM */
  153. #ifdef CONFIG_BERYLLIUM
  154. #ifdef IPA_OFFLOAD
  155. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  156. [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
  157. [7] = WLAN_CFG_RX_RING_MASK_2, [9] = WLAN_CFG_RX_RING_MASK_4,
  158. [10] = WLAN_CFG_RX_RING_MASK_5, [11] = WLAN_CFG_RX_RING_MASK_6};
  159. #else
  160. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  161. [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
  162. [7] = WLAN_CFG_RX_RING_MASK_2, [8] = WLAN_CFG_RX_RING_MASK_3,
  163. [9] = WLAN_CFG_RX_RING_MASK_4, [10] = WLAN_CFG_RX_RING_MASK_5,
  164. [11] = WLAN_CFG_RX_RING_MASK_6, [12] = WLAN_CFG_RX_RING_MASK_7};
  165. #endif /* IPA_OFFLOAD */
  166. #else /* !defined(CONFIG_BERYLLIUM) */
  167. #ifdef IPA_OFFLOAD
  168. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  169. [1] = WLAN_CFG_RX_RING_MASK_0, [2] = WLAN_CFG_RX_RING_MASK_1,
  170. [3] = WLAN_CFG_RX_RING_MASK_2};
  171. #else
  172. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  173. [1] = WLAN_CFG_RX_RING_MASK_0, [2] = WLAN_CFG_RX_RING_MASK_1,
  174. [3] = WLAN_CFG_RX_RING_MASK_2 | WLAN_CFG_RX_RING_MASK_3};
  175. #endif
  176. #endif /* CONFIG_BERYLLIUM */
  177. #ifdef CONFIG_BERYLLIUM
  178. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  179. [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0};
  180. #else
  181. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  182. [6] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  183. WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  184. #endif /* CONFIG_BERYLLIUM */
  185. #ifdef CONFIG_BERYLLIUM
  186. static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  187. [5] = WLAN_CFG_RX_MON_RING_MASK_0};
  188. #else
  189. static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  190. [1] = WLAN_CFG_RX_MON_RING_MASK_0, [2] = WLAN_CFG_RX_MON_RING_MASK_1};
  191. #endif
  192. static const uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  193. static const uint8_t host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  194. static const uint8_t rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  195. #ifdef CONFIG_BERYLLIUM
  196. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  197. [14] = WLAN_CFG_RX_ERR_RING_MASK_0};
  198. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  199. [14] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  200. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  201. [13] = WLAN_CFG_REO_STATUS_RING_MASK_0};
  202. #else
  203. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  204. [6] = WLAN_CFG_RX_ERR_RING_MASK_0};
  205. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  206. [6] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  207. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  208. [6] = WLAN_CFG_REO_STATUS_RING_MASK_0};
  209. #endif
  210. #ifdef CONFIG_BERYLLIUM
  211. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  212. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  213. [15] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  214. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  215. [16] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  216. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  217. [17] = WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK};
  218. #else
  219. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  220. 0 };
  221. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  222. 0 };
  223. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  224. 0 };
  225. #endif
  226. #else
  227. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  228. 0 };
  229. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  230. 0 };
  231. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  232. 0 };
  233. #endif
  234. #else
  235. /* Integrated configuration + 8 possible MSI configurations */
  236. #define NUM_INTERRUPT_COMBINATIONS 9
  237. /*
  238. * This structure contains the best possible mask assignment for a given
  239. * number of MSIs available in the system.
  240. */
  241. #ifdef IPA_OFFLOAD
  242. static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
  243. /* Interrupt assignment for integrated configuration */
  244. {
  245. /* tx ring masks */
  246. { WLAN_CFG_TX_RING_MASK_0,
  247. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  248. /* rx ring masks */
  249. { 0, 0, 0, 0, 0, 0, 0,
  250. WLAN_CFG_RX_RING_MASK_0,
  251. WLAN_CFG_RX_RING_MASK_1,
  252. WLAN_CFG_RX_RING_MASK_2,
  253. 0},
  254. /* rx mon ring masks */
  255. { 0, 0, 0, 0,
  256. WLAN_CFG_RX_MON_RING_MASK_0,
  257. WLAN_CFG_RX_MON_RING_MASK_1,
  258. WLAN_CFG_RX_MON_RING_MASK_2,
  259. 0, 0, 0, 0},
  260. /* host2rxdma ring masks */
  261. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  262. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  263. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  264. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  265. 0, 0, 0, 0, 0, 0, 0},
  266. /* rxdma2host ring masks */
  267. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  268. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  269. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  270. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  271. 0, 0, 0, 0, 0, 0, 0},
  272. /* host2rxdma mon ring masks */
  273. { 0, 0, 0, 0,
  274. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  275. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  276. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  277. 0, 0, 0, 0},
  278. /* rxdma2host mon ring masks */
  279. { 0, 0, 0, 0,
  280. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  281. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  282. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  283. 0, 0, 0, 0},
  284. /* rx err ring masks */
  285. { WLAN_CFG_RX_ERR_RING_MASK_0,
  286. WLAN_CFG_RX_ERR_RING_MASK_1,
  287. WLAN_CFG_RX_ERR_RING_MASK_2,
  288. WLAN_CFG_RX_ERR_RING_MASK_3,
  289. 0, 0, 0, 0, 0, 0, 0},
  290. /* rx wbm rel ring masks */
  291. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  292. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  293. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  294. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  295. 0, 0, 0, 0, 0, 0, 0},
  296. /* reo status ring masks */
  297. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  298. WLAN_CFG_REO_STATUS_RING_MASK_1,
  299. WLAN_CFG_REO_STATUS_RING_MASK_2,
  300. WLAN_CFG_REO_STATUS_RING_MASK_3,
  301. 0, 0, 0, 0, 0, 0, 0},
  302. },
  303. /* Interrupt assignment for 1 MSI combination */
  304. {
  305. /* tx ring masks */
  306. { WLAN_CFG_TX_RING_MASK_0,
  307. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  308. /* rx ring masks */
  309. { WLAN_CFG_RX_RING_MASK_0 |
  310. WLAN_CFG_RX_RING_MASK_1 |
  311. WLAN_CFG_RX_RING_MASK_2,
  312. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  313. /* rx mon ring masks */
  314. { WLAN_CFG_RX_MON_RING_MASK_0 |
  315. WLAN_CFG_RX_MON_RING_MASK_1 |
  316. WLAN_CFG_RX_MON_RING_MASK_2,
  317. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  318. /* host2rxdma ring masks */
  319. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  320. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  321. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  322. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  323. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  324. /* rxdma2host ring masks */
  325. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  326. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  327. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  328. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  329. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  330. /* host2rxdma mon ring masks */
  331. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  332. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  333. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  334. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  335. /* rxdma2host mon ring masks */
  336. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  337. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  338. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  339. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  340. /* rx err ring masks */
  341. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  342. WLAN_CFG_RX_ERR_RING_MASK_1 |
  343. WLAN_CFG_RX_ERR_RING_MASK_2 |
  344. WLAN_CFG_RX_ERR_RING_MASK_3,
  345. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  346. /* rx wbm rel ring masks */
  347. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  348. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  349. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  350. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  351. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  352. /* reo status ring masks */
  353. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  354. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  355. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  356. WLAN_CFG_REO_STATUS_RING_MASK_3,
  357. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  358. },
  359. /* Interrupt assignment for 2 MSI combination */
  360. {
  361. /* tx ring masks */
  362. { WLAN_CFG_TX_RING_MASK_0,
  363. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  364. /* rx ring masks */
  365. { WLAN_CFG_RX_RING_MASK_0 |
  366. WLAN_CFG_RX_RING_MASK_1,
  367. WLAN_CFG_RX_RING_MASK_2,
  368. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  369. /* rx mon ring masks */
  370. { WLAN_CFG_RX_MON_RING_MASK_0 |
  371. WLAN_CFG_RX_MON_RING_MASK_1,
  372. WLAN_CFG_RX_MON_RING_MASK_2,
  373. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  374. /* host2rxdma ring masks */
  375. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  376. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  377. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  378. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  379. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  380. /* rxdma2host ring masks */
  381. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  382. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  383. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  384. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  385. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  386. /* host2rxdma mon ring masks */
  387. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  388. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  389. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  390. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  391. /* rxdma2host mon ring masks */
  392. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  393. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  394. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  395. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  396. /* rx err ring masks */
  397. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  398. WLAN_CFG_RX_ERR_RING_MASK_1,
  399. WLAN_CFG_RX_ERR_RING_MASK_2 |
  400. WLAN_CFG_RX_ERR_RING_MASK_3,
  401. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  402. /* rx wbm rel ring masks */
  403. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  404. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  405. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  406. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  407. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  408. /* reo status ring masks */
  409. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  410. WLAN_CFG_REO_STATUS_RING_MASK_1,
  411. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  412. WLAN_CFG_REO_STATUS_RING_MASK_3,
  413. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  414. },
  415. /* Interrupt assignment for 3 MSI combination */
  416. {
  417. /* tx ring masks */
  418. { WLAN_CFG_TX_RING_MASK_0,
  419. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  420. /* rx ring masks */
  421. { WLAN_CFG_RX_RING_MASK_0,
  422. WLAN_CFG_RX_RING_MASK_1,
  423. WLAN_CFG_RX_RING_MASK_2,
  424. 0, 0, 0, 0, 0, 0, 0, 0},
  425. /* rx mon ring masks */
  426. { 0, 0,
  427. WLAN_CFG_RX_MON_RING_MASK_0 |
  428. WLAN_CFG_RX_MON_RING_MASK_1 |
  429. WLAN_CFG_RX_MON_RING_MASK_2,
  430. 0, 0, 0, 0, 0, 0, 0, 0},
  431. /* host2rxdma ring masks */
  432. { 0, 0,
  433. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  434. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  435. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  436. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  437. 0, 0, 0, 0, 0, 0, 0, 0},
  438. /* rxdma2host ring masks */
  439. { 0, 0,
  440. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  441. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  442. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  443. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  444. 0, 0, 0, 0, 0, 0, 0, 0},
  445. /* host2rxdma mon ring masks */
  446. { 0, 0,
  447. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  448. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  449. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  450. 0, 0, 0, 0, 0, 0, 0, 0},
  451. /* rxdma2host mon ring masks */
  452. { 0, 0,
  453. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  454. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  455. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  456. 0, 0, 0, 0, 0, 0, 0, 0},
  457. /* rx err ring masks */
  458. { 0, 0,
  459. WLAN_CFG_RX_ERR_RING_MASK_0 |
  460. WLAN_CFG_RX_ERR_RING_MASK_1 |
  461. WLAN_CFG_RX_ERR_RING_MASK_2 |
  462. WLAN_CFG_RX_ERR_RING_MASK_3,
  463. 0, 0, 0, 0, 0, 0, 0, 0},
  464. /* rx wbm rel ring masks */
  465. { 0, 0,
  466. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  467. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  468. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  469. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  470. 0, 0, 0, 0, 0, 0, 0, 0},
  471. /* reo status ring masks */
  472. { 0, 0,
  473. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  474. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  475. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  476. WLAN_CFG_REO_STATUS_RING_MASK_3,
  477. 0, 0, 0, 0, 0, 0, 0, 0},
  478. },
  479. /* Interrupt assignment for 4 MSI combination */
  480. {
  481. /* tx ring masks */
  482. { WLAN_CFG_TX_RING_MASK_0,
  483. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  484. /* rx ring masks */
  485. { WLAN_CFG_RX_RING_MASK_0,
  486. WLAN_CFG_RX_RING_MASK_1,
  487. WLAN_CFG_RX_RING_MASK_2,
  488. 0, 0, 0, 0, 0, 0, 0, 0},
  489. /* rx mon ring masks */
  490. { WLAN_CFG_RX_MON_RING_MASK_0,
  491. WLAN_CFG_RX_MON_RING_MASK_1,
  492. WLAN_CFG_RX_MON_RING_MASK_2,
  493. 0, 0, 0, 0, 0, 0, 0, 0},
  494. /* host2rxdma ring masks */
  495. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  496. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  497. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  498. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  499. 0, 0, 0, 0, 0, 0, 0},
  500. /* rxdma2host ring masks */
  501. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  502. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  503. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  504. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  505. 0, 0, 0, 0, 0, 0, 0},
  506. /* host2rxdma mon ring masks */
  507. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  508. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  509. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  510. 0, 0, 0, 0, 0, 0, 0, 0},
  511. /* rxdma2host mon ring masks */
  512. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  513. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  514. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  515. 0, 0, 0, 0, 0, 0, 0, 0},
  516. /* rx err ring masks */
  517. { WLAN_CFG_RX_ERR_RING_MASK_0,
  518. WLAN_CFG_RX_ERR_RING_MASK_1,
  519. WLAN_CFG_RX_ERR_RING_MASK_2,
  520. WLAN_CFG_RX_ERR_RING_MASK_3,
  521. 0, 0, 0, 0, 0, 0, 0},
  522. /* rx wbm rel ring masks */
  523. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  524. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  525. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  526. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  527. 0, 0, 0, 0, 0, 0, 0},
  528. /* reo status ring masks */
  529. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  530. WLAN_CFG_REO_STATUS_RING_MASK_1,
  531. WLAN_CFG_REO_STATUS_RING_MASK_2,
  532. WLAN_CFG_REO_STATUS_RING_MASK_3,
  533. 0, 0, 0, 0, 0, 0, 0},
  534. },
  535. /* Interrupt assignment for 5 MSI combination */
  536. {
  537. /* tx ring masks */
  538. { WLAN_CFG_TX_RING_MASK_0,
  539. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  540. /* rx ring masks */
  541. { WLAN_CFG_RX_RING_MASK_0,
  542. WLAN_CFG_RX_RING_MASK_1,
  543. WLAN_CFG_RX_RING_MASK_2,
  544. 0, 0, 0, 0, 0, 0, 0, 0},
  545. /* rx mon ring masks */
  546. { 0, 0, 0, 0,
  547. WLAN_CFG_RX_MON_RING_MASK_0 |
  548. WLAN_CFG_RX_MON_RING_MASK_1 |
  549. WLAN_CFG_RX_MON_RING_MASK_2,
  550. 0, 0, 0, 0, 0, 0},
  551. /* host2rxdma ring masks */
  552. { 0, 0, 0, 0,
  553. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  554. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  555. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  556. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  557. 0, 0, 0, 0, 0, 0},
  558. /* rxdma2host ring masks */
  559. { 0, 0, 0, 0,
  560. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  561. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  562. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  563. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  564. 0, 0, 0, 0, 0, 0},
  565. /* host2rxdma mon ring masks */
  566. { 0, 0, 0, 0,
  567. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  568. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  569. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  570. 0, 0, 0, 0, 0, 0},
  571. /* rxdma2host mon ring masks */
  572. { 0, 0, 0, 0,
  573. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  574. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  575. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  576. 0, 0, 0, 0, 0, 0},
  577. /* rx err ring masks */
  578. { 0, 0, 0, 0,
  579. WLAN_CFG_RX_ERR_RING_MASK_0 |
  580. WLAN_CFG_RX_ERR_RING_MASK_1 |
  581. WLAN_CFG_RX_ERR_RING_MASK_2 |
  582. WLAN_CFG_RX_ERR_RING_MASK_3,
  583. 0, 0, 0, 0, 0, 0},
  584. /* rx wbm rel ring masks */
  585. { 0, 0, 0, 0,
  586. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  587. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  588. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  589. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  590. 0, 0, 0, 0, 0, 0},
  591. /* reo status ring masks */
  592. { 0, 0, 0, 0,
  593. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  594. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  595. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  596. WLAN_CFG_REO_STATUS_RING_MASK_3,
  597. 0, 0, 0, 0, 0, 0},
  598. },
  599. /* Interrupt assignment for 6 MSI combination */
  600. {
  601. /* tx ring masks */
  602. { WLAN_CFG_TX_RING_MASK_0,
  603. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  604. /* rx ring masks */
  605. { 0, 0,
  606. WLAN_CFG_RX_RING_MASK_0,
  607. WLAN_CFG_RX_RING_MASK_1,
  608. WLAN_CFG_RX_RING_MASK_2,
  609. 0, 0, 0, 0, 0, 0},
  610. /* rx mon ring masks */
  611. { WLAN_CFG_RX_MON_RING_MASK_0,
  612. WLAN_CFG_RX_MON_RING_MASK_1,
  613. WLAN_CFG_RX_MON_RING_MASK_2,
  614. 0, 0, 0, 0, 0, 0, 0, 0},
  615. /* host2rxdma ring masks */
  616. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  617. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  618. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  619. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  620. 0, 0, 0, 0, 0, 0, 0},
  621. /* rxdma2host ring masks */
  622. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  623. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  624. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  625. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  626. 0, 0, 0, 0, 0, 0, 0},
  627. /* host2rxdma mon ring masks */
  628. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  629. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  630. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  631. 0, 0, 0, 0, 0, 0, 0, 0},
  632. /* rxdma2host mon ring masks */
  633. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  634. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  635. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  636. 0, 0, 0, 0, 0, 0, 0, 0},
  637. /* rx err ring masks */
  638. { WLAN_CFG_RX_ERR_RING_MASK_0,
  639. WLAN_CFG_RX_ERR_RING_MASK_1,
  640. WLAN_CFG_RX_ERR_RING_MASK_2,
  641. WLAN_CFG_RX_ERR_RING_MASK_3,
  642. 0, 0, 0, 0, 0, 0, 0},
  643. /* rx wbm rel ring masks */
  644. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  645. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  646. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  647. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  648. 0, 0, 0, 0, 0, 0, 0},
  649. /* reo status ring masks */
  650. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  651. WLAN_CFG_REO_STATUS_RING_MASK_1,
  652. WLAN_CFG_REO_STATUS_RING_MASK_2,
  653. WLAN_CFG_REO_STATUS_RING_MASK_3,
  654. 0, 0, 0, 0, 0, 0, 0},
  655. },
  656. /* Interrupt assignment for 7 MSI combination */
  657. {
  658. /* tx ring masks */
  659. { WLAN_CFG_TX_RING_MASK_0,
  660. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  661. /* rx ring masks */
  662. { 0, 0, 0,
  663. WLAN_CFG_RX_RING_MASK_0,
  664. WLAN_CFG_RX_RING_MASK_1,
  665. WLAN_CFG_RX_RING_MASK_2,
  666. 0, 0, 0, 0},
  667. /* rx mon ring masks */
  668. { 0, 0, 0,
  669. WLAN_CFG_RX_MON_RING_MASK_0,
  670. WLAN_CFG_RX_MON_RING_MASK_1,
  671. WLAN_CFG_RX_MON_RING_MASK_2,
  672. 0, 0, 0, 0, 0},
  673. /* host2rxdma ring masks */
  674. { 0, 0, 0,
  675. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  676. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  677. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  678. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  679. 0, 0, 0, 0},
  680. /* rxdma2host ring masks */
  681. { 0, 0, 0,
  682. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  683. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  684. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  685. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  686. 0, 0, 0, 0},
  687. /* host2rxdma mon ring masks */
  688. { 0, 0, 0,
  689. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  690. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  691. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  692. 0, 0, 0, 0, 0},
  693. /* rxdma2host mon ring masks */
  694. { 0, 0, 0,
  695. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  696. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  697. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  698. 0, 0, 0, 0, 0},
  699. /* rx err ring masks */
  700. { 0, 0, 0,
  701. WLAN_CFG_RX_ERR_RING_MASK_0,
  702. WLAN_CFG_RX_ERR_RING_MASK_1,
  703. WLAN_CFG_RX_ERR_RING_MASK_2,
  704. WLAN_CFG_RX_ERR_RING_MASK_3,
  705. 0, 0, 0, 0},
  706. /* rx wbm rel ring masks */
  707. { 0, 0, 0,
  708. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  709. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  710. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  711. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  712. 0, 0, 0, 0},
  713. /* reo status ring masks */
  714. { 0, 0, 0,
  715. WLAN_CFG_REO_STATUS_RING_MASK_0,
  716. WLAN_CFG_REO_STATUS_RING_MASK_1,
  717. WLAN_CFG_REO_STATUS_RING_MASK_2,
  718. WLAN_CFG_REO_STATUS_RING_MASK_3,
  719. 0, 0, 0, 0},
  720. },
  721. /* Interrupt assignment for 8 MSI combination */
  722. {
  723. /* tx ring masks */
  724. { WLAN_CFG_TX_RING_MASK_0,
  725. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  726. /* rx ring masks */
  727. { 0, 0, 0, 0,
  728. WLAN_CFG_RX_RING_MASK_0,
  729. WLAN_CFG_RX_RING_MASK_1,
  730. WLAN_CFG_RX_RING_MASK_2,
  731. 0, 0, 0, 0},
  732. /* rx mon ring masks */
  733. { 0, 0, 0,
  734. WLAN_CFG_RX_MON_RING_MASK_0,
  735. WLAN_CFG_RX_MON_RING_MASK_1,
  736. WLAN_CFG_RX_MON_RING_MASK_2,
  737. 0, 0, 0, 0, 0},
  738. /* host2rxdma ring masks */
  739. { 0, 0, 0,
  740. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  741. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  742. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  743. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  744. 0, 0, 0, 0},
  745. /* rxdma2host ring masks */
  746. { 0, 0, 0,
  747. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  748. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  749. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  750. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  751. 0, 0, 0, 0},
  752. /* host2rxdma mon ring masks */
  753. { 0, 0, 0,
  754. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  755. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  756. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  757. 0, 0, 0, 0, 0},
  758. /* rxdma2host mon ring masks */
  759. { 0, 0, 0,
  760. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  761. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  762. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  763. 0, 0, 0, 0, 0},
  764. /* rx err ring masks */
  765. { 0, 0, 0,
  766. WLAN_CFG_RX_ERR_RING_MASK_0,
  767. WLAN_CFG_RX_ERR_RING_MASK_1,
  768. WLAN_CFG_RX_ERR_RING_MASK_2,
  769. WLAN_CFG_RX_ERR_RING_MASK_3,
  770. 0, 0, 0, 0},
  771. /* rx wbm rel ring masks */
  772. { 0, 0, 0,
  773. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  774. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  775. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  776. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  777. 0, 0, 0, 0},
  778. /* reo status ring masks */
  779. { 0, 0, 0,
  780. WLAN_CFG_REO_STATUS_RING_MASK_0,
  781. WLAN_CFG_REO_STATUS_RING_MASK_1,
  782. WLAN_CFG_REO_STATUS_RING_MASK_2,
  783. WLAN_CFG_REO_STATUS_RING_MASK_3,
  784. 0, 0, 0, 0},
  785. },
  786. };
  787. #else
  788. static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
  789. /* Interrupt assignment for integrated configuration */
  790. {
  791. /* tx ring masks */
  792. { WLAN_CFG_TX_RING_MASK_0,
  793. WLAN_CFG_TX_RING_MASK_1,
  794. WLAN_CFG_TX_RING_MASK_2,
  795. WLAN_CFG_TX_RING_MASK_3,
  796. 0, 0, 0, 0, 0, 0, 0},
  797. /* rx ring masks */
  798. { 0, 0, 0, 0, 0, 0, 0,
  799. WLAN_CFG_RX_RING_MASK_0,
  800. WLAN_CFG_RX_RING_MASK_1,
  801. WLAN_CFG_RX_RING_MASK_2,
  802. WLAN_CFG_RX_RING_MASK_3},
  803. /* rx mon ring masks */
  804. { 0, 0, 0, 0,
  805. WLAN_CFG_RX_MON_RING_MASK_0,
  806. WLAN_CFG_RX_MON_RING_MASK_1,
  807. WLAN_CFG_RX_MON_RING_MASK_2,
  808. 0, 0, 0, 0},
  809. /* host2rxdma ring masks */
  810. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  811. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  812. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  813. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  814. 0, 0, 0, 0, 0, 0, 0},
  815. /* rxdma2host ring masks */
  816. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  817. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  818. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  819. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  820. 0, 0, 0, 0, 0, 0, 0},
  821. /* host2rxdma mon ring masks */
  822. { 0, 0, 0, 0,
  823. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  824. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  825. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  826. 0, 0, 0, 0},
  827. /* rxdma2host mon ring masks */
  828. { 0, 0, 0, 0,
  829. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  830. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  831. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  832. 0, 0, 0, 0},
  833. /* rx err ring masks */
  834. { WLAN_CFG_RX_ERR_RING_MASK_0,
  835. WLAN_CFG_RX_ERR_RING_MASK_1,
  836. WLAN_CFG_RX_ERR_RING_MASK_2,
  837. WLAN_CFG_RX_ERR_RING_MASK_3,
  838. 0, 0, 0, 0, 0, 0, 0},
  839. /* rx wbm rel ring masks */
  840. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  841. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  842. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  843. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  844. 0, 0, 0, 0, 0, 0, 0},
  845. /* reo status ring masks */
  846. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  847. WLAN_CFG_REO_STATUS_RING_MASK_1,
  848. WLAN_CFG_REO_STATUS_RING_MASK_2,
  849. WLAN_CFG_REO_STATUS_RING_MASK_3,
  850. 0, 0, 0, 0, 0, 0, 0},
  851. /* rx_ring_near_full_irq mask */
  852. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  853. /* rx_ring_near_full_irq_2 mask */
  854. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  855. /* tx_ring_near_full_irq mask */
  856. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  857. /* host2txmon ring masks */
  858. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  859. /* tx mon ring masks */
  860. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  861. },
  862. /* Interrupt assignment for 1 MSI combination */
  863. {
  864. /* tx ring masks */
  865. { WLAN_CFG_TX_RING_MASK_0 |
  866. WLAN_CFG_TX_RING_MASK_1 |
  867. WLAN_CFG_TX_RING_MASK_2 |
  868. WLAN_CFG_TX_RING_MASK_3,
  869. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  870. /* rx ring masks */
  871. { WLAN_CFG_RX_RING_MASK_0 |
  872. WLAN_CFG_RX_RING_MASK_1 |
  873. WLAN_CFG_RX_RING_MASK_2 |
  874. WLAN_CFG_RX_RING_MASK_3,
  875. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  876. /* rx mon ring masks */
  877. { WLAN_CFG_RX_MON_RING_MASK_0 |
  878. WLAN_CFG_RX_MON_RING_MASK_1 |
  879. WLAN_CFG_RX_MON_RING_MASK_2,
  880. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  881. /* host2rxdma ring masks */
  882. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  883. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  884. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  885. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  886. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  887. /* rxdma2host ring masks */
  888. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  889. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  890. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  891. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  892. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  893. /* host2rxdma mon ring masks */
  894. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  895. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  896. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  897. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  898. /* rxdma2host mon ring masks */
  899. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  900. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  901. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  902. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  903. /* rx err ring masks */
  904. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  905. WLAN_CFG_RX_ERR_RING_MASK_1 |
  906. WLAN_CFG_RX_ERR_RING_MASK_2 |
  907. WLAN_CFG_RX_ERR_RING_MASK_3,
  908. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  909. /* rx wbm rel ring masks */
  910. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  911. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  912. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  913. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  914. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  915. /* reo status ring masks */
  916. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  917. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  918. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  919. WLAN_CFG_REO_STATUS_RING_MASK_3,
  920. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  921. /* rx_ring_near_full_irq mask */
  922. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  923. /* rx_ring_near_full_irq_2 mask */
  924. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  925. /* tx_ring_near_full_irq mask */
  926. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  927. /* host2txmon ring masks */
  928. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  929. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  930. /* tx mon ring masks */
  931. { WLAN_CFG_TX_MON_RING_MASK_0 |
  932. WLAN_CFG_TX_MON_RING_MASK_1,
  933. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  934. },
  935. /* Interrupt assignment for 2 MSI combination */
  936. {
  937. /* tx ring masks */
  938. { WLAN_CFG_TX_RING_MASK_0 |
  939. WLAN_CFG_TX_RING_MASK_1,
  940. WLAN_CFG_TX_RING_MASK_2 |
  941. WLAN_CFG_TX_RING_MASK_3,
  942. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  943. /* rx ring masks */
  944. { WLAN_CFG_RX_RING_MASK_0 |
  945. WLAN_CFG_RX_RING_MASK_1,
  946. WLAN_CFG_RX_RING_MASK_2 |
  947. WLAN_CFG_RX_RING_MASK_3,
  948. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  949. /* rx mon ring masks */
  950. { WLAN_CFG_RX_MON_RING_MASK_0 |
  951. WLAN_CFG_RX_MON_RING_MASK_1,
  952. WLAN_CFG_RX_MON_RING_MASK_2,
  953. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  954. /* host2rxdma ring masks */
  955. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  956. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  957. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  958. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  959. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  960. /* rxdma2host ring masks */
  961. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  962. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  963. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  964. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  965. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  966. /* host2rxdma mon ring masks */
  967. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  968. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  969. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  970. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  971. /* rxdma2host mon ring masks */
  972. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  973. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  974. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  975. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  976. /* rx err ring masks */
  977. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  978. WLAN_CFG_RX_ERR_RING_MASK_1,
  979. WLAN_CFG_RX_ERR_RING_MASK_2 |
  980. WLAN_CFG_RX_ERR_RING_MASK_3,
  981. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  982. /* rx wbm rel ring masks */
  983. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  984. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  985. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  986. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  987. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  988. /* reo status ring masks */
  989. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  990. WLAN_CFG_REO_STATUS_RING_MASK_1,
  991. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  992. WLAN_CFG_REO_STATUS_RING_MASK_3,
  993. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  994. /* rx_ring_near_full_irq mask */
  995. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  996. /* rx_ring_near_full_irq_2 mask */
  997. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  998. /* tx_ring_near_full_irq mask */
  999. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1000. /* host2txmon ring masks */
  1001. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1002. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1003. /* tx mon ring masks */
  1004. { WLAN_CFG_TX_MON_RING_MASK_0,
  1005. WLAN_CFG_TX_MON_RING_MASK_1,
  1006. 0, 0, 0, 0, 0, 0},
  1007. },
  1008. /* Interrupt assignment for 3 MSI combination */
  1009. {
  1010. /* tx ring masks */
  1011. { WLAN_CFG_TX_RING_MASK_0 |
  1012. WLAN_CFG_TX_RING_MASK_1,
  1013. WLAN_CFG_TX_RING_MASK_2 |
  1014. WLAN_CFG_TX_RING_MASK_3,
  1015. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1016. /* rx ring masks */
  1017. { WLAN_CFG_RX_RING_MASK_0 |
  1018. WLAN_CFG_RX_RING_MASK_1,
  1019. WLAN_CFG_RX_RING_MASK_2 |
  1020. WLAN_CFG_RX_RING_MASK_3,
  1021. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1022. /* rx mon ring masks */
  1023. { 0, 0,
  1024. WLAN_CFG_RX_MON_RING_MASK_0 |
  1025. WLAN_CFG_RX_MON_RING_MASK_1 |
  1026. WLAN_CFG_RX_MON_RING_MASK_2,
  1027. 0, 0, 0, 0, 0, 0, 0, 0},
  1028. /* host2rxdma ring masks */
  1029. { 0, 0,
  1030. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  1031. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  1032. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  1033. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1034. 0, 0, 0, 0, 0, 0, 0, 0},
  1035. /* rxdma2host ring masks */
  1036. { 0, 0,
  1037. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  1038. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  1039. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  1040. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1041. 0, 0, 0, 0, 0, 0, 0, 0},
  1042. /* host2rxdma mon ring masks */
  1043. { 0, 0,
  1044. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  1045. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  1046. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1047. 0, 0, 0, 0, 0, 0, 0, 0},
  1048. /* rxdma2host mon ring masks */
  1049. { 0, 0,
  1050. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  1051. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  1052. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1053. 0, 0, 0, 0, 0, 0, 0, 0},
  1054. /* rx err ring masks */
  1055. { 0, 0,
  1056. WLAN_CFG_RX_ERR_RING_MASK_0 |
  1057. WLAN_CFG_RX_ERR_RING_MASK_1 |
  1058. WLAN_CFG_RX_ERR_RING_MASK_2 |
  1059. WLAN_CFG_RX_ERR_RING_MASK_3,
  1060. 0, 0, 0, 0, 0, 0, 0, 0},
  1061. /* rx wbm rel ring masks */
  1062. { 0, 0,
  1063. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  1064. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  1065. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  1066. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1067. 0, 0, 0, 0, 0, 0, 0, 0},
  1068. /* reo status ring masks */
  1069. { 0, 0,
  1070. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  1071. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  1072. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  1073. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1074. 0, 0, 0, 0, 0, 0, 0, 0},
  1075. /* rx_ring_near_full_irq mask */
  1076. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1077. /* rx_ring_near_full_irq_2 mask */
  1078. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1079. /* tx_ring_near_full_irq mask */
  1080. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1081. /* host2txmon ring masks */
  1082. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1083. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1084. /* tx mon ring masks */
  1085. { WLAN_CFG_TX_MON_RING_MASK_0,
  1086. WLAN_CFG_TX_MON_RING_MASK_1,
  1087. 0, 0, 0, 0, 0, 0},
  1088. },
  1089. /* Interrupt assignment for 4 MSI combination */
  1090. {
  1091. /* tx ring masks */
  1092. { WLAN_CFG_TX_RING_MASK_0,
  1093. WLAN_CFG_TX_RING_MASK_1,
  1094. WLAN_CFG_TX_RING_MASK_2,
  1095. WLAN_CFG_TX_RING_MASK_3,
  1096. 0, 0, 0, 0, 0, 0, 0},
  1097. /* rx ring masks */
  1098. { WLAN_CFG_RX_RING_MASK_0,
  1099. WLAN_CFG_RX_RING_MASK_1,
  1100. WLAN_CFG_RX_RING_MASK_2,
  1101. WLAN_CFG_RX_RING_MASK_3,
  1102. 0, 0, 0, 0, 0, 0, 0},
  1103. /* rx mon ring masks */
  1104. { WLAN_CFG_RX_MON_RING_MASK_0,
  1105. WLAN_CFG_RX_MON_RING_MASK_1,
  1106. WLAN_CFG_RX_MON_RING_MASK_2,
  1107. 0, 0, 0, 0, 0, 0, 0, 0},
  1108. /* host2rxdma ring masks */
  1109. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1110. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1111. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1112. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1113. 0, 0, 0, 0, 0, 0, 0},
  1114. /* rxdma2host ring masks */
  1115. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1116. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1117. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1118. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1119. 0, 0, 0, 0, 0, 0, 0},
  1120. /* host2rxdma mon ring masks */
  1121. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1122. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1123. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1124. 0, 0, 0, 0, 0, 0, 0, 0},
  1125. /* rxdma2host mon ring masks */
  1126. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1127. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1128. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1129. 0, 0, 0, 0, 0, 0, 0, 0},
  1130. /* rx err ring masks */
  1131. { WLAN_CFG_RX_ERR_RING_MASK_0,
  1132. WLAN_CFG_RX_ERR_RING_MASK_1,
  1133. WLAN_CFG_RX_ERR_RING_MASK_2,
  1134. WLAN_CFG_RX_ERR_RING_MASK_3,
  1135. 0, 0, 0, 0, 0, 0, 0},
  1136. /* rx wbm rel ring masks */
  1137. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1138. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1139. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1140. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1141. 0, 0, 0, 0, 0, 0, 0},
  1142. /* reo status ring masks */
  1143. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  1144. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1145. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1146. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1147. 0, 0, 0, 0, 0, 0, 0},
  1148. /* rx_ring_near_full_irq mask */
  1149. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1150. /* rx_ring_near_full_irq_2 mask */
  1151. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1152. /* tx_ring_near_full_irq mask */
  1153. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1154. /* host2txmon ring masks */
  1155. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1156. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1157. /* tx mon ring masks */
  1158. { WLAN_CFG_TX_MON_RING_MASK_0,
  1159. WLAN_CFG_TX_MON_RING_MASK_1,
  1160. 0, 0, 0, 0, 0, 0},
  1161. },
  1162. /* Interrupt assignment for 5 MSI combination */
  1163. {
  1164. /* tx ring masks */
  1165. { WLAN_CFG_TX_RING_MASK_0,
  1166. WLAN_CFG_TX_RING_MASK_1,
  1167. WLAN_CFG_TX_RING_MASK_2,
  1168. WLAN_CFG_TX_RING_MASK_3,
  1169. 0, 0, 0, 0, 0, 0, 0},
  1170. /* rx ring masks */
  1171. { WLAN_CFG_RX_RING_MASK_0,
  1172. WLAN_CFG_RX_RING_MASK_1,
  1173. WLAN_CFG_RX_RING_MASK_2,
  1174. WLAN_CFG_RX_RING_MASK_3,
  1175. 0, 0, 0, 0, 0, 0, 0},
  1176. /* rx mon ring masks */
  1177. { 0, 0, 0, 0,
  1178. WLAN_CFG_RX_MON_RING_MASK_0 |
  1179. WLAN_CFG_RX_MON_RING_MASK_1 |
  1180. WLAN_CFG_RX_MON_RING_MASK_2,
  1181. 0, 0, 0, 0, 0, 0},
  1182. /* host2rxdma ring masks */
  1183. { 0, 0, 0, 0,
  1184. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  1185. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  1186. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  1187. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1188. 0, 0, 0, 0, 0, 0},
  1189. /* rxdma2host ring masks */
  1190. { 0, 0, 0, 0,
  1191. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  1192. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  1193. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  1194. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1195. 0, 0, 0, 0, 0, 0},
  1196. /* host2rxdma mon ring masks */
  1197. { 0, 0, 0, 0,
  1198. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  1199. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  1200. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1201. 0, 0, 0, 0, 0, 0},
  1202. /* rxdma2host mon ring masks */
  1203. { 0, 0, 0, 0,
  1204. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  1205. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  1206. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1207. 0, 0, 0, 0, 0, 0},
  1208. /* rx err ring masks */
  1209. { 0, 0, 0, 0,
  1210. WLAN_CFG_RX_ERR_RING_MASK_0 |
  1211. WLAN_CFG_RX_ERR_RING_MASK_1 |
  1212. WLAN_CFG_RX_ERR_RING_MASK_2 |
  1213. WLAN_CFG_RX_ERR_RING_MASK_3,
  1214. 0, 0, 0, 0, 0, 0},
  1215. /* rx wbm rel ring masks */
  1216. { 0, 0, 0, 0,
  1217. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  1218. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  1219. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  1220. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1221. 0, 0, 0, 0, 0, 0},
  1222. /* reo status ring masks */
  1223. { 0, 0, 0, 0,
  1224. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  1225. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  1226. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  1227. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1228. 0, 0, 0, 0, 0, 0},
  1229. /* rx_ring_near_full_irq mask */
  1230. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1231. /* rx_ring_near_full_irq_2 mask */
  1232. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1233. /* tx_ring_near_full_irq mask */
  1234. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1235. /* host2txmon ring masks */
  1236. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1237. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1238. /* tx mon ring masks */
  1239. { WLAN_CFG_TX_MON_RING_MASK_0,
  1240. WLAN_CFG_TX_MON_RING_MASK_1,
  1241. 0, 0, 0, 0, 0, 0},
  1242. },
  1243. /* Interrupt assignment for 6 MSI combination */
  1244. {
  1245. /* tx ring masks */
  1246. { WLAN_CFG_TX_RING_MASK_0,
  1247. WLAN_CFG_TX_RING_MASK_1,
  1248. WLAN_CFG_TX_RING_MASK_2,
  1249. WLAN_CFG_TX_RING_MASK_3,
  1250. 0, 0, 0, 0, 0, 0, 0},
  1251. /* rx ring masks */
  1252. { 0, 0,
  1253. WLAN_CFG_RX_RING_MASK_0,
  1254. WLAN_CFG_RX_RING_MASK_1,
  1255. WLAN_CFG_RX_RING_MASK_2,
  1256. WLAN_CFG_RX_RING_MASK_3,
  1257. 0, 0, 0, 0, 0},
  1258. /* rx mon ring masks */
  1259. { WLAN_CFG_RX_MON_RING_MASK_0,
  1260. WLAN_CFG_RX_MON_RING_MASK_1,
  1261. WLAN_CFG_RX_MON_RING_MASK_2,
  1262. 0, 0, 0, 0, 0, 0, 0, 0},
  1263. /* host2rxdma ring masks */
  1264. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1265. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1266. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1267. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1268. 0, 0, 0, 0, 0, 0, 0},
  1269. /* rxdma2host ring masks */
  1270. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1271. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1272. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1273. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1274. 0, 0, 0, 0, 0, 0, 0},
  1275. /* host2rxdma mon ring masks */
  1276. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1277. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1278. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1279. 0, 0, 0, 0, 0, 0, 0, 0},
  1280. /* rxdma2host mon ring masks */
  1281. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1282. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1283. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1284. 0, 0, 0, 0, 0, 0, 0, 0},
  1285. /* rx err ring masks */
  1286. { WLAN_CFG_RX_ERR_RING_MASK_0,
  1287. WLAN_CFG_RX_ERR_RING_MASK_1,
  1288. WLAN_CFG_RX_ERR_RING_MASK_2,
  1289. WLAN_CFG_RX_ERR_RING_MASK_3,
  1290. 0, 0, 0, 0, 0, 0, 0},
  1291. /* rx wbm rel ring masks */
  1292. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1293. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1294. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1295. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1296. 0, 0, 0, 0, 0, 0, 0},
  1297. /* reo status ring masks */
  1298. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  1299. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1300. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1301. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1302. 0, 0, 0, 0, 0, 0, 0},
  1303. /* rx_ring_near_full_irq mask */
  1304. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1305. /* rx_ring_near_full_irq_2 mask */
  1306. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1307. /* tx_ring_near_full_irq mask */
  1308. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1309. /* host2txmon ring masks */
  1310. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1311. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1312. /* tx mon ring masks */
  1313. { WLAN_CFG_TX_MON_RING_MASK_0,
  1314. WLAN_CFG_TX_MON_RING_MASK_1,
  1315. 0, 0, 0, 0, 0, 0},
  1316. },
  1317. /* Interrupt assignment for 7 MSI combination */
  1318. {
  1319. /* tx ring masks */
  1320. { WLAN_CFG_TX_RING_MASK_0,
  1321. WLAN_CFG_TX_RING_MASK_1,
  1322. WLAN_CFG_TX_RING_MASK_2,
  1323. WLAN_CFG_TX_RING_MASK_3,
  1324. 0, 0, 0, 0, 0, 0, 0},
  1325. /* rx ring masks */
  1326. { 0, 0, 0,
  1327. WLAN_CFG_RX_RING_MASK_0,
  1328. WLAN_CFG_RX_RING_MASK_1,
  1329. WLAN_CFG_RX_RING_MASK_2,
  1330. WLAN_CFG_RX_RING_MASK_3,
  1331. 0, 0, 0},
  1332. /* rx mon ring masks */
  1333. { 0, 0, 0,
  1334. WLAN_CFG_RX_MON_RING_MASK_0,
  1335. WLAN_CFG_RX_MON_RING_MASK_1,
  1336. WLAN_CFG_RX_MON_RING_MASK_2,
  1337. 0, 0, 0, 0, 0},
  1338. /* host2rxdma ring masks */
  1339. { 0, 0, 0,
  1340. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1341. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1342. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1343. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1344. 0, 0, 0, 0},
  1345. /* rxdma2host ring masks */
  1346. { 0, 0, 0,
  1347. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1348. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1349. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1350. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1351. 0, 0, 0, 0},
  1352. /* host2rxdma mon ring masks */
  1353. { 0, 0, 0,
  1354. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1355. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1356. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1357. 0, 0, 0, 0, 0},
  1358. /* rxdma2host mon ring masks */
  1359. { 0, 0, 0,
  1360. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1361. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1362. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1363. 0, 0, 0, 0, 0},
  1364. /* rx err ring masks */
  1365. { 0, 0, 0,
  1366. WLAN_CFG_RX_ERR_RING_MASK_0,
  1367. WLAN_CFG_RX_ERR_RING_MASK_1,
  1368. WLAN_CFG_RX_ERR_RING_MASK_2,
  1369. WLAN_CFG_RX_ERR_RING_MASK_3,
  1370. 0, 0, 0, 0},
  1371. /* rx wbm rel ring masks */
  1372. { 0, 0, 0,
  1373. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1374. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1375. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1376. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1377. 0, 0, 0, 0},
  1378. /* reo status ring masks */
  1379. { 0, 0, 0,
  1380. WLAN_CFG_REO_STATUS_RING_MASK_0,
  1381. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1382. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1383. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1384. 0, 0, 0, 0},
  1385. /* rx_ring_near_full_irq mask */
  1386. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1387. /* rx_ring_near_full_irq_2 mask */
  1388. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1389. /* tx_ring_near_full_irq mask */
  1390. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1391. /* host2txmon ring masks */
  1392. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1393. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1394. /* tx mon ring masks */
  1395. { WLAN_CFG_TX_MON_RING_MASK_0,
  1396. WLAN_CFG_TX_MON_RING_MASK_1,
  1397. 0, 0, 0, 0, 0, 0},
  1398. },
  1399. /* Interrupt assignment for 8 MSI combination */
  1400. {
  1401. /* tx ring masks */
  1402. { WLAN_CFG_TX_RING_MASK_0,
  1403. WLAN_CFG_TX_RING_MASK_1,
  1404. WLAN_CFG_TX_RING_MASK_2,
  1405. WLAN_CFG_TX_RING_MASK_3,
  1406. 0, 0, 0, 0, 0, 0, 0},
  1407. /* rx ring masks */
  1408. { 0, 0, 0, 0,
  1409. WLAN_CFG_RX_RING_MASK_0,
  1410. WLAN_CFG_RX_RING_MASK_1,
  1411. WLAN_CFG_RX_RING_MASK_2,
  1412. WLAN_CFG_RX_RING_MASK_3,
  1413. 0, 0, 0},
  1414. /* rx mon ring masks */
  1415. { 0, 0, 0,
  1416. WLAN_CFG_RX_MON_RING_MASK_0,
  1417. WLAN_CFG_RX_MON_RING_MASK_1,
  1418. WLAN_CFG_RX_MON_RING_MASK_2,
  1419. 0, 0, 0, 0, 0},
  1420. /* host2rxdma ring masks */
  1421. { 0, 0, 0,
  1422. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1423. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1424. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1425. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1426. 0, 0, 0, 0},
  1427. /* rxdma2host ring masks */
  1428. { 0, 0, 0,
  1429. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1430. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1431. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1432. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1433. 0, 0, 0, 0},
  1434. /* host2rxdma mon ring masks */
  1435. { 0, 0, 0,
  1436. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1437. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1438. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1439. 0, 0, 0, 0, 0},
  1440. /* rxdma2host mon ring masks */
  1441. { 0, 0, 0,
  1442. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1443. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1444. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1445. 0, 0, 0, 0, 0},
  1446. /* rx err ring masks */
  1447. { 0, 0, 0,
  1448. WLAN_CFG_RX_ERR_RING_MASK_0,
  1449. WLAN_CFG_RX_ERR_RING_MASK_1,
  1450. WLAN_CFG_RX_ERR_RING_MASK_2,
  1451. WLAN_CFG_RX_ERR_RING_MASK_3,
  1452. 0, 0, 0, 0},
  1453. /* rx wbm rel ring masks */
  1454. { 0, 0, 0,
  1455. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1456. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1457. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1458. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1459. 0, 0, 0, 0},
  1460. /* reo status ring masks */
  1461. { 0, 0, 0,
  1462. WLAN_CFG_REO_STATUS_RING_MASK_0,
  1463. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1464. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1465. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1466. 0, 0, 0, 0},
  1467. /* rx_ring_near_full_irq mask */
  1468. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1469. /* rx_ring_near_full_irq_2 mask */
  1470. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1471. /* tx_ring_near_full_irq mask */
  1472. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1473. /* host2txmon ring masks */
  1474. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1475. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1476. /* tx mon ring masks */
  1477. { WLAN_CFG_TX_MON_RING_MASK_0,
  1478. WLAN_CFG_TX_MON_RING_MASK_1,
  1479. 0, 0, 0, 0, 0, 0},
  1480. },
  1481. };
  1482. #endif
  1483. #endif
  1484. /**
  1485. * g_wlan_srng_cfg[] - Per ring_type specific configuration
  1486. *
  1487. */
  1488. struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
  1489. /* REO_DST ring configuration */
  1490. struct wlan_srng_cfg wlan_srng_reo_cfg = {
  1491. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
  1492. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING,
  1493. .low_threshold = 0,
  1494. };
  1495. /* WBM2SW_RELEASE ring configuration */
  1496. struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
  1497. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
  1498. .batch_count_threshold = 0,
  1499. .low_threshold = 0,
  1500. };
  1501. /* RXDMA_BUF ring configuration */
  1502. struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
  1503. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1504. .batch_count_threshold = 0,
  1505. .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
  1506. };
  1507. /* RXDMA_MONITOR_BUF ring configuration */
  1508. struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
  1509. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1510. .batch_count_threshold = 0,
  1511. .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
  1512. };
  1513. /* RXDMA_MONITOR_STATUS ring configuration */
  1514. struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
  1515. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1516. .batch_count_threshold = 0,
  1517. .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
  1518. };
  1519. /* TX_MONITOR_BUF ring configuration */
  1520. struct wlan_srng_cfg wlan_srng_tx_monitor_buf_cfg = {
  1521. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_TX,
  1522. .batch_count_threshold = 0,
  1523. .low_threshold = WLAN_CFG_TX_MONITOR_BUF_RING_SIZE_MAX >> 3,
  1524. };
  1525. /* DEFAULT_CONFIG ring configuration */
  1526. struct wlan_srng_cfg wlan_srng_default_cfg = {
  1527. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
  1528. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
  1529. .low_threshold = 0,
  1530. };
  1531. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
  1532. {
  1533. g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
  1534. g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
  1535. g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
  1536. g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
  1537. g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
  1538. g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
  1539. g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
  1540. g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
  1541. g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
  1542. g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
  1543. g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
  1544. g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
  1545. g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
  1546. g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
  1547. wlan_srng_rxdma_monitor_buf_cfg;
  1548. g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
  1549. wlan_srng_rxdma_monitor_status_cfg;
  1550. g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
  1551. g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
  1552. g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
  1553. #ifdef WLAN_FEATURE_CIF_CFR
  1554. g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
  1555. #endif
  1556. g_wlan_srng_cfg[TX_MONITOR_BUF] = wlan_srng_tx_monitor_buf_cfg;
  1557. *wlan_cfg = g_wlan_srng_cfg;
  1558. }
  1559. static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
  1560. 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
  1561. 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
  1562. 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
  1563. 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
  1564. 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
  1565. };
  1566. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  1567. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1568. int num_dp_msi,
  1569. int interrupt_mode,
  1570. bool is_monitor_mode)
  1571. { int i = 0;
  1572. const uint8_t *tx_ring_intr_mask =
  1573. wlan_cfg_get_tx_ring_int_mask(wlan_cfg_ctx);
  1574. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  1575. wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_intr_mask[i];
  1576. if (wlan_cfg_ctx->int_tx_ring_mask[i])
  1577. wlan_cfg_ctx->tx_rings_grp_bitmap |= BIT(i);
  1578. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  1579. rx_mon_ring_mask_msi[i];
  1580. wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
  1581. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  1582. rx_err_ring_mask_msi[i];
  1583. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  1584. rx_wbm_rel_ring_mask_msi[i];
  1585. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  1586. reo_status_ring_mask_msi[i];
  1587. if (is_monitor_mode) {
  1588. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  1589. if (interrupt_mode == DP_INTR_POLL)
  1590. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1591. else
  1592. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1593. rxdma2host_ring_mask_msi[i];
  1594. } else {
  1595. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1596. rx_ring_mask_msi[i];
  1597. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1598. rxdma2host_ring_mask_msi[i];
  1599. }
  1600. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1601. host2rxdma_ring_mask_msi[i];
  1602. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1603. host2rxdma_mon_ring_mask_msi[i];
  1604. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1605. rxdma2host_mon_ring_mask_msi[i];
  1606. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1607. rx_ring_near_full_irq_1_mask_msi[i];
  1608. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1609. rx_ring_near_full_irq_2_mask_msi[i];
  1610. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1611. tx_ring_near_full_irq_mask_msi[i];
  1612. }
  1613. }
  1614. #else
  1615. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1616. int num_dp_msi,
  1617. int interrupt_mode,
  1618. bool is_monitor_mode)
  1619. {
  1620. int i = 0;
  1621. int interrupt_index = 0;
  1622. int int_host2rxdma_mon_ring_mask;
  1623. bool host2rxmon_mask_set = false;
  1624. bool txmon_hw_support = false;
  1625. if(interrupt_mode == DP_INTR_INTEGRATED) {
  1626. interrupt_index = 0;
  1627. } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
  1628. DP_INTR_POLL) {
  1629. interrupt_index = num_dp_msi;
  1630. } else {
  1631. qdf_err("Interrupt mode %d", interrupt_mode);
  1632. }
  1633. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  1634. wlan_cfg_ctx->int_tx_ring_mask[i] =
  1635. dp_mask_assignment[interrupt_index].tx_ring_mask[i];
  1636. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  1637. dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
  1638. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  1639. dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
  1640. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  1641. dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
  1642. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  1643. dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
  1644. if (is_monitor_mode) {
  1645. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  1646. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1647. } else {
  1648. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1649. dp_mask_assignment[interrupt_index].rx_ring_mask[i];
  1650. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1651. dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
  1652. }
  1653. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1654. dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
  1655. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1656. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1657. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1658. dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
  1659. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1660. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
  1661. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1662. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
  1663. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1664. dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
  1665. txmon_hw_support = wlan_cfg_get_txmon_hw_support(wlan_cfg_ctx);
  1666. if (txmon_hw_support) {
  1667. wlan_cfg_ctx->int_tx_mon_ring_mask[i] =
  1668. dp_mask_assignment[interrupt_index].tx_mon_ring_mask[i];
  1669. wlan_cfg_ctx->int_host2txmon_ring_mask[i] =
  1670. dp_mask_assignment[interrupt_index].host2txmon_ring_mask[i];
  1671. int_host2rxdma_mon_ring_mask =
  1672. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1673. if (int_host2rxdma_mon_ring_mask && !host2rxmon_mask_set) {
  1674. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[interrupt_index] =
  1675. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1676. host2rxmon_mask_set = true;
  1677. }
  1678. } else {
  1679. wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
  1680. wlan_cfg_ctx->int_host2txmon_ring_mask[i] = 0;
  1681. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1682. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1683. }
  1684. }
  1685. }
  1686. #endif
  1687. #ifdef IPA_OFFLOAD
  1688. #define WLAN_CFG_IPA_ENABLE_MASK BIT(0)
  1689. #ifdef IPA_WDI3_TX_TWO_PIPES
  1690. /**
  1691. * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
  1692. * in dp soc cfg context
  1693. * @psoc: Object manager psoc
  1694. * @wlan_cfg_ctx: dp soc cfg ctx
  1695. *
  1696. * Return: None
  1697. */
  1698. static void
  1699. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1700. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1701. {
  1702. wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
  1703. WLAN_CFG_IPA_ENABLE_MASK);
  1704. wlan_cfg_ctx->ipa_tx_ring_size =
  1705. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1706. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1707. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1708. wlan_cfg_ctx->ipa_tx_alt_ring_size =
  1709. cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
  1710. wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
  1711. cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
  1712. }
  1713. #else /* !IPA_WDI3_TX_TWO_PIPES */
  1714. /**
  1715. * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
  1716. * cfg context
  1717. * @psoc - Object manager psoc
  1718. * @wlan_cfg_ctx - dp soc cfg ctx
  1719. *
  1720. * Return: None
  1721. */
  1722. static void
  1723. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1724. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1725. {
  1726. wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
  1727. WLAN_CFG_IPA_ENABLE_MASK);
  1728. wlan_cfg_ctx->ipa_tx_ring_size =
  1729. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1730. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1731. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1732. }
  1733. #endif /* IPA_WDI3_TX_TWO_PIPES */
  1734. #else /* !IPA_OFFLOAD */
  1735. static inline void
  1736. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1737. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1738. {
  1739. }
  1740. #endif
  1741. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  1742. static void
  1743. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1744. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1745. {
  1746. wlan_cfg_ctx->hw_cc_enabled =
  1747. cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
  1748. }
  1749. #else
  1750. static void
  1751. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1752. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1753. {
  1754. wlan_cfg_ctx->hw_cc_enabled = true;
  1755. }
  1756. #endif
  1757. #ifdef WLAN_SUPPORT_PPEDS
  1758. /**
  1759. * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc
  1760. * cfg context
  1761. * @psoc - Object manager psoc
  1762. * @wlan_cfg_ctx - dp soc cfg ctx
  1763. *
  1764. * Return: None
  1765. */
  1766. static void
  1767. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1768. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1769. {
  1770. wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE);
  1771. wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
  1772. wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
  1773. wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc,
  1774. CFG_DP_PPE_RELEASE_RING);
  1775. }
  1776. #else
  1777. static inline void
  1778. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1779. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1780. {
  1781. }
  1782. #endif
  1783. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  1784. /**
  1785. * wlan_cfg_get_lsb_set_pos() - returns position of LSB which is set
  1786. *
  1787. * Return: position of LSB which is set
  1788. */
  1789. static uint8_t wlan_cfg_get_lsb_set_pos(uint8_t val)
  1790. {
  1791. uint8_t pos = 0;
  1792. while (pos < 8) {
  1793. if (val & (1 << pos))
  1794. return pos;
  1795. pos++;
  1796. }
  1797. return 0;
  1798. }
  1799. /**
  1800. * wlan_multi_soc_mlo_cfg_attach() - Update multi soc mlo config in dp soc
  1801. * cfg context
  1802. * @psoc - Object manager psoc
  1803. * @wlan_cfg_ctx - dp soc cfg ctx
  1804. *
  1805. * Return: None
  1806. */
  1807. static void
  1808. wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1809. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1810. {
  1811. uint8_t rx_ring_map;
  1812. rx_ring_map =
  1813. cfg_get(psoc, CFG_DP_MLO_CHIP0_RX_RING_MAP);
  1814. wlan_cfg_ctx->mlo_chip_rx_ring_map[0] = rx_ring_map;
  1815. wlan_cfg_ctx->mlo_chip_default_rx_ring_id[0] =
  1816. wlan_cfg_get_lsb_set_pos(rx_ring_map);
  1817. wlan_cfg_ctx->lmac_peer_id_msb[0] = 1;
  1818. rx_ring_map =
  1819. cfg_get(psoc, CFG_DP_MLO_CHIP1_RX_RING_MAP);
  1820. wlan_cfg_ctx->mlo_chip_rx_ring_map[1] = rx_ring_map;
  1821. wlan_cfg_ctx->mlo_chip_default_rx_ring_id[1] =
  1822. wlan_cfg_get_lsb_set_pos(rx_ring_map);
  1823. wlan_cfg_ctx->lmac_peer_id_msb[1] = 2;
  1824. rx_ring_map =
  1825. cfg_get(psoc, CFG_DP_MLO_CHIP2_RX_RING_MAP);
  1826. wlan_cfg_ctx->mlo_chip_rx_ring_map[2] = rx_ring_map;
  1827. wlan_cfg_ctx->mlo_chip_default_rx_ring_id[2] =
  1828. wlan_cfg_get_lsb_set_pos(rx_ring_map);
  1829. wlan_cfg_ctx->lmac_peer_id_msb[2] = 3;
  1830. }
  1831. #else
  1832. static inline void
  1833. wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1834. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1835. {
  1836. }
  1837. #endif
  1838. #ifdef WLAN_FEATURE_11BE_MLO
  1839. /**
  1840. * wlan_soc_mlo_cfg_attach() - Update mlo config in dp soc
  1841. * cfg context
  1842. * @psoc - Object manager psoc
  1843. * @wlan_cfg_ctx - dp soc cfg ctx
  1844. *
  1845. * Return: None
  1846. */
  1847. static void
  1848. wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1849. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1850. {
  1851. wlan_multi_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
  1852. }
  1853. #else
  1854. static inline void
  1855. wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1856. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1857. {
  1858. }
  1859. #endif
  1860. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  1861. /**
  1862. * wlan_soc_vdev_hw_stats_cfg_attach() - Update hw vdev stats config in dp soc
  1863. * cfg context
  1864. * @psoc - Object manager psoc
  1865. * @wlan_cfg_ctx - dp soc cfg ctx
  1866. *
  1867. * Return: None
  1868. */
  1869. static void
  1870. wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1871. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1872. {
  1873. wlan_cfg_ctx->vdev_stats_hw_offload_config = cfg_get(psoc,
  1874. CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG);
  1875. wlan_cfg_ctx->vdev_stats_hw_offload_timer = cfg_get(psoc,
  1876. CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER);
  1877. }
  1878. #else
  1879. static void
  1880. wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1881. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1882. {
  1883. }
  1884. #endif
  1885. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  1886. static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1887. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1888. {
  1889. wlan_cfg_ctx->tx_capt_max_mem_allowed =
  1890. cfg_get(psoc, CFG_DP_TX_CAPT_MAX_MEM_MB) * 1024 * 1024;
  1891. }
  1892. #else
  1893. static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1894. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1895. {
  1896. }
  1897. #endif
  1898. /**
  1899. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1900. * @psoc - Object manager psoc
  1901. * Return: wlan_cfg_ctx - Handle to Configuration context
  1902. */
  1903. struct wlan_cfg_dp_soc_ctxt *
  1904. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1905. {
  1906. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1907. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1908. uint32_t gro_bit_set;
  1909. if (!wlan_cfg_ctx)
  1910. return NULL;
  1911. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1912. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1913. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1914. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1915. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1916. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1917. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1918. wlan_cfg_ctx->num_tx_comp_rings = cfg_get(psoc, CFG_DP_TX_COMP_RINGS);
  1919. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1920. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1921. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1922. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1923. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1924. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1925. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1926. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1927. CFG_DP_TX_EXT_DESC_POOLS);
  1928. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1929. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1930. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1931. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1932. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1933. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1934. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1935. CFG_DP_TX_COMPL_RING_SIZE);
  1936. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1937. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1938. wlan_cfg_ctx->int_batch_threshold_tx =
  1939. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1940. wlan_cfg_ctx->int_timer_threshold_tx =
  1941. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1942. wlan_cfg_ctx->int_batch_threshold_rx =
  1943. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1944. wlan_cfg_ctx->int_timer_threshold_rx =
  1945. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1946. wlan_cfg_ctx->int_batch_threshold_other =
  1947. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1948. wlan_cfg_ctx->int_timer_threshold_other =
  1949. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1950. wlan_cfg_ctx->pktlog_buffer_size =
  1951. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1952. /* This is default mapping and can be overridden by HW config
  1953. * received from FW */
  1954. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1955. if (MAX_PDEV_CNT > 1)
  1956. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1957. if (MAX_PDEV_CNT > 2)
  1958. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1959. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1960. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1961. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1962. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1963. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1964. gro_bit_set = cfg_get(psoc, CFG_DP_GRO);
  1965. if (gro_bit_set & DP_GRO_ENABLE_BIT_SET) {
  1966. wlan_cfg_ctx->gro_enabled = true;
  1967. if (gro_bit_set & DP_FORCE_USE_GRO_BIT_SET)
  1968. wlan_cfg_ctx->force_gro_enabled = true;
  1969. }
  1970. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1971. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1972. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1973. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1974. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1975. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1976. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1977. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1978. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1979. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1980. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1981. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1982. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1983. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1984. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1985. wlan_cfg_ctx->defrag_timeout_check =
  1986. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1987. wlan_cfg_ctx->rx_defrag_min_timeout =
  1988. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1989. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1990. CFG_DP_WBM_RELEASE_RING);
  1991. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1992. CFG_DP_TCL_CMD_CREDIT_RING);
  1993. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1994. CFG_DP_TCL_STATUS_RING);
  1995. wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc,
  1996. CFG_DP_RX_DESTINATION_RING);
  1997. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1998. CFG_DP_REO_REINJECT_RING);
  1999. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  2000. CFG_DP_RX_RELEASE_RING);
  2001. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  2002. CFG_DP_REO_EXCEPTION_RING);
  2003. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  2004. CFG_DP_REO_CMD_RING);
  2005. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  2006. CFG_DP_REO_STATUS_RING);
  2007. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  2008. CFG_DP_RXDMA_REFILL_RING);
  2009. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  2010. CFG_DP_TX_DESC_LIMIT_0);
  2011. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  2012. CFG_DP_TX_DESC_LIMIT_1);
  2013. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  2014. CFG_DP_TX_DESC_LIMIT_2);
  2015. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  2016. CFG_DP_TX_DEVICE_LIMIT);
  2017. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  2018. CFG_DP_TX_SW_INTERNODE_QUEUE);
  2019. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  2020. CFG_DP_RXDMA_ERR_DST_RING);
  2021. wlan_cfg_ctx->enable_data_stall_detection =
  2022. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  2023. wlan_cfg_ctx->tx_flow_start_queue_offset =
  2024. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  2025. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  2026. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  2027. wlan_cfg_ctx->disable_intra_bss_fwd =
  2028. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  2029. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  2030. CFG_DP_RX_SW_DESC_WEIGHT);
  2031. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  2032. CFG_DP_RX_SW_DESC_NUM);
  2033. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  2034. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  2035. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  2036. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  2037. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  2038. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  2039. wlan_cfg_ctx->rx_flow_search_table_size =
  2040. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  2041. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  2042. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  2043. wlan_cfg_ctx->mon_drop_thresh =
  2044. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  2045. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  2046. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  2047. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  2048. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  2049. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  2050. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  2051. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  2052. wlan_cfg_ctx->rx_pending_high_threshold =
  2053. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  2054. wlan_cfg_ctx->rx_pending_low_threshold =
  2055. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  2056. wlan_cfg_ctx->is_poll_mode_enabled =
  2057. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  2058. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  2059. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  2060. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  2061. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  2062. wlan_cfg_ctx->radio0_rx_default_reo =
  2063. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  2064. wlan_cfg_ctx->radio1_rx_default_reo =
  2065. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  2066. wlan_cfg_ctx->radio2_rx_default_reo =
  2067. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  2068. wlan_cfg_ctx->wow_check_rx_pending_enable =
  2069. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  2070. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  2071. CFG_DP_DELAY_MON_REPLENISH);
  2072. wlan_cfg_ctx->rx_mon_buf_ring_size = cfg_get(psoc,
  2073. CFG_DP_RXDMA_MONITOR_BUF_RING);
  2074. wlan_cfg_ctx->tx_mon_buf_ring_size = cfg_get(psoc,
  2075. CFG_DP_TX_MONITOR_BUF_RING);
  2076. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  2077. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  2078. wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
  2079. wlan_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
  2080. wlan_soc_vdev_hw_stats_cfg_attach(psoc, wlan_cfg_ctx);
  2081. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2082. wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
  2083. PKT_CAPTURE_MODE_DATA_ONLY;
  2084. #endif
  2085. wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = NUM_RXDMA_RINGS_PER_PDEV;
  2086. wlan_cfg_ctx->num_rxdma_status_rings_per_pdev =
  2087. NUM_RXDMA_RINGS_PER_PDEV;
  2088. wlan_soc_tx_capt_cfg_attach(psoc, wlan_cfg_ctx);
  2089. return wlan_cfg_ctx;
  2090. }
  2091. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  2092. {
  2093. qdf_mem_free(wlan_cfg_ctx);
  2094. }
  2095. struct wlan_cfg_dp_pdev_ctxt *
  2096. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  2097. {
  2098. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  2099. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  2100. if (!wlan_cfg_ctx)
  2101. return NULL;
  2102. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  2103. CFG_DP_RXDMA_BUF_RING);
  2104. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  2105. CFG_DP_RXDMA_MONITOR_BUF_RING);
  2106. wlan_cfg_ctx->dma_rx_mon_dest_ring_size = cfg_get(psoc,
  2107. CFG_DP_RXDMA_MONITOR_DST_RING);
  2108. wlan_cfg_ctx->dma_tx_mon_dest_ring_size = cfg_get(psoc,
  2109. CFG_DP_TX_MONITOR_DST_RING);
  2110. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  2111. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  2112. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  2113. CFG_DP_RXDMA_MONITOR_DESC_RING);
  2114. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  2115. return wlan_cfg_ctx;
  2116. }
  2117. void wlan_cfg_set_mon_delayed_replenish_entries(
  2118. struct wlan_cfg_dp_soc_ctxt *cfg,
  2119. uint32_t val)
  2120. {
  2121. cfg->delayed_replenish_entries = val;
  2122. }
  2123. qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
  2124. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  2125. {
  2126. return cfg->delayed_replenish_entries;
  2127. }
  2128. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  2129. {
  2130. if (wlan_cfg_ctx)
  2131. qdf_mem_free(wlan_cfg_ctx);
  2132. }
  2133. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  2134. {
  2135. return cfg->mon_drop_thresh;
  2136. }
  2137. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  2138. {
  2139. cfg->num_int_ctxts = num;
  2140. }
  2141. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  2142. {
  2143. cfg->max_peer_id = val;
  2144. }
  2145. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  2146. {
  2147. cfg->max_ast_idx = val;
  2148. }
  2149. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2150. {
  2151. return cfg->max_ast_idx;
  2152. }
  2153. qdf_export_symbol(wlan_cfg_get_max_ast_idx);
  2154. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2155. int context, int mask)
  2156. {
  2157. cfg->int_tx_ring_mask[context] = mask;
  2158. }
  2159. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2160. int context, int mask)
  2161. {
  2162. cfg->int_rx_ring_mask[context] = mask;
  2163. }
  2164. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2165. int context, int mask)
  2166. {
  2167. cfg->int_rx_mon_ring_mask[context] = mask;
  2168. }
  2169. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2170. int context, int mask)
  2171. {
  2172. cfg->int_tx_mon_ring_mask[context] = mask;
  2173. }
  2174. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2175. int context)
  2176. {
  2177. return cfg->int_host2rxdma_mon_ring_mask[context];
  2178. }
  2179. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2180. int context, int mask)
  2181. {
  2182. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  2183. }
  2184. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2185. int context)
  2186. {
  2187. return cfg->int_rxdma2host_mon_ring_mask[context];
  2188. }
  2189. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2190. int context, int mask)
  2191. {
  2192. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  2193. }
  2194. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2195. int context, int mask)
  2196. {
  2197. cfg->int_rxdma2host_ring_mask[context] = mask;
  2198. }
  2199. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2200. int context)
  2201. {
  2202. return cfg->int_rxdma2host_ring_mask[context];
  2203. }
  2204. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2205. int context, int mask)
  2206. {
  2207. cfg->int_host2rxdma_ring_mask[context] = mask;
  2208. }
  2209. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2210. int context)
  2211. {
  2212. return cfg->int_host2rxdma_ring_mask[context];
  2213. }
  2214. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2215. int context)
  2216. {
  2217. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  2218. }
  2219. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2220. int context)
  2221. {
  2222. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  2223. }
  2224. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2225. int context)
  2226. {
  2227. return cfg->int_tx_ring_near_full_irq_mask[context];
  2228. }
  2229. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  2230. int hw_macid)
  2231. {
  2232. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  2233. cfg->hw_macid[pdev_idx] = hw_macid;
  2234. }
  2235. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  2236. {
  2237. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  2238. return cfg->hw_macid[pdev_idx];
  2239. }
  2240. qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
  2241. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2242. int hw_macid)
  2243. {
  2244. int idx;
  2245. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  2246. if (cfg->hw_macid[idx] == hw_macid)
  2247. return (idx + 1);
  2248. }
  2249. qdf_assert_always(idx < MAX_PDEV_CNT);
  2250. return WLAN_INVALID_PDEV_ID;
  2251. }
  2252. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  2253. int hw_macid)
  2254. {
  2255. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  2256. (pdev_idx == INVALID_PDEV_ID));
  2257. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  2258. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  2259. }
  2260. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  2261. {
  2262. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  2263. return cfg->hw_macid_pdev_id_map[hw_macid];
  2264. }
  2265. qdf_export_symbol(wlan_cfg_get_pdev_idx);
  2266. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2267. int context, int mask)
  2268. {
  2269. cfg->int_ce_ring_mask[context] = mask;
  2270. }
  2271. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  2272. int mask)
  2273. {
  2274. cfg->int_rx_ring_mask[context] = mask;
  2275. }
  2276. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2277. int context, int mask)
  2278. {
  2279. return cfg->int_rx_err_ring_mask[context] = mask;
  2280. }
  2281. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2282. int context, int mask)
  2283. {
  2284. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  2285. }
  2286. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2287. int context, int mask)
  2288. {
  2289. return cfg->int_reo_status_ring_mask[context] = mask;
  2290. }
  2291. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  2292. {
  2293. return cfg->num_int_ctxts;
  2294. }
  2295. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2296. {
  2297. return cfg->int_tx_ring_mask[context];
  2298. }
  2299. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2300. {
  2301. return cfg->int_rx_ring_mask[context];
  2302. }
  2303. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2304. int context)
  2305. {
  2306. return cfg->int_rx_err_ring_mask[context];
  2307. }
  2308. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2309. int context)
  2310. {
  2311. return cfg->int_rx_wbm_rel_ring_mask[context];
  2312. }
  2313. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2314. int context)
  2315. {
  2316. return cfg->int_reo_status_ring_mask[context];
  2317. }
  2318. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2319. {
  2320. return cfg->int_rx_mon_ring_mask[context];
  2321. }
  2322. #ifdef CONFIG_BERYLLIUM
  2323. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2324. {
  2325. return cfg->int_tx_mon_ring_mask[context];
  2326. }
  2327. #else
  2328. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2329. {
  2330. return 0;
  2331. }
  2332. #endif
  2333. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2334. {
  2335. return cfg->int_ce_ring_mask[context];
  2336. }
  2337. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  2338. {
  2339. return cfg->max_clients;
  2340. }
  2341. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2342. {
  2343. return cfg->max_alloc_size;
  2344. }
  2345. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2346. {
  2347. return cfg->per_pdev_tx_ring;
  2348. }
  2349. uint32_t
  2350. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2351. {
  2352. return cfg->rx_pending_high_threshold;
  2353. }
  2354. uint32_t
  2355. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2356. {
  2357. return cfg->rx_pending_low_threshold;
  2358. }
  2359. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2360. {
  2361. return cfg->per_pdev_lmac_ring;
  2362. }
  2363. qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
  2364. #if defined(DP_USE_SINGLE_TCL) && !defined(TX_MULTI_TCL)
  2365. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2366. {
  2367. return 1;
  2368. }
  2369. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2370. {
  2371. return 1;
  2372. }
  2373. #else
  2374. #if defined(IPA_OFFLOAD) && defined(TX_MULTI_TCL)
  2375. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2376. {
  2377. if (!cfg->ipa_enabled)
  2378. return cfg->num_tcl_data_rings;
  2379. return 1;
  2380. }
  2381. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2382. {
  2383. if (!cfg->ipa_enabled)
  2384. return cfg->num_nss_tcl_data_rings;
  2385. return 1;
  2386. }
  2387. #else
  2388. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2389. {
  2390. return cfg->num_tcl_data_rings;
  2391. }
  2392. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2393. {
  2394. return cfg->num_nss_tcl_data_rings;
  2395. }
  2396. #endif
  2397. #endif
  2398. int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2399. {
  2400. return cfg->num_tx_comp_rings;
  2401. }
  2402. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2403. {
  2404. return cfg->tx_ring_size;
  2405. }
  2406. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2407. {
  2408. return cfg->tx_comp_ring_size;
  2409. }
  2410. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2411. {
  2412. return cfg->per_pdev_rx_ring;
  2413. }
  2414. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2415. {
  2416. return cfg->num_reo_dest_rings;
  2417. }
  2418. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2419. {
  2420. return cfg->num_nss_reo_dest_rings;
  2421. }
  2422. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  2423. {
  2424. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  2425. }
  2426. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2427. {
  2428. return cfg->num_tx_desc_pool;
  2429. }
  2430. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2431. {
  2432. cfg->num_tx_desc_pool = num_pool;
  2433. }
  2434. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2435. {
  2436. return cfg->num_tx_ext_desc_pool;
  2437. }
  2438. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2439. {
  2440. cfg->num_tx_ext_desc_pool = num_pool;
  2441. }
  2442. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2443. {
  2444. return cfg->reo_dst_ring_size;
  2445. }
  2446. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2447. int reo_dst_ring_size)
  2448. {
  2449. cfg->reo_dst_ring_size = reo_dst_ring_size;
  2450. }
  2451. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  2452. bool raw_mode_war)
  2453. {
  2454. cfg->raw_mode_war = raw_mode_war;
  2455. }
  2456. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  2457. {
  2458. return cfg->raw_mode_war;
  2459. }
  2460. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2461. {
  2462. return cfg->num_tx_desc;
  2463. }
  2464. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  2465. {
  2466. cfg->num_tx_desc = num_desc;
  2467. }
  2468. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2469. {
  2470. return cfg->min_tx_desc;
  2471. }
  2472. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2473. {
  2474. return cfg->num_tx_ext_desc;
  2475. }
  2476. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  2477. {
  2478. cfg->num_tx_ext_desc = num_ext_desc;
  2479. }
  2480. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2481. {
  2482. /* TODO: This should be calculated based on target capabilities */
  2483. return cfg->max_peer_id;
  2484. }
  2485. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2486. {
  2487. return cfg->dma_mon_buf_ring_size;
  2488. }
  2489. qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
  2490. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2491. {
  2492. return cfg->dma_rx_mon_dest_ring_size;
  2493. }
  2494. qdf_export_symbol(wlan_cfg_get_dma_rx_mon_dest_ring_size);
  2495. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2496. {
  2497. return cfg->dma_tx_mon_dest_ring_size;
  2498. }
  2499. qdf_export_symbol(wlan_cfg_get_dma_tx_mon_dest_ring_size);
  2500. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2501. {
  2502. return cfg->dma_mon_status_ring_size;
  2503. }
  2504. qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
  2505. int
  2506. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2507. {
  2508. return cfg->rxdma_monitor_desc_ring;
  2509. }
  2510. qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
  2511. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2512. {
  2513. return cfg->rx_dma_buf_ring_size;
  2514. }
  2515. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2516. {
  2517. return cfg->num_mac_rings;
  2518. }
  2519. qdf_export_symbol(wlan_cfg_get_num_mac_rings);
  2520. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2521. {
  2522. return cfg->gro_enabled;
  2523. }
  2524. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2525. {
  2526. return cfg->lro_enabled;
  2527. }
  2528. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2529. {
  2530. return cfg->ipa_enabled;
  2531. }
  2532. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  2533. {
  2534. cfg->rx_hash = val;
  2535. }
  2536. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2537. {
  2538. return cfg->rx_hash;
  2539. }
  2540. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2541. {
  2542. return cfg->nss_enabled;
  2543. }
  2544. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  2545. {
  2546. cfg->nss_enabled = nss_enabled;
  2547. }
  2548. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  2549. {
  2550. return cfg->nss_cfg;
  2551. }
  2552. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  2553. {
  2554. cfg->nss_cfg = nss_cfg;
  2555. if (cfg->nss_cfg)
  2556. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  2557. }
  2558. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2559. {
  2560. return cfg->int_batch_threshold_tx;
  2561. }
  2562. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2563. {
  2564. return cfg->int_timer_threshold_tx;
  2565. }
  2566. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2567. {
  2568. return cfg->int_batch_threshold_rx;
  2569. }
  2570. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2571. {
  2572. return cfg->int_timer_threshold_rx;
  2573. }
  2574. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2575. {
  2576. return cfg->int_batch_threshold_other;
  2577. }
  2578. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2579. {
  2580. return cfg->int_timer_threshold_other;
  2581. }
  2582. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  2583. {
  2584. return cfg->int_timer_threshold_mon;
  2585. }
  2586. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2587. {
  2588. return cfg->p2p_tcp_udp_checksumoffload;
  2589. }
  2590. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2591. {
  2592. return cfg->nan_tcp_udp_checksumoffload;
  2593. }
  2594. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2595. {
  2596. return cfg->tcp_udp_checksumoffload;
  2597. }
  2598. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  2599. {
  2600. return cfg->rx_defrag_min_timeout;
  2601. }
  2602. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  2603. {
  2604. return cfg->defrag_timeout_check;
  2605. }
  2606. int
  2607. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2608. {
  2609. return cfg->wbm_release_ring;
  2610. }
  2611. int
  2612. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2613. {
  2614. return cfg->tcl_cmd_credit_ring;
  2615. }
  2616. int
  2617. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2618. {
  2619. return cfg->tcl_status_ring;
  2620. }
  2621. int
  2622. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2623. {
  2624. return cfg->reo_reinject_ring;
  2625. }
  2626. int
  2627. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2628. {
  2629. return cfg->rx_release_ring;
  2630. }
  2631. int
  2632. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2633. {
  2634. return cfg->reo_exception_ring;
  2635. }
  2636. int
  2637. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2638. {
  2639. return cfg->reo_cmd_ring;
  2640. }
  2641. int
  2642. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2643. {
  2644. return cfg->reo_status_ring;
  2645. }
  2646. int
  2647. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2648. {
  2649. return cfg->rxdma_refill_ring;
  2650. }
  2651. int
  2652. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  2653. {
  2654. return cfg->tx_desc_limit_0;
  2655. }
  2656. int
  2657. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  2658. {
  2659. return cfg->tx_desc_limit_1;
  2660. }
  2661. int
  2662. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  2663. {
  2664. return cfg->tx_desc_limit_2;
  2665. }
  2666. int
  2667. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  2668. {
  2669. return cfg->tx_device_limit;
  2670. }
  2671. int
  2672. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  2673. {
  2674. return cfg->tx_sw_internode_queue;
  2675. }
  2676. int
  2677. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2678. {
  2679. return cfg->rxdma_err_dst_ring;
  2680. }
  2681. int
  2682. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  2683. {
  2684. return cfg->rx_sw_desc_weight;
  2685. }
  2686. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
  2687. int
  2688. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  2689. {
  2690. return cfg->rx_sw_desc_num;
  2691. }
  2692. uint32_t
  2693. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  2694. {
  2695. return cfg->reo_rings_mapping;
  2696. }
  2697. bool
  2698. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  2699. enum cdp_capabilities dp_caps)
  2700. {
  2701. switch (dp_caps) {
  2702. case CDP_CFG_DP_TSO:
  2703. return cfg->tso_enabled;
  2704. case CDP_CFG_DP_LRO:
  2705. return cfg->lro_enabled;
  2706. case CDP_CFG_DP_SG:
  2707. return cfg->sg_enabled;
  2708. case CDP_CFG_DP_GRO:
  2709. return cfg->gro_enabled;
  2710. case CDP_CFG_DP_OL_TX_CSUM:
  2711. return cfg->ol_tx_csum_enabled;
  2712. case CDP_CFG_DP_OL_RX_CSUM:
  2713. return cfg->ol_rx_csum_enabled;
  2714. case CDP_CFG_DP_RAWMODE:
  2715. return cfg->rawmode_enabled;
  2716. case CDP_CFG_DP_PEER_FLOW_CTRL:
  2717. return cfg->peer_flow_ctrl_enabled;
  2718. default:
  2719. return false;
  2720. }
  2721. }
  2722. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  2723. bool val)
  2724. {
  2725. cfg->is_tso_desc_attach_defer = val;
  2726. }
  2727. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2728. {
  2729. return cfg->is_tso_desc_attach_defer;
  2730. }
  2731. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  2732. /**
  2733. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  2734. * @cfg: config context
  2735. *
  2736. * Return: stop threshold
  2737. */
  2738. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  2739. {
  2740. return cfg->tx_flow_stop_queue_threshold;
  2741. }
  2742. /**
  2743. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  2744. * for TX to resume
  2745. * @cfg: config context
  2746. *
  2747. * Return: stop threshold
  2748. */
  2749. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  2750. {
  2751. return cfg->tx_flow_start_queue_offset;
  2752. }
  2753. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  2754. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2755. bool val)
  2756. {
  2757. cfg->is_rx_flow_tag_enabled = val;
  2758. }
  2759. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  2760. {
  2761. return cfg->rx_toeplitz_hash_key;
  2762. }
  2763. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  2764. {
  2765. return cfg->rx_flow_max_search;
  2766. }
  2767. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2768. {
  2769. return cfg->is_rx_flow_tag_enabled;
  2770. }
  2771. qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
  2772. #ifdef WLAN_SUPPORT_RX_FISA
  2773. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2774. {
  2775. return (bool)(cfg->is_rx_fisa_enabled);
  2776. }
  2777. #else
  2778. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2779. {
  2780. return false;
  2781. }
  2782. #endif
  2783. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2784. {
  2785. return (bool)(cfg->is_poll_mode_enabled);
  2786. }
  2787. void
  2788. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  2789. bool val)
  2790. {
  2791. cfg->is_rx_flow_search_table_per_pdev = val;
  2792. }
  2793. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  2794. {
  2795. return cfg->is_rx_flow_search_table_per_pdev;
  2796. }
  2797. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2798. uint16_t val)
  2799. {
  2800. cfg->rx_flow_search_table_size = val;
  2801. }
  2802. uint16_t
  2803. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2804. {
  2805. return cfg->rx_flow_search_table_size;
  2806. }
  2807. void
  2808. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2809. bool val)
  2810. {
  2811. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  2812. }
  2813. bool
  2814. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2815. {
  2816. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  2817. }
  2818. qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
  2819. void
  2820. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  2821. bool val)
  2822. {
  2823. cfg->tx_per_pkt_vdev_id_check = val;
  2824. }
  2825. bool
  2826. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2827. {
  2828. return cfg->tx_per_pkt_vdev_id_check;
  2829. }
  2830. void
  2831. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  2832. bool val)
  2833. {
  2834. cfg->pext_stats_enabled = val;
  2835. }
  2836. bool
  2837. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2838. {
  2839. return cfg->pext_stats_enabled;
  2840. }
  2841. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2842. {
  2843. return cfg->fst_in_cmem;
  2844. }
  2845. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  2846. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2847. {
  2848. return cfg->is_rx_buff_pool_enabled;
  2849. }
  2850. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2851. {
  2852. return cfg->is_rx_refill_buff_pool_enabled;
  2853. }
  2854. #else
  2855. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2856. {
  2857. return false;
  2858. }
  2859. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  2860. struct wlan_cfg_dp_soc_ctxt *cfg)
  2861. {
  2862. return false;
  2863. }
  2864. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  2865. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  2866. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2867. {
  2868. return (bool)(cfg->is_swlm_enabled);
  2869. }
  2870. #else
  2871. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2872. {
  2873. return false;
  2874. }
  2875. #endif
  2876. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2877. {
  2878. return cfg->radio0_rx_default_reo;
  2879. }
  2880. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2881. {
  2882. return cfg->radio1_rx_default_reo;
  2883. }
  2884. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2885. {
  2886. return cfg->radio2_rx_default_reo;
  2887. }
  2888. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  2889. {
  2890. cfg->rxdma1_enable = true;
  2891. }
  2892. void
  2893. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  2894. bool val)
  2895. {
  2896. cfg->delay_mon_replenish = val;
  2897. }
  2898. bool
  2899. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  2900. {
  2901. return cfg->delay_mon_replenish;
  2902. }
  2903. qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
  2904. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  2905. {
  2906. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  2907. cfg->delay_mon_replenish);
  2908. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  2909. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  2910. }
  2911. #ifdef IPA_OFFLOAD
  2912. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2913. {
  2914. return cfg->ipa_tx_ring_size;
  2915. }
  2916. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2917. {
  2918. return cfg->ipa_tx_comp_ring_size;
  2919. }
  2920. #ifdef IPA_WDI3_TX_TWO_PIPES
  2921. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2922. {
  2923. return cfg->ipa_tx_alt_ring_size;
  2924. }
  2925. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2926. {
  2927. return cfg->ipa_tx_alt_comp_ring_size;
  2928. }
  2929. #else
  2930. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2931. {
  2932. return cfg->ipa_tx_ring_size;
  2933. }
  2934. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2935. {
  2936. return cfg->ipa_tx_comp_ring_size;
  2937. }
  2938. #endif
  2939. #endif
  2940. #ifdef WLAN_SUPPORT_PPEDS
  2941. bool
  2942. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2943. {
  2944. return cfg->ppe_enable;
  2945. }
  2946. int
  2947. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2948. {
  2949. return cfg->reo2ppe_ring;
  2950. }
  2951. int
  2952. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2953. {
  2954. return cfg->ppe2tcl_ring;
  2955. }
  2956. int
  2957. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2958. {
  2959. return cfg->ppe_release_ring;
  2960. }
  2961. #endif
  2962. void
  2963. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2964. struct wlan_dp_prealloc_cfg *cfg)
  2965. {
  2966. if (!ctrl_psoc || !cfg)
  2967. return;
  2968. cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
  2969. cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
  2970. CFG_DP_TX_COMPL_RING_SIZE);
  2971. cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
  2972. CFG_DP_WBM_RELEASE_RING);
  2973. cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
  2974. CFG_DP_RXDMA_ERR_DST_RING);
  2975. cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
  2976. CFG_DP_REO_EXCEPTION_RING);
  2977. cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
  2978. cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
  2979. }
  2980. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2981. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2982. {
  2983. return cfg->pkt_capture_mode;
  2984. }
  2985. #endif
  2986. uint32_t
  2987. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2988. {
  2989. return cfg->rx_mon_buf_ring_size;
  2990. }
  2991. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_mon_buf_ring_size);
  2992. uint32_t
  2993. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2994. {
  2995. return cfg->tx_mon_buf_ring_size;
  2996. }
  2997. qdf_export_symbol(wlan_cfg_get_dp_soc_tx_mon_buf_ring_size);
  2998. uint8_t
  2999. wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  3000. {
  3001. return cfg->rx_rel_wbm2sw_ring_id;
  3002. }
  3003. void
  3004. wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  3005. uint8_t wbm2sw_ring_id)
  3006. {
  3007. cfg->rx_rel_wbm2sw_ring_id = wbm2sw_ring_id;
  3008. }
  3009. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  3010. uint8_t
  3011. wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  3012. uint8_t chip_id)
  3013. {
  3014. return cfg->mlo_chip_rx_ring_map[chip_id];
  3015. }
  3016. uint8_t
  3017. wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  3018. uint8_t chip_id)
  3019. {
  3020. return cfg->mlo_chip_default_rx_ring_id[chip_id];
  3021. }
  3022. uint8_t
  3023. wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  3024. uint8_t chip_id)
  3025. {
  3026. return cfg->lmac_peer_id_msb[chip_id];
  3027. }
  3028. #endif
  3029. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  3030. bool
  3031. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  3032. {
  3033. return cfg->vdev_stats_hw_offload_config;
  3034. }
  3035. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
  3036. {
  3037. return cfg->vdev_stats_hw_offload_timer;
  3038. }
  3039. void
  3040. wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
  3041. bool val)
  3042. {
  3043. cfg->vdev_stats_hw_offload_config = val;
  3044. }
  3045. #else
  3046. bool
  3047. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  3048. {
  3049. return false;
  3050. }
  3051. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
  3052. {
  3053. return 0;
  3054. }
  3055. void
  3056. wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
  3057. bool val)
  3058. {}
  3059. #endif
  3060. #ifdef CONFIG_SAWF
  3061. bool wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  3062. {
  3063. return cfg->sawf_enabled;
  3064. }
  3065. void wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  3066. {
  3067. cfg->sawf_enabled = val;
  3068. }
  3069. #else
  3070. bool wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  3071. {
  3072. return false;
  3073. }
  3074. void wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  3075. {
  3076. }
  3077. #endif
  3078. #ifdef CONFIG_BERYLLIUM
  3079. int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  3080. int context)
  3081. {
  3082. return cfg->int_host2txmon_ring_mask[context];
  3083. }
  3084. qdf_export_symbol(wlan_cfg_get_host2txmon_ring_mask);
  3085. void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  3086. int context, int mask)
  3087. {
  3088. cfg->int_host2txmon_ring_mask[context] = mask;
  3089. }
  3090. #else
  3091. int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  3092. int context)
  3093. {
  3094. return 0;
  3095. }
  3096. void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  3097. int context, int mask)
  3098. {
  3099. }
  3100. #endif
  3101. qdf_export_symbol(wlan_cfg_set_host2txmon_ring_mask);
  3102. void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg,
  3103. bool txmon_hw_support)
  3104. {
  3105. cfg->txmon_hw_support = txmon_hw_support;
  3106. }
  3107. bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg)
  3108. {
  3109. return cfg->txmon_hw_support;
  3110. }
  3111. qdf_export_symbol(wlan_cfg_get_txmon_hw_support);