wlan_cfg.c 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995
  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. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1475. } else {
  1476. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1477. rx_ring_mask_msi[i];
  1478. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1479. rxdma2host_ring_mask_msi[i];
  1480. }
  1481. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1482. host2rxdma_ring_mask_msi[i];
  1483. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1484. host2rxdma_mon_ring_mask_msi[i];
  1485. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1486. rxdma2host_mon_ring_mask_msi[i];
  1487. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1488. rx_ring_near_full_irq_1_mask_msi[i];
  1489. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1490. rx_ring_near_full_irq_2_mask_msi[i];
  1491. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1492. tx_ring_near_full_irq_mask_msi[i];
  1493. }
  1494. }
  1495. #else
  1496. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1497. int num_dp_msi,
  1498. int interrupt_mode,
  1499. bool is_monitor_mode)
  1500. {
  1501. int i = 0;
  1502. int interrupt_index = 0;
  1503. if(interrupt_mode == DP_INTR_INTEGRATED) {
  1504. interrupt_index = 0;
  1505. } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
  1506. DP_INTR_POLL) {
  1507. interrupt_index = num_dp_msi;
  1508. } else {
  1509. qdf_err("Interrupt mode %d", interrupt_mode);
  1510. }
  1511. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  1512. wlan_cfg_ctx->int_tx_ring_mask[i] =
  1513. dp_mask_assignment[interrupt_index].tx_ring_mask[i];
  1514. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  1515. dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
  1516. wlan_cfg_ctx->int_tx_mon_ring_mask[i] =
  1517. dp_mask_assignment[interrupt_index].tx_mon_ring_mask[i];
  1518. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  1519. dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
  1520. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  1521. dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
  1522. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  1523. dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
  1524. if (is_monitor_mode) {
  1525. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  1526. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1527. } else {
  1528. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1529. dp_mask_assignment[interrupt_index].rx_ring_mask[i];
  1530. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1531. dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
  1532. }
  1533. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1534. dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
  1535. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1536. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1537. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1538. dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
  1539. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1540. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
  1541. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1542. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
  1543. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1544. dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
  1545. }
  1546. }
  1547. #endif
  1548. #ifdef IPA_OFFLOAD
  1549. #define WLAN_CFG_IPA_ENABLE_MASK BIT(0)
  1550. #ifdef IPA_WDI3_TX_TWO_PIPES
  1551. /**
  1552. * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
  1553. * in dp soc cfg context
  1554. * @psoc: Object manager psoc
  1555. * @wlan_cfg_ctx: dp soc cfg ctx
  1556. *
  1557. * Return: None
  1558. */
  1559. static void
  1560. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1561. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1562. {
  1563. wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
  1564. WLAN_CFG_IPA_ENABLE_MASK);
  1565. wlan_cfg_ctx->ipa_tx_ring_size =
  1566. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1567. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1568. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1569. wlan_cfg_ctx->ipa_tx_alt_ring_size =
  1570. cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
  1571. wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
  1572. cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
  1573. }
  1574. #else /* !IPA_WDI3_TX_TWO_PIPES */
  1575. /**
  1576. * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
  1577. * cfg context
  1578. * @psoc - Object manager psoc
  1579. * @wlan_cfg_ctx - dp soc cfg ctx
  1580. *
  1581. * Return: None
  1582. */
  1583. static void
  1584. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1585. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1586. {
  1587. wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
  1588. WLAN_CFG_IPA_ENABLE_MASK);
  1589. wlan_cfg_ctx->ipa_tx_ring_size =
  1590. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1591. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1592. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1593. }
  1594. #endif /* IPA_WDI3_TX_TWO_PIPES */
  1595. #else /* !IPA_OFFLOAD */
  1596. static inline void
  1597. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1598. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1599. {
  1600. }
  1601. #endif
  1602. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  1603. static void
  1604. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1605. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1606. {
  1607. wlan_cfg_ctx->hw_cc_enabled =
  1608. cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
  1609. }
  1610. #else
  1611. static void
  1612. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1613. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1614. {
  1615. wlan_cfg_ctx->hw_cc_enabled = true;
  1616. }
  1617. #endif
  1618. #ifdef WLAN_SUPPORT_PPEDS
  1619. /**
  1620. * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc
  1621. * cfg context
  1622. * @psoc - Object manager psoc
  1623. * @wlan_cfg_ctx - dp soc cfg ctx
  1624. *
  1625. * Return: None
  1626. */
  1627. static void
  1628. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1629. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1630. {
  1631. wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE);
  1632. wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
  1633. wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
  1634. wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc,
  1635. CFG_DP_PPE_RELEASE_RING);
  1636. }
  1637. #else
  1638. static inline void
  1639. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1640. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1641. {
  1642. }
  1643. #endif
  1644. /**
  1645. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1646. * @psoc - Object manager psoc
  1647. * Return: wlan_cfg_ctx - Handle to Configuration context
  1648. */
  1649. struct wlan_cfg_dp_soc_ctxt *
  1650. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1651. {
  1652. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1653. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1654. if (!wlan_cfg_ctx)
  1655. return NULL;
  1656. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1657. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1658. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1659. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1660. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1661. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1662. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1663. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1664. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1665. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1666. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1667. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1668. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1669. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1670. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1671. CFG_DP_TX_EXT_DESC_POOLS);
  1672. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1673. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1674. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1675. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1676. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1677. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1678. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1679. CFG_DP_TX_COMPL_RING_SIZE);
  1680. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1681. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1682. wlan_cfg_ctx->int_batch_threshold_tx =
  1683. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1684. wlan_cfg_ctx->int_timer_threshold_tx =
  1685. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1686. wlan_cfg_ctx->int_batch_threshold_rx =
  1687. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1688. wlan_cfg_ctx->int_timer_threshold_rx =
  1689. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1690. wlan_cfg_ctx->int_batch_threshold_other =
  1691. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1692. wlan_cfg_ctx->int_timer_threshold_other =
  1693. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1694. wlan_cfg_ctx->pktlog_buffer_size =
  1695. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1696. /* This is default mapping and can be overridden by HW config
  1697. * received from FW */
  1698. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1699. if (MAX_PDEV_CNT > 1)
  1700. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1701. if (MAX_PDEV_CNT > 2)
  1702. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1703. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1704. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1705. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1706. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1707. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1708. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  1709. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1710. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1711. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1712. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1713. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1714. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1715. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1716. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1717. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1718. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1719. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1720. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1721. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1722. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1723. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1724. wlan_cfg_ctx->defrag_timeout_check =
  1725. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1726. wlan_cfg_ctx->rx_defrag_min_timeout =
  1727. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1728. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1729. CFG_DP_WBM_RELEASE_RING);
  1730. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1731. CFG_DP_TCL_CMD_CREDIT_RING);
  1732. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1733. CFG_DP_TCL_STATUS_RING);
  1734. wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc,
  1735. CFG_DP_RX_DESTINATION_RING);
  1736. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1737. CFG_DP_REO_REINJECT_RING);
  1738. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  1739. CFG_DP_RX_RELEASE_RING);
  1740. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  1741. CFG_DP_REO_EXCEPTION_RING);
  1742. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  1743. CFG_DP_REO_CMD_RING);
  1744. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  1745. CFG_DP_REO_STATUS_RING);
  1746. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  1747. CFG_DP_RXDMA_REFILL_RING);
  1748. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  1749. CFG_DP_TX_DESC_LIMIT_0);
  1750. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  1751. CFG_DP_TX_DESC_LIMIT_1);
  1752. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  1753. CFG_DP_TX_DESC_LIMIT_2);
  1754. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  1755. CFG_DP_TX_DEVICE_LIMIT);
  1756. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  1757. CFG_DP_TX_SW_INTERNODE_QUEUE);
  1758. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  1759. CFG_DP_RXDMA_ERR_DST_RING);
  1760. wlan_cfg_ctx->enable_data_stall_detection =
  1761. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  1762. wlan_cfg_ctx->enable_force_rx_64_ba =
  1763. cfg_get(psoc, CFG_FORCE_RX_64_BA);
  1764. wlan_cfg_ctx->tx_flow_start_queue_offset =
  1765. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  1766. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  1767. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  1768. wlan_cfg_ctx->disable_intra_bss_fwd =
  1769. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  1770. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  1771. CFG_DP_RX_SW_DESC_WEIGHT);
  1772. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  1773. CFG_DP_RX_SW_DESC_NUM);
  1774. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  1775. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  1776. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  1777. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  1778. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  1779. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  1780. wlan_cfg_ctx->rx_flow_search_table_size =
  1781. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  1782. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  1783. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  1784. wlan_cfg_ctx->mon_drop_thresh =
  1785. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  1786. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1787. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1788. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1789. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1790. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1791. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1792. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1793. wlan_cfg_ctx->rx_pending_high_threshold =
  1794. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1795. wlan_cfg_ctx->rx_pending_low_threshold =
  1796. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1797. wlan_cfg_ctx->is_poll_mode_enabled =
  1798. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1799. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1800. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1801. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1802. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1803. wlan_cfg_ctx->radio0_rx_default_reo =
  1804. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1805. wlan_cfg_ctx->radio1_rx_default_reo =
  1806. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1807. wlan_cfg_ctx->radio2_rx_default_reo =
  1808. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1809. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1810. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1811. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1812. CFG_DP_DELAY_MON_REPLENISH);
  1813. wlan_cfg_ctx->rx_mon_buf_ring_size = cfg_get(psoc,
  1814. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1815. wlan_cfg_ctx->tx_mon_buf_ring_size = cfg_get(psoc,
  1816. CFG_DP_TX_MONITOR_BUF_RING);
  1817. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  1818. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  1819. wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
  1820. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1821. wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
  1822. PKT_CAPTURE_MODE_DATA_ONLY;
  1823. #endif
  1824. return wlan_cfg_ctx;
  1825. }
  1826. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1827. {
  1828. qdf_mem_free(wlan_cfg_ctx);
  1829. }
  1830. struct wlan_cfg_dp_pdev_ctxt *
  1831. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1832. {
  1833. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1834. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1835. if (!wlan_cfg_ctx)
  1836. return NULL;
  1837. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1838. CFG_DP_RXDMA_BUF_RING);
  1839. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1840. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1841. wlan_cfg_ctx->dma_rx_mon_dest_ring_size = cfg_get(psoc,
  1842. CFG_DP_RXDMA_MONITOR_DST_RING);
  1843. wlan_cfg_ctx->dma_tx_mon_dest_ring_size = cfg_get(psoc,
  1844. CFG_DP_TX_MONITOR_DST_RING);
  1845. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1846. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1847. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1848. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1849. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1850. return wlan_cfg_ctx;
  1851. }
  1852. void wlan_cfg_set_mon_delayed_replenish_entries(
  1853. struct wlan_cfg_dp_soc_ctxt *cfg,
  1854. uint32_t val)
  1855. {
  1856. cfg->delayed_replenish_entries = val;
  1857. }
  1858. qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
  1859. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1860. {
  1861. return cfg->delayed_replenish_entries;
  1862. }
  1863. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1864. {
  1865. if (wlan_cfg_ctx)
  1866. qdf_mem_free(wlan_cfg_ctx);
  1867. }
  1868. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1869. {
  1870. return cfg->mon_drop_thresh;
  1871. }
  1872. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1873. {
  1874. cfg->num_int_ctxts = num;
  1875. }
  1876. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1877. {
  1878. cfg->max_peer_id = val;
  1879. }
  1880. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1881. {
  1882. cfg->max_ast_idx = val;
  1883. }
  1884. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1885. {
  1886. return cfg->max_ast_idx;
  1887. }
  1888. qdf_export_symbol(wlan_cfg_get_max_ast_idx);
  1889. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1890. int context, int mask)
  1891. {
  1892. cfg->int_tx_ring_mask[context] = mask;
  1893. }
  1894. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1895. int context, int mask)
  1896. {
  1897. cfg->int_rx_ring_mask[context] = mask;
  1898. }
  1899. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1900. int context, int mask)
  1901. {
  1902. cfg->int_rx_mon_ring_mask[context] = mask;
  1903. }
  1904. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1905. int context, int mask)
  1906. {
  1907. cfg->int_tx_mon_ring_mask[context] = mask;
  1908. }
  1909. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1910. int context)
  1911. {
  1912. return cfg->int_host2rxdma_mon_ring_mask[context];
  1913. }
  1914. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1915. int context, int mask)
  1916. {
  1917. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  1918. }
  1919. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1920. int context)
  1921. {
  1922. return cfg->int_rxdma2host_mon_ring_mask[context];
  1923. }
  1924. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1925. int context, int mask)
  1926. {
  1927. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  1928. }
  1929. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1930. int context, int mask)
  1931. {
  1932. cfg->int_rxdma2host_ring_mask[context] = mask;
  1933. }
  1934. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1935. int context)
  1936. {
  1937. return cfg->int_rxdma2host_ring_mask[context];
  1938. }
  1939. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1940. int context, int mask)
  1941. {
  1942. cfg->int_host2rxdma_ring_mask[context] = mask;
  1943. }
  1944. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1945. int context)
  1946. {
  1947. return cfg->int_host2rxdma_ring_mask[context];
  1948. }
  1949. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1950. int context)
  1951. {
  1952. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  1953. }
  1954. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1955. int context)
  1956. {
  1957. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  1958. }
  1959. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1960. int context)
  1961. {
  1962. return cfg->int_tx_ring_near_full_irq_mask[context];
  1963. }
  1964. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1965. int hw_macid)
  1966. {
  1967. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1968. cfg->hw_macid[pdev_idx] = hw_macid;
  1969. }
  1970. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  1971. {
  1972. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1973. return cfg->hw_macid[pdev_idx];
  1974. }
  1975. qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
  1976. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1977. int hw_macid)
  1978. {
  1979. int idx;
  1980. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  1981. if (cfg->hw_macid[idx] == hw_macid)
  1982. return (idx + 1);
  1983. }
  1984. qdf_assert_always(idx < MAX_PDEV_CNT);
  1985. return WLAN_INVALID_PDEV_ID;
  1986. }
  1987. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1988. int hw_macid)
  1989. {
  1990. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  1991. (pdev_idx == INVALID_PDEV_ID));
  1992. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1993. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  1994. }
  1995. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  1996. {
  1997. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1998. return cfg->hw_macid_pdev_id_map[hw_macid];
  1999. }
  2000. qdf_export_symbol(wlan_cfg_get_pdev_idx);
  2001. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2002. int context, int mask)
  2003. {
  2004. cfg->int_ce_ring_mask[context] = mask;
  2005. }
  2006. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  2007. int mask)
  2008. {
  2009. cfg->int_rx_ring_mask[context] = mask;
  2010. }
  2011. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2012. int context, int mask)
  2013. {
  2014. return cfg->int_rx_err_ring_mask[context] = mask;
  2015. }
  2016. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2017. int context, int mask)
  2018. {
  2019. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  2020. }
  2021. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2022. int context, int mask)
  2023. {
  2024. return cfg->int_reo_status_ring_mask[context] = mask;
  2025. }
  2026. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  2027. {
  2028. return cfg->num_int_ctxts;
  2029. }
  2030. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2031. {
  2032. return cfg->int_tx_ring_mask[context];
  2033. }
  2034. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2035. {
  2036. return cfg->int_rx_ring_mask[context];
  2037. }
  2038. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2039. int context)
  2040. {
  2041. return cfg->int_rx_err_ring_mask[context];
  2042. }
  2043. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2044. int context)
  2045. {
  2046. return cfg->int_rx_wbm_rel_ring_mask[context];
  2047. }
  2048. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2049. int context)
  2050. {
  2051. return cfg->int_reo_status_ring_mask[context];
  2052. }
  2053. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2054. {
  2055. return cfg->int_rx_mon_ring_mask[context];
  2056. }
  2057. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2058. {
  2059. return cfg->int_tx_mon_ring_mask[context];
  2060. }
  2061. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2062. {
  2063. return cfg->int_ce_ring_mask[context];
  2064. }
  2065. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  2066. {
  2067. return cfg->max_clients;
  2068. }
  2069. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2070. {
  2071. return cfg->max_alloc_size;
  2072. }
  2073. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2074. {
  2075. return cfg->per_pdev_tx_ring;
  2076. }
  2077. uint32_t
  2078. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2079. {
  2080. return cfg->rx_pending_high_threshold;
  2081. }
  2082. uint32_t
  2083. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2084. {
  2085. return cfg->rx_pending_low_threshold;
  2086. }
  2087. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2088. {
  2089. return cfg->per_pdev_lmac_ring;
  2090. }
  2091. qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
  2092. #if defined(DP_USE_SINGLE_TCL) && !defined(TX_MULTI_TCL)
  2093. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2094. {
  2095. return 1;
  2096. }
  2097. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2098. {
  2099. return 1;
  2100. }
  2101. #else
  2102. #if defined(IPA_OFFLOAD) && defined(TX_MULTI_TCL)
  2103. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2104. {
  2105. if (!cfg->ipa_enabled)
  2106. return cfg->num_tcl_data_rings;
  2107. return 1;
  2108. }
  2109. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2110. {
  2111. if (!cfg->ipa_enabled)
  2112. return cfg->num_nss_tcl_data_rings;
  2113. return 1;
  2114. }
  2115. #else
  2116. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2117. {
  2118. return cfg->num_tcl_data_rings;
  2119. }
  2120. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2121. {
  2122. return cfg->num_nss_tcl_data_rings;
  2123. }
  2124. #endif
  2125. #endif
  2126. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2127. {
  2128. return cfg->tx_ring_size;
  2129. }
  2130. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2131. {
  2132. return cfg->tx_comp_ring_size;
  2133. }
  2134. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2135. {
  2136. return cfg->per_pdev_rx_ring;
  2137. }
  2138. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2139. {
  2140. return cfg->num_reo_dest_rings;
  2141. }
  2142. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2143. {
  2144. return cfg->num_nss_reo_dest_rings;
  2145. }
  2146. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  2147. {
  2148. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  2149. }
  2150. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2151. {
  2152. return cfg->num_tx_desc_pool;
  2153. }
  2154. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2155. {
  2156. cfg->num_tx_desc_pool = num_pool;
  2157. }
  2158. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2159. {
  2160. return cfg->num_tx_ext_desc_pool;
  2161. }
  2162. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2163. {
  2164. cfg->num_tx_ext_desc_pool = num_pool;
  2165. }
  2166. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2167. {
  2168. return cfg->reo_dst_ring_size;
  2169. }
  2170. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2171. int reo_dst_ring_size)
  2172. {
  2173. cfg->reo_dst_ring_size = reo_dst_ring_size;
  2174. }
  2175. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  2176. bool raw_mode_war)
  2177. {
  2178. cfg->raw_mode_war = raw_mode_war;
  2179. }
  2180. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  2181. {
  2182. return cfg->raw_mode_war;
  2183. }
  2184. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2185. {
  2186. return cfg->num_tx_desc;
  2187. }
  2188. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  2189. {
  2190. cfg->num_tx_desc = num_desc;
  2191. }
  2192. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2193. {
  2194. return cfg->min_tx_desc;
  2195. }
  2196. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2197. {
  2198. return cfg->num_tx_ext_desc;
  2199. }
  2200. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  2201. {
  2202. cfg->num_tx_ext_desc = num_ext_desc;
  2203. }
  2204. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2205. {
  2206. /* TODO: This should be calculated based on target capabilities */
  2207. return cfg->max_peer_id;
  2208. }
  2209. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2210. {
  2211. return cfg->dma_mon_buf_ring_size;
  2212. }
  2213. qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
  2214. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2215. {
  2216. return cfg->dma_rx_mon_dest_ring_size;
  2217. }
  2218. qdf_export_symbol(wlan_cfg_get_dma_rx_mon_dest_ring_size);
  2219. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2220. {
  2221. return cfg->dma_tx_mon_dest_ring_size;
  2222. }
  2223. qdf_export_symbol(wlan_cfg_get_dma_tx_mon_dest_ring_size);
  2224. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2225. {
  2226. return cfg->dma_mon_status_ring_size;
  2227. }
  2228. qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
  2229. int
  2230. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2231. {
  2232. return cfg->rxdma_monitor_desc_ring;
  2233. }
  2234. qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
  2235. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2236. {
  2237. return cfg->rx_dma_buf_ring_size;
  2238. }
  2239. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2240. {
  2241. return cfg->num_mac_rings;
  2242. }
  2243. qdf_export_symbol(wlan_cfg_get_num_mac_rings);
  2244. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2245. {
  2246. return cfg->gro_enabled;
  2247. }
  2248. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2249. {
  2250. return cfg->lro_enabled;
  2251. }
  2252. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2253. {
  2254. return cfg->ipa_enabled;
  2255. }
  2256. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  2257. {
  2258. cfg->rx_hash = val;
  2259. }
  2260. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2261. {
  2262. return cfg->rx_hash;
  2263. }
  2264. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2265. {
  2266. return cfg->nss_enabled;
  2267. }
  2268. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  2269. {
  2270. cfg->nss_enabled = nss_enabled;
  2271. }
  2272. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  2273. {
  2274. return cfg->nss_cfg;
  2275. }
  2276. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  2277. {
  2278. cfg->nss_cfg = nss_cfg;
  2279. if (cfg->nss_cfg)
  2280. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  2281. }
  2282. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2283. {
  2284. return cfg->int_batch_threshold_tx;
  2285. }
  2286. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2287. {
  2288. return cfg->int_timer_threshold_tx;
  2289. }
  2290. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2291. {
  2292. return cfg->int_batch_threshold_rx;
  2293. }
  2294. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2295. {
  2296. return cfg->int_timer_threshold_rx;
  2297. }
  2298. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2299. {
  2300. return cfg->int_batch_threshold_other;
  2301. }
  2302. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2303. {
  2304. return cfg->int_timer_threshold_other;
  2305. }
  2306. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  2307. {
  2308. return cfg->int_timer_threshold_mon;
  2309. }
  2310. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2311. {
  2312. return cfg->p2p_tcp_udp_checksumoffload;
  2313. }
  2314. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2315. {
  2316. return cfg->nan_tcp_udp_checksumoffload;
  2317. }
  2318. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2319. {
  2320. return cfg->tcp_udp_checksumoffload;
  2321. }
  2322. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  2323. {
  2324. return cfg->rx_defrag_min_timeout;
  2325. }
  2326. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  2327. {
  2328. return cfg->defrag_timeout_check;
  2329. }
  2330. int
  2331. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2332. {
  2333. return cfg->wbm_release_ring;
  2334. }
  2335. int
  2336. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2337. {
  2338. return cfg->tcl_cmd_credit_ring;
  2339. }
  2340. int
  2341. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2342. {
  2343. return cfg->tcl_status_ring;
  2344. }
  2345. int
  2346. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2347. {
  2348. return cfg->reo_reinject_ring;
  2349. }
  2350. int
  2351. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2352. {
  2353. return cfg->rx_release_ring;
  2354. }
  2355. int
  2356. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2357. {
  2358. return cfg->reo_exception_ring;
  2359. }
  2360. int
  2361. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2362. {
  2363. return cfg->reo_cmd_ring;
  2364. }
  2365. int
  2366. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2367. {
  2368. return cfg->reo_status_ring;
  2369. }
  2370. int
  2371. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2372. {
  2373. return cfg->rxdma_refill_ring;
  2374. }
  2375. int
  2376. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  2377. {
  2378. return cfg->tx_desc_limit_0;
  2379. }
  2380. int
  2381. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  2382. {
  2383. return cfg->tx_desc_limit_1;
  2384. }
  2385. int
  2386. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  2387. {
  2388. return cfg->tx_desc_limit_2;
  2389. }
  2390. int
  2391. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  2392. {
  2393. return cfg->tx_device_limit;
  2394. }
  2395. int
  2396. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  2397. {
  2398. return cfg->tx_sw_internode_queue;
  2399. }
  2400. int
  2401. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2402. {
  2403. return cfg->rxdma_err_dst_ring;
  2404. }
  2405. int
  2406. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  2407. {
  2408. return cfg->rx_sw_desc_weight;
  2409. }
  2410. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
  2411. int
  2412. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  2413. {
  2414. return cfg->rx_sw_desc_num;
  2415. }
  2416. uint32_t
  2417. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  2418. {
  2419. return cfg->reo_rings_mapping;
  2420. }
  2421. bool
  2422. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  2423. enum cdp_capabilities dp_caps)
  2424. {
  2425. switch (dp_caps) {
  2426. case CDP_CFG_DP_TSO:
  2427. return cfg->tso_enabled;
  2428. case CDP_CFG_DP_LRO:
  2429. return cfg->lro_enabled;
  2430. case CDP_CFG_DP_SG:
  2431. return cfg->sg_enabled;
  2432. case CDP_CFG_DP_GRO:
  2433. return cfg->gro_enabled;
  2434. case CDP_CFG_DP_OL_TX_CSUM:
  2435. return cfg->ol_tx_csum_enabled;
  2436. case CDP_CFG_DP_OL_RX_CSUM:
  2437. return cfg->ol_rx_csum_enabled;
  2438. case CDP_CFG_DP_RAWMODE:
  2439. return cfg->rawmode_enabled;
  2440. case CDP_CFG_DP_PEER_FLOW_CTRL:
  2441. return cfg->peer_flow_ctrl_enabled;
  2442. default:
  2443. return false;
  2444. }
  2445. }
  2446. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  2447. bool val)
  2448. {
  2449. cfg->is_tso_desc_attach_defer = val;
  2450. }
  2451. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2452. {
  2453. return cfg->is_tso_desc_attach_defer;
  2454. }
  2455. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  2456. /**
  2457. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  2458. * @cfg: config context
  2459. *
  2460. * Return: stop threshold
  2461. */
  2462. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  2463. {
  2464. return cfg->tx_flow_stop_queue_threshold;
  2465. }
  2466. /**
  2467. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  2468. * for TX to resume
  2469. * @cfg: config context
  2470. *
  2471. * Return: stop threshold
  2472. */
  2473. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  2474. {
  2475. return cfg->tx_flow_start_queue_offset;
  2476. }
  2477. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  2478. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2479. bool val)
  2480. {
  2481. cfg->is_rx_flow_tag_enabled = val;
  2482. }
  2483. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  2484. {
  2485. return cfg->rx_toeplitz_hash_key;
  2486. }
  2487. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  2488. {
  2489. return cfg->rx_flow_max_search;
  2490. }
  2491. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2492. {
  2493. return cfg->is_rx_flow_tag_enabled;
  2494. }
  2495. qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
  2496. #ifdef WLAN_SUPPORT_RX_FISA
  2497. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2498. {
  2499. return (bool)(cfg->is_rx_fisa_enabled);
  2500. }
  2501. #else
  2502. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2503. {
  2504. return false;
  2505. }
  2506. #endif
  2507. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2508. {
  2509. return (bool)(cfg->is_poll_mode_enabled);
  2510. }
  2511. void
  2512. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  2513. bool val)
  2514. {
  2515. cfg->is_rx_flow_search_table_per_pdev = val;
  2516. }
  2517. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  2518. {
  2519. return cfg->is_rx_flow_search_table_per_pdev;
  2520. }
  2521. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2522. uint16_t val)
  2523. {
  2524. cfg->rx_flow_search_table_size = val;
  2525. }
  2526. uint16_t
  2527. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2528. {
  2529. return cfg->rx_flow_search_table_size;
  2530. }
  2531. void
  2532. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2533. bool val)
  2534. {
  2535. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  2536. }
  2537. bool
  2538. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2539. {
  2540. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  2541. }
  2542. qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
  2543. void
  2544. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  2545. bool val)
  2546. {
  2547. cfg->tx_per_pkt_vdev_id_check = val;
  2548. }
  2549. bool
  2550. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2551. {
  2552. return cfg->tx_per_pkt_vdev_id_check;
  2553. }
  2554. void
  2555. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  2556. bool val)
  2557. {
  2558. cfg->pext_stats_enabled = val;
  2559. }
  2560. bool
  2561. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2562. {
  2563. return cfg->pext_stats_enabled;
  2564. }
  2565. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2566. {
  2567. return cfg->fst_in_cmem;
  2568. }
  2569. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  2570. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2571. {
  2572. return cfg->is_rx_buff_pool_enabled;
  2573. }
  2574. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2575. {
  2576. return cfg->is_rx_refill_buff_pool_enabled;
  2577. }
  2578. #else
  2579. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2580. {
  2581. return false;
  2582. }
  2583. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  2584. struct wlan_cfg_dp_soc_ctxt *cfg)
  2585. {
  2586. return false;
  2587. }
  2588. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  2589. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  2590. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2591. {
  2592. return (bool)(cfg->is_swlm_enabled);
  2593. }
  2594. #else
  2595. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2596. {
  2597. return false;
  2598. }
  2599. #endif
  2600. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2601. {
  2602. return cfg->radio0_rx_default_reo;
  2603. }
  2604. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2605. {
  2606. return cfg->radio1_rx_default_reo;
  2607. }
  2608. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2609. {
  2610. return cfg->radio2_rx_default_reo;
  2611. }
  2612. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  2613. {
  2614. cfg->rxdma1_enable = true;
  2615. }
  2616. bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
  2617. {
  2618. return cfg->enable_force_rx_64_ba;
  2619. }
  2620. void
  2621. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  2622. bool val)
  2623. {
  2624. cfg->delay_mon_replenish = val;
  2625. }
  2626. bool
  2627. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  2628. {
  2629. return cfg->delay_mon_replenish;
  2630. }
  2631. qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
  2632. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  2633. {
  2634. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  2635. cfg->delay_mon_replenish);
  2636. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  2637. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  2638. }
  2639. #ifdef IPA_OFFLOAD
  2640. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2641. {
  2642. return cfg->ipa_tx_ring_size;
  2643. }
  2644. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2645. {
  2646. return cfg->ipa_tx_comp_ring_size;
  2647. }
  2648. #ifdef IPA_WDI3_TX_TWO_PIPES
  2649. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2650. {
  2651. return cfg->ipa_tx_alt_ring_size;
  2652. }
  2653. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2654. {
  2655. return cfg->ipa_tx_alt_comp_ring_size;
  2656. }
  2657. #else
  2658. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2659. {
  2660. return cfg->ipa_tx_ring_size;
  2661. }
  2662. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2663. {
  2664. return cfg->ipa_tx_comp_ring_size;
  2665. }
  2666. #endif
  2667. #endif
  2668. #ifdef WLAN_SUPPORT_PPEDS
  2669. bool
  2670. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2671. {
  2672. return cfg->ppe_enable;
  2673. }
  2674. int
  2675. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2676. {
  2677. return cfg->reo2ppe_ring;
  2678. }
  2679. int
  2680. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2681. {
  2682. return cfg->ppe2tcl_ring;
  2683. }
  2684. int
  2685. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2686. {
  2687. return cfg->ppe_release_ring;
  2688. }
  2689. #endif
  2690. void
  2691. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2692. struct wlan_dp_prealloc_cfg *cfg)
  2693. {
  2694. if (!ctrl_psoc || !cfg)
  2695. return;
  2696. cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
  2697. cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
  2698. CFG_DP_TX_COMPL_RING_SIZE);
  2699. cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
  2700. CFG_DP_WBM_RELEASE_RING);
  2701. cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
  2702. CFG_DP_RXDMA_ERR_DST_RING);
  2703. cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
  2704. CFG_DP_REO_EXCEPTION_RING);
  2705. cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
  2706. cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
  2707. }
  2708. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2709. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2710. {
  2711. return cfg->pkt_capture_mode;
  2712. }
  2713. #endif
  2714. uint32_t
  2715. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2716. {
  2717. return cfg->rx_mon_buf_ring_size;
  2718. }
  2719. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_mon_buf_ring_size);
  2720. uint32_t
  2721. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2722. {
  2723. return cfg->tx_mon_buf_ring_size;
  2724. }
  2725. qdf_export_symbol(wlan_cfg_get_dp_soc_tx_mon_buf_ring_size);
  2726. uint8_t
  2727. wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2728. {
  2729. return cfg->rx_rel_wbm2sw_ring_id;
  2730. }
  2731. void
  2732. wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2733. uint8_t wbm2sw_ring_id)
  2734. {
  2735. cfg->rx_rel_wbm2sw_ring_id = wbm2sw_ring_id;
  2736. }