wlan_cfg.c 97 KB

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