wlan_cfg.c 96 KB

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