wlan_cfg.c 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306
  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. #ifdef IPA_WDI3_TX_TWO_PIPES
  946. /**
  947. * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
  948. * in dp soc cfg context
  949. * @psoc: Object manager psoc
  950. * @wlan_cfg_ctx: dp soc cfg ctx
  951. *
  952. * Return: None
  953. */
  954. static void
  955. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  956. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  957. {
  958. wlan_cfg_ctx->ipa_tx_ring_size =
  959. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  960. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  961. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  962. wlan_cfg_ctx->ipa_tx_alt_ring_size =
  963. cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
  964. wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
  965. cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
  966. }
  967. #else /* !IPA_WDI3_TX_TWO_PIPES */
  968. /**
  969. * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
  970. * cfg context
  971. * @psoc - Object manager psoc
  972. * @wlan_cfg_ctx - dp soc cfg ctx
  973. *
  974. * Return: None
  975. */
  976. static void
  977. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  978. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  979. {
  980. wlan_cfg_ctx->ipa_tx_ring_size =
  981. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  982. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  983. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  984. }
  985. #endif /* IPA_WDI3_TX_TWO_PIPES */
  986. #else /* !IPA_OFFLOAD */
  987. static inline void
  988. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  989. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  990. {
  991. }
  992. #endif
  993. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  994. static void
  995. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  996. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  997. {
  998. wlan_cfg_ctx->hw_cc_enabled =
  999. cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
  1000. }
  1001. #else
  1002. static void
  1003. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1004. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1005. {
  1006. wlan_cfg_ctx->hw_cc_enabled = true;
  1007. }
  1008. #endif
  1009. #ifdef WLAN_SUPPORT_PPEDS
  1010. /**
  1011. * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc
  1012. * cfg context
  1013. * @psoc - Object manager psoc
  1014. * @wlan_cfg_ctx - dp soc cfg ctx
  1015. *
  1016. * Return: None
  1017. */
  1018. static void
  1019. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1020. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1021. {
  1022. wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE);
  1023. wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
  1024. wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
  1025. wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc,
  1026. CFG_DP_PPE_RELEASE_RING);
  1027. }
  1028. #else
  1029. static inline void
  1030. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1031. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1032. {
  1033. }
  1034. #endif
  1035. /**
  1036. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1037. * @psoc - Object manager psoc
  1038. * Return: wlan_cfg_ctx - Handle to Configuration context
  1039. */
  1040. struct wlan_cfg_dp_soc_ctxt *
  1041. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1042. {
  1043. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1044. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1045. if (!wlan_cfg_ctx)
  1046. return NULL;
  1047. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1048. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1049. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1050. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1051. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1052. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1053. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1054. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1055. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1056. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1057. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1058. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1059. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1060. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1061. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1062. CFG_DP_TX_EXT_DESC_POOLS);
  1063. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1064. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1065. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1066. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1067. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1068. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1069. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1070. CFG_DP_TX_COMPL_RING_SIZE);
  1071. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1072. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1073. wlan_cfg_ctx->int_batch_threshold_tx =
  1074. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1075. wlan_cfg_ctx->int_timer_threshold_tx =
  1076. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1077. wlan_cfg_ctx->int_batch_threshold_rx =
  1078. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1079. wlan_cfg_ctx->int_timer_threshold_rx =
  1080. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1081. wlan_cfg_ctx->int_batch_threshold_other =
  1082. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1083. wlan_cfg_ctx->int_timer_threshold_other =
  1084. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1085. wlan_cfg_ctx->pktlog_buffer_size =
  1086. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1087. /* This is default mapping and can be overridden by HW config
  1088. * received from FW */
  1089. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1090. if (MAX_PDEV_CNT > 1)
  1091. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1092. if (MAX_PDEV_CNT > 2)
  1093. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1094. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1095. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1096. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1097. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1098. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1099. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  1100. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1101. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1102. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1103. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1104. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1105. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1106. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1107. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1108. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1109. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1110. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1111. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1112. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1113. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1114. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1115. wlan_cfg_ctx->defrag_timeout_check =
  1116. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1117. wlan_cfg_ctx->rx_defrag_min_timeout =
  1118. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1119. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1120. CFG_DP_WBM_RELEASE_RING);
  1121. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1122. CFG_DP_TCL_CMD_CREDIT_RING);
  1123. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1124. CFG_DP_TCL_STATUS_RING);
  1125. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1126. CFG_DP_REO_REINJECT_RING);
  1127. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  1128. CFG_DP_RX_RELEASE_RING);
  1129. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  1130. CFG_DP_REO_EXCEPTION_RING);
  1131. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  1132. CFG_DP_REO_CMD_RING);
  1133. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  1134. CFG_DP_REO_STATUS_RING);
  1135. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  1136. CFG_DP_RXDMA_REFILL_RING);
  1137. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  1138. CFG_DP_TX_DESC_LIMIT_0);
  1139. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  1140. CFG_DP_TX_DESC_LIMIT_1);
  1141. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  1142. CFG_DP_TX_DESC_LIMIT_2);
  1143. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  1144. CFG_DP_TX_DEVICE_LIMIT);
  1145. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  1146. CFG_DP_TX_SW_INTERNODE_QUEUE);
  1147. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  1148. CFG_DP_RXDMA_ERR_DST_RING);
  1149. wlan_cfg_ctx->enable_data_stall_detection =
  1150. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  1151. wlan_cfg_ctx->enable_force_rx_64_ba =
  1152. cfg_get(psoc, CFG_FORCE_RX_64_BA);
  1153. wlan_cfg_ctx->tx_flow_start_queue_offset =
  1154. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  1155. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  1156. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  1157. wlan_cfg_ctx->disable_intra_bss_fwd =
  1158. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  1159. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  1160. CFG_DP_RX_SW_DESC_WEIGHT);
  1161. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  1162. CFG_DP_RX_SW_DESC_NUM);
  1163. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  1164. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  1165. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  1166. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  1167. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  1168. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  1169. wlan_cfg_ctx->rx_flow_search_table_size =
  1170. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  1171. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  1172. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  1173. wlan_cfg_ctx->mon_drop_thresh =
  1174. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  1175. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1176. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1177. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1178. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1179. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1180. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1181. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1182. wlan_cfg_ctx->rx_pending_high_threshold =
  1183. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1184. wlan_cfg_ctx->rx_pending_low_threshold =
  1185. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1186. wlan_cfg_ctx->is_poll_mode_enabled =
  1187. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1188. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1189. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1190. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1191. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1192. wlan_cfg_ctx->radio0_rx_default_reo =
  1193. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1194. wlan_cfg_ctx->radio1_rx_default_reo =
  1195. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1196. wlan_cfg_ctx->radio2_rx_default_reo =
  1197. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1198. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1199. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1200. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1201. CFG_DP_DELAY_MON_REPLENISH);
  1202. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  1203. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  1204. wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
  1205. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1206. wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
  1207. PKT_CAPTURE_MODE_DATA_ONLY;
  1208. #endif
  1209. return wlan_cfg_ctx;
  1210. }
  1211. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1212. {
  1213. qdf_mem_free(wlan_cfg_ctx);
  1214. }
  1215. struct wlan_cfg_dp_pdev_ctxt *
  1216. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1217. {
  1218. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1219. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1220. if (!wlan_cfg_ctx)
  1221. return NULL;
  1222. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1223. CFG_DP_RXDMA_BUF_RING);
  1224. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1225. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1226. wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
  1227. CFG_DP_RXDMA_MONITOR_DST_RING);
  1228. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1229. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1230. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1231. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1232. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1233. return wlan_cfg_ctx;
  1234. }
  1235. void wlan_cfg_set_mon_delayed_replenish_entries(
  1236. struct wlan_cfg_dp_soc_ctxt *cfg,
  1237. uint32_t val)
  1238. {
  1239. cfg->delayed_replenish_entries = val;
  1240. }
  1241. qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
  1242. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1243. {
  1244. return cfg->delayed_replenish_entries;
  1245. }
  1246. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1247. {
  1248. if (wlan_cfg_ctx)
  1249. qdf_mem_free(wlan_cfg_ctx);
  1250. }
  1251. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1252. {
  1253. return cfg->mon_drop_thresh;
  1254. }
  1255. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1256. {
  1257. cfg->num_int_ctxts = num;
  1258. }
  1259. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1260. {
  1261. cfg->max_peer_id = val;
  1262. }
  1263. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1264. {
  1265. cfg->max_ast_idx = val;
  1266. }
  1267. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1268. {
  1269. return cfg->max_ast_idx;
  1270. }
  1271. qdf_export_symbol(wlan_cfg_get_max_ast_idx);
  1272. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1273. int context, int mask)
  1274. {
  1275. cfg->int_tx_ring_mask[context] = mask;
  1276. }
  1277. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1278. int context, int mask)
  1279. {
  1280. cfg->int_rx_ring_mask[context] = mask;
  1281. }
  1282. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1283. int context, int mask)
  1284. {
  1285. cfg->int_rx_mon_ring_mask[context] = mask;
  1286. }
  1287. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1288. int context)
  1289. {
  1290. return cfg->int_host2rxdma_mon_ring_mask[context];
  1291. }
  1292. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1293. int context, int mask)
  1294. {
  1295. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  1296. }
  1297. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1298. int context)
  1299. {
  1300. return cfg->int_rxdma2host_mon_ring_mask[context];
  1301. }
  1302. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1303. int context, int mask)
  1304. {
  1305. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  1306. }
  1307. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1308. int context, int mask)
  1309. {
  1310. cfg->int_rxdma2host_ring_mask[context] = mask;
  1311. }
  1312. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1313. int context)
  1314. {
  1315. return cfg->int_rxdma2host_ring_mask[context];
  1316. }
  1317. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1318. int context, int mask)
  1319. {
  1320. cfg->int_host2rxdma_ring_mask[context] = mask;
  1321. }
  1322. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1323. int context)
  1324. {
  1325. return cfg->int_host2rxdma_ring_mask[context];
  1326. }
  1327. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1328. int context)
  1329. {
  1330. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  1331. }
  1332. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1333. int context)
  1334. {
  1335. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  1336. }
  1337. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1338. int context)
  1339. {
  1340. return cfg->int_tx_ring_near_full_irq_mask[context];
  1341. }
  1342. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1343. int hw_macid)
  1344. {
  1345. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1346. cfg->hw_macid[pdev_idx] = hw_macid;
  1347. }
  1348. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  1349. {
  1350. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1351. return cfg->hw_macid[pdev_idx];
  1352. }
  1353. qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
  1354. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1355. int hw_macid)
  1356. {
  1357. int idx;
  1358. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  1359. if (cfg->hw_macid[idx] == hw_macid)
  1360. return (idx + 1);
  1361. }
  1362. qdf_assert_always(idx < MAX_PDEV_CNT);
  1363. return WLAN_INVALID_PDEV_ID;
  1364. }
  1365. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1366. int hw_macid)
  1367. {
  1368. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  1369. (pdev_idx == INVALID_PDEV_ID));
  1370. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1371. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  1372. }
  1373. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  1374. {
  1375. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1376. return cfg->hw_macid_pdev_id_map[hw_macid];
  1377. }
  1378. qdf_export_symbol(wlan_cfg_get_pdev_idx);
  1379. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1380. int context, int mask)
  1381. {
  1382. cfg->int_ce_ring_mask[context] = mask;
  1383. }
  1384. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  1385. int mask)
  1386. {
  1387. cfg->int_rx_ring_mask[context] = mask;
  1388. }
  1389. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1390. int context, int mask)
  1391. {
  1392. return cfg->int_rx_err_ring_mask[context] = mask;
  1393. }
  1394. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1395. int context, int mask)
  1396. {
  1397. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  1398. }
  1399. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1400. int context, int mask)
  1401. {
  1402. return cfg->int_reo_status_ring_mask[context] = mask;
  1403. }
  1404. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  1405. {
  1406. return cfg->num_int_ctxts;
  1407. }
  1408. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1409. {
  1410. return cfg->int_tx_ring_mask[context];
  1411. }
  1412. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1413. {
  1414. return cfg->int_rx_ring_mask[context];
  1415. }
  1416. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1417. int context)
  1418. {
  1419. return cfg->int_rx_err_ring_mask[context];
  1420. }
  1421. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1422. int context)
  1423. {
  1424. return cfg->int_rx_wbm_rel_ring_mask[context];
  1425. }
  1426. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1427. int context)
  1428. {
  1429. return cfg->int_reo_status_ring_mask[context];
  1430. }
  1431. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1432. {
  1433. return cfg->int_rx_mon_ring_mask[context];
  1434. }
  1435. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1436. {
  1437. return cfg->int_ce_ring_mask[context];
  1438. }
  1439. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  1440. {
  1441. return cfg->max_clients;
  1442. }
  1443. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1444. {
  1445. return cfg->max_alloc_size;
  1446. }
  1447. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1448. {
  1449. return cfg->per_pdev_tx_ring;
  1450. }
  1451. uint32_t
  1452. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1453. {
  1454. return cfg->rx_pending_high_threshold;
  1455. }
  1456. uint32_t
  1457. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1458. {
  1459. return cfg->rx_pending_low_threshold;
  1460. }
  1461. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1462. {
  1463. return cfg->per_pdev_lmac_ring;
  1464. }
  1465. qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
  1466. #if defined(DP_USE_SINGLE_TCL)
  1467. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1468. {
  1469. return 1;
  1470. }
  1471. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1472. {
  1473. return 1;
  1474. }
  1475. #else
  1476. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1477. {
  1478. return cfg->num_tcl_data_rings;
  1479. }
  1480. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1481. {
  1482. return cfg->num_nss_tcl_data_rings;
  1483. }
  1484. #endif
  1485. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1486. {
  1487. return cfg->tx_ring_size;
  1488. }
  1489. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1490. {
  1491. return cfg->tx_comp_ring_size;
  1492. }
  1493. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1494. {
  1495. return cfg->per_pdev_rx_ring;
  1496. }
  1497. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1498. {
  1499. return cfg->num_reo_dest_rings;
  1500. }
  1501. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1502. {
  1503. return cfg->num_nss_reo_dest_rings;
  1504. }
  1505. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  1506. {
  1507. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  1508. }
  1509. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1510. {
  1511. return cfg->num_tx_desc_pool;
  1512. }
  1513. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1514. {
  1515. cfg->num_tx_desc_pool = num_pool;
  1516. }
  1517. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1518. {
  1519. return cfg->num_tx_ext_desc_pool;
  1520. }
  1521. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1522. {
  1523. cfg->num_tx_ext_desc_pool = num_pool;
  1524. }
  1525. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1526. {
  1527. return cfg->reo_dst_ring_size;
  1528. }
  1529. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1530. int reo_dst_ring_size)
  1531. {
  1532. cfg->reo_dst_ring_size = reo_dst_ring_size;
  1533. }
  1534. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  1535. bool raw_mode_war)
  1536. {
  1537. cfg->raw_mode_war = raw_mode_war;
  1538. }
  1539. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  1540. {
  1541. return cfg->raw_mode_war;
  1542. }
  1543. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1544. {
  1545. return cfg->num_tx_desc;
  1546. }
  1547. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  1548. {
  1549. cfg->num_tx_desc = num_desc;
  1550. }
  1551. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1552. {
  1553. return cfg->min_tx_desc;
  1554. }
  1555. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1556. {
  1557. return cfg->num_tx_ext_desc;
  1558. }
  1559. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  1560. {
  1561. cfg->num_tx_ext_desc = num_ext_desc;
  1562. }
  1563. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  1564. {
  1565. /* TODO: This should be calculated based on target capabilities */
  1566. return cfg->max_peer_id;
  1567. }
  1568. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1569. {
  1570. return cfg->dma_mon_buf_ring_size;
  1571. }
  1572. qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
  1573. int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1574. {
  1575. return cfg->dma_mon_dest_ring_size;
  1576. }
  1577. qdf_export_symbol(wlan_cfg_get_dma_mon_dest_ring_size);
  1578. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1579. {
  1580. return cfg->dma_mon_status_ring_size;
  1581. }
  1582. qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
  1583. int
  1584. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1585. {
  1586. return cfg->rxdma_monitor_desc_ring;
  1587. }
  1588. qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
  1589. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1590. {
  1591. return cfg->rx_dma_buf_ring_size;
  1592. }
  1593. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1594. {
  1595. return cfg->num_mac_rings;
  1596. }
  1597. qdf_export_symbol(wlan_cfg_get_num_mac_rings);
  1598. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1599. {
  1600. return cfg->gro_enabled;
  1601. }
  1602. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1603. {
  1604. return cfg->lro_enabled;
  1605. }
  1606. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1607. {
  1608. return cfg->ipa_enabled;
  1609. }
  1610. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  1611. {
  1612. cfg->rx_hash = val;
  1613. }
  1614. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1615. {
  1616. return cfg->rx_hash;
  1617. }
  1618. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1619. {
  1620. return cfg->nss_enabled;
  1621. }
  1622. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  1623. {
  1624. cfg->nss_enabled = nss_enabled;
  1625. }
  1626. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  1627. {
  1628. return cfg->nss_cfg;
  1629. }
  1630. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  1631. {
  1632. cfg->nss_cfg = nss_cfg;
  1633. if (cfg->nss_cfg)
  1634. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  1635. }
  1636. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1637. {
  1638. return cfg->int_batch_threshold_tx;
  1639. }
  1640. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1641. {
  1642. return cfg->int_timer_threshold_tx;
  1643. }
  1644. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1645. {
  1646. return cfg->int_batch_threshold_rx;
  1647. }
  1648. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1649. {
  1650. return cfg->int_timer_threshold_rx;
  1651. }
  1652. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1653. {
  1654. return cfg->int_batch_threshold_other;
  1655. }
  1656. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1657. {
  1658. return cfg->int_timer_threshold_other;
  1659. }
  1660. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  1661. {
  1662. return cfg->int_timer_threshold_mon;
  1663. }
  1664. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1665. {
  1666. return cfg->p2p_tcp_udp_checksumoffload;
  1667. }
  1668. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1669. {
  1670. return cfg->nan_tcp_udp_checksumoffload;
  1671. }
  1672. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1673. {
  1674. return cfg->tcp_udp_checksumoffload;
  1675. }
  1676. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  1677. {
  1678. return cfg->rx_defrag_min_timeout;
  1679. }
  1680. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  1681. {
  1682. return cfg->defrag_timeout_check;
  1683. }
  1684. int
  1685. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1686. {
  1687. return cfg->wbm_release_ring;
  1688. }
  1689. int
  1690. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1691. {
  1692. return cfg->tcl_cmd_credit_ring;
  1693. }
  1694. int
  1695. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1696. {
  1697. return cfg->tcl_status_ring;
  1698. }
  1699. int
  1700. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1701. {
  1702. return cfg->reo_reinject_ring;
  1703. }
  1704. int
  1705. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1706. {
  1707. return cfg->rx_release_ring;
  1708. }
  1709. int
  1710. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1711. {
  1712. return cfg->reo_exception_ring;
  1713. }
  1714. int
  1715. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1716. {
  1717. return cfg->reo_cmd_ring;
  1718. }
  1719. int
  1720. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1721. {
  1722. return cfg->reo_status_ring;
  1723. }
  1724. int
  1725. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1726. {
  1727. return cfg->rxdma_refill_ring;
  1728. }
  1729. int
  1730. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  1731. {
  1732. return cfg->tx_desc_limit_0;
  1733. }
  1734. int
  1735. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  1736. {
  1737. return cfg->tx_desc_limit_1;
  1738. }
  1739. int
  1740. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  1741. {
  1742. return cfg->tx_desc_limit_2;
  1743. }
  1744. int
  1745. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  1746. {
  1747. return cfg->tx_device_limit;
  1748. }
  1749. int
  1750. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  1751. {
  1752. return cfg->tx_sw_internode_queue;
  1753. }
  1754. int
  1755. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1756. {
  1757. return cfg->rxdma_err_dst_ring;
  1758. }
  1759. int
  1760. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  1761. {
  1762. return cfg->rx_sw_desc_weight;
  1763. }
  1764. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
  1765. int
  1766. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  1767. {
  1768. return cfg->rx_sw_desc_num;
  1769. }
  1770. uint32_t
  1771. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  1772. {
  1773. return cfg->reo_rings_mapping;
  1774. }
  1775. bool
  1776. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1777. enum cdp_capabilities dp_caps)
  1778. {
  1779. switch (dp_caps) {
  1780. case CDP_CFG_DP_TSO:
  1781. return cfg->tso_enabled;
  1782. case CDP_CFG_DP_LRO:
  1783. return cfg->lro_enabled;
  1784. case CDP_CFG_DP_SG:
  1785. return cfg->sg_enabled;
  1786. case CDP_CFG_DP_GRO:
  1787. return cfg->gro_enabled;
  1788. case CDP_CFG_DP_OL_TX_CSUM:
  1789. return cfg->ol_tx_csum_enabled;
  1790. case CDP_CFG_DP_OL_RX_CSUM:
  1791. return cfg->ol_rx_csum_enabled;
  1792. case CDP_CFG_DP_RAWMODE:
  1793. return cfg->rawmode_enabled;
  1794. case CDP_CFG_DP_PEER_FLOW_CTRL:
  1795. return cfg->peer_flow_ctrl_enabled;
  1796. default:
  1797. return false;
  1798. }
  1799. }
  1800. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1801. bool val)
  1802. {
  1803. cfg->is_tso_desc_attach_defer = val;
  1804. }
  1805. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  1806. {
  1807. return cfg->is_tso_desc_attach_defer;
  1808. }
  1809. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1810. /**
  1811. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  1812. * @cfg: config context
  1813. *
  1814. * Return: stop threshold
  1815. */
  1816. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  1817. {
  1818. return cfg->tx_flow_stop_queue_threshold;
  1819. }
  1820. /**
  1821. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  1822. * for TX to resume
  1823. * @cfg: config context
  1824. *
  1825. * Return: stop threshold
  1826. */
  1827. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  1828. {
  1829. return cfg->tx_flow_start_queue_offset;
  1830. }
  1831. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1832. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1833. bool val)
  1834. {
  1835. cfg->is_rx_flow_tag_enabled = val;
  1836. }
  1837. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  1838. {
  1839. return cfg->rx_toeplitz_hash_key;
  1840. }
  1841. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  1842. {
  1843. return cfg->rx_flow_max_search;
  1844. }
  1845. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1846. {
  1847. return cfg->is_rx_flow_tag_enabled;
  1848. }
  1849. qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
  1850. #ifdef WLAN_SUPPORT_RX_FISA
  1851. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1852. {
  1853. return (bool)(cfg->is_rx_fisa_enabled);
  1854. }
  1855. #else
  1856. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1857. {
  1858. return false;
  1859. }
  1860. #endif
  1861. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1862. {
  1863. return (bool)(cfg->is_poll_mode_enabled);
  1864. }
  1865. void
  1866. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1867. bool val)
  1868. {
  1869. cfg->is_rx_flow_search_table_per_pdev = val;
  1870. }
  1871. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  1872. {
  1873. return cfg->is_rx_flow_search_table_per_pdev;
  1874. }
  1875. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1876. uint16_t val)
  1877. {
  1878. cfg->rx_flow_search_table_size = val;
  1879. }
  1880. uint16_t
  1881. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1882. {
  1883. return cfg->rx_flow_search_table_size;
  1884. }
  1885. void
  1886. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1887. bool val)
  1888. {
  1889. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  1890. }
  1891. bool
  1892. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1893. {
  1894. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  1895. }
  1896. qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
  1897. void
  1898. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1899. bool val)
  1900. {
  1901. cfg->tx_per_pkt_vdev_id_check = val;
  1902. }
  1903. bool
  1904. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1905. {
  1906. return cfg->tx_per_pkt_vdev_id_check;
  1907. }
  1908. void
  1909. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1910. bool val)
  1911. {
  1912. cfg->pext_stats_enabled = val;
  1913. }
  1914. bool
  1915. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1916. {
  1917. return cfg->pext_stats_enabled;
  1918. }
  1919. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1920. {
  1921. return cfg->fst_in_cmem;
  1922. }
  1923. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1924. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1925. {
  1926. return cfg->is_rx_buff_pool_enabled;
  1927. }
  1928. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1929. {
  1930. return cfg->is_rx_refill_buff_pool_enabled;
  1931. }
  1932. #else
  1933. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1934. {
  1935. return false;
  1936. }
  1937. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  1938. struct wlan_cfg_dp_soc_ctxt *cfg)
  1939. {
  1940. return false;
  1941. }
  1942. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  1943. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  1944. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1945. {
  1946. return (bool)(cfg->is_swlm_enabled);
  1947. }
  1948. #else
  1949. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1950. {
  1951. return false;
  1952. }
  1953. #endif
  1954. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1955. {
  1956. return cfg->radio0_rx_default_reo;
  1957. }
  1958. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1959. {
  1960. return cfg->radio1_rx_default_reo;
  1961. }
  1962. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1963. {
  1964. return cfg->radio2_rx_default_reo;
  1965. }
  1966. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  1967. {
  1968. cfg->rxdma1_enable = true;
  1969. }
  1970. bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
  1971. {
  1972. return cfg->enable_force_rx_64_ba;
  1973. }
  1974. void
  1975. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  1976. bool val)
  1977. {
  1978. cfg->delay_mon_replenish = val;
  1979. }
  1980. bool
  1981. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  1982. {
  1983. return cfg->delay_mon_replenish;
  1984. }
  1985. qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
  1986. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  1987. {
  1988. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  1989. cfg->delay_mon_replenish);
  1990. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  1991. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  1992. }
  1993. #ifdef IPA_OFFLOAD
  1994. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1995. {
  1996. return cfg->ipa_tx_ring_size;
  1997. }
  1998. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1999. {
  2000. return cfg->ipa_tx_comp_ring_size;
  2001. }
  2002. #ifdef IPA_WDI3_TX_TWO_PIPES
  2003. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2004. {
  2005. return cfg->ipa_tx_alt_ring_size;
  2006. }
  2007. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2008. {
  2009. return cfg->ipa_tx_alt_comp_ring_size;
  2010. }
  2011. #else
  2012. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2013. {
  2014. return cfg->ipa_tx_ring_size;
  2015. }
  2016. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2017. {
  2018. return cfg->ipa_tx_comp_ring_size;
  2019. }
  2020. #endif
  2021. #endif
  2022. #ifdef WLAN_SUPPORT_PPEDS
  2023. bool
  2024. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2025. {
  2026. return cfg->ppe_enable;
  2027. }
  2028. int
  2029. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2030. {
  2031. return cfg->reo2ppe_ring;
  2032. }
  2033. int
  2034. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2035. {
  2036. return cfg->ppe2tcl_ring;
  2037. }
  2038. int
  2039. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2040. {
  2041. return cfg->ppe_release_ring;
  2042. }
  2043. #endif
  2044. void
  2045. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2046. struct wlan_dp_prealloc_cfg *cfg)
  2047. {
  2048. if (!ctrl_psoc || !cfg)
  2049. return;
  2050. cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
  2051. cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
  2052. CFG_DP_TX_COMPL_RING_SIZE);
  2053. cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
  2054. CFG_DP_WBM_RELEASE_RING);
  2055. cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
  2056. CFG_DP_RXDMA_ERR_DST_RING);
  2057. cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
  2058. CFG_DP_REO_EXCEPTION_RING);
  2059. cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
  2060. cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
  2061. }
  2062. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2063. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2064. {
  2065. return cfg->pkt_capture_mode;
  2066. }
  2067. #endif