wlan_cfg.c 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418
  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. wlan_cfg_ctx->rx_pending_high_threshold =
  540. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  541. wlan_cfg_ctx->rx_pending_low_threshold =
  542. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  543. return wlan_cfg_ctx;
  544. }
  545. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  546. {
  547. qdf_mem_free(wlan_cfg_ctx);
  548. }
  549. struct wlan_cfg_dp_pdev_ctxt *
  550. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  551. {
  552. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  553. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  554. if (!wlan_cfg_ctx)
  555. return NULL;
  556. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  557. CFG_DP_RXDMA_BUF_RING);
  558. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  559. CFG_DP_RXDMA_MONITOR_BUF_RING);
  560. wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
  561. CFG_DP_RXDMA_MONITOR_DST_RING);
  562. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  563. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  564. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  565. CFG_DP_RXDMA_MONITOR_DESC_RING);
  566. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  567. return wlan_cfg_ctx;
  568. }
  569. void wlan_cfg_set_mon_delayed_replenish_entries(
  570. struct wlan_cfg_dp_soc_ctxt *cfg,
  571. uint32_t val)
  572. {
  573. cfg->delayed_replenish_entries = val;
  574. }
  575. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  576. {
  577. return cfg->delayed_replenish_entries;
  578. }
  579. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  580. {
  581. if (wlan_cfg_ctx)
  582. qdf_mem_free(wlan_cfg_ctx);
  583. }
  584. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  585. {
  586. return cfg->mon_drop_thresh;
  587. }
  588. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  589. {
  590. cfg->num_int_ctxts = num;
  591. }
  592. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  593. {
  594. cfg->max_peer_id = val;
  595. }
  596. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  597. {
  598. cfg->max_ast_idx = val;
  599. }
  600. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  601. {
  602. return cfg->max_ast_idx;
  603. }
  604. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  605. int context, int mask)
  606. {
  607. cfg->int_tx_ring_mask[context] = mask;
  608. }
  609. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  610. int context, int mask)
  611. {
  612. cfg->int_rx_ring_mask[context] = mask;
  613. }
  614. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  615. int context, int mask)
  616. {
  617. cfg->int_rx_mon_ring_mask[context] = mask;
  618. }
  619. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  620. int context)
  621. {
  622. return cfg->int_host2rxdma_mon_ring_mask[context];
  623. }
  624. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  625. int context, int mask)
  626. {
  627. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  628. }
  629. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  630. int context)
  631. {
  632. return cfg->int_rxdma2host_mon_ring_mask[context];
  633. }
  634. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  635. int context, int mask)
  636. {
  637. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  638. }
  639. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  640. int context, int mask)
  641. {
  642. cfg->int_rxdma2host_ring_mask[context] = mask;
  643. }
  644. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  645. int context)
  646. {
  647. return cfg->int_rxdma2host_ring_mask[context];
  648. }
  649. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  650. int context, int mask)
  651. {
  652. cfg->int_host2rxdma_ring_mask[context] = mask;
  653. }
  654. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  655. int context)
  656. {
  657. return cfg->int_host2rxdma_ring_mask[context];
  658. }
  659. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  660. int hw_macid)
  661. {
  662. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  663. cfg->hw_macid[pdev_idx] = hw_macid;
  664. }
  665. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  666. {
  667. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  668. return cfg->hw_macid[pdev_idx];
  669. }
  670. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  671. int hw_macid)
  672. {
  673. int idx;
  674. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  675. if (cfg->hw_macid[idx] == hw_macid)
  676. return (idx + 1);
  677. }
  678. qdf_assert_always(idx < MAX_PDEV_CNT);
  679. return WLAN_INVALID_PDEV_ID;
  680. }
  681. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  682. int hw_macid)
  683. {
  684. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  685. (pdev_idx == INVALID_PDEV_ID));
  686. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  687. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  688. }
  689. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  690. {
  691. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  692. return cfg->hw_macid_pdev_id_map[hw_macid];
  693. }
  694. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  695. int context, int mask)
  696. {
  697. cfg->int_ce_ring_mask[context] = mask;
  698. }
  699. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  700. int mask)
  701. {
  702. cfg->int_rx_ring_mask[context] = mask;
  703. }
  704. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  705. int context, int mask)
  706. {
  707. return cfg->int_rx_err_ring_mask[context] = mask;
  708. }
  709. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  710. int context, int mask)
  711. {
  712. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  713. }
  714. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  715. int context, int mask)
  716. {
  717. return cfg->int_reo_status_ring_mask[context] = mask;
  718. }
  719. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  720. {
  721. return cfg->num_int_ctxts;
  722. }
  723. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  724. {
  725. return cfg->int_tx_ring_mask[context];
  726. }
  727. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  728. {
  729. return cfg->int_rx_ring_mask[context];
  730. }
  731. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  732. int context)
  733. {
  734. return cfg->int_rx_err_ring_mask[context];
  735. }
  736. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  737. int context)
  738. {
  739. return cfg->int_rx_wbm_rel_ring_mask[context];
  740. }
  741. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  742. int context)
  743. {
  744. return cfg->int_reo_status_ring_mask[context];
  745. }
  746. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  747. {
  748. return cfg->int_rx_mon_ring_mask[context];
  749. }
  750. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  751. {
  752. return cfg->int_ce_ring_mask[context];
  753. }
  754. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  755. {
  756. return cfg->max_clients;
  757. }
  758. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  759. {
  760. return cfg->max_alloc_size;
  761. }
  762. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  763. {
  764. return cfg->per_pdev_tx_ring;
  765. }
  766. uint32_t
  767. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  768. {
  769. return cfg->rx_pending_high_threshold;
  770. }
  771. uint32_t
  772. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  773. {
  774. return cfg->rx_pending_low_threshold;
  775. }
  776. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  777. {
  778. return cfg->per_pdev_lmac_ring;
  779. }
  780. #ifdef DP_MEMORY_OPT
  781. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  782. {
  783. return 1;
  784. }
  785. #else
  786. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  787. {
  788. return cfg->num_tcl_data_rings;
  789. }
  790. #endif
  791. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  792. {
  793. return cfg->tx_ring_size;
  794. }
  795. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  796. {
  797. return cfg->tx_comp_ring_size;
  798. }
  799. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  800. {
  801. return cfg->per_pdev_rx_ring;
  802. }
  803. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  804. {
  805. return cfg->num_reo_dest_rings;
  806. }
  807. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  808. {
  809. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  810. }
  811. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  812. {
  813. return cfg->num_tx_desc_pool;
  814. }
  815. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  816. {
  817. cfg->num_tx_desc_pool = num_pool;
  818. }
  819. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  820. {
  821. return cfg->num_tx_ext_desc_pool;
  822. }
  823. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  824. {
  825. cfg->num_tx_ext_desc_pool = num_pool;
  826. }
  827. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  828. {
  829. return cfg->reo_dst_ring_size;
  830. }
  831. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  832. int reo_dst_ring_size)
  833. {
  834. cfg->reo_dst_ring_size = reo_dst_ring_size;
  835. }
  836. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  837. bool raw_mode_war)
  838. {
  839. cfg->raw_mode_war = raw_mode_war;
  840. }
  841. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  842. {
  843. return cfg->raw_mode_war;
  844. }
  845. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  846. {
  847. return cfg->num_tx_desc;
  848. }
  849. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  850. {
  851. cfg->num_tx_desc = num_desc;
  852. }
  853. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  854. {
  855. return cfg->min_tx_desc;
  856. }
  857. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  858. {
  859. return cfg->num_tx_ext_desc;
  860. }
  861. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  862. {
  863. cfg->num_tx_ext_desc = num_ext_desc;
  864. }
  865. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  866. {
  867. /* TODO: This should be calculated based on target capabilities */
  868. return cfg->max_peer_id;
  869. }
  870. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  871. {
  872. return cfg->dma_mon_buf_ring_size;
  873. }
  874. int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  875. {
  876. return cfg->dma_mon_dest_ring_size;
  877. }
  878. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  879. {
  880. return cfg->dma_mon_status_ring_size;
  881. }
  882. int
  883. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  884. {
  885. return cfg->rxdma_monitor_desc_ring;
  886. }
  887. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  888. {
  889. return cfg->rx_dma_buf_ring_size;
  890. }
  891. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  892. {
  893. return cfg->num_mac_rings;
  894. }
  895. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  896. {
  897. return cfg->gro_enabled;
  898. }
  899. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  900. {
  901. return cfg->lro_enabled;
  902. }
  903. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  904. {
  905. return cfg->ipa_enabled;
  906. }
  907. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  908. {
  909. cfg->rx_hash = val;
  910. }
  911. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  912. {
  913. return cfg->rx_hash;
  914. }
  915. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  916. {
  917. return cfg->nss_enabled;
  918. }
  919. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  920. {
  921. cfg->nss_enabled = nss_enabled;
  922. }
  923. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  924. {
  925. return cfg->nss_cfg;
  926. }
  927. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  928. {
  929. cfg->nss_cfg = nss_cfg;
  930. if (cfg->nss_cfg)
  931. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  932. }
  933. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  934. {
  935. return cfg->int_batch_threshold_tx;
  936. }
  937. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  938. {
  939. return cfg->int_timer_threshold_tx;
  940. }
  941. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  942. {
  943. return cfg->int_batch_threshold_rx;
  944. }
  945. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  946. {
  947. return cfg->int_timer_threshold_rx;
  948. }
  949. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  950. {
  951. return cfg->int_batch_threshold_other;
  952. }
  953. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  954. {
  955. return cfg->int_timer_threshold_other;
  956. }
  957. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  958. {
  959. return cfg->int_timer_threshold_mon;
  960. }
  961. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  962. {
  963. return cfg->p2p_tcp_udp_checksumoffload;
  964. }
  965. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  966. {
  967. return cfg->nan_tcp_udp_checksumoffload;
  968. }
  969. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  970. {
  971. return cfg->tcp_udp_checksumoffload;
  972. }
  973. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  974. {
  975. return cfg->rx_defrag_min_timeout;
  976. }
  977. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  978. {
  979. return cfg->defrag_timeout_check;
  980. }
  981. int
  982. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  983. {
  984. return cfg->wbm_release_ring;
  985. }
  986. int
  987. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  988. {
  989. return cfg->tcl_cmd_credit_ring;
  990. }
  991. int
  992. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  993. {
  994. return cfg->tcl_status_ring;
  995. }
  996. int
  997. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  998. {
  999. return cfg->reo_reinject_ring;
  1000. }
  1001. int
  1002. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1003. {
  1004. return cfg->rx_release_ring;
  1005. }
  1006. int
  1007. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1008. {
  1009. return cfg->reo_exception_ring;
  1010. }
  1011. int
  1012. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1013. {
  1014. return cfg->reo_cmd_ring;
  1015. }
  1016. int
  1017. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1018. {
  1019. return cfg->reo_status_ring;
  1020. }
  1021. int
  1022. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1023. {
  1024. return cfg->rxdma_refill_ring;
  1025. }
  1026. int
  1027. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  1028. {
  1029. return cfg->tx_desc_limit_0;
  1030. }
  1031. int
  1032. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  1033. {
  1034. return cfg->tx_desc_limit_1;
  1035. }
  1036. int
  1037. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  1038. {
  1039. return cfg->tx_desc_limit_2;
  1040. }
  1041. int
  1042. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  1043. {
  1044. return cfg->tx_device_limit;
  1045. }
  1046. int
  1047. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  1048. {
  1049. return cfg->tx_sw_internode_queue;
  1050. }
  1051. int
  1052. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1053. {
  1054. return cfg->rxdma_err_dst_ring;
  1055. }
  1056. int
  1057. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  1058. {
  1059. return cfg->rx_sw_desc_weight;
  1060. }
  1061. int
  1062. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  1063. {
  1064. return cfg->rx_sw_desc_num;
  1065. }
  1066. uint32_t
  1067. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  1068. {
  1069. return cfg->reo_rings_mapping;
  1070. }
  1071. bool
  1072. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1073. enum cdp_capabilities dp_caps)
  1074. {
  1075. switch (dp_caps) {
  1076. case CDP_CFG_DP_TSO:
  1077. return cfg->tso_enabled;
  1078. case CDP_CFG_DP_LRO:
  1079. return cfg->lro_enabled;
  1080. case CDP_CFG_DP_SG:
  1081. return cfg->sg_enabled;
  1082. case CDP_CFG_DP_GRO:
  1083. return cfg->gro_enabled;
  1084. case CDP_CFG_DP_OL_TX_CSUM:
  1085. return cfg->ol_tx_csum_enabled;
  1086. case CDP_CFG_DP_OL_RX_CSUM:
  1087. return cfg->ol_rx_csum_enabled;
  1088. case CDP_CFG_DP_RAWMODE:
  1089. return cfg->rawmode_enabled;
  1090. case CDP_CFG_DP_PEER_FLOW_CTRL:
  1091. return cfg->peer_flow_ctrl_enabled;
  1092. default:
  1093. return false;
  1094. }
  1095. }
  1096. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1097. bool val)
  1098. {
  1099. cfg->is_tso_desc_attach_defer = val;
  1100. }
  1101. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  1102. {
  1103. return cfg->is_tso_desc_attach_defer;
  1104. }
  1105. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1106. /**
  1107. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  1108. * @cfg: config context
  1109. *
  1110. * Return: stop threshold
  1111. */
  1112. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  1113. {
  1114. return cfg->tx_flow_stop_queue_threshold;
  1115. }
  1116. /**
  1117. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  1118. * for TX to resume
  1119. * @cfg: config context
  1120. *
  1121. * Return: stop threshold
  1122. */
  1123. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  1124. {
  1125. return cfg->tx_flow_start_queue_offset;
  1126. }
  1127. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1128. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1129. bool val)
  1130. {
  1131. cfg->is_rx_flow_tag_enabled = val;
  1132. }
  1133. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  1134. {
  1135. return cfg->rx_toeplitz_hash_key;
  1136. }
  1137. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  1138. {
  1139. return cfg->rx_flow_max_search;
  1140. }
  1141. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1142. {
  1143. return cfg->is_rx_flow_tag_enabled;
  1144. }
  1145. #ifdef WLAN_SUPPORT_RX_FISA
  1146. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1147. {
  1148. return (bool)(cfg->is_rx_fisa_enabled);
  1149. }
  1150. #else
  1151. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1152. {
  1153. return false;
  1154. }
  1155. #endif
  1156. void
  1157. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1158. bool val)
  1159. {
  1160. cfg->is_rx_flow_search_table_per_pdev = val;
  1161. }
  1162. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  1163. {
  1164. return cfg->is_rx_flow_search_table_per_pdev;
  1165. }
  1166. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1167. uint16_t val)
  1168. {
  1169. cfg->rx_flow_search_table_size = val;
  1170. }
  1171. uint16_t
  1172. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1173. {
  1174. return cfg->rx_flow_search_table_size;
  1175. }
  1176. void
  1177. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1178. bool val)
  1179. {
  1180. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  1181. }
  1182. bool
  1183. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1184. {
  1185. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  1186. }
  1187. void
  1188. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1189. bool val)
  1190. {
  1191. cfg->pext_stats_enabled = val;
  1192. }
  1193. bool
  1194. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1195. {
  1196. return cfg->pext_stats_enabled;
  1197. }
  1198. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1199. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1200. {
  1201. return cfg->is_rx_buff_pool_enabled;
  1202. }
  1203. #else
  1204. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1205. {
  1206. return false;
  1207. }
  1208. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */