wlan_cfg.c 97 KB

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