wlan_cfg.c 63 KB

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