wlan_cfg.c 64 KB

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