wlan_cfg.c 89 KB

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