wlan_cfg.c 91 KB

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