wlan_cfg.c 66 KB

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