wlan_cfg.c 98 KB

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