wlan_cfg.c 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939
  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_TX_MON_RING_MASK_0 BIT(0)
  50. #define WLAN_CFG_TX_MON_RING_MASK_1 BIT(1)
  51. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
  52. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
  53. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
  54. #define WLAN_CFG_HOST2TXMON_RING_MASK_0 0x1
  55. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
  56. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
  57. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
  58. #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
  59. #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
  60. #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
  61. #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
  62. #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
  63. #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
  64. #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
  65. #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
  66. #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
  67. #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
  68. #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
  69. #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
  70. #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
  71. #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
  72. #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
  73. #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
  74. #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
  75. #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
  76. #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
  77. #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
  78. struct dp_int_mask_assignment {
  79. uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  80. uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  81. uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  82. uint8_t tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  83. uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  84. uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  85. uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  86. uint8_t rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  87. uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  88. uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  89. uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  90. uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  91. uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  92. uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  93. uint8_t host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  94. };
  95. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  96. /*
  97. * For BE, there are 18 available MSI interrupts, assigned in the manner
  98. * below.
  99. * TX(5) + RX(8) + (REO ERR + WBM ERR)(1) +
  100. * (REO status + RXDMA[0] + RXDMA[1])(1) + NEAR_Full_RX(2) + NEAR_Full_TX(1)
  101. * For IPA_OFFLOAD enabled case, 2 TX/RX rings would be assigned to IPA.
  102. */
  103. #ifdef CONFIG_BERYLLIUM
  104. #ifdef IPA_OFFLOAD
  105. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  106. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_6,
  107. [2] = WLAN_CFG_TX_RING_MASK_7};
  108. #else
  109. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  110. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_4,
  111. [2] = WLAN_CFG_TX_RING_MASK_2, [3] = WLAN_CFG_TX_RING_MASK_6,
  112. [4] = WLAN_CFG_TX_RING_MASK_7};
  113. #endif
  114. #else
  115. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  116. WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0};
  117. #endif /* CONFIG_BERYLLIUM */
  118. #ifdef CONFIG_BERYLLIUM
  119. #ifdef IPA_OFFLOAD
  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, [9] = WLAN_CFG_RX_RING_MASK_4,
  123. [10] = WLAN_CFG_RX_RING_MASK_5, [11] = WLAN_CFG_RX_RING_MASK_6};
  124. #else
  125. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  126. [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
  127. [7] = WLAN_CFG_RX_RING_MASK_2, [8] = WLAN_CFG_RX_RING_MASK_3,
  128. [9] = WLAN_CFG_RX_RING_MASK_4, [10] = WLAN_CFG_RX_RING_MASK_5,
  129. [11] = WLAN_CFG_RX_RING_MASK_6, [12] = WLAN_CFG_RX_RING_MASK_7};
  130. #endif /* IPA_OFFLOAD */
  131. #else /* !defined(CONFIG_BERYLLIUM) */
  132. #ifdef IPA_OFFLOAD
  133. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  134. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1,
  135. WLAN_CFG_RX_RING_MASK_2, 0, 0, 0};
  136. #else
  137. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  138. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1,
  139. WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0};
  140. #endif
  141. #endif /* CONFIG_BERYLLIUM */
  142. #ifdef CONFIG_BERYLLIUM
  143. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  144. [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  145. WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  146. #else
  147. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  148. 0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  149. WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  150. #endif /* CONFIG_BERYLLIUM */
  151. static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  152. [1] = WLAN_CFG_RX_MON_RING_MASK_0,
  153. [2] = WLAN_CFG_RX_MON_RING_MASK_1};
  154. static const uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  155. static const uint8_t host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  156. static const uint8_t rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  157. #ifdef CONFIG_BERYLLIUM
  158. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  159. [14] = WLAN_CFG_RX_ERR_RING_MASK_0};
  160. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  161. [14] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  162. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  163. [13] = WLAN_CFG_REO_STATUS_RING_MASK_0};
  164. #else
  165. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  166. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0};
  167. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  168. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  169. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  170. 0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0};
  171. #endif
  172. #ifdef CONFIG_BERYLLIUM
  173. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  174. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  175. [15] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  176. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  177. [16] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  178. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  179. [17] = WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK};
  180. #else
  181. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  182. 0 };
  183. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  184. 0 };
  185. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  186. 0 };
  187. #endif
  188. #else
  189. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  190. 0 };
  191. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  192. 0 };
  193. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  194. 0 };
  195. #endif
  196. #else
  197. /* Integrated configuration + 8 possible MSI configurations */
  198. #define NUM_INTERRUPT_COMBINATIONS 9
  199. /*
  200. * This structure contains the best possible mask assignment for a given
  201. * number of MSIs available in the system.
  202. */
  203. #ifdef IPA_OFFLOAD
  204. static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
  205. /* Interrupt assignment for integrated configuration */
  206. {
  207. /* tx ring masks */
  208. { WLAN_CFG_TX_RING_MASK_0,
  209. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  210. /* rx ring masks */
  211. { 0, 0, 0, 0, 0, 0, 0,
  212. WLAN_CFG_RX_RING_MASK_0,
  213. WLAN_CFG_RX_RING_MASK_1,
  214. WLAN_CFG_RX_RING_MASK_2,
  215. 0},
  216. /* rx mon ring masks */
  217. { 0, 0, 0, 0,
  218. WLAN_CFG_RX_MON_RING_MASK_0,
  219. WLAN_CFG_RX_MON_RING_MASK_1,
  220. WLAN_CFG_RX_MON_RING_MASK_2,
  221. 0, 0, 0, 0},
  222. /* host2rxdma ring masks */
  223. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  224. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  225. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  226. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  227. 0, 0, 0, 0, 0, 0, 0},
  228. /* rxdma2host ring masks */
  229. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  230. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  231. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  232. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  233. 0, 0, 0, 0, 0, 0, 0},
  234. /* host2rxdma mon ring masks */
  235. { 0, 0, 0, 0,
  236. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  237. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  238. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  239. 0, 0, 0, 0},
  240. /* rxdma2host mon ring masks */
  241. { 0, 0, 0, 0,
  242. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  243. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  244. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  245. 0, 0, 0, 0},
  246. /* rx err ring masks */
  247. { WLAN_CFG_RX_ERR_RING_MASK_0,
  248. WLAN_CFG_RX_ERR_RING_MASK_1,
  249. WLAN_CFG_RX_ERR_RING_MASK_2,
  250. WLAN_CFG_RX_ERR_RING_MASK_3,
  251. 0, 0, 0, 0, 0, 0, 0},
  252. /* rx wbm rel ring masks */
  253. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  254. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  255. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  256. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  257. 0, 0, 0, 0, 0, 0, 0},
  258. /* reo status ring masks */
  259. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  260. WLAN_CFG_REO_STATUS_RING_MASK_1,
  261. WLAN_CFG_REO_STATUS_RING_MASK_2,
  262. WLAN_CFG_REO_STATUS_RING_MASK_3,
  263. 0, 0, 0, 0, 0, 0, 0},
  264. },
  265. /* Interrupt assignment for 1 MSI combination */
  266. {
  267. /* tx ring masks */
  268. { WLAN_CFG_TX_RING_MASK_0,
  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. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  275. /* rx mon ring masks */
  276. { WLAN_CFG_RX_MON_RING_MASK_0 |
  277. WLAN_CFG_RX_MON_RING_MASK_1 |
  278. WLAN_CFG_RX_MON_RING_MASK_2,
  279. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  280. /* host2rxdma ring masks */
  281. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  282. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  283. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  284. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  285. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  286. /* rxdma2host ring masks */
  287. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  288. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  289. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  290. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  291. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  292. /* host2rxdma mon ring masks */
  293. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  294. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  295. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  296. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  297. /* rxdma2host mon ring masks */
  298. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  299. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  300. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  301. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  302. /* rx err ring masks */
  303. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  304. WLAN_CFG_RX_ERR_RING_MASK_1 |
  305. WLAN_CFG_RX_ERR_RING_MASK_2 |
  306. WLAN_CFG_RX_ERR_RING_MASK_3,
  307. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  308. /* rx wbm rel ring masks */
  309. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  310. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  311. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  312. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  313. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  314. /* reo status ring masks */
  315. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  316. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  317. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  318. WLAN_CFG_REO_STATUS_RING_MASK_3,
  319. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  320. },
  321. /* Interrupt assignment for 2 MSI combination */
  322. {
  323. /* tx ring masks */
  324. { WLAN_CFG_TX_RING_MASK_0,
  325. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  326. /* rx ring masks */
  327. { WLAN_CFG_RX_RING_MASK_0 |
  328. WLAN_CFG_RX_RING_MASK_1,
  329. WLAN_CFG_RX_RING_MASK_2,
  330. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  331. /* rx mon ring masks */
  332. { WLAN_CFG_RX_MON_RING_MASK_0 |
  333. WLAN_CFG_RX_MON_RING_MASK_1,
  334. WLAN_CFG_RX_MON_RING_MASK_2,
  335. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  336. /* host2rxdma ring masks */
  337. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  338. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  339. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  340. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  341. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  342. /* rxdma2host ring masks */
  343. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  344. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  345. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  346. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  347. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  348. /* host2rxdma mon ring masks */
  349. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  350. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  351. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  352. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  353. /* rxdma2host mon ring masks */
  354. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  355. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  356. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  357. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  358. /* rx err ring masks */
  359. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  360. WLAN_CFG_RX_ERR_RING_MASK_1,
  361. WLAN_CFG_RX_ERR_RING_MASK_2 |
  362. WLAN_CFG_RX_ERR_RING_MASK_3,
  363. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  364. /* rx wbm rel ring masks */
  365. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  366. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  367. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  368. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  369. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  370. /* reo status ring masks */
  371. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  372. WLAN_CFG_REO_STATUS_RING_MASK_1,
  373. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  374. WLAN_CFG_REO_STATUS_RING_MASK_3,
  375. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  376. },
  377. /* Interrupt assignment for 3 MSI combination */
  378. {
  379. /* tx ring masks */
  380. { WLAN_CFG_TX_RING_MASK_0,
  381. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  382. /* rx ring masks */
  383. { WLAN_CFG_RX_RING_MASK_0,
  384. WLAN_CFG_RX_RING_MASK_1,
  385. WLAN_CFG_RX_RING_MASK_2,
  386. 0, 0, 0, 0, 0, 0, 0, 0},
  387. /* rx mon ring masks */
  388. { 0, 0,
  389. WLAN_CFG_RX_MON_RING_MASK_0 |
  390. WLAN_CFG_RX_MON_RING_MASK_1 |
  391. WLAN_CFG_RX_MON_RING_MASK_2,
  392. 0, 0, 0, 0, 0, 0, 0, 0},
  393. /* host2rxdma ring masks */
  394. { 0, 0,
  395. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  396. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  397. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  398. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  399. 0, 0, 0, 0, 0, 0, 0, 0},
  400. /* rxdma2host ring masks */
  401. { 0, 0,
  402. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  403. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  404. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  405. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  406. 0, 0, 0, 0, 0, 0, 0, 0},
  407. /* host2rxdma mon ring masks */
  408. { 0, 0,
  409. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  410. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  411. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  412. 0, 0, 0, 0, 0, 0, 0, 0},
  413. /* rxdma2host mon ring masks */
  414. { 0, 0,
  415. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  416. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  417. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  418. 0, 0, 0, 0, 0, 0, 0, 0},
  419. /* rx err ring masks */
  420. { 0, 0,
  421. WLAN_CFG_RX_ERR_RING_MASK_0 |
  422. WLAN_CFG_RX_ERR_RING_MASK_1 |
  423. WLAN_CFG_RX_ERR_RING_MASK_2 |
  424. WLAN_CFG_RX_ERR_RING_MASK_3,
  425. 0, 0, 0, 0, 0, 0, 0, 0},
  426. /* rx wbm rel ring masks */
  427. { 0, 0,
  428. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  429. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  430. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  431. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  432. 0, 0, 0, 0, 0, 0, 0, 0},
  433. /* reo status ring masks */
  434. { 0, 0,
  435. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  436. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  437. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  438. WLAN_CFG_REO_STATUS_RING_MASK_3,
  439. 0, 0, 0, 0, 0, 0, 0, 0},
  440. },
  441. /* Interrupt assignment for 4 MSI combination */
  442. {
  443. /* tx ring masks */
  444. { WLAN_CFG_TX_RING_MASK_0,
  445. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  446. /* rx ring masks */
  447. { WLAN_CFG_RX_RING_MASK_0,
  448. WLAN_CFG_RX_RING_MASK_1,
  449. WLAN_CFG_RX_RING_MASK_2,
  450. 0, 0, 0, 0, 0, 0, 0, 0},
  451. /* rx mon ring masks */
  452. { WLAN_CFG_RX_MON_RING_MASK_0,
  453. WLAN_CFG_RX_MON_RING_MASK_1,
  454. WLAN_CFG_RX_MON_RING_MASK_2,
  455. 0, 0, 0, 0, 0, 0, 0, 0},
  456. /* host2rxdma ring masks */
  457. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  458. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  459. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  460. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  461. 0, 0, 0, 0, 0, 0, 0},
  462. /* rxdma2host ring masks */
  463. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  464. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  465. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  466. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  467. 0, 0, 0, 0, 0, 0, 0},
  468. /* host2rxdma mon ring masks */
  469. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  470. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  471. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  472. 0, 0, 0, 0, 0, 0, 0, 0},
  473. /* rxdma2host mon ring masks */
  474. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  475. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  476. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  477. 0, 0, 0, 0, 0, 0, 0, 0},
  478. /* rx err ring masks */
  479. { WLAN_CFG_RX_ERR_RING_MASK_0,
  480. WLAN_CFG_RX_ERR_RING_MASK_1,
  481. WLAN_CFG_RX_ERR_RING_MASK_2,
  482. WLAN_CFG_RX_ERR_RING_MASK_3,
  483. 0, 0, 0, 0, 0, 0, 0},
  484. /* rx wbm rel ring masks */
  485. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  486. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  487. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  488. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  489. 0, 0, 0, 0, 0, 0, 0},
  490. /* reo status ring masks */
  491. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  492. WLAN_CFG_REO_STATUS_RING_MASK_1,
  493. WLAN_CFG_REO_STATUS_RING_MASK_2,
  494. WLAN_CFG_REO_STATUS_RING_MASK_3,
  495. 0, 0, 0, 0, 0, 0, 0},
  496. },
  497. /* Interrupt assignment for 5 MSI combination */
  498. {
  499. /* tx ring masks */
  500. { WLAN_CFG_TX_RING_MASK_0,
  501. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  502. /* rx ring masks */
  503. { WLAN_CFG_RX_RING_MASK_0,
  504. WLAN_CFG_RX_RING_MASK_1,
  505. WLAN_CFG_RX_RING_MASK_2,
  506. 0, 0, 0, 0, 0, 0, 0, 0},
  507. /* rx mon ring masks */
  508. { 0, 0, 0, 0,
  509. WLAN_CFG_RX_MON_RING_MASK_0 |
  510. WLAN_CFG_RX_MON_RING_MASK_1 |
  511. WLAN_CFG_RX_MON_RING_MASK_2,
  512. 0, 0, 0, 0, 0, 0},
  513. /* host2rxdma ring masks */
  514. { 0, 0, 0, 0,
  515. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  516. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  517. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  518. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  519. 0, 0, 0, 0, 0, 0},
  520. /* rxdma2host ring masks */
  521. { 0, 0, 0, 0,
  522. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  523. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  524. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  525. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  526. 0, 0, 0, 0, 0, 0},
  527. /* host2rxdma mon ring masks */
  528. { 0, 0, 0, 0,
  529. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  530. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  531. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  532. 0, 0, 0, 0, 0, 0},
  533. /* rxdma2host mon ring masks */
  534. { 0, 0, 0, 0,
  535. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  536. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  537. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  538. 0, 0, 0, 0, 0, 0},
  539. /* rx err ring masks */
  540. { 0, 0, 0, 0,
  541. WLAN_CFG_RX_ERR_RING_MASK_0 |
  542. WLAN_CFG_RX_ERR_RING_MASK_1 |
  543. WLAN_CFG_RX_ERR_RING_MASK_2 |
  544. WLAN_CFG_RX_ERR_RING_MASK_3,
  545. 0, 0, 0, 0, 0, 0},
  546. /* rx wbm rel ring masks */
  547. { 0, 0, 0, 0,
  548. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  549. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  550. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  551. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  552. 0, 0, 0, 0, 0, 0},
  553. /* reo status ring masks */
  554. { 0, 0, 0, 0,
  555. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  556. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  557. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  558. WLAN_CFG_REO_STATUS_RING_MASK_3,
  559. 0, 0, 0, 0, 0, 0},
  560. },
  561. /* Interrupt assignment for 6 MSI combination */
  562. {
  563. /* tx ring masks */
  564. { WLAN_CFG_TX_RING_MASK_0,
  565. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  566. /* rx ring masks */
  567. { 0, 0,
  568. WLAN_CFG_RX_RING_MASK_0,
  569. WLAN_CFG_RX_RING_MASK_1,
  570. WLAN_CFG_RX_RING_MASK_2,
  571. 0, 0, 0, 0, 0, 0},
  572. /* rx mon ring masks */
  573. { WLAN_CFG_RX_MON_RING_MASK_0,
  574. WLAN_CFG_RX_MON_RING_MASK_1,
  575. WLAN_CFG_RX_MON_RING_MASK_2,
  576. 0, 0, 0, 0, 0, 0, 0, 0},
  577. /* host2rxdma ring masks */
  578. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  579. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  580. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  581. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  582. 0, 0, 0, 0, 0, 0, 0},
  583. /* rxdma2host ring masks */
  584. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  585. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  586. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  587. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  588. 0, 0, 0, 0, 0, 0, 0},
  589. /* host2rxdma mon ring masks */
  590. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  591. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  592. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  593. 0, 0, 0, 0, 0, 0, 0, 0},
  594. /* rxdma2host mon ring masks */
  595. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  596. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  597. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  598. 0, 0, 0, 0, 0, 0, 0, 0},
  599. /* rx err ring masks */
  600. { WLAN_CFG_RX_ERR_RING_MASK_0,
  601. WLAN_CFG_RX_ERR_RING_MASK_1,
  602. WLAN_CFG_RX_ERR_RING_MASK_2,
  603. WLAN_CFG_RX_ERR_RING_MASK_3,
  604. 0, 0, 0, 0, 0, 0, 0},
  605. /* rx wbm rel ring masks */
  606. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  607. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  608. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  609. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  610. 0, 0, 0, 0, 0, 0, 0},
  611. /* reo status ring masks */
  612. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  613. WLAN_CFG_REO_STATUS_RING_MASK_1,
  614. WLAN_CFG_REO_STATUS_RING_MASK_2,
  615. WLAN_CFG_REO_STATUS_RING_MASK_3,
  616. 0, 0, 0, 0, 0, 0, 0},
  617. },
  618. /* Interrupt assignment for 7 MSI combination */
  619. {
  620. /* tx ring masks */
  621. { WLAN_CFG_TX_RING_MASK_0,
  622. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  623. /* rx ring masks */
  624. { 0, 0, 0,
  625. WLAN_CFG_RX_RING_MASK_0,
  626. WLAN_CFG_RX_RING_MASK_1,
  627. WLAN_CFG_RX_RING_MASK_2,
  628. 0, 0, 0, 0},
  629. /* rx mon ring masks */
  630. { 0, 0, 0,
  631. WLAN_CFG_RX_MON_RING_MASK_0,
  632. WLAN_CFG_RX_MON_RING_MASK_1,
  633. WLAN_CFG_RX_MON_RING_MASK_2,
  634. 0, 0, 0, 0, 0},
  635. /* host2rxdma ring masks */
  636. { 0, 0, 0,
  637. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  638. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  639. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  640. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  641. 0, 0, 0, 0},
  642. /* rxdma2host ring masks */
  643. { 0, 0, 0,
  644. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  645. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  646. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  647. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  648. 0, 0, 0, 0},
  649. /* host2rxdma mon ring masks */
  650. { 0, 0, 0,
  651. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  652. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  653. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  654. 0, 0, 0, 0, 0},
  655. /* rxdma2host mon ring masks */
  656. { 0, 0, 0,
  657. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  658. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  659. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  660. 0, 0, 0, 0, 0},
  661. /* rx err ring masks */
  662. { 0, 0, 0,
  663. WLAN_CFG_RX_ERR_RING_MASK_0,
  664. WLAN_CFG_RX_ERR_RING_MASK_1,
  665. WLAN_CFG_RX_ERR_RING_MASK_2,
  666. WLAN_CFG_RX_ERR_RING_MASK_3,
  667. 0, 0, 0, 0},
  668. /* rx wbm rel ring masks */
  669. { 0, 0, 0,
  670. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  671. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  672. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  673. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  674. 0, 0, 0, 0},
  675. /* reo status ring masks */
  676. { 0, 0, 0,
  677. WLAN_CFG_REO_STATUS_RING_MASK_0,
  678. WLAN_CFG_REO_STATUS_RING_MASK_1,
  679. WLAN_CFG_REO_STATUS_RING_MASK_2,
  680. WLAN_CFG_REO_STATUS_RING_MASK_3,
  681. 0, 0, 0, 0},
  682. },
  683. /* Interrupt assignment for 8 MSI combination */
  684. {
  685. /* tx ring masks */
  686. { WLAN_CFG_TX_RING_MASK_0,
  687. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  688. /* rx ring masks */
  689. { 0, 0, 0, 0,
  690. WLAN_CFG_RX_RING_MASK_0,
  691. WLAN_CFG_RX_RING_MASK_1,
  692. WLAN_CFG_RX_RING_MASK_2,
  693. 0, 0, 0, 0},
  694. /* rx mon ring masks */
  695. { 0, 0, 0,
  696. WLAN_CFG_RX_MON_RING_MASK_0,
  697. WLAN_CFG_RX_MON_RING_MASK_1,
  698. WLAN_CFG_RX_MON_RING_MASK_2,
  699. 0, 0, 0, 0, 0},
  700. /* host2rxdma ring masks */
  701. { 0, 0, 0,
  702. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  703. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  704. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  705. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  706. 0, 0, 0, 0},
  707. /* rxdma2host ring masks */
  708. { 0, 0, 0,
  709. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  710. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  711. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  712. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  713. 0, 0, 0, 0},
  714. /* host2rxdma mon ring masks */
  715. { 0, 0, 0,
  716. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  717. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  718. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  719. 0, 0, 0, 0, 0},
  720. /* rxdma2host mon ring masks */
  721. { 0, 0, 0,
  722. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  723. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  724. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  725. 0, 0, 0, 0, 0},
  726. /* rx err ring masks */
  727. { 0, 0, 0,
  728. WLAN_CFG_RX_ERR_RING_MASK_0,
  729. WLAN_CFG_RX_ERR_RING_MASK_1,
  730. WLAN_CFG_RX_ERR_RING_MASK_2,
  731. WLAN_CFG_RX_ERR_RING_MASK_3,
  732. 0, 0, 0, 0},
  733. /* rx wbm rel ring masks */
  734. { 0, 0, 0,
  735. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  736. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  737. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  738. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  739. 0, 0, 0, 0},
  740. /* reo status ring masks */
  741. { 0, 0, 0,
  742. WLAN_CFG_REO_STATUS_RING_MASK_0,
  743. WLAN_CFG_REO_STATUS_RING_MASK_1,
  744. WLAN_CFG_REO_STATUS_RING_MASK_2,
  745. WLAN_CFG_REO_STATUS_RING_MASK_3,
  746. 0, 0, 0, 0},
  747. },
  748. };
  749. #else
  750. static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
  751. /* Interrupt assignment for integrated configuration */
  752. {
  753. /* tx ring masks */
  754. { WLAN_CFG_TX_RING_MASK_0,
  755. WLAN_CFG_TX_RING_MASK_1,
  756. WLAN_CFG_TX_RING_MASK_2,
  757. WLAN_CFG_TX_RING_MASK_3,
  758. 0, 0, 0, 0, 0, 0, 0},
  759. /* rx ring masks */
  760. { 0, 0, 0, 0, 0, 0, 0,
  761. WLAN_CFG_RX_RING_MASK_0,
  762. WLAN_CFG_RX_RING_MASK_1,
  763. WLAN_CFG_RX_RING_MASK_2,
  764. WLAN_CFG_RX_RING_MASK_3},
  765. /* rx mon ring masks */
  766. { 0, 0, 0, 0,
  767. WLAN_CFG_RX_MON_RING_MASK_0,
  768. WLAN_CFG_RX_MON_RING_MASK_1,
  769. WLAN_CFG_RX_MON_RING_MASK_2,
  770. 0, 0, 0, 0},
  771. /* host2rxdma ring masks */
  772. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  773. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  774. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  775. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  776. 0, 0, 0, 0, 0, 0, 0},
  777. /* rxdma2host ring masks */
  778. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  779. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  780. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  781. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  782. 0, 0, 0, 0, 0, 0, 0},
  783. /* host2rxdma mon ring masks */
  784. { 0, 0, 0, 0,
  785. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  786. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  787. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  788. 0, 0, 0, 0},
  789. /* rxdma2host mon ring masks */
  790. { 0, 0, 0, 0,
  791. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  792. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  793. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  794. 0, 0, 0, 0},
  795. /* rx err ring masks */
  796. { WLAN_CFG_RX_ERR_RING_MASK_0,
  797. WLAN_CFG_RX_ERR_RING_MASK_1,
  798. WLAN_CFG_RX_ERR_RING_MASK_2,
  799. WLAN_CFG_RX_ERR_RING_MASK_3,
  800. 0, 0, 0, 0, 0, 0, 0},
  801. /* rx wbm rel ring masks */
  802. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  803. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  804. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  805. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  806. 0, 0, 0, 0, 0, 0, 0},
  807. /* reo status ring masks */
  808. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  809. WLAN_CFG_REO_STATUS_RING_MASK_1,
  810. WLAN_CFG_REO_STATUS_RING_MASK_2,
  811. WLAN_CFG_REO_STATUS_RING_MASK_3,
  812. 0, 0, 0, 0, 0, 0, 0},
  813. },
  814. /* Interrupt assignment for 1 MSI combination */
  815. {
  816. /* tx ring masks */
  817. { WLAN_CFG_TX_RING_MASK_0 |
  818. WLAN_CFG_TX_RING_MASK_1 |
  819. WLAN_CFG_TX_RING_MASK_2 |
  820. WLAN_CFG_TX_RING_MASK_3,
  821. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  822. /* rx ring masks */
  823. { WLAN_CFG_RX_RING_MASK_0 |
  824. WLAN_CFG_RX_RING_MASK_1 |
  825. WLAN_CFG_RX_RING_MASK_2 |
  826. WLAN_CFG_RX_RING_MASK_3,
  827. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  828. /* rx mon ring masks */
  829. { WLAN_CFG_RX_MON_RING_MASK_0 |
  830. WLAN_CFG_RX_MON_RING_MASK_1 |
  831. WLAN_CFG_RX_MON_RING_MASK_2,
  832. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  833. /* host2rxdma ring masks */
  834. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  835. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  836. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  837. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  838. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  839. /* rxdma2host ring masks */
  840. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  841. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  842. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  843. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  844. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  845. /* host2rxdma mon ring masks */
  846. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  847. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  848. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  849. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  850. /* rxdma2host mon ring masks */
  851. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  852. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  853. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  854. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  855. /* rx err ring masks */
  856. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  857. WLAN_CFG_RX_ERR_RING_MASK_1 |
  858. WLAN_CFG_RX_ERR_RING_MASK_2 |
  859. WLAN_CFG_RX_ERR_RING_MASK_3,
  860. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  861. /* rx wbm rel ring masks */
  862. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  863. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  864. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  865. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  866. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  867. /* reo status ring masks */
  868. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  869. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  870. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  871. WLAN_CFG_REO_STATUS_RING_MASK_3,
  872. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  873. },
  874. /* Interrupt assignment for 2 MSI combination */
  875. {
  876. /* tx ring masks */
  877. { WLAN_CFG_TX_RING_MASK_0 |
  878. WLAN_CFG_TX_RING_MASK_1,
  879. WLAN_CFG_TX_RING_MASK_2 |
  880. WLAN_CFG_TX_RING_MASK_3,
  881. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  882. /* rx ring masks */
  883. { WLAN_CFG_RX_RING_MASK_0 |
  884. WLAN_CFG_RX_RING_MASK_1,
  885. WLAN_CFG_RX_RING_MASK_2 |
  886. WLAN_CFG_RX_RING_MASK_3,
  887. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  888. /* rx mon ring masks */
  889. { WLAN_CFG_RX_MON_RING_MASK_0 |
  890. WLAN_CFG_RX_MON_RING_MASK_1,
  891. WLAN_CFG_RX_MON_RING_MASK_2,
  892. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  893. /* host2rxdma ring masks */
  894. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  895. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  896. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  897. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  898. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  899. /* rxdma2host ring masks */
  900. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  901. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  902. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  903. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  904. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  905. /* host2rxdma mon ring masks */
  906. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  907. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  908. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  909. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  910. /* rxdma2host mon ring masks */
  911. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  912. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  913. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  914. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  915. /* rx err ring masks */
  916. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  917. WLAN_CFG_RX_ERR_RING_MASK_1,
  918. WLAN_CFG_RX_ERR_RING_MASK_2 |
  919. WLAN_CFG_RX_ERR_RING_MASK_3,
  920. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  921. /* rx wbm rel ring masks */
  922. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  923. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  924. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  925. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  926. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  927. /* reo status ring masks */
  928. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  929. WLAN_CFG_REO_STATUS_RING_MASK_1,
  930. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  931. WLAN_CFG_REO_STATUS_RING_MASK_3,
  932. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  933. },
  934. /* Interrupt assignment for 3 MSI combination */
  935. {
  936. /* tx ring masks */
  937. { WLAN_CFG_TX_RING_MASK_0 |
  938. WLAN_CFG_TX_RING_MASK_1,
  939. WLAN_CFG_TX_RING_MASK_2 |
  940. WLAN_CFG_TX_RING_MASK_3,
  941. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  942. /* rx ring masks */
  943. { WLAN_CFG_RX_RING_MASK_0 |
  944. WLAN_CFG_RX_RING_MASK_1,
  945. WLAN_CFG_RX_RING_MASK_2 |
  946. WLAN_CFG_RX_RING_MASK_3,
  947. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  948. /* rx mon ring masks */
  949. { 0, 0,
  950. WLAN_CFG_RX_MON_RING_MASK_0 |
  951. WLAN_CFG_RX_MON_RING_MASK_1 |
  952. WLAN_CFG_RX_MON_RING_MASK_2,
  953. 0, 0, 0, 0, 0, 0, 0, 0},
  954. /* host2rxdma ring masks */
  955. { 0, 0,
  956. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  957. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  958. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  959. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  960. 0, 0, 0, 0, 0, 0, 0, 0},
  961. /* rxdma2host ring masks */
  962. { 0, 0,
  963. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  964. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  965. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  966. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  967. 0, 0, 0, 0, 0, 0, 0, 0},
  968. /* host2rxdma mon ring masks */
  969. { 0, 0,
  970. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  971. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  972. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  973. 0, 0, 0, 0, 0, 0, 0, 0},
  974. /* rxdma2host mon ring masks */
  975. { 0, 0,
  976. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  977. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  978. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  979. 0, 0, 0, 0, 0, 0, 0, 0},
  980. /* rx err ring masks */
  981. { 0, 0,
  982. WLAN_CFG_RX_ERR_RING_MASK_0 |
  983. WLAN_CFG_RX_ERR_RING_MASK_1 |
  984. WLAN_CFG_RX_ERR_RING_MASK_2 |
  985. WLAN_CFG_RX_ERR_RING_MASK_3,
  986. 0, 0, 0, 0, 0, 0, 0, 0},
  987. /* rx wbm rel ring masks */
  988. { 0, 0,
  989. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  990. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  991. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  992. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  993. 0, 0, 0, 0, 0, 0, 0, 0},
  994. /* reo status ring masks */
  995. { 0, 0,
  996. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  997. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  998. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  999. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1000. 0, 0, 0, 0, 0, 0, 0, 0},
  1001. },
  1002. /* Interrupt assignment for 4 MSI combination */
  1003. {
  1004. /* tx ring masks */
  1005. { WLAN_CFG_TX_RING_MASK_0,
  1006. WLAN_CFG_TX_RING_MASK_1,
  1007. WLAN_CFG_TX_RING_MASK_2,
  1008. WLAN_CFG_TX_RING_MASK_3,
  1009. 0, 0, 0, 0, 0, 0, 0},
  1010. /* rx ring masks */
  1011. { WLAN_CFG_RX_RING_MASK_0,
  1012. WLAN_CFG_RX_RING_MASK_1,
  1013. WLAN_CFG_RX_RING_MASK_2,
  1014. WLAN_CFG_RX_RING_MASK_3,
  1015. 0, 0, 0, 0, 0, 0, 0},
  1016. /* rx mon ring masks */
  1017. { WLAN_CFG_RX_MON_RING_MASK_0,
  1018. WLAN_CFG_RX_MON_RING_MASK_1,
  1019. WLAN_CFG_RX_MON_RING_MASK_2,
  1020. 0, 0, 0, 0, 0, 0, 0, 0},
  1021. /* host2rxdma ring masks */
  1022. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1023. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1024. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1025. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1026. 0, 0, 0, 0, 0, 0, 0},
  1027. /* rxdma2host ring masks */
  1028. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1029. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1030. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1031. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1032. 0, 0, 0, 0, 0, 0, 0},
  1033. /* host2rxdma mon ring masks */
  1034. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1035. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1036. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1037. 0, 0, 0, 0, 0, 0, 0, 0},
  1038. /* rxdma2host mon ring masks */
  1039. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1040. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1041. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1042. 0, 0, 0, 0, 0, 0, 0, 0},
  1043. /* rx err ring masks */
  1044. { WLAN_CFG_RX_ERR_RING_MASK_0,
  1045. WLAN_CFG_RX_ERR_RING_MASK_1,
  1046. WLAN_CFG_RX_ERR_RING_MASK_2,
  1047. WLAN_CFG_RX_ERR_RING_MASK_3,
  1048. 0, 0, 0, 0, 0, 0, 0},
  1049. /* rx wbm rel ring masks */
  1050. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1051. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1052. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1053. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1054. 0, 0, 0, 0, 0, 0, 0},
  1055. /* reo status ring masks */
  1056. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  1057. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1058. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1059. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1060. 0, 0, 0, 0, 0, 0, 0},
  1061. },
  1062. /* Interrupt assignment for 5 MSI combination */
  1063. {
  1064. /* tx ring masks */
  1065. { WLAN_CFG_TX_RING_MASK_0,
  1066. WLAN_CFG_TX_RING_MASK_1,
  1067. WLAN_CFG_TX_RING_MASK_2,
  1068. WLAN_CFG_TX_RING_MASK_3,
  1069. 0, 0, 0, 0, 0, 0, 0},
  1070. /* rx ring masks */
  1071. { WLAN_CFG_RX_RING_MASK_0,
  1072. WLAN_CFG_RX_RING_MASK_1,
  1073. WLAN_CFG_RX_RING_MASK_2,
  1074. WLAN_CFG_RX_RING_MASK_3,
  1075. 0, 0, 0, 0, 0, 0, 0},
  1076. /* rx mon ring masks */
  1077. { 0, 0, 0, 0,
  1078. WLAN_CFG_RX_MON_RING_MASK_0 |
  1079. WLAN_CFG_RX_MON_RING_MASK_1 |
  1080. WLAN_CFG_RX_MON_RING_MASK_2,
  1081. 0, 0, 0, 0, 0, 0},
  1082. /* host2rxdma ring masks */
  1083. { 0, 0, 0, 0,
  1084. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  1085. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  1086. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  1087. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1088. 0, 0, 0, 0, 0, 0},
  1089. /* rxdma2host ring masks */
  1090. { 0, 0, 0, 0,
  1091. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  1092. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  1093. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  1094. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1095. 0, 0, 0, 0, 0, 0},
  1096. /* host2rxdma mon ring masks */
  1097. { 0, 0, 0, 0,
  1098. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  1099. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  1100. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1101. 0, 0, 0, 0, 0, 0},
  1102. /* rxdma2host mon ring masks */
  1103. { 0, 0, 0, 0,
  1104. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  1105. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  1106. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1107. 0, 0, 0, 0, 0, 0},
  1108. /* rx err ring masks */
  1109. { 0, 0, 0, 0,
  1110. WLAN_CFG_RX_ERR_RING_MASK_0 |
  1111. WLAN_CFG_RX_ERR_RING_MASK_1 |
  1112. WLAN_CFG_RX_ERR_RING_MASK_2 |
  1113. WLAN_CFG_RX_ERR_RING_MASK_3,
  1114. 0, 0, 0, 0, 0, 0},
  1115. /* rx wbm rel ring masks */
  1116. { 0, 0, 0, 0,
  1117. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  1118. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  1119. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  1120. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1121. 0, 0, 0, 0, 0, 0},
  1122. /* reo status ring masks */
  1123. { 0, 0, 0, 0,
  1124. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  1125. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  1126. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  1127. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1128. 0, 0, 0, 0, 0, 0},
  1129. },
  1130. /* Interrupt assignment for 6 MSI combination */
  1131. {
  1132. /* tx ring masks */
  1133. { WLAN_CFG_TX_RING_MASK_0,
  1134. WLAN_CFG_TX_RING_MASK_1,
  1135. WLAN_CFG_TX_RING_MASK_2,
  1136. WLAN_CFG_TX_RING_MASK_3,
  1137. 0, 0, 0, 0, 0, 0, 0},
  1138. /* rx ring masks */
  1139. { 0, 0,
  1140. WLAN_CFG_RX_RING_MASK_0,
  1141. WLAN_CFG_RX_RING_MASK_1,
  1142. WLAN_CFG_RX_RING_MASK_2,
  1143. WLAN_CFG_RX_RING_MASK_3,
  1144. 0, 0, 0, 0, 0},
  1145. /* rx mon ring masks */
  1146. { WLAN_CFG_RX_MON_RING_MASK_0,
  1147. WLAN_CFG_RX_MON_RING_MASK_1,
  1148. WLAN_CFG_RX_MON_RING_MASK_2,
  1149. 0, 0, 0, 0, 0, 0, 0, 0},
  1150. /* host2rxdma ring masks */
  1151. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1152. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1153. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1154. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1155. 0, 0, 0, 0, 0, 0, 0},
  1156. /* rxdma2host ring masks */
  1157. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1158. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1159. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1160. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1161. 0, 0, 0, 0, 0, 0, 0},
  1162. /* host2rxdma mon ring masks */
  1163. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1164. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1165. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1166. 0, 0, 0, 0, 0, 0, 0, 0},
  1167. /* rxdma2host mon ring masks */
  1168. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1169. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1170. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1171. 0, 0, 0, 0, 0, 0, 0, 0},
  1172. /* rx err ring masks */
  1173. { WLAN_CFG_RX_ERR_RING_MASK_0,
  1174. WLAN_CFG_RX_ERR_RING_MASK_1,
  1175. WLAN_CFG_RX_ERR_RING_MASK_2,
  1176. WLAN_CFG_RX_ERR_RING_MASK_3,
  1177. 0, 0, 0, 0, 0, 0, 0},
  1178. /* rx wbm rel ring masks */
  1179. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1180. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1181. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1182. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1183. 0, 0, 0, 0, 0, 0, 0},
  1184. /* reo status ring masks */
  1185. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  1186. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1187. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1188. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1189. 0, 0, 0, 0, 0, 0, 0},
  1190. },
  1191. /* Interrupt assignment for 7 MSI combination */
  1192. {
  1193. /* tx ring masks */
  1194. { WLAN_CFG_TX_RING_MASK_0,
  1195. WLAN_CFG_TX_RING_MASK_1,
  1196. WLAN_CFG_TX_RING_MASK_2,
  1197. WLAN_CFG_TX_RING_MASK_3,
  1198. 0, 0, 0, 0, 0, 0, 0},
  1199. /* rx ring masks */
  1200. { 0, 0, 0,
  1201. WLAN_CFG_RX_RING_MASK_0,
  1202. WLAN_CFG_RX_RING_MASK_1,
  1203. WLAN_CFG_RX_RING_MASK_2,
  1204. WLAN_CFG_RX_RING_MASK_3,
  1205. 0, 0, 0},
  1206. /* rx mon ring masks */
  1207. { 0, 0, 0,
  1208. WLAN_CFG_RX_MON_RING_MASK_0,
  1209. WLAN_CFG_RX_MON_RING_MASK_1,
  1210. WLAN_CFG_RX_MON_RING_MASK_2,
  1211. 0, 0, 0, 0, 0},
  1212. /* host2rxdma ring masks */
  1213. { 0, 0, 0,
  1214. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1215. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1216. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1217. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1218. 0, 0, 0, 0},
  1219. /* rxdma2host ring masks */
  1220. { 0, 0, 0,
  1221. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1222. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1223. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1224. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1225. 0, 0, 0, 0},
  1226. /* host2rxdma mon ring masks */
  1227. { 0, 0, 0,
  1228. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1229. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1230. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1231. 0, 0, 0, 0, 0},
  1232. /* rxdma2host mon ring masks */
  1233. { 0, 0, 0,
  1234. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1235. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1236. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1237. 0, 0, 0, 0, 0},
  1238. /* rx err ring masks */
  1239. { 0, 0, 0,
  1240. WLAN_CFG_RX_ERR_RING_MASK_0,
  1241. WLAN_CFG_RX_ERR_RING_MASK_1,
  1242. WLAN_CFG_RX_ERR_RING_MASK_2,
  1243. WLAN_CFG_RX_ERR_RING_MASK_3,
  1244. 0, 0, 0, 0},
  1245. /* rx wbm rel ring masks */
  1246. { 0, 0, 0,
  1247. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1248. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1249. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1250. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1251. 0, 0, 0, 0},
  1252. /* reo status ring masks */
  1253. { 0, 0, 0,
  1254. WLAN_CFG_REO_STATUS_RING_MASK_0,
  1255. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1256. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1257. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1258. 0, 0, 0, 0},
  1259. },
  1260. /* Interrupt assignment for 8 MSI combination */
  1261. {
  1262. /* tx ring masks */
  1263. { WLAN_CFG_TX_RING_MASK_0,
  1264. WLAN_CFG_TX_RING_MASK_1,
  1265. WLAN_CFG_TX_RING_MASK_2,
  1266. WLAN_CFG_TX_RING_MASK_3,
  1267. 0, 0, 0, 0, 0, 0, 0},
  1268. /* rx ring masks */
  1269. { 0, 0, 0, 0,
  1270. WLAN_CFG_RX_RING_MASK_0,
  1271. WLAN_CFG_RX_RING_MASK_1,
  1272. WLAN_CFG_RX_RING_MASK_2,
  1273. WLAN_CFG_RX_RING_MASK_3,
  1274. 0, 0, 0},
  1275. /* rx mon ring masks */
  1276. { 0, 0, 0,
  1277. WLAN_CFG_RX_MON_RING_MASK_0,
  1278. WLAN_CFG_RX_MON_RING_MASK_1,
  1279. WLAN_CFG_RX_MON_RING_MASK_2,
  1280. 0, 0, 0, 0, 0},
  1281. /* tx mon ring masks */
  1282. { WLAN_CFG_TX_MON_RING_MASK_0,
  1283. WLAN_CFG_TX_MON_RING_MASK_1,
  1284. 0, 0, 0, 0, 0, 0},
  1285. /* host2rxdma ring masks */
  1286. { 0, 0, 0,
  1287. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  1288. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  1289. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  1290. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  1291. 0, 0, 0, 0},
  1292. /* rxdma2host ring masks */
  1293. { 0, 0, 0,
  1294. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  1295. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  1296. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  1297. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  1298. 0, 0, 0, 0},
  1299. /* host2rxdma mon ring masks */
  1300. { 0, 0, 0,
  1301. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  1302. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  1303. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  1304. 0, 0, 0, 0, 0},
  1305. /* rxdma2host mon ring masks */
  1306. { 0, 0, 0,
  1307. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  1308. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  1309. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  1310. 0, 0, 0, 0, 0},
  1311. /* rx err ring masks */
  1312. { 0, 0, 0,
  1313. WLAN_CFG_RX_ERR_RING_MASK_0,
  1314. WLAN_CFG_RX_ERR_RING_MASK_1,
  1315. WLAN_CFG_RX_ERR_RING_MASK_2,
  1316. WLAN_CFG_RX_ERR_RING_MASK_3,
  1317. 0, 0, 0, 0},
  1318. /* rx wbm rel ring masks */
  1319. { 0, 0, 0,
  1320. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  1321. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  1322. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  1323. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  1324. 0, 0, 0, 0},
  1325. /* reo status ring masks */
  1326. { 0, 0, 0,
  1327. WLAN_CFG_REO_STATUS_RING_MASK_0,
  1328. WLAN_CFG_REO_STATUS_RING_MASK_1,
  1329. WLAN_CFG_REO_STATUS_RING_MASK_2,
  1330. WLAN_CFG_REO_STATUS_RING_MASK_3,
  1331. 0, 0, 0, 0},
  1332. /* host2txmon ring masks */
  1333. { WLAN_CFG_HOST2TXMON_RING_MASK_0,
  1334. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  1335. },
  1336. };
  1337. #endif
  1338. #endif
  1339. /**
  1340. * g_wlan_srng_cfg[] - Per ring_type specific configuration
  1341. *
  1342. */
  1343. struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
  1344. /* REO_DST ring configuration */
  1345. struct wlan_srng_cfg wlan_srng_reo_cfg = {
  1346. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
  1347. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING,
  1348. .low_threshold = 0,
  1349. };
  1350. /* WBM2SW_RELEASE ring configuration */
  1351. struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
  1352. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
  1353. .batch_count_threshold = 0,
  1354. .low_threshold = 0,
  1355. };
  1356. /* RXDMA_BUF ring configuration */
  1357. struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
  1358. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1359. .batch_count_threshold = 0,
  1360. .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
  1361. };
  1362. /* RXDMA_MONITOR_BUF ring configuration */
  1363. struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
  1364. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1365. .batch_count_threshold = 0,
  1366. .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
  1367. };
  1368. /* RXDMA_MONITOR_STATUS ring configuration */
  1369. struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
  1370. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  1371. .batch_count_threshold = 0,
  1372. .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
  1373. };
  1374. /* TX_MONITOR_BUF ring configuration */
  1375. struct wlan_srng_cfg wlan_srng_tx_monitor_buf_cfg = {
  1376. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_TX,
  1377. .batch_count_threshold = 0,
  1378. .low_threshold = WLAN_CFG_TX_MONITOR_BUF_RING_SIZE_MAX >> 3,
  1379. };
  1380. /* DEFAULT_CONFIG ring configuration */
  1381. struct wlan_srng_cfg wlan_srng_default_cfg = {
  1382. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
  1383. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
  1384. .low_threshold = 0,
  1385. };
  1386. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
  1387. {
  1388. g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
  1389. g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
  1390. g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
  1391. g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
  1392. g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
  1393. g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
  1394. g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
  1395. g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
  1396. g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
  1397. g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
  1398. g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
  1399. g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
  1400. g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
  1401. g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
  1402. wlan_srng_rxdma_monitor_buf_cfg;
  1403. g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
  1404. wlan_srng_rxdma_monitor_status_cfg;
  1405. g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
  1406. g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
  1407. g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
  1408. #ifdef WLAN_FEATURE_CIF_CFR
  1409. g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
  1410. #endif
  1411. g_wlan_srng_cfg[TX_MONITOR_BUF] = wlan_srng_tx_monitor_buf_cfg;
  1412. *wlan_cfg = g_wlan_srng_cfg;
  1413. }
  1414. static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
  1415. 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
  1416. 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
  1417. 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
  1418. 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
  1419. 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
  1420. };
  1421. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  1422. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1423. int num_dp_msi,
  1424. int interrupt_mode,
  1425. bool is_monitor_mode)
  1426. { int i = 0;
  1427. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  1428. wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i];
  1429. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  1430. rx_mon_ring_mask_msi[i];
  1431. wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
  1432. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  1433. rx_err_ring_mask_msi[i];
  1434. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  1435. rx_wbm_rel_ring_mask_msi[i];
  1436. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  1437. reo_status_ring_mask_msi[i];
  1438. if (is_monitor_mode) {
  1439. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  1440. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1441. } else {
  1442. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1443. rx_ring_mask_msi[i];
  1444. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1445. rxdma2host_ring_mask_msi[i];
  1446. }
  1447. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1448. host2rxdma_ring_mask_msi[i];
  1449. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1450. host2rxdma_mon_ring_mask_msi[i];
  1451. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1452. rxdma2host_mon_ring_mask_msi[i];
  1453. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1454. rx_ring_near_full_irq_1_mask_msi[i];
  1455. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1456. rx_ring_near_full_irq_2_mask_msi[i];
  1457. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1458. tx_ring_near_full_irq_mask_msi[i];
  1459. }
  1460. }
  1461. #else
  1462. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1463. int num_dp_msi,
  1464. int interrupt_mode,
  1465. bool is_monitor_mode)
  1466. {
  1467. int i = 0;
  1468. int interrupt_index = 0;
  1469. if(interrupt_mode == DP_INTR_INTEGRATED) {
  1470. interrupt_index = 0;
  1471. } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
  1472. DP_INTR_POLL) {
  1473. interrupt_index = num_dp_msi;
  1474. } else {
  1475. qdf_err("Interrupt mode %d", interrupt_mode);
  1476. }
  1477. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  1478. wlan_cfg_ctx->int_tx_ring_mask[i] =
  1479. dp_mask_assignment[interrupt_index].tx_ring_mask[i];
  1480. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  1481. dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
  1482. wlan_cfg_ctx->int_tx_mon_ring_mask[i] =
  1483. dp_mask_assignment[interrupt_index].tx_mon_ring_mask[i];
  1484. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  1485. dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
  1486. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  1487. dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
  1488. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  1489. dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
  1490. if (is_monitor_mode) {
  1491. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  1492. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  1493. } else {
  1494. wlan_cfg_ctx->int_rx_ring_mask[i] =
  1495. dp_mask_assignment[interrupt_index].rx_ring_mask[i];
  1496. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  1497. dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
  1498. }
  1499. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  1500. dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
  1501. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  1502. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  1503. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  1504. dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
  1505. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  1506. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
  1507. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  1508. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
  1509. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  1510. dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
  1511. wlan_cfg_ctx->int_host2txmon_ring_mask[i] =
  1512. dp_mask_assignment[interrupt_index].host2txmon_ring_mask[i];
  1513. }
  1514. }
  1515. #endif
  1516. #ifdef IPA_OFFLOAD
  1517. #ifdef IPA_WDI3_TX_TWO_PIPES
  1518. /**
  1519. * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
  1520. * in dp soc cfg context
  1521. * @psoc: Object manager psoc
  1522. * @wlan_cfg_ctx: dp soc cfg ctx
  1523. *
  1524. * Return: None
  1525. */
  1526. static void
  1527. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1528. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1529. {
  1530. wlan_cfg_ctx->ipa_tx_ring_size =
  1531. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1532. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1533. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1534. wlan_cfg_ctx->ipa_tx_alt_ring_size =
  1535. cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
  1536. wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
  1537. cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
  1538. }
  1539. #else /* !IPA_WDI3_TX_TWO_PIPES */
  1540. /**
  1541. * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
  1542. * cfg context
  1543. * @psoc - Object manager psoc
  1544. * @wlan_cfg_ctx - dp soc cfg ctx
  1545. *
  1546. * Return: None
  1547. */
  1548. static void
  1549. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1550. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1551. {
  1552. wlan_cfg_ctx->ipa_tx_ring_size =
  1553. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  1554. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  1555. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  1556. }
  1557. #endif /* IPA_WDI3_TX_TWO_PIPES */
  1558. #else /* !IPA_OFFLOAD */
  1559. static inline void
  1560. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1561. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1562. {
  1563. }
  1564. #endif
  1565. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  1566. static void
  1567. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1568. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1569. {
  1570. wlan_cfg_ctx->hw_cc_enabled =
  1571. cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
  1572. }
  1573. #else
  1574. static void
  1575. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1576. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1577. {
  1578. wlan_cfg_ctx->hw_cc_enabled = true;
  1579. }
  1580. #endif
  1581. #ifdef WLAN_SUPPORT_PPEDS
  1582. /**
  1583. * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc
  1584. * cfg context
  1585. * @psoc - Object manager psoc
  1586. * @wlan_cfg_ctx - dp soc cfg ctx
  1587. *
  1588. * Return: None
  1589. */
  1590. static void
  1591. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1592. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1593. {
  1594. wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE);
  1595. wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
  1596. wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
  1597. wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc,
  1598. CFG_DP_PPE_RELEASE_RING);
  1599. }
  1600. #else
  1601. static inline void
  1602. wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1603. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1604. {
  1605. }
  1606. #endif
  1607. /**
  1608. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1609. * @psoc - Object manager psoc
  1610. * Return: wlan_cfg_ctx - Handle to Configuration context
  1611. */
  1612. struct wlan_cfg_dp_soc_ctxt *
  1613. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1614. {
  1615. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1616. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1617. if (!wlan_cfg_ctx)
  1618. return NULL;
  1619. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1620. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1621. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1622. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1623. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1624. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1625. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1626. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1627. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1628. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1629. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1630. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1631. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1632. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1633. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1634. CFG_DP_TX_EXT_DESC_POOLS);
  1635. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1636. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1637. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1638. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1639. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1640. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1641. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1642. CFG_DP_TX_COMPL_RING_SIZE);
  1643. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1644. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1645. wlan_cfg_ctx->int_batch_threshold_tx =
  1646. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1647. wlan_cfg_ctx->int_timer_threshold_tx =
  1648. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1649. wlan_cfg_ctx->int_batch_threshold_rx =
  1650. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1651. wlan_cfg_ctx->int_timer_threshold_rx =
  1652. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1653. wlan_cfg_ctx->int_batch_threshold_other =
  1654. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1655. wlan_cfg_ctx->int_timer_threshold_other =
  1656. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1657. wlan_cfg_ctx->pktlog_buffer_size =
  1658. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1659. /* This is default mapping and can be overridden by HW config
  1660. * received from FW */
  1661. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1662. if (MAX_PDEV_CNT > 1)
  1663. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1664. if (MAX_PDEV_CNT > 2)
  1665. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1666. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1667. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1668. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1669. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1670. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1671. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  1672. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1673. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1674. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1675. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1676. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1677. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1678. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1679. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1680. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1681. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1682. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1683. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1684. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1685. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1686. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1687. wlan_cfg_ctx->defrag_timeout_check =
  1688. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1689. wlan_cfg_ctx->rx_defrag_min_timeout =
  1690. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1691. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1692. CFG_DP_WBM_RELEASE_RING);
  1693. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1694. CFG_DP_TCL_CMD_CREDIT_RING);
  1695. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1696. CFG_DP_TCL_STATUS_RING);
  1697. wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc,
  1698. CFG_DP_RX_DESTINATION_RING);
  1699. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1700. CFG_DP_REO_REINJECT_RING);
  1701. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  1702. CFG_DP_RX_RELEASE_RING);
  1703. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  1704. CFG_DP_REO_EXCEPTION_RING);
  1705. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  1706. CFG_DP_REO_CMD_RING);
  1707. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  1708. CFG_DP_REO_STATUS_RING);
  1709. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  1710. CFG_DP_RXDMA_REFILL_RING);
  1711. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  1712. CFG_DP_TX_DESC_LIMIT_0);
  1713. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  1714. CFG_DP_TX_DESC_LIMIT_1);
  1715. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  1716. CFG_DP_TX_DESC_LIMIT_2);
  1717. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  1718. CFG_DP_TX_DEVICE_LIMIT);
  1719. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  1720. CFG_DP_TX_SW_INTERNODE_QUEUE);
  1721. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  1722. CFG_DP_RXDMA_ERR_DST_RING);
  1723. wlan_cfg_ctx->enable_data_stall_detection =
  1724. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  1725. wlan_cfg_ctx->enable_force_rx_64_ba =
  1726. cfg_get(psoc, CFG_FORCE_RX_64_BA);
  1727. wlan_cfg_ctx->tx_flow_start_queue_offset =
  1728. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  1729. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  1730. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  1731. wlan_cfg_ctx->disable_intra_bss_fwd =
  1732. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  1733. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  1734. CFG_DP_RX_SW_DESC_WEIGHT);
  1735. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  1736. CFG_DP_RX_SW_DESC_NUM);
  1737. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  1738. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  1739. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  1740. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  1741. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  1742. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  1743. wlan_cfg_ctx->rx_flow_search_table_size =
  1744. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  1745. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  1746. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  1747. wlan_cfg_ctx->mon_drop_thresh =
  1748. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  1749. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1750. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1751. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1752. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1753. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1754. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1755. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1756. wlan_cfg_ctx->rx_pending_high_threshold =
  1757. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1758. wlan_cfg_ctx->rx_pending_low_threshold =
  1759. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1760. wlan_cfg_ctx->is_poll_mode_enabled =
  1761. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1762. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1763. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1764. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1765. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1766. wlan_cfg_ctx->radio0_rx_default_reo =
  1767. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1768. wlan_cfg_ctx->radio1_rx_default_reo =
  1769. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1770. wlan_cfg_ctx->radio2_rx_default_reo =
  1771. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1772. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1773. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1774. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1775. CFG_DP_DELAY_MON_REPLENISH);
  1776. wlan_cfg_ctx->rx_mon_buf_ring_size = cfg_get(psoc,
  1777. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1778. wlan_cfg_ctx->tx_mon_buf_ring_size = cfg_get(psoc,
  1779. CFG_DP_TX_MONITOR_BUF_RING);
  1780. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  1781. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  1782. wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
  1783. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1784. wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
  1785. PKT_CAPTURE_MODE_DATA_ONLY;
  1786. #endif
  1787. return wlan_cfg_ctx;
  1788. }
  1789. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1790. {
  1791. qdf_mem_free(wlan_cfg_ctx);
  1792. }
  1793. struct wlan_cfg_dp_pdev_ctxt *
  1794. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1795. {
  1796. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1797. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1798. if (!wlan_cfg_ctx)
  1799. return NULL;
  1800. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1801. CFG_DP_RXDMA_BUF_RING);
  1802. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1803. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1804. wlan_cfg_ctx->dma_rx_mon_dest_ring_size = cfg_get(psoc,
  1805. CFG_DP_RXDMA_MONITOR_DST_RING);
  1806. wlan_cfg_ctx->dma_tx_mon_dest_ring_size = cfg_get(psoc,
  1807. CFG_DP_TX_MONITOR_DST_RING);
  1808. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1809. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1810. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1811. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1812. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1813. return wlan_cfg_ctx;
  1814. }
  1815. void wlan_cfg_set_mon_delayed_replenish_entries(
  1816. struct wlan_cfg_dp_soc_ctxt *cfg,
  1817. uint32_t val)
  1818. {
  1819. cfg->delayed_replenish_entries = val;
  1820. }
  1821. qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
  1822. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1823. {
  1824. return cfg->delayed_replenish_entries;
  1825. }
  1826. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1827. {
  1828. if (wlan_cfg_ctx)
  1829. qdf_mem_free(wlan_cfg_ctx);
  1830. }
  1831. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1832. {
  1833. return cfg->mon_drop_thresh;
  1834. }
  1835. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1836. {
  1837. cfg->num_int_ctxts = num;
  1838. }
  1839. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1840. {
  1841. cfg->max_peer_id = val;
  1842. }
  1843. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1844. {
  1845. cfg->max_ast_idx = val;
  1846. }
  1847. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1848. {
  1849. return cfg->max_ast_idx;
  1850. }
  1851. qdf_export_symbol(wlan_cfg_get_max_ast_idx);
  1852. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1853. int context, int mask)
  1854. {
  1855. cfg->int_tx_ring_mask[context] = mask;
  1856. }
  1857. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1858. int context, int mask)
  1859. {
  1860. cfg->int_rx_ring_mask[context] = mask;
  1861. }
  1862. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1863. int context, int mask)
  1864. {
  1865. cfg->int_rx_mon_ring_mask[context] = mask;
  1866. }
  1867. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1868. int context, int mask)
  1869. {
  1870. cfg->int_tx_mon_ring_mask[context] = mask;
  1871. }
  1872. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1873. int context)
  1874. {
  1875. return cfg->int_host2rxdma_mon_ring_mask[context];
  1876. }
  1877. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1878. int context, int mask)
  1879. {
  1880. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  1881. }
  1882. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1883. int context)
  1884. {
  1885. return cfg->int_rxdma2host_mon_ring_mask[context];
  1886. }
  1887. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1888. int context, int mask)
  1889. {
  1890. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  1891. }
  1892. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1893. int context, int mask)
  1894. {
  1895. cfg->int_rxdma2host_ring_mask[context] = mask;
  1896. }
  1897. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1898. int context)
  1899. {
  1900. return cfg->int_rxdma2host_ring_mask[context];
  1901. }
  1902. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1903. int context, int mask)
  1904. {
  1905. cfg->int_host2rxdma_ring_mask[context] = mask;
  1906. }
  1907. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1908. int context)
  1909. {
  1910. return cfg->int_host2rxdma_ring_mask[context];
  1911. }
  1912. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1913. int context)
  1914. {
  1915. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  1916. }
  1917. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1918. int context)
  1919. {
  1920. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  1921. }
  1922. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1923. int context)
  1924. {
  1925. return cfg->int_tx_ring_near_full_irq_mask[context];
  1926. }
  1927. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1928. int hw_macid)
  1929. {
  1930. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1931. cfg->hw_macid[pdev_idx] = hw_macid;
  1932. }
  1933. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  1934. {
  1935. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1936. return cfg->hw_macid[pdev_idx];
  1937. }
  1938. qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
  1939. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1940. int hw_macid)
  1941. {
  1942. int idx;
  1943. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  1944. if (cfg->hw_macid[idx] == hw_macid)
  1945. return (idx + 1);
  1946. }
  1947. qdf_assert_always(idx < MAX_PDEV_CNT);
  1948. return WLAN_INVALID_PDEV_ID;
  1949. }
  1950. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1951. int hw_macid)
  1952. {
  1953. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  1954. (pdev_idx == INVALID_PDEV_ID));
  1955. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1956. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  1957. }
  1958. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  1959. {
  1960. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1961. return cfg->hw_macid_pdev_id_map[hw_macid];
  1962. }
  1963. qdf_export_symbol(wlan_cfg_get_pdev_idx);
  1964. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1965. int context, int mask)
  1966. {
  1967. cfg->int_ce_ring_mask[context] = mask;
  1968. }
  1969. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  1970. int mask)
  1971. {
  1972. cfg->int_rx_ring_mask[context] = mask;
  1973. }
  1974. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1975. int context, int mask)
  1976. {
  1977. return cfg->int_rx_err_ring_mask[context] = mask;
  1978. }
  1979. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1980. int context, int mask)
  1981. {
  1982. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  1983. }
  1984. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1985. int context, int mask)
  1986. {
  1987. return cfg->int_reo_status_ring_mask[context] = mask;
  1988. }
  1989. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  1990. {
  1991. return cfg->num_int_ctxts;
  1992. }
  1993. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1994. {
  1995. return cfg->int_tx_ring_mask[context];
  1996. }
  1997. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1998. {
  1999. return cfg->int_rx_ring_mask[context];
  2000. }
  2001. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2002. int context)
  2003. {
  2004. return cfg->int_rx_err_ring_mask[context];
  2005. }
  2006. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2007. int context)
  2008. {
  2009. return cfg->int_rx_wbm_rel_ring_mask[context];
  2010. }
  2011. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2012. int context)
  2013. {
  2014. return cfg->int_reo_status_ring_mask[context];
  2015. }
  2016. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2017. {
  2018. return cfg->int_rx_mon_ring_mask[context];
  2019. }
  2020. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2021. {
  2022. return cfg->int_tx_mon_ring_mask[context];
  2023. }
  2024. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2025. {
  2026. return cfg->int_ce_ring_mask[context];
  2027. }
  2028. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  2029. {
  2030. return cfg->max_clients;
  2031. }
  2032. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2033. {
  2034. return cfg->max_alloc_size;
  2035. }
  2036. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2037. {
  2038. return cfg->per_pdev_tx_ring;
  2039. }
  2040. uint32_t
  2041. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2042. {
  2043. return cfg->rx_pending_high_threshold;
  2044. }
  2045. uint32_t
  2046. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2047. {
  2048. return cfg->rx_pending_low_threshold;
  2049. }
  2050. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2051. {
  2052. return cfg->per_pdev_lmac_ring;
  2053. }
  2054. qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
  2055. #if defined(DP_USE_SINGLE_TCL)
  2056. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2057. {
  2058. return 1;
  2059. }
  2060. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2061. {
  2062. return 1;
  2063. }
  2064. #else
  2065. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2066. {
  2067. return cfg->num_tcl_data_rings;
  2068. }
  2069. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2070. {
  2071. return cfg->num_nss_tcl_data_rings;
  2072. }
  2073. #endif
  2074. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2075. {
  2076. return cfg->tx_ring_size;
  2077. }
  2078. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2079. {
  2080. return cfg->tx_comp_ring_size;
  2081. }
  2082. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2083. {
  2084. return cfg->per_pdev_rx_ring;
  2085. }
  2086. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2087. {
  2088. return cfg->num_reo_dest_rings;
  2089. }
  2090. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2091. {
  2092. return cfg->num_nss_reo_dest_rings;
  2093. }
  2094. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  2095. {
  2096. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  2097. }
  2098. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2099. {
  2100. return cfg->num_tx_desc_pool;
  2101. }
  2102. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2103. {
  2104. cfg->num_tx_desc_pool = num_pool;
  2105. }
  2106. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2107. {
  2108. return cfg->num_tx_ext_desc_pool;
  2109. }
  2110. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2111. {
  2112. cfg->num_tx_ext_desc_pool = num_pool;
  2113. }
  2114. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2115. {
  2116. return cfg->reo_dst_ring_size;
  2117. }
  2118. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2119. int reo_dst_ring_size)
  2120. {
  2121. cfg->reo_dst_ring_size = reo_dst_ring_size;
  2122. }
  2123. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  2124. bool raw_mode_war)
  2125. {
  2126. cfg->raw_mode_war = raw_mode_war;
  2127. }
  2128. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  2129. {
  2130. return cfg->raw_mode_war;
  2131. }
  2132. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2133. {
  2134. return cfg->num_tx_desc;
  2135. }
  2136. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  2137. {
  2138. cfg->num_tx_desc = num_desc;
  2139. }
  2140. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2141. {
  2142. return cfg->min_tx_desc;
  2143. }
  2144. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2145. {
  2146. return cfg->num_tx_ext_desc;
  2147. }
  2148. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  2149. {
  2150. cfg->num_tx_ext_desc = num_ext_desc;
  2151. }
  2152. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2153. {
  2154. /* TODO: This should be calculated based on target capabilities */
  2155. return cfg->max_peer_id;
  2156. }
  2157. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2158. {
  2159. return cfg->dma_mon_buf_ring_size;
  2160. }
  2161. qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
  2162. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2163. {
  2164. return cfg->dma_rx_mon_dest_ring_size;
  2165. }
  2166. qdf_export_symbol(wlan_cfg_get_dma_rx_mon_dest_ring_size);
  2167. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2168. {
  2169. return cfg->dma_tx_mon_dest_ring_size;
  2170. }
  2171. qdf_export_symbol(wlan_cfg_get_dma_tx_mon_dest_ring_size);
  2172. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2173. {
  2174. return cfg->dma_mon_status_ring_size;
  2175. }
  2176. qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
  2177. int
  2178. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2179. {
  2180. return cfg->rxdma_monitor_desc_ring;
  2181. }
  2182. qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
  2183. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2184. {
  2185. return cfg->rx_dma_buf_ring_size;
  2186. }
  2187. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2188. {
  2189. return cfg->num_mac_rings;
  2190. }
  2191. qdf_export_symbol(wlan_cfg_get_num_mac_rings);
  2192. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2193. {
  2194. return cfg->gro_enabled;
  2195. }
  2196. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2197. {
  2198. return cfg->lro_enabled;
  2199. }
  2200. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2201. {
  2202. return cfg->ipa_enabled;
  2203. }
  2204. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  2205. {
  2206. cfg->rx_hash = val;
  2207. }
  2208. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2209. {
  2210. return cfg->rx_hash;
  2211. }
  2212. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2213. {
  2214. return cfg->nss_enabled;
  2215. }
  2216. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  2217. {
  2218. cfg->nss_enabled = nss_enabled;
  2219. }
  2220. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  2221. {
  2222. return cfg->nss_cfg;
  2223. }
  2224. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  2225. {
  2226. cfg->nss_cfg = nss_cfg;
  2227. if (cfg->nss_cfg)
  2228. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  2229. }
  2230. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2231. {
  2232. return cfg->int_batch_threshold_tx;
  2233. }
  2234. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2235. {
  2236. return cfg->int_timer_threshold_tx;
  2237. }
  2238. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2239. {
  2240. return cfg->int_batch_threshold_rx;
  2241. }
  2242. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2243. {
  2244. return cfg->int_timer_threshold_rx;
  2245. }
  2246. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2247. {
  2248. return cfg->int_batch_threshold_other;
  2249. }
  2250. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2251. {
  2252. return cfg->int_timer_threshold_other;
  2253. }
  2254. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  2255. {
  2256. return cfg->int_timer_threshold_mon;
  2257. }
  2258. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2259. {
  2260. return cfg->p2p_tcp_udp_checksumoffload;
  2261. }
  2262. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2263. {
  2264. return cfg->nan_tcp_udp_checksumoffload;
  2265. }
  2266. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2267. {
  2268. return cfg->tcp_udp_checksumoffload;
  2269. }
  2270. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  2271. {
  2272. return cfg->rx_defrag_min_timeout;
  2273. }
  2274. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  2275. {
  2276. return cfg->defrag_timeout_check;
  2277. }
  2278. int
  2279. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2280. {
  2281. return cfg->wbm_release_ring;
  2282. }
  2283. int
  2284. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2285. {
  2286. return cfg->tcl_cmd_credit_ring;
  2287. }
  2288. int
  2289. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2290. {
  2291. return cfg->tcl_status_ring;
  2292. }
  2293. int
  2294. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2295. {
  2296. return cfg->reo_reinject_ring;
  2297. }
  2298. int
  2299. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2300. {
  2301. return cfg->rx_release_ring;
  2302. }
  2303. int
  2304. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2305. {
  2306. return cfg->reo_exception_ring;
  2307. }
  2308. int
  2309. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2310. {
  2311. return cfg->reo_cmd_ring;
  2312. }
  2313. int
  2314. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2315. {
  2316. return cfg->reo_status_ring;
  2317. }
  2318. int
  2319. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2320. {
  2321. return cfg->rxdma_refill_ring;
  2322. }
  2323. int
  2324. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  2325. {
  2326. return cfg->tx_desc_limit_0;
  2327. }
  2328. int
  2329. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  2330. {
  2331. return cfg->tx_desc_limit_1;
  2332. }
  2333. int
  2334. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  2335. {
  2336. return cfg->tx_desc_limit_2;
  2337. }
  2338. int
  2339. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  2340. {
  2341. return cfg->tx_device_limit;
  2342. }
  2343. int
  2344. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  2345. {
  2346. return cfg->tx_sw_internode_queue;
  2347. }
  2348. int
  2349. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2350. {
  2351. return cfg->rxdma_err_dst_ring;
  2352. }
  2353. int
  2354. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  2355. {
  2356. return cfg->rx_sw_desc_weight;
  2357. }
  2358. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
  2359. int
  2360. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  2361. {
  2362. return cfg->rx_sw_desc_num;
  2363. }
  2364. uint32_t
  2365. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  2366. {
  2367. return cfg->reo_rings_mapping;
  2368. }
  2369. bool
  2370. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  2371. enum cdp_capabilities dp_caps)
  2372. {
  2373. switch (dp_caps) {
  2374. case CDP_CFG_DP_TSO:
  2375. return cfg->tso_enabled;
  2376. case CDP_CFG_DP_LRO:
  2377. return cfg->lro_enabled;
  2378. case CDP_CFG_DP_SG:
  2379. return cfg->sg_enabled;
  2380. case CDP_CFG_DP_GRO:
  2381. return cfg->gro_enabled;
  2382. case CDP_CFG_DP_OL_TX_CSUM:
  2383. return cfg->ol_tx_csum_enabled;
  2384. case CDP_CFG_DP_OL_RX_CSUM:
  2385. return cfg->ol_rx_csum_enabled;
  2386. case CDP_CFG_DP_RAWMODE:
  2387. return cfg->rawmode_enabled;
  2388. case CDP_CFG_DP_PEER_FLOW_CTRL:
  2389. return cfg->peer_flow_ctrl_enabled;
  2390. default:
  2391. return false;
  2392. }
  2393. }
  2394. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  2395. bool val)
  2396. {
  2397. cfg->is_tso_desc_attach_defer = val;
  2398. }
  2399. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2400. {
  2401. return cfg->is_tso_desc_attach_defer;
  2402. }
  2403. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  2404. /**
  2405. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  2406. * @cfg: config context
  2407. *
  2408. * Return: stop threshold
  2409. */
  2410. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  2411. {
  2412. return cfg->tx_flow_stop_queue_threshold;
  2413. }
  2414. /**
  2415. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  2416. * for TX to resume
  2417. * @cfg: config context
  2418. *
  2419. * Return: stop threshold
  2420. */
  2421. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  2422. {
  2423. return cfg->tx_flow_start_queue_offset;
  2424. }
  2425. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  2426. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2427. bool val)
  2428. {
  2429. cfg->is_rx_flow_tag_enabled = val;
  2430. }
  2431. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  2432. {
  2433. return cfg->rx_toeplitz_hash_key;
  2434. }
  2435. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  2436. {
  2437. return cfg->rx_flow_max_search;
  2438. }
  2439. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2440. {
  2441. return cfg->is_rx_flow_tag_enabled;
  2442. }
  2443. qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
  2444. #ifdef WLAN_SUPPORT_RX_FISA
  2445. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2446. {
  2447. return (bool)(cfg->is_rx_fisa_enabled);
  2448. }
  2449. #else
  2450. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2451. {
  2452. return false;
  2453. }
  2454. #endif
  2455. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2456. {
  2457. return (bool)(cfg->is_poll_mode_enabled);
  2458. }
  2459. void
  2460. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  2461. bool val)
  2462. {
  2463. cfg->is_rx_flow_search_table_per_pdev = val;
  2464. }
  2465. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  2466. {
  2467. return cfg->is_rx_flow_search_table_per_pdev;
  2468. }
  2469. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2470. uint16_t val)
  2471. {
  2472. cfg->rx_flow_search_table_size = val;
  2473. }
  2474. uint16_t
  2475. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2476. {
  2477. return cfg->rx_flow_search_table_size;
  2478. }
  2479. void
  2480. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2481. bool val)
  2482. {
  2483. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  2484. }
  2485. bool
  2486. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2487. {
  2488. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  2489. }
  2490. qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
  2491. void
  2492. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  2493. bool val)
  2494. {
  2495. cfg->tx_per_pkt_vdev_id_check = val;
  2496. }
  2497. bool
  2498. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2499. {
  2500. return cfg->tx_per_pkt_vdev_id_check;
  2501. }
  2502. void
  2503. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  2504. bool val)
  2505. {
  2506. cfg->pext_stats_enabled = val;
  2507. }
  2508. bool
  2509. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2510. {
  2511. return cfg->pext_stats_enabled;
  2512. }
  2513. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2514. {
  2515. return cfg->fst_in_cmem;
  2516. }
  2517. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  2518. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2519. {
  2520. return cfg->is_rx_buff_pool_enabled;
  2521. }
  2522. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2523. {
  2524. return cfg->is_rx_refill_buff_pool_enabled;
  2525. }
  2526. #else
  2527. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2528. {
  2529. return false;
  2530. }
  2531. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  2532. struct wlan_cfg_dp_soc_ctxt *cfg)
  2533. {
  2534. return false;
  2535. }
  2536. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  2537. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  2538. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2539. {
  2540. return (bool)(cfg->is_swlm_enabled);
  2541. }
  2542. #else
  2543. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2544. {
  2545. return false;
  2546. }
  2547. #endif
  2548. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2549. {
  2550. return cfg->radio0_rx_default_reo;
  2551. }
  2552. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2553. {
  2554. return cfg->radio1_rx_default_reo;
  2555. }
  2556. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2557. {
  2558. return cfg->radio2_rx_default_reo;
  2559. }
  2560. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  2561. {
  2562. cfg->rxdma1_enable = true;
  2563. }
  2564. bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
  2565. {
  2566. return cfg->enable_force_rx_64_ba;
  2567. }
  2568. void
  2569. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  2570. bool val)
  2571. {
  2572. cfg->delay_mon_replenish = val;
  2573. }
  2574. bool
  2575. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  2576. {
  2577. return cfg->delay_mon_replenish;
  2578. }
  2579. qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
  2580. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  2581. {
  2582. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  2583. cfg->delay_mon_replenish);
  2584. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  2585. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  2586. }
  2587. #ifdef IPA_OFFLOAD
  2588. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2589. {
  2590. return cfg->ipa_tx_ring_size;
  2591. }
  2592. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2593. {
  2594. return cfg->ipa_tx_comp_ring_size;
  2595. }
  2596. #ifdef IPA_WDI3_TX_TWO_PIPES
  2597. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2598. {
  2599. return cfg->ipa_tx_alt_ring_size;
  2600. }
  2601. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2602. {
  2603. return cfg->ipa_tx_alt_comp_ring_size;
  2604. }
  2605. #else
  2606. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2607. {
  2608. return cfg->ipa_tx_ring_size;
  2609. }
  2610. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2611. {
  2612. return cfg->ipa_tx_comp_ring_size;
  2613. }
  2614. #endif
  2615. #endif
  2616. #ifdef WLAN_SUPPORT_PPEDS
  2617. bool
  2618. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2619. {
  2620. return cfg->ppe_enable;
  2621. }
  2622. int
  2623. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2624. {
  2625. return cfg->reo2ppe_ring;
  2626. }
  2627. int
  2628. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2629. {
  2630. return cfg->ppe2tcl_ring;
  2631. }
  2632. int
  2633. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2634. {
  2635. return cfg->ppe_release_ring;
  2636. }
  2637. #endif
  2638. void
  2639. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2640. struct wlan_dp_prealloc_cfg *cfg)
  2641. {
  2642. if (!ctrl_psoc || !cfg)
  2643. return;
  2644. cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
  2645. cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
  2646. CFG_DP_TX_COMPL_RING_SIZE);
  2647. cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
  2648. CFG_DP_WBM_RELEASE_RING);
  2649. cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
  2650. CFG_DP_RXDMA_ERR_DST_RING);
  2651. cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
  2652. CFG_DP_REO_EXCEPTION_RING);
  2653. cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
  2654. cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
  2655. }
  2656. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2657. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2658. {
  2659. return cfg->pkt_capture_mode;
  2660. }
  2661. #endif
  2662. uint32_t
  2663. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2664. {
  2665. return cfg->rx_mon_buf_ring_size;
  2666. }
  2667. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_mon_buf_ring_size);
  2668. uint32_t
  2669. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2670. {
  2671. return cfg->tx_mon_buf_ring_size;
  2672. }
  2673. qdf_export_symbol(wlan_cfg_get_dp_soc_tx_mon_buf_ring_size);
  2674. int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2675. int context)
  2676. {
  2677. return cfg->int_host2txmon_ring_mask[context];
  2678. }
  2679. qdf_export_symbol(wlan_cfg_get_host2txmon_ring_mask);
  2680. void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2681. int context, int mask)
  2682. {
  2683. cfg->int_host2txmon_ring_mask[context] = mask;
  2684. }
  2685. qdf_export_symbol(wlan_cfg_set_host2txmon_ring_mask);