wlan_cfg.c 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155
  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. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  1722. /**
  1723. * wlan_soc_vdev_hw_stats_cfg_attach() - Update hw vdev stats config in dp soc
  1724. * cfg context
  1725. * @psoc - Object manager psoc
  1726. * @wlan_cfg_ctx - dp soc cfg ctx
  1727. *
  1728. * Return: None
  1729. */
  1730. static void
  1731. wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1732. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1733. {
  1734. wlan_cfg_ctx->vdev_stats_hw_offload_config = cfg_get(psoc,
  1735. CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG);
  1736. wlan_cfg_ctx->vdev_stats_hw_offload_timer = cfg_get(psoc,
  1737. CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER);
  1738. }
  1739. #else
  1740. static void
  1741. wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1742. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1743. {
  1744. }
  1745. #endif
  1746. /**
  1747. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1748. * @psoc - Object manager psoc
  1749. * Return: wlan_cfg_ctx - Handle to Configuration context
  1750. */
  1751. struct wlan_cfg_dp_soc_ctxt *
  1752. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1753. {
  1754. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1755. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1756. uint32_t gro_bit_set;
  1757. if (!wlan_cfg_ctx)
  1758. return NULL;
  1759. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1760. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1761. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1762. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1763. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1764. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1765. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1766. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1767. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1768. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1769. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1770. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1771. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1772. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1773. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1774. CFG_DP_TX_EXT_DESC_POOLS);
  1775. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1776. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1777. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1778. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1779. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1780. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1781. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1782. CFG_DP_TX_COMPL_RING_SIZE);
  1783. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1784. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1785. wlan_cfg_ctx->int_batch_threshold_tx =
  1786. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1787. wlan_cfg_ctx->int_timer_threshold_tx =
  1788. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1789. wlan_cfg_ctx->int_batch_threshold_rx =
  1790. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1791. wlan_cfg_ctx->int_timer_threshold_rx =
  1792. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1793. wlan_cfg_ctx->int_batch_threshold_other =
  1794. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1795. wlan_cfg_ctx->int_timer_threshold_other =
  1796. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1797. wlan_cfg_ctx->pktlog_buffer_size =
  1798. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1799. /* This is default mapping and can be overridden by HW config
  1800. * received from FW */
  1801. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1802. if (MAX_PDEV_CNT > 1)
  1803. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1804. if (MAX_PDEV_CNT > 2)
  1805. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1806. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1807. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1808. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1809. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1810. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1811. gro_bit_set = cfg_get(psoc, CFG_DP_GRO);
  1812. if (gro_bit_set & DP_GRO_ENABLE_BIT_SET) {
  1813. wlan_cfg_ctx->gro_enabled = true;
  1814. if (gro_bit_set & DP_FORCE_USE_GRO_BIT_SET)
  1815. wlan_cfg_ctx->force_gro_enabled = true;
  1816. }
  1817. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1818. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1819. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1820. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1821. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1822. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1823. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1824. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1825. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1826. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1827. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1828. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1829. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1830. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1831. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1832. wlan_cfg_ctx->defrag_timeout_check =
  1833. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1834. wlan_cfg_ctx->rx_defrag_min_timeout =
  1835. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1836. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1837. CFG_DP_WBM_RELEASE_RING);
  1838. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1839. CFG_DP_TCL_CMD_CREDIT_RING);
  1840. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1841. CFG_DP_TCL_STATUS_RING);
  1842. wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc,
  1843. CFG_DP_RX_DESTINATION_RING);
  1844. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1845. CFG_DP_REO_REINJECT_RING);
  1846. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  1847. CFG_DP_RX_RELEASE_RING);
  1848. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  1849. CFG_DP_REO_EXCEPTION_RING);
  1850. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  1851. CFG_DP_REO_CMD_RING);
  1852. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  1853. CFG_DP_REO_STATUS_RING);
  1854. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  1855. CFG_DP_RXDMA_REFILL_RING);
  1856. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  1857. CFG_DP_TX_DESC_LIMIT_0);
  1858. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  1859. CFG_DP_TX_DESC_LIMIT_1);
  1860. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  1861. CFG_DP_TX_DESC_LIMIT_2);
  1862. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  1863. CFG_DP_TX_DEVICE_LIMIT);
  1864. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  1865. CFG_DP_TX_SW_INTERNODE_QUEUE);
  1866. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  1867. CFG_DP_RXDMA_ERR_DST_RING);
  1868. wlan_cfg_ctx->enable_data_stall_detection =
  1869. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  1870. wlan_cfg_ctx->tx_flow_start_queue_offset =
  1871. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  1872. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  1873. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  1874. wlan_cfg_ctx->disable_intra_bss_fwd =
  1875. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  1876. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  1877. CFG_DP_RX_SW_DESC_WEIGHT);
  1878. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  1879. CFG_DP_RX_SW_DESC_NUM);
  1880. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  1881. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  1882. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  1883. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  1884. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  1885. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  1886. wlan_cfg_ctx->rx_flow_search_table_size =
  1887. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  1888. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  1889. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  1890. wlan_cfg_ctx->mon_drop_thresh =
  1891. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  1892. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1893. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1894. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1895. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1896. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1897. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1898. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1899. wlan_cfg_ctx->rx_pending_high_threshold =
  1900. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1901. wlan_cfg_ctx->rx_pending_low_threshold =
  1902. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1903. wlan_cfg_ctx->is_poll_mode_enabled =
  1904. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1905. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1906. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1907. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1908. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1909. wlan_cfg_ctx->radio0_rx_default_reo =
  1910. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1911. wlan_cfg_ctx->radio1_rx_default_reo =
  1912. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1913. wlan_cfg_ctx->radio2_rx_default_reo =
  1914. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1915. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1916. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1917. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1918. CFG_DP_DELAY_MON_REPLENISH);
  1919. wlan_cfg_ctx->rx_mon_buf_ring_size = cfg_get(psoc,
  1920. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1921. wlan_cfg_ctx->tx_mon_buf_ring_size = cfg_get(psoc,
  1922. CFG_DP_TX_MONITOR_BUF_RING);
  1923. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  1924. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  1925. wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
  1926. wlan_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
  1927. wlan_soc_vdev_hw_stats_cfg_attach(psoc, wlan_cfg_ctx);
  1928. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1929. wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
  1930. PKT_CAPTURE_MODE_DATA_ONLY;
  1931. #endif
  1932. return wlan_cfg_ctx;
  1933. }
  1934. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1935. {
  1936. qdf_mem_free(wlan_cfg_ctx);
  1937. }
  1938. struct wlan_cfg_dp_pdev_ctxt *
  1939. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1940. {
  1941. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1942. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1943. if (!wlan_cfg_ctx)
  1944. return NULL;
  1945. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1946. CFG_DP_RXDMA_BUF_RING);
  1947. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1948. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1949. wlan_cfg_ctx->dma_rx_mon_dest_ring_size = cfg_get(psoc,
  1950. CFG_DP_RXDMA_MONITOR_DST_RING);
  1951. wlan_cfg_ctx->dma_tx_mon_dest_ring_size = cfg_get(psoc,
  1952. CFG_DP_TX_MONITOR_DST_RING);
  1953. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1954. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1955. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1956. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1957. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1958. return wlan_cfg_ctx;
  1959. }
  1960. void wlan_cfg_set_mon_delayed_replenish_entries(
  1961. struct wlan_cfg_dp_soc_ctxt *cfg,
  1962. uint32_t val)
  1963. {
  1964. cfg->delayed_replenish_entries = val;
  1965. }
  1966. qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
  1967. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1968. {
  1969. return cfg->delayed_replenish_entries;
  1970. }
  1971. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1972. {
  1973. if (wlan_cfg_ctx)
  1974. qdf_mem_free(wlan_cfg_ctx);
  1975. }
  1976. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1977. {
  1978. return cfg->mon_drop_thresh;
  1979. }
  1980. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1981. {
  1982. cfg->num_int_ctxts = num;
  1983. }
  1984. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1985. {
  1986. cfg->max_peer_id = val;
  1987. }
  1988. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1989. {
  1990. cfg->max_ast_idx = val;
  1991. }
  1992. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1993. {
  1994. return cfg->max_ast_idx;
  1995. }
  1996. qdf_export_symbol(wlan_cfg_get_max_ast_idx);
  1997. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1998. int context, int mask)
  1999. {
  2000. cfg->int_tx_ring_mask[context] = mask;
  2001. }
  2002. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2003. int context, int mask)
  2004. {
  2005. cfg->int_rx_ring_mask[context] = mask;
  2006. }
  2007. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2008. int context, int mask)
  2009. {
  2010. cfg->int_rx_mon_ring_mask[context] = mask;
  2011. }
  2012. void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2013. int context, int mask)
  2014. {
  2015. cfg->int_tx_mon_ring_mask[context] = mask;
  2016. }
  2017. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2018. int context)
  2019. {
  2020. return cfg->int_host2rxdma_mon_ring_mask[context];
  2021. }
  2022. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2023. int context, int mask)
  2024. {
  2025. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  2026. }
  2027. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2028. int context)
  2029. {
  2030. return cfg->int_rxdma2host_mon_ring_mask[context];
  2031. }
  2032. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2033. int context, int mask)
  2034. {
  2035. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  2036. }
  2037. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2038. int context, int mask)
  2039. {
  2040. cfg->int_rxdma2host_ring_mask[context] = mask;
  2041. }
  2042. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2043. int context)
  2044. {
  2045. return cfg->int_rxdma2host_ring_mask[context];
  2046. }
  2047. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2048. int context, int mask)
  2049. {
  2050. cfg->int_host2rxdma_ring_mask[context] = mask;
  2051. }
  2052. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2053. int context)
  2054. {
  2055. return cfg->int_host2rxdma_ring_mask[context];
  2056. }
  2057. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2058. int context)
  2059. {
  2060. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  2061. }
  2062. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2063. int context)
  2064. {
  2065. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  2066. }
  2067. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2068. int context)
  2069. {
  2070. return cfg->int_tx_ring_near_full_irq_mask[context];
  2071. }
  2072. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  2073. int hw_macid)
  2074. {
  2075. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  2076. cfg->hw_macid[pdev_idx] = hw_macid;
  2077. }
  2078. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  2079. {
  2080. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  2081. return cfg->hw_macid[pdev_idx];
  2082. }
  2083. qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
  2084. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2085. int hw_macid)
  2086. {
  2087. int idx;
  2088. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  2089. if (cfg->hw_macid[idx] == hw_macid)
  2090. return (idx + 1);
  2091. }
  2092. qdf_assert_always(idx < MAX_PDEV_CNT);
  2093. return WLAN_INVALID_PDEV_ID;
  2094. }
  2095. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  2096. int hw_macid)
  2097. {
  2098. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  2099. (pdev_idx == INVALID_PDEV_ID));
  2100. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  2101. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  2102. }
  2103. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  2104. {
  2105. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  2106. return cfg->hw_macid_pdev_id_map[hw_macid];
  2107. }
  2108. qdf_export_symbol(wlan_cfg_get_pdev_idx);
  2109. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2110. int context, int mask)
  2111. {
  2112. cfg->int_ce_ring_mask[context] = mask;
  2113. }
  2114. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  2115. int mask)
  2116. {
  2117. cfg->int_rx_ring_mask[context] = mask;
  2118. }
  2119. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2120. int context, int mask)
  2121. {
  2122. return cfg->int_rx_err_ring_mask[context] = mask;
  2123. }
  2124. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2125. int context, int mask)
  2126. {
  2127. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  2128. }
  2129. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2130. int context, int mask)
  2131. {
  2132. return cfg->int_reo_status_ring_mask[context] = mask;
  2133. }
  2134. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  2135. {
  2136. return cfg->num_int_ctxts;
  2137. }
  2138. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2139. {
  2140. return cfg->int_tx_ring_mask[context];
  2141. }
  2142. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2143. {
  2144. return cfg->int_rx_ring_mask[context];
  2145. }
  2146. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2147. int context)
  2148. {
  2149. return cfg->int_rx_err_ring_mask[context];
  2150. }
  2151. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2152. int context)
  2153. {
  2154. return cfg->int_rx_wbm_rel_ring_mask[context];
  2155. }
  2156. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  2157. int context)
  2158. {
  2159. return cfg->int_reo_status_ring_mask[context];
  2160. }
  2161. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2162. {
  2163. return cfg->int_rx_mon_ring_mask[context];
  2164. }
  2165. int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2166. {
  2167. return cfg->int_tx_mon_ring_mask[context];
  2168. }
  2169. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  2170. {
  2171. return cfg->int_ce_ring_mask[context];
  2172. }
  2173. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  2174. {
  2175. return cfg->max_clients;
  2176. }
  2177. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2178. {
  2179. return cfg->max_alloc_size;
  2180. }
  2181. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2182. {
  2183. return cfg->per_pdev_tx_ring;
  2184. }
  2185. uint32_t
  2186. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2187. {
  2188. return cfg->rx_pending_high_threshold;
  2189. }
  2190. uint32_t
  2191. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  2192. {
  2193. return cfg->rx_pending_low_threshold;
  2194. }
  2195. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2196. {
  2197. return cfg->per_pdev_lmac_ring;
  2198. }
  2199. qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
  2200. #if defined(DP_USE_SINGLE_TCL) && !defined(TX_MULTI_TCL)
  2201. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2202. {
  2203. return 1;
  2204. }
  2205. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2206. {
  2207. return 1;
  2208. }
  2209. #else
  2210. #if defined(IPA_OFFLOAD) && defined(TX_MULTI_TCL)
  2211. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2212. {
  2213. if (!cfg->ipa_enabled)
  2214. return cfg->num_tcl_data_rings;
  2215. return 1;
  2216. }
  2217. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2218. {
  2219. if (!cfg->ipa_enabled)
  2220. return cfg->num_nss_tcl_data_rings;
  2221. return 1;
  2222. }
  2223. #else
  2224. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2225. {
  2226. return cfg->num_tcl_data_rings;
  2227. }
  2228. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2229. {
  2230. return cfg->num_nss_tcl_data_rings;
  2231. }
  2232. #endif
  2233. #endif
  2234. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2235. {
  2236. return cfg->tx_ring_size;
  2237. }
  2238. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2239. {
  2240. return cfg->tx_comp_ring_size;
  2241. }
  2242. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  2243. {
  2244. return cfg->per_pdev_rx_ring;
  2245. }
  2246. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2247. {
  2248. return cfg->num_reo_dest_rings;
  2249. }
  2250. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  2251. {
  2252. return cfg->num_nss_reo_dest_rings;
  2253. }
  2254. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  2255. {
  2256. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  2257. }
  2258. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2259. {
  2260. return cfg->num_tx_desc_pool;
  2261. }
  2262. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2263. {
  2264. cfg->num_tx_desc_pool = num_pool;
  2265. }
  2266. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  2267. {
  2268. return cfg->num_tx_ext_desc_pool;
  2269. }
  2270. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  2271. {
  2272. cfg->num_tx_ext_desc_pool = num_pool;
  2273. }
  2274. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2275. {
  2276. return cfg->reo_dst_ring_size;
  2277. }
  2278. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2279. int reo_dst_ring_size)
  2280. {
  2281. cfg->reo_dst_ring_size = reo_dst_ring_size;
  2282. }
  2283. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  2284. bool raw_mode_war)
  2285. {
  2286. cfg->raw_mode_war = raw_mode_war;
  2287. }
  2288. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  2289. {
  2290. return cfg->raw_mode_war;
  2291. }
  2292. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2293. {
  2294. return cfg->num_tx_desc;
  2295. }
  2296. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  2297. {
  2298. cfg->num_tx_desc = num_desc;
  2299. }
  2300. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2301. {
  2302. return cfg->min_tx_desc;
  2303. }
  2304. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  2305. {
  2306. return cfg->num_tx_ext_desc;
  2307. }
  2308. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  2309. {
  2310. cfg->num_tx_ext_desc = num_ext_desc;
  2311. }
  2312. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2313. {
  2314. /* TODO: This should be calculated based on target capabilities */
  2315. return cfg->max_peer_id;
  2316. }
  2317. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2318. {
  2319. return cfg->dma_mon_buf_ring_size;
  2320. }
  2321. qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
  2322. int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2323. {
  2324. return cfg->dma_rx_mon_dest_ring_size;
  2325. }
  2326. qdf_export_symbol(wlan_cfg_get_dma_rx_mon_dest_ring_size);
  2327. int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2328. {
  2329. return cfg->dma_tx_mon_dest_ring_size;
  2330. }
  2331. qdf_export_symbol(wlan_cfg_get_dma_tx_mon_dest_ring_size);
  2332. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2333. {
  2334. return cfg->dma_mon_status_ring_size;
  2335. }
  2336. qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
  2337. int
  2338. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2339. {
  2340. return cfg->rxdma_monitor_desc_ring;
  2341. }
  2342. qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
  2343. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2344. {
  2345. return cfg->rx_dma_buf_ring_size;
  2346. }
  2347. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2348. {
  2349. return cfg->num_mac_rings;
  2350. }
  2351. qdf_export_symbol(wlan_cfg_get_num_mac_rings);
  2352. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2353. {
  2354. return cfg->gro_enabled;
  2355. }
  2356. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2357. {
  2358. return cfg->lro_enabled;
  2359. }
  2360. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2361. {
  2362. return cfg->ipa_enabled;
  2363. }
  2364. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  2365. {
  2366. cfg->rx_hash = val;
  2367. }
  2368. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2369. {
  2370. return cfg->rx_hash;
  2371. }
  2372. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  2373. {
  2374. return cfg->nss_enabled;
  2375. }
  2376. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  2377. {
  2378. cfg->nss_enabled = nss_enabled;
  2379. }
  2380. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  2381. {
  2382. return cfg->nss_cfg;
  2383. }
  2384. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  2385. {
  2386. cfg->nss_cfg = nss_cfg;
  2387. if (cfg->nss_cfg)
  2388. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  2389. }
  2390. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2391. {
  2392. return cfg->int_batch_threshold_tx;
  2393. }
  2394. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2395. {
  2396. return cfg->int_timer_threshold_tx;
  2397. }
  2398. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2399. {
  2400. return cfg->int_batch_threshold_rx;
  2401. }
  2402. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  2403. {
  2404. return cfg->int_timer_threshold_rx;
  2405. }
  2406. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2407. {
  2408. return cfg->int_batch_threshold_other;
  2409. }
  2410. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  2411. {
  2412. return cfg->int_timer_threshold_other;
  2413. }
  2414. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  2415. {
  2416. return cfg->int_timer_threshold_mon;
  2417. }
  2418. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2419. {
  2420. return cfg->p2p_tcp_udp_checksumoffload;
  2421. }
  2422. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2423. {
  2424. return cfg->nan_tcp_udp_checksumoffload;
  2425. }
  2426. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  2427. {
  2428. return cfg->tcp_udp_checksumoffload;
  2429. }
  2430. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  2431. {
  2432. return cfg->rx_defrag_min_timeout;
  2433. }
  2434. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  2435. {
  2436. return cfg->defrag_timeout_check;
  2437. }
  2438. int
  2439. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2440. {
  2441. return cfg->wbm_release_ring;
  2442. }
  2443. int
  2444. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2445. {
  2446. return cfg->tcl_cmd_credit_ring;
  2447. }
  2448. int
  2449. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2450. {
  2451. return cfg->tcl_status_ring;
  2452. }
  2453. int
  2454. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2455. {
  2456. return cfg->reo_reinject_ring;
  2457. }
  2458. int
  2459. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2460. {
  2461. return cfg->rx_release_ring;
  2462. }
  2463. int
  2464. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2465. {
  2466. return cfg->reo_exception_ring;
  2467. }
  2468. int
  2469. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2470. {
  2471. return cfg->reo_cmd_ring;
  2472. }
  2473. int
  2474. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2475. {
  2476. return cfg->reo_status_ring;
  2477. }
  2478. int
  2479. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2480. {
  2481. return cfg->rxdma_refill_ring;
  2482. }
  2483. int
  2484. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  2485. {
  2486. return cfg->tx_desc_limit_0;
  2487. }
  2488. int
  2489. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  2490. {
  2491. return cfg->tx_desc_limit_1;
  2492. }
  2493. int
  2494. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  2495. {
  2496. return cfg->tx_desc_limit_2;
  2497. }
  2498. int
  2499. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  2500. {
  2501. return cfg->tx_device_limit;
  2502. }
  2503. int
  2504. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  2505. {
  2506. return cfg->tx_sw_internode_queue;
  2507. }
  2508. int
  2509. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2510. {
  2511. return cfg->rxdma_err_dst_ring;
  2512. }
  2513. int
  2514. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  2515. {
  2516. return cfg->rx_sw_desc_weight;
  2517. }
  2518. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
  2519. int
  2520. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  2521. {
  2522. return cfg->rx_sw_desc_num;
  2523. }
  2524. uint32_t
  2525. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  2526. {
  2527. return cfg->reo_rings_mapping;
  2528. }
  2529. bool
  2530. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  2531. enum cdp_capabilities dp_caps)
  2532. {
  2533. switch (dp_caps) {
  2534. case CDP_CFG_DP_TSO:
  2535. return cfg->tso_enabled;
  2536. case CDP_CFG_DP_LRO:
  2537. return cfg->lro_enabled;
  2538. case CDP_CFG_DP_SG:
  2539. return cfg->sg_enabled;
  2540. case CDP_CFG_DP_GRO:
  2541. return cfg->gro_enabled;
  2542. case CDP_CFG_DP_OL_TX_CSUM:
  2543. return cfg->ol_tx_csum_enabled;
  2544. case CDP_CFG_DP_OL_RX_CSUM:
  2545. return cfg->ol_rx_csum_enabled;
  2546. case CDP_CFG_DP_RAWMODE:
  2547. return cfg->rawmode_enabled;
  2548. case CDP_CFG_DP_PEER_FLOW_CTRL:
  2549. return cfg->peer_flow_ctrl_enabled;
  2550. default:
  2551. return false;
  2552. }
  2553. }
  2554. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  2555. bool val)
  2556. {
  2557. cfg->is_tso_desc_attach_defer = val;
  2558. }
  2559. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2560. {
  2561. return cfg->is_tso_desc_attach_defer;
  2562. }
  2563. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  2564. /**
  2565. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  2566. * @cfg: config context
  2567. *
  2568. * Return: stop threshold
  2569. */
  2570. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  2571. {
  2572. return cfg->tx_flow_stop_queue_threshold;
  2573. }
  2574. /**
  2575. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  2576. * for TX to resume
  2577. * @cfg: config context
  2578. *
  2579. * Return: stop threshold
  2580. */
  2581. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  2582. {
  2583. return cfg->tx_flow_start_queue_offset;
  2584. }
  2585. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  2586. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2587. bool val)
  2588. {
  2589. cfg->is_rx_flow_tag_enabled = val;
  2590. }
  2591. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  2592. {
  2593. return cfg->rx_toeplitz_hash_key;
  2594. }
  2595. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  2596. {
  2597. return cfg->rx_flow_max_search;
  2598. }
  2599. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2600. {
  2601. return cfg->is_rx_flow_tag_enabled;
  2602. }
  2603. qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
  2604. #ifdef WLAN_SUPPORT_RX_FISA
  2605. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2606. {
  2607. return (bool)(cfg->is_rx_fisa_enabled);
  2608. }
  2609. #else
  2610. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2611. {
  2612. return false;
  2613. }
  2614. #endif
  2615. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2616. {
  2617. return (bool)(cfg->is_poll_mode_enabled);
  2618. }
  2619. void
  2620. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  2621. bool val)
  2622. {
  2623. cfg->is_rx_flow_search_table_per_pdev = val;
  2624. }
  2625. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  2626. {
  2627. return cfg->is_rx_flow_search_table_per_pdev;
  2628. }
  2629. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  2630. uint16_t val)
  2631. {
  2632. cfg->rx_flow_search_table_size = val;
  2633. }
  2634. uint16_t
  2635. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2636. {
  2637. return cfg->rx_flow_search_table_size;
  2638. }
  2639. void
  2640. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  2641. bool val)
  2642. {
  2643. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  2644. }
  2645. bool
  2646. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2647. {
  2648. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  2649. }
  2650. qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
  2651. void
  2652. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  2653. bool val)
  2654. {
  2655. cfg->tx_per_pkt_vdev_id_check = val;
  2656. }
  2657. bool
  2658. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2659. {
  2660. return cfg->tx_per_pkt_vdev_id_check;
  2661. }
  2662. void
  2663. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  2664. bool val)
  2665. {
  2666. cfg->pext_stats_enabled = val;
  2667. }
  2668. bool
  2669. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2670. {
  2671. return cfg->pext_stats_enabled;
  2672. }
  2673. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2674. {
  2675. return cfg->fst_in_cmem;
  2676. }
  2677. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  2678. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2679. {
  2680. return cfg->is_rx_buff_pool_enabled;
  2681. }
  2682. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2683. {
  2684. return cfg->is_rx_refill_buff_pool_enabled;
  2685. }
  2686. #else
  2687. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2688. {
  2689. return false;
  2690. }
  2691. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  2692. struct wlan_cfg_dp_soc_ctxt *cfg)
  2693. {
  2694. return false;
  2695. }
  2696. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  2697. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  2698. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2699. {
  2700. return (bool)(cfg->is_swlm_enabled);
  2701. }
  2702. #else
  2703. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2704. {
  2705. return false;
  2706. }
  2707. #endif
  2708. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2709. {
  2710. return cfg->radio0_rx_default_reo;
  2711. }
  2712. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2713. {
  2714. return cfg->radio1_rx_default_reo;
  2715. }
  2716. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  2717. {
  2718. return cfg->radio2_rx_default_reo;
  2719. }
  2720. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  2721. {
  2722. cfg->rxdma1_enable = true;
  2723. }
  2724. void
  2725. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  2726. bool val)
  2727. {
  2728. cfg->delay_mon_replenish = val;
  2729. }
  2730. bool
  2731. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  2732. {
  2733. return cfg->delay_mon_replenish;
  2734. }
  2735. qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
  2736. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  2737. {
  2738. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  2739. cfg->delay_mon_replenish);
  2740. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  2741. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  2742. }
  2743. #ifdef IPA_OFFLOAD
  2744. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2745. {
  2746. return cfg->ipa_tx_ring_size;
  2747. }
  2748. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2749. {
  2750. return cfg->ipa_tx_comp_ring_size;
  2751. }
  2752. #ifdef IPA_WDI3_TX_TWO_PIPES
  2753. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2754. {
  2755. return cfg->ipa_tx_alt_ring_size;
  2756. }
  2757. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2758. {
  2759. return cfg->ipa_tx_alt_comp_ring_size;
  2760. }
  2761. #else
  2762. int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2763. {
  2764. return cfg->ipa_tx_ring_size;
  2765. }
  2766. int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2767. {
  2768. return cfg->ipa_tx_comp_ring_size;
  2769. }
  2770. #endif
  2771. #endif
  2772. #ifdef WLAN_SUPPORT_PPEDS
  2773. bool
  2774. wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  2775. {
  2776. return cfg->ppe_enable;
  2777. }
  2778. int
  2779. wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2780. {
  2781. return cfg->reo2ppe_ring;
  2782. }
  2783. int
  2784. wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2785. {
  2786. return cfg->ppe2tcl_ring;
  2787. }
  2788. int
  2789. wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2790. {
  2791. return cfg->ppe_release_ring;
  2792. }
  2793. #endif
  2794. void
  2795. wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  2796. struct wlan_dp_prealloc_cfg *cfg)
  2797. {
  2798. if (!ctrl_psoc || !cfg)
  2799. return;
  2800. cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
  2801. cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
  2802. CFG_DP_TX_COMPL_RING_SIZE);
  2803. cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
  2804. CFG_DP_WBM_RELEASE_RING);
  2805. cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
  2806. CFG_DP_RXDMA_ERR_DST_RING);
  2807. cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
  2808. CFG_DP_REO_EXCEPTION_RING);
  2809. cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
  2810. cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
  2811. }
  2812. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  2813. uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
  2814. {
  2815. return cfg->pkt_capture_mode;
  2816. }
  2817. #endif
  2818. uint32_t
  2819. wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2820. {
  2821. return cfg->rx_mon_buf_ring_size;
  2822. }
  2823. qdf_export_symbol(wlan_cfg_get_dp_soc_rx_mon_buf_ring_size);
  2824. uint32_t
  2825. wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  2826. {
  2827. return cfg->tx_mon_buf_ring_size;
  2828. }
  2829. qdf_export_symbol(wlan_cfg_get_dp_soc_tx_mon_buf_ring_size);
  2830. uint8_t
  2831. wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  2832. {
  2833. return cfg->rx_rel_wbm2sw_ring_id;
  2834. }
  2835. void
  2836. wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2837. uint8_t wbm2sw_ring_id)
  2838. {
  2839. cfg->rx_rel_wbm2sw_ring_id = wbm2sw_ring_id;
  2840. }
  2841. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  2842. uint8_t
  2843. wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2844. uint8_t chip_id)
  2845. {
  2846. return cfg->mlo_chip_rx_ring_map[chip_id];
  2847. }
  2848. uint8_t
  2849. wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2850. uint8_t chip_id)
  2851. {
  2852. return cfg->mlo_chip_default_rx_ring_id[chip_id];
  2853. }
  2854. uint8_t
  2855. wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  2856. uint8_t chip_id)
  2857. {
  2858. return cfg->lmac_peer_id_msb[chip_id];
  2859. }
  2860. #endif
  2861. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  2862. bool
  2863. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  2864. {
  2865. return cfg->vdev_stats_hw_offload_config;
  2866. }
  2867. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2868. {
  2869. return cfg->vdev_stats_hw_offload_timer;
  2870. }
  2871. #else
  2872. bool
  2873. wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
  2874. {
  2875. return false;
  2876. }
  2877. int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
  2878. {
  2879. return 0;
  2880. }
  2881. #endif