wlan_cfg.c 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. /*
  2. * Copyright (c) 2016-2020 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_RING_MASK_0 0x1
  46. #define WLAN_CFG_RX_RING_MASK_1 0x2
  47. #define WLAN_CFG_RX_RING_MASK_2 0x4
  48. #define WLAN_CFG_RX_RING_MASK_3 0x8
  49. #define WLAN_CFG_RX_MON_RING_MASK_0 0x1
  50. #define WLAN_CFG_RX_MON_RING_MASK_1 0x2
  51. #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
  52. #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
  53. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
  54. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
  55. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
  56. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
  57. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
  58. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
  59. #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
  60. #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
  61. #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
  62. #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
  63. #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
  64. #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
  65. #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
  66. #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
  67. #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
  68. #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
  69. #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
  70. #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
  71. #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
  72. #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
  73. #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
  74. #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
  75. #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
  76. #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
  77. #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
  78. #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
  79. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  80. static const int tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  81. WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0};
  82. #ifndef IPA_OFFLOAD
  83. static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  84. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0};
  85. #else
  86. static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  87. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, 0, 0, 0};
  88. #endif
  89. static const int rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  90. 0, WLAN_CFG_RX_MON_RING_MASK_0, WLAN_CFG_RX_MON_RING_MASK_1, 0, 0, 0, 0};
  91. static const int host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  92. 0, 0, 0, 0, 0, 0, 0};
  93. static const int rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  94. 0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0, WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  95. static const int host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  96. 0, 0, 0, 0, 0, 0, 0};
  97. static const int rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  98. 0, 0, 0, 0, 0, 0, 0};
  99. static const int rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  100. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0};
  101. static const int rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  102. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  103. static const int reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  104. 0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0};
  105. static const int tx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  106. 0, 0, 0, 0, 0, 0, 0};
  107. static const int rx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  108. 0, 0, 0, 0, 0, 0, 0};
  109. static const int rx_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  110. 0, 0, 0, 0, 0, 0, 0};
  111. static const int host2rxdma_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  112. 0, 0, 0, 0, 0, 0, 0};
  113. static const int rxdma2host_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  114. 0, 0, 0, 0, 0, 0, 0};
  115. static const int host2rxdma_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  116. 0, 0, 0, 0, 0, 0, 0};
  117. static const int rxdma2host_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  118. 0, 0, 0, 0, 0, 0, 0};
  119. static const int rx_err_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  120. 0, 0, 0, 0, 0, 0, 0};
  121. static const int rx_wbm_rel_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  122. 0, 0, 0, 0, 0, 0, 0};
  123. static const int reo_status_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  124. 0, 0, 0, 0, 0, 0, 0};
  125. #else
  126. static const int tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  127. WLAN_CFG_TX_RING_MASK_0,
  128. WLAN_CFG_TX_RING_MASK_1,
  129. WLAN_CFG_TX_RING_MASK_2,
  130. WLAN_CFG_TX_RING_MASK_3};
  131. static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  132. 0,
  133. 0,
  134. 0,
  135. 0,
  136. WLAN_CFG_RX_RING_MASK_0,
  137. WLAN_CFG_RX_RING_MASK_1,
  138. WLAN_CFG_RX_RING_MASK_2,
  139. WLAN_CFG_RX_RING_MASK_3};
  140. static const int rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  141. 0,
  142. 0,
  143. 0,
  144. WLAN_CFG_RX_MON_RING_MASK_0,
  145. WLAN_CFG_RX_MON_RING_MASK_1,
  146. WLAN_CFG_RX_MON_RING_MASK_2};
  147. static const int host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  148. 0,
  149. 0,
  150. 0,
  151. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  152. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  153. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  154. WLAN_CFG_HOST2RXDMA_RING_MASK_3};
  155. static const int rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  156. 0,
  157. 0,
  158. 0,
  159. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  160. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  161. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  162. WLAN_CFG_RXDMA2HOST_RING_MASK_3};
  163. static const int host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  164. 0,
  165. 0,
  166. 0,
  167. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  168. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  169. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2};
  170. static const int rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  171. 0,
  172. 0,
  173. 0,
  174. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  175. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  176. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2};
  177. static const int rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  178. 0,
  179. 0,
  180. 0,
  181. WLAN_CFG_RX_ERR_RING_MASK_0,
  182. WLAN_CFG_RX_ERR_RING_MASK_1,
  183. WLAN_CFG_RX_ERR_RING_MASK_2,
  184. WLAN_CFG_RX_ERR_RING_MASK_3};
  185. static const int rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  186. 0,
  187. 0,
  188. 0,
  189. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  190. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  191. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  192. WLAN_CFG_RX_WBM_REL_RING_MASK_3};
  193. static const int reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  194. 0,
  195. 0,
  196. 0,
  197. WLAN_CFG_REO_STATUS_RING_MASK_0,
  198. WLAN_CFG_REO_STATUS_RING_MASK_1,
  199. WLAN_CFG_REO_STATUS_RING_MASK_2,
  200. WLAN_CFG_REO_STATUS_RING_MASK_3};
  201. static const int tx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  202. WLAN_CFG_TX_RING_MASK_0,
  203. WLAN_CFG_TX_RING_MASK_1,
  204. WLAN_CFG_TX_RING_MASK_2,
  205. WLAN_CFG_TX_RING_MASK_3};
  206. static const int rx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  207. 0,
  208. 0,
  209. 0,
  210. 0,
  211. 0,
  212. 0,
  213. 0,
  214. WLAN_CFG_RX_RING_MASK_0,
  215. WLAN_CFG_RX_RING_MASK_1,
  216. WLAN_CFG_RX_RING_MASK_2,
  217. WLAN_CFG_RX_RING_MASK_3};
  218. static const int rx_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  219. 0,
  220. 0,
  221. 0,
  222. 0,
  223. WLAN_CFG_RX_MON_RING_MASK_0,
  224. WLAN_CFG_RX_MON_RING_MASK_1,
  225. WLAN_CFG_RX_MON_RING_MASK_2};
  226. static const int host2rxdma_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  227. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  228. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  229. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  230. WLAN_CFG_HOST2RXDMA_RING_MASK_3};
  231. static const int rxdma2host_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  232. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  233. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  234. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  235. WLAN_CFG_RXDMA2HOST_RING_MASK_3};
  236. static const int host2rxdma_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  237. 0,
  238. 0,
  239. 0,
  240. 0,
  241. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  242. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  243. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2};
  244. static const int rxdma2host_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  245. 0,
  246. 0,
  247. 0,
  248. 0,
  249. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  250. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  251. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2};
  252. static const int rx_err_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  253. WLAN_CFG_RX_ERR_RING_MASK_0,
  254. WLAN_CFG_RX_ERR_RING_MASK_1,
  255. WLAN_CFG_RX_ERR_RING_MASK_2,
  256. WLAN_CFG_RX_ERR_RING_MASK_3};
  257. static const int rx_wbm_rel_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  258. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  259. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  260. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  261. WLAN_CFG_RX_WBM_REL_RING_MASK_3};
  262. static const int reo_status_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
  263. WLAN_CFG_REO_STATUS_RING_MASK_0,
  264. WLAN_CFG_REO_STATUS_RING_MASK_1,
  265. WLAN_CFG_REO_STATUS_RING_MASK_2,
  266. WLAN_CFG_REO_STATUS_RING_MASK_3};
  267. #endif /* MAX_PDEV_CNT == 1 */
  268. /**
  269. * g_wlan_srng_cfg[] - Per ring_type specific configuration
  270. *
  271. */
  272. struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
  273. /* REO_DST ring configuration */
  274. struct wlan_srng_cfg wlan_srng_reo_cfg = {
  275. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
  276. .batch_count_threshold = 0,
  277. .low_threshold = 0,
  278. };
  279. /* WBM2SW_RELEASE ring configuration */
  280. struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
  281. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
  282. .batch_count_threshold = 0,
  283. .low_threshold = 0,
  284. };
  285. /* RXDMA_BUF ring configuration */
  286. struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
  287. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  288. .batch_count_threshold = 0,
  289. .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
  290. };
  291. /* RXDMA_MONITOR_BUF ring configuration */
  292. struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
  293. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  294. .batch_count_threshold = 0,
  295. .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
  296. };
  297. /* RXDMA_MONITOR_STATUS ring configuration */
  298. struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
  299. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  300. .batch_count_threshold = 0,
  301. .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
  302. };
  303. /* DEFAULT_CONFIG ring configuration */
  304. struct wlan_srng_cfg wlan_srng_default_cfg = {
  305. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
  306. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
  307. .low_threshold = 0,
  308. };
  309. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
  310. {
  311. g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
  312. g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
  313. g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
  314. g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
  315. g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
  316. g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
  317. g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
  318. g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
  319. g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
  320. g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
  321. g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
  322. g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
  323. g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
  324. g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
  325. wlan_srng_rxdma_monitor_buf_cfg;
  326. g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
  327. wlan_srng_rxdma_monitor_status_cfg;
  328. g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
  329. g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
  330. g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
  331. #ifdef WLAN_FEATURE_CIF_CFR
  332. g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
  333. #endif
  334. *wlan_cfg = g_wlan_srng_cfg;
  335. }
  336. static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
  337. 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
  338. 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
  339. 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
  340. 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
  341. 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
  342. };
  343. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  344. int interrupt_mode,
  345. bool is_monitor_mode) {
  346. int i = 0;
  347. if (interrupt_mode == DP_INTR_INTEGRATED) {
  348. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  349. wlan_cfg_ctx->int_tx_ring_mask[i] =
  350. tx_ring_mask_integrated[i];
  351. wlan_cfg_ctx->int_rx_ring_mask[i] =
  352. rx_ring_mask_integrated[i];
  353. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  354. rx_mon_ring_mask_integrated[i];
  355. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  356. rx_err_ring_mask_integrated[i];
  357. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  358. rx_wbm_rel_ring_mask_integrated[i];
  359. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  360. reo_status_ring_mask_integrated[i];
  361. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  362. rxdma2host_ring_mask_integrated[i];
  363. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  364. host2rxdma_ring_mask_integrated[i];
  365. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  366. host2rxdma_mon_ring_mask_integrated[i];
  367. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  368. rxdma2host_mon_ring_mask_integrated[i];
  369. }
  370. } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
  371. DP_INTR_POLL) {
  372. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  373. wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i];
  374. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  375. rx_mon_ring_mask_msi[i];
  376. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  377. rx_err_ring_mask_msi[i];
  378. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  379. rx_wbm_rel_ring_mask_msi[i];
  380. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  381. reo_status_ring_mask_msi[i];
  382. if (is_monitor_mode) {
  383. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  384. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  385. } else {
  386. wlan_cfg_ctx->int_rx_ring_mask[i] =
  387. rx_ring_mask_msi[i];
  388. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  389. rxdma2host_ring_mask_msi[i];
  390. }
  391. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  392. host2rxdma_ring_mask_msi[i];
  393. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  394. host2rxdma_mon_ring_mask_msi[i];
  395. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  396. rxdma2host_mon_ring_mask_msi[i];
  397. }
  398. } else {
  399. qdf_err("Interrupt mode %d", interrupt_mode);
  400. }
  401. }
  402. /**
  403. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  404. * @psoc - Object manager psoc
  405. * Return: wlan_cfg_ctx - Handle to Configuration context
  406. */
  407. struct wlan_cfg_dp_soc_ctxt *
  408. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  409. {
  410. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  411. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  412. if (!wlan_cfg_ctx)
  413. return NULL;
  414. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  415. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  416. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  417. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  418. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  419. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  420. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  421. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  422. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  423. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  424. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  425. CFG_DP_TX_EXT_DESC_POOLS);
  426. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  427. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  428. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  429. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  430. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  431. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  432. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  433. CFG_DP_TX_COMPL_RING_SIZE);
  434. wlan_cfg_ctx->tx_comp_ring_size_nss =
  435. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  436. wlan_cfg_ctx->int_batch_threshold_tx =
  437. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  438. wlan_cfg_ctx->int_timer_threshold_tx =
  439. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  440. wlan_cfg_ctx->int_batch_threshold_rx =
  441. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  442. wlan_cfg_ctx->int_timer_threshold_rx =
  443. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  444. wlan_cfg_ctx->int_batch_threshold_other =
  445. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  446. wlan_cfg_ctx->int_timer_threshold_other =
  447. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  448. wlan_cfg_ctx->pktlog_buffer_size =
  449. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  450. /* This is default mapping and can be overridden by HW config
  451. * received from FW */
  452. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  453. if (MAX_PDEV_CNT > 1)
  454. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  455. if (MAX_PDEV_CNT > 2)
  456. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  457. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  458. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  459. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  460. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  461. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  462. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  463. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  464. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  465. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  466. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  467. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  468. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  469. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  470. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  471. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  472. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  473. wlan_cfg_ctx->tcp_udp_checksumoffload =
  474. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  475. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  476. wlan_cfg_ctx->defrag_timeout_check =
  477. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  478. wlan_cfg_ctx->rx_defrag_min_timeout =
  479. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  480. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  481. CFG_DP_WBM_RELEASE_RING);
  482. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  483. CFG_DP_TCL_CMD_CREDIT_RING);
  484. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  485. CFG_DP_TCL_STATUS_RING);
  486. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  487. CFG_DP_REO_REINJECT_RING);
  488. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  489. CFG_DP_RX_RELEASE_RING);
  490. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  491. CFG_DP_REO_EXCEPTION_RING);
  492. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  493. CFG_DP_REO_CMD_RING);
  494. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  495. CFG_DP_REO_STATUS_RING);
  496. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  497. CFG_DP_RXDMA_REFILL_RING);
  498. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  499. CFG_DP_TX_DESC_LIMIT_0);
  500. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  501. CFG_DP_TX_DESC_LIMIT_1);
  502. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  503. CFG_DP_TX_DESC_LIMIT_2);
  504. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  505. CFG_DP_TX_DEVICE_LIMIT);
  506. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  507. CFG_DP_TX_SW_INTERNODE_QUEUE);
  508. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  509. CFG_DP_RXDMA_ERR_DST_RING);
  510. wlan_cfg_ctx->enable_data_stall_detection =
  511. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  512. wlan_cfg_ctx->tx_flow_start_queue_offset =
  513. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  514. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  515. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  516. wlan_cfg_ctx->disable_intra_bss_fwd =
  517. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  518. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  519. CFG_DP_RX_SW_DESC_WEIGHT);
  520. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  521. CFG_DP_RX_SW_DESC_NUM);
  522. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  523. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  524. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  525. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  526. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  527. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  528. wlan_cfg_ctx->rx_flow_search_table_size =
  529. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  530. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  531. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  532. wlan_cfg_ctx->mon_drop_thresh =
  533. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  534. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  535. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  536. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  537. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  538. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  539. return wlan_cfg_ctx;
  540. }
  541. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  542. {
  543. qdf_mem_free(wlan_cfg_ctx);
  544. }
  545. struct wlan_cfg_dp_pdev_ctxt *
  546. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  547. {
  548. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  549. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  550. if (!wlan_cfg_ctx)
  551. return NULL;
  552. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  553. CFG_DP_RXDMA_BUF_RING);
  554. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  555. CFG_DP_RXDMA_MONITOR_BUF_RING);
  556. wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
  557. CFG_DP_RXDMA_MONITOR_DST_RING);
  558. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  559. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  560. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  561. CFG_DP_RXDMA_MONITOR_DESC_RING);
  562. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  563. return wlan_cfg_ctx;
  564. }
  565. void wlan_cfg_set_mon_delayed_replenish_entries(
  566. struct wlan_cfg_dp_soc_ctxt *cfg,
  567. uint32_t val)
  568. {
  569. cfg->delayed_replenish_entries = val;
  570. }
  571. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  572. {
  573. return cfg->delayed_replenish_entries;
  574. }
  575. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  576. {
  577. if (wlan_cfg_ctx)
  578. qdf_mem_free(wlan_cfg_ctx);
  579. }
  580. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  581. {
  582. return cfg->mon_drop_thresh;
  583. }
  584. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  585. {
  586. cfg->num_int_ctxts = num;
  587. }
  588. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  589. {
  590. cfg->max_peer_id = val;
  591. }
  592. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  593. {
  594. cfg->max_ast_idx = val;
  595. }
  596. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  597. {
  598. return cfg->max_ast_idx;
  599. }
  600. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  601. int context, int mask)
  602. {
  603. cfg->int_tx_ring_mask[context] = mask;
  604. }
  605. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  606. int context, int mask)
  607. {
  608. cfg->int_rx_ring_mask[context] = mask;
  609. }
  610. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  611. int context, int mask)
  612. {
  613. cfg->int_rx_mon_ring_mask[context] = mask;
  614. }
  615. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  616. int context)
  617. {
  618. return cfg->int_host2rxdma_mon_ring_mask[context];
  619. }
  620. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  621. int context, int mask)
  622. {
  623. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  624. }
  625. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  626. int context)
  627. {
  628. return cfg->int_rxdma2host_mon_ring_mask[context];
  629. }
  630. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  631. int context, int mask)
  632. {
  633. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  634. }
  635. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  636. int context, int mask)
  637. {
  638. cfg->int_rxdma2host_ring_mask[context] = mask;
  639. }
  640. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  641. int context)
  642. {
  643. return cfg->int_rxdma2host_ring_mask[context];
  644. }
  645. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  646. int context, int mask)
  647. {
  648. cfg->int_host2rxdma_ring_mask[context] = mask;
  649. }
  650. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  651. int context)
  652. {
  653. return cfg->int_host2rxdma_ring_mask[context];
  654. }
  655. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  656. int hw_macid)
  657. {
  658. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  659. cfg->hw_macid[pdev_idx] = hw_macid;
  660. }
  661. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  662. {
  663. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  664. return cfg->hw_macid[pdev_idx];
  665. }
  666. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  667. int hw_macid)
  668. {
  669. int idx;
  670. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  671. if (cfg->hw_macid[idx] == hw_macid)
  672. return (idx + 1);
  673. }
  674. qdf_assert_always(idx < MAX_PDEV_CNT);
  675. return WLAN_INVALID_PDEV_ID;
  676. }
  677. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  678. int hw_macid)
  679. {
  680. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  681. (pdev_idx == INVALID_PDEV_ID));
  682. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  683. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  684. }
  685. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  686. {
  687. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  688. return cfg->hw_macid_pdev_id_map[hw_macid];
  689. }
  690. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  691. int context, int mask)
  692. {
  693. cfg->int_ce_ring_mask[context] = mask;
  694. }
  695. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  696. int mask)
  697. {
  698. cfg->int_rx_ring_mask[context] = mask;
  699. }
  700. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  701. int context, int mask)
  702. {
  703. return cfg->int_rx_err_ring_mask[context] = mask;
  704. }
  705. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  706. int context, int mask)
  707. {
  708. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  709. }
  710. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  711. int context, int mask)
  712. {
  713. return cfg->int_reo_status_ring_mask[context] = mask;
  714. }
  715. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  716. {
  717. return cfg->num_int_ctxts;
  718. }
  719. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  720. {
  721. return cfg->int_tx_ring_mask[context];
  722. }
  723. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  724. {
  725. return cfg->int_rx_ring_mask[context];
  726. }
  727. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  728. int context)
  729. {
  730. return cfg->int_rx_err_ring_mask[context];
  731. }
  732. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  733. int context)
  734. {
  735. return cfg->int_rx_wbm_rel_ring_mask[context];
  736. }
  737. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  738. int context)
  739. {
  740. return cfg->int_reo_status_ring_mask[context];
  741. }
  742. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  743. {
  744. return cfg->int_rx_mon_ring_mask[context];
  745. }
  746. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  747. {
  748. return cfg->int_ce_ring_mask[context];
  749. }
  750. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  751. {
  752. return cfg->max_clients;
  753. }
  754. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  755. {
  756. return cfg->max_alloc_size;
  757. }
  758. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  759. {
  760. return cfg->per_pdev_tx_ring;
  761. }
  762. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  763. {
  764. return cfg->per_pdev_lmac_ring;
  765. }
  766. #ifdef DP_MEMORY_OPT
  767. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  768. {
  769. return 1;
  770. }
  771. #else
  772. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  773. {
  774. return cfg->num_tcl_data_rings;
  775. }
  776. #endif
  777. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  778. {
  779. return cfg->tx_ring_size;
  780. }
  781. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  782. {
  783. return cfg->tx_comp_ring_size;
  784. }
  785. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  786. {
  787. return cfg->per_pdev_rx_ring;
  788. }
  789. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  790. {
  791. return cfg->num_reo_dest_rings;
  792. }
  793. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  794. {
  795. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  796. }
  797. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  798. {
  799. return cfg->num_tx_desc_pool;
  800. }
  801. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  802. {
  803. cfg->num_tx_desc_pool = num_pool;
  804. }
  805. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  806. {
  807. return cfg->num_tx_ext_desc_pool;
  808. }
  809. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  810. {
  811. cfg->num_tx_ext_desc_pool = num_pool;
  812. }
  813. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  814. {
  815. return cfg->reo_dst_ring_size;
  816. }
  817. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  818. int reo_dst_ring_size)
  819. {
  820. cfg->reo_dst_ring_size = reo_dst_ring_size;
  821. }
  822. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  823. bool raw_mode_war)
  824. {
  825. cfg->raw_mode_war = raw_mode_war;
  826. }
  827. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  828. {
  829. return cfg->raw_mode_war;
  830. }
  831. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  832. {
  833. return cfg->num_tx_desc;
  834. }
  835. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  836. {
  837. cfg->num_tx_desc = num_desc;
  838. }
  839. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  840. {
  841. return cfg->min_tx_desc;
  842. }
  843. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  844. {
  845. return cfg->num_tx_ext_desc;
  846. }
  847. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  848. {
  849. cfg->num_tx_ext_desc = num_ext_desc;
  850. }
  851. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  852. {
  853. /* TODO: This should be calculated based on target capabilities */
  854. return cfg->max_peer_id;
  855. }
  856. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  857. {
  858. return cfg->dma_mon_buf_ring_size;
  859. }
  860. int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  861. {
  862. return cfg->dma_mon_dest_ring_size;
  863. }
  864. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  865. {
  866. return cfg->dma_mon_status_ring_size;
  867. }
  868. int
  869. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  870. {
  871. return cfg->rxdma_monitor_desc_ring;
  872. }
  873. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  874. {
  875. return cfg->rx_dma_buf_ring_size;
  876. }
  877. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  878. {
  879. return cfg->num_mac_rings;
  880. }
  881. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  882. {
  883. return cfg->gro_enabled;
  884. }
  885. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  886. {
  887. return cfg->lro_enabled;
  888. }
  889. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  890. {
  891. return cfg->ipa_enabled;
  892. }
  893. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  894. {
  895. cfg->rx_hash = val;
  896. }
  897. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  898. {
  899. return cfg->rx_hash;
  900. }
  901. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  902. {
  903. return cfg->nss_enabled;
  904. }
  905. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  906. {
  907. cfg->nss_enabled = nss_enabled;
  908. }
  909. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  910. {
  911. return cfg->nss_cfg;
  912. }
  913. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  914. {
  915. cfg->nss_cfg = nss_cfg;
  916. if (cfg->nss_cfg)
  917. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  918. }
  919. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  920. {
  921. return cfg->int_batch_threshold_tx;
  922. }
  923. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  924. {
  925. return cfg->int_timer_threshold_tx;
  926. }
  927. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  928. {
  929. return cfg->int_batch_threshold_rx;
  930. }
  931. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  932. {
  933. return cfg->int_timer_threshold_rx;
  934. }
  935. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  936. {
  937. return cfg->int_batch_threshold_other;
  938. }
  939. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  940. {
  941. return cfg->int_timer_threshold_other;
  942. }
  943. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  944. {
  945. return cfg->int_timer_threshold_mon;
  946. }
  947. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  948. {
  949. return cfg->p2p_tcp_udp_checksumoffload;
  950. }
  951. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  952. {
  953. return cfg->nan_tcp_udp_checksumoffload;
  954. }
  955. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  956. {
  957. return cfg->tcp_udp_checksumoffload;
  958. }
  959. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  960. {
  961. return cfg->rx_defrag_min_timeout;
  962. }
  963. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  964. {
  965. return cfg->defrag_timeout_check;
  966. }
  967. int
  968. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  969. {
  970. return cfg->wbm_release_ring;
  971. }
  972. int
  973. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  974. {
  975. return cfg->tcl_cmd_credit_ring;
  976. }
  977. int
  978. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  979. {
  980. return cfg->tcl_status_ring;
  981. }
  982. int
  983. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  984. {
  985. return cfg->reo_reinject_ring;
  986. }
  987. int
  988. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  989. {
  990. return cfg->rx_release_ring;
  991. }
  992. int
  993. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  994. {
  995. return cfg->reo_exception_ring;
  996. }
  997. int
  998. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  999. {
  1000. return cfg->reo_cmd_ring;
  1001. }
  1002. int
  1003. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1004. {
  1005. return cfg->reo_status_ring;
  1006. }
  1007. int
  1008. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1009. {
  1010. return cfg->rxdma_refill_ring;
  1011. }
  1012. int
  1013. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  1014. {
  1015. return cfg->tx_desc_limit_0;
  1016. }
  1017. int
  1018. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  1019. {
  1020. return cfg->tx_desc_limit_1;
  1021. }
  1022. int
  1023. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  1024. {
  1025. return cfg->tx_desc_limit_2;
  1026. }
  1027. int
  1028. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  1029. {
  1030. return cfg->tx_device_limit;
  1031. }
  1032. int
  1033. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  1034. {
  1035. return cfg->tx_sw_internode_queue;
  1036. }
  1037. int
  1038. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1039. {
  1040. return cfg->rxdma_err_dst_ring;
  1041. }
  1042. int
  1043. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  1044. {
  1045. return cfg->rx_sw_desc_weight;
  1046. }
  1047. int
  1048. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  1049. {
  1050. return cfg->rx_sw_desc_num;
  1051. }
  1052. uint32_t
  1053. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  1054. {
  1055. return cfg->reo_rings_mapping;
  1056. }
  1057. bool
  1058. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1059. enum cdp_capabilities dp_caps)
  1060. {
  1061. switch (dp_caps) {
  1062. case CDP_CFG_DP_TSO:
  1063. return cfg->tso_enabled;
  1064. case CDP_CFG_DP_LRO:
  1065. return cfg->lro_enabled;
  1066. case CDP_CFG_DP_SG:
  1067. return cfg->sg_enabled;
  1068. case CDP_CFG_DP_GRO:
  1069. return cfg->gro_enabled;
  1070. case CDP_CFG_DP_OL_TX_CSUM:
  1071. return cfg->ol_tx_csum_enabled;
  1072. case CDP_CFG_DP_OL_RX_CSUM:
  1073. return cfg->ol_rx_csum_enabled;
  1074. case CDP_CFG_DP_RAWMODE:
  1075. return cfg->rawmode_enabled;
  1076. case CDP_CFG_DP_PEER_FLOW_CTRL:
  1077. return cfg->peer_flow_ctrl_enabled;
  1078. default:
  1079. return false;
  1080. }
  1081. }
  1082. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1083. bool val)
  1084. {
  1085. cfg->is_tso_desc_attach_defer = val;
  1086. }
  1087. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  1088. {
  1089. return cfg->is_tso_desc_attach_defer;
  1090. }
  1091. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1092. /**
  1093. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  1094. * @cfg: config context
  1095. *
  1096. * Return: stop threshold
  1097. */
  1098. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  1099. {
  1100. return cfg->tx_flow_stop_queue_threshold;
  1101. }
  1102. /**
  1103. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  1104. * for TX to resume
  1105. * @cfg: config context
  1106. *
  1107. * Return: stop threshold
  1108. */
  1109. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  1110. {
  1111. return cfg->tx_flow_start_queue_offset;
  1112. }
  1113. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1114. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1115. bool val)
  1116. {
  1117. cfg->is_rx_flow_tag_enabled = val;
  1118. }
  1119. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  1120. {
  1121. return cfg->rx_toeplitz_hash_key;
  1122. }
  1123. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  1124. {
  1125. return cfg->rx_flow_max_search;
  1126. }
  1127. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1128. {
  1129. return cfg->is_rx_flow_tag_enabled;
  1130. }
  1131. #ifdef WLAN_SUPPORT_RX_FISA
  1132. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1133. {
  1134. return (bool)(cfg->is_rx_fisa_enabled);
  1135. }
  1136. #else
  1137. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1138. {
  1139. return false;
  1140. }
  1141. #endif
  1142. void
  1143. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1144. bool val)
  1145. {
  1146. cfg->is_rx_flow_search_table_per_pdev = val;
  1147. }
  1148. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  1149. {
  1150. return cfg->is_rx_flow_search_table_per_pdev;
  1151. }
  1152. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1153. uint16_t val)
  1154. {
  1155. cfg->rx_flow_search_table_size = val;
  1156. }
  1157. uint16_t
  1158. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1159. {
  1160. return cfg->rx_flow_search_table_size;
  1161. }
  1162. void
  1163. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1164. bool val)
  1165. {
  1166. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  1167. }
  1168. bool
  1169. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1170. {
  1171. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  1172. }
  1173. void
  1174. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1175. bool val)
  1176. {
  1177. cfg->pext_stats_enabled = val;
  1178. }
  1179. bool
  1180. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1181. {
  1182. return cfg->pext_stats_enabled;
  1183. }
  1184. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1185. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1186. {
  1187. return cfg->is_rx_buff_pool_enabled;
  1188. }
  1189. #else
  1190. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1191. {
  1192. return false;
  1193. }
  1194. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */