wlan_cfg.c 85 KB

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