wlan_cfg.c 87 KB

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