wlan_cfg.c 98 KB

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