wlan_cfg.c 83 KB

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