wlan_cfg.c 59 KB

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