wlan_cfg.c 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #if defined(CONFIG_HL_SUPPORT)
  19. #include "wlan_tgt_def_config_hl.h"
  20. #else
  21. #include "wlan_tgt_def_config.h"
  22. #endif
  23. #include "qdf_trace.h"
  24. #include "qdf_mem.h"
  25. #include <cdp_txrx_ops.h>
  26. #include "wlan_cfg.h"
  27. #include "cfg_ucfg_api.h"
  28. #include "hal_api.h"
  29. #include "dp_types.h"
  30. /*
  31. * The max allowed size for tx comp ring is 8191.
  32. * This is limited by h/w ring max size.
  33. * As this is not a power of 2 it does not work with nss offload so the
  34. * nearest available size which is power of 2 is 4096 chosen for nss
  35. */
  36. #define WLAN_CFG_TX_RING_MASK_0 BIT(0)
  37. #define WLAN_CFG_TX_RING_MASK_1 BIT(1)
  38. #define WLAN_CFG_TX_RING_MASK_2 BIT(2)
  39. #define WLAN_CFG_TX_RING_MASK_3 0
  40. #define WLAN_CFG_TX_RING_MASK_4 BIT(4)
  41. #define WLAN_CFG_TX_RING_MASK_5 BIT(5)
  42. #define WLAN_CFG_TX_RING_MASK_6 BIT(6)
  43. #define WLAN_CFG_RX_MON_RING_MASK_0 0x1
  44. #define WLAN_CFG_RX_MON_RING_MASK_1 0x2
  45. #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
  46. #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
  47. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
  48. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
  49. #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
  50. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
  51. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
  52. #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
  53. #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
  54. #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
  55. #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
  56. #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
  57. #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
  58. #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
  59. #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
  60. #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
  61. #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
  62. #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
  63. #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
  64. #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
  65. #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
  66. #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
  67. #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
  68. #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
  69. #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
  70. #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
  71. #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
  72. #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
  73. struct dp_int_mask_assignment {
  74. uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  75. uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  76. uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  77. uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  78. uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  79. uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  80. uint8_t rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  81. uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  82. uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  83. uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  84. uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  85. uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  86. uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  87. };
  88. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  89. /*
  90. * For BE, there are 18 available MSI interrupts, assigned in the manner
  91. * below.
  92. * TX(5) + RX(8) + (REO ERR + WBM ERR)(1) +
  93. * (REO status + RXDMA[0] + RXDMA[1])(1) + NEAR_Full_RX(2) + NEAR_Full_TX(1)
  94. * For IPA_OFFLOAD enabled case, 2 TX/RX rings would be assigned to IPA.
  95. */
  96. #ifdef CONFIG_BERYLLIUM
  97. #ifdef IPA_OFFLOAD
  98. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  99. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_5,
  100. [2] = WLAN_CFG_TX_RING_MASK_6};
  101. #else
  102. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  103. [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_4,
  104. [2] = WLAN_CFG_TX_RING_MASK_2, [3] = WLAN_CFG_TX_RING_MASK_5,
  105. [4] = WLAN_CFG_TX_RING_MASK_6};
  106. #endif
  107. #else
  108. static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  109. WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0};
  110. #endif /* CONFIG_BERYLLIUM */
  111. #ifdef CONFIG_BERYLLIUM
  112. #ifdef IPA_OFFLOAD
  113. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  114. [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
  115. [7] = WLAN_CFG_RX_RING_MASK_2, [9] = WLAN_CFG_RX_RING_MASK_4,
  116. [10] = WLAN_CFG_RX_RING_MASK_5, [11] = WLAN_CFG_RX_RING_MASK_6};
  117. #else
  118. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  119. [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
  120. [7] = WLAN_CFG_RX_RING_MASK_2, [8] = WLAN_CFG_RX_RING_MASK_3,
  121. [9] = WLAN_CFG_RX_RING_MASK_4, [10] = WLAN_CFG_RX_RING_MASK_5,
  122. [11] = WLAN_CFG_RX_RING_MASK_6, [12] = WLAN_CFG_RX_RING_MASK_7};
  123. #endif /* IPA_OFFLOAD */
  124. #else /* !defined(CONFIG_BERYLLIUM) */
  125. #ifdef IPA_OFFLOAD
  126. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  127. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1,
  128. WLAN_CFG_RX_RING_MASK_2, 0, 0, 0};
  129. #else
  130. static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  131. 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1,
  132. WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0};
  133. #endif
  134. #endif /* CONFIG_BERYLLIUM */
  135. #ifdef CONFIG_BERYLLIUM
  136. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  137. [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  138. WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  139. #else
  140. static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  141. 0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  142. WLAN_CFG_RXDMA2HOST_RING_MASK_1};
  143. #endif /* CONFIG_BERYLLIUM */
  144. static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  145. [1] = WLAN_CFG_RX_MON_RING_MASK_0,
  146. [2] = WLAN_CFG_RX_MON_RING_MASK_1};
  147. static const uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  148. static const uint8_t host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  149. static const uint8_t rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
  150. #ifdef CONFIG_BERYLLIUM
  151. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  152. [14] = WLAN_CFG_RX_ERR_RING_MASK_0};
  153. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  154. [14] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  155. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  156. [13] = WLAN_CFG_REO_STATUS_RING_MASK_0};
  157. #else
  158. static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  159. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0};
  160. static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  161. 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0};
  162. static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  163. 0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0};
  164. #endif
  165. #ifdef CONFIG_BERYLLIUM
  166. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  167. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  168. [15] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  169. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  170. [16] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
  171. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  172. [17] = WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK};
  173. #else
  174. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  175. 0 };
  176. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  177. 0 };
  178. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  179. 0 };
  180. #endif
  181. #else
  182. static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  183. 0 };
  184. static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  185. 0 };
  186. static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
  187. 0 };
  188. #endif
  189. #ifdef CONFIG_BERYLLIUM
  190. #ifdef IPA_OFFLOAD
  191. struct wlan_cfg_tcl_wbm_ring_num_map tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
  192. {.tcl_ring_num = 0, .wbm_ring_num = 0, .for_ipa = 0},
  193. {1, 4, 1}, /* For IPA */
  194. {2, 2, 1}, /* For IPA */
  195. {3, 5, 0},
  196. {4, 6, 0},
  197. };
  198. #else
  199. struct wlan_cfg_tcl_wbm_ring_num_map tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
  200. {.tcl_ring_num = 0, .wbm_ring_num = 0, .for_ipa = 0},
  201. {1, 4, 0},
  202. {2, 2, 0},
  203. {3, 5, 0},
  204. {4, 6, 0},
  205. };
  206. #endif /* IPA_OFFLOAD */
  207. #else
  208. struct wlan_cfg_tcl_wbm_ring_num_map tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
  209. {.tcl_ring_num = 0, .wbm_ring_num = 0, .for_ipa = 0},
  210. {1, 4, 1}, /* For IPA */
  211. {2, 2, 1}, /* For IPA */
  212. };
  213. #endif
  214. #else
  215. /* Integrated configuration + 8 possible MSI configurations */
  216. #define NUM_INTERRUPT_COMBINATIONS 9
  217. /*
  218. * This structure contains the best possible mask assignment for a given
  219. * number of MSIs available in the system.
  220. */
  221. static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
  222. /* Interrupt assignment for integrated configuration */
  223. {
  224. /* tx ring masks */
  225. { WLAN_CFG_TX_RING_MASK_0,
  226. WLAN_CFG_TX_RING_MASK_1,
  227. WLAN_CFG_TX_RING_MASK_2,
  228. WLAN_CFG_TX_RING_MASK_3,
  229. 0, 0, 0, 0, 0, 0, 0},
  230. /* rx ring masks */
  231. { 0, 0, 0, 0, 0, 0, 0,
  232. WLAN_CFG_RX_RING_MASK_0,
  233. WLAN_CFG_RX_RING_MASK_1,
  234. WLAN_CFG_RX_RING_MASK_2,
  235. WLAN_CFG_RX_RING_MASK_3},
  236. /* rx mon ring masks */
  237. { 0, 0, 0, 0,
  238. WLAN_CFG_RX_MON_RING_MASK_0,
  239. WLAN_CFG_RX_MON_RING_MASK_1,
  240. WLAN_CFG_RX_MON_RING_MASK_2,
  241. 0, 0, 0, 0},
  242. /* host2rxdma ring masks */
  243. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  244. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  245. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  246. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  247. 0, 0, 0, 0, 0, 0, 0},
  248. /* rxdma2host ring masks */
  249. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  250. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  251. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  252. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  253. 0, 0, 0, 0, 0, 0, 0},
  254. /* host2rxdma mon ring masks */
  255. { 0, 0, 0, 0,
  256. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  257. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  258. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  259. 0, 0, 0, 0},
  260. /* rxdma2host mon ring masks */
  261. { 0, 0, 0, 0,
  262. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  263. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  264. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  265. 0, 0, 0, 0},
  266. /* rx err ring masks */
  267. { WLAN_CFG_RX_ERR_RING_MASK_0,
  268. WLAN_CFG_RX_ERR_RING_MASK_1,
  269. WLAN_CFG_RX_ERR_RING_MASK_2,
  270. WLAN_CFG_RX_ERR_RING_MASK_3,
  271. 0, 0, 0, 0, 0, 0, 0},
  272. /* rx wbm rel ring masks */
  273. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  274. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  275. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  276. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  277. 0, 0, 0, 0, 0, 0, 0},
  278. /* reo status ring masks */
  279. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  280. WLAN_CFG_REO_STATUS_RING_MASK_1,
  281. WLAN_CFG_REO_STATUS_RING_MASK_2,
  282. WLAN_CFG_REO_STATUS_RING_MASK_3,
  283. 0, 0, 0, 0, 0, 0, 0},
  284. },
  285. /* Interrupt assignment for 1 MSI combination */
  286. {
  287. /* tx ring masks */
  288. { WLAN_CFG_TX_RING_MASK_0 |
  289. WLAN_CFG_TX_RING_MASK_1 |
  290. WLAN_CFG_TX_RING_MASK_2 |
  291. WLAN_CFG_TX_RING_MASK_3,
  292. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  293. /* rx ring masks */
  294. { WLAN_CFG_RX_RING_MASK_0 |
  295. WLAN_CFG_RX_RING_MASK_1 |
  296. WLAN_CFG_RX_RING_MASK_2 |
  297. WLAN_CFG_RX_RING_MASK_3,
  298. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  299. /* rx mon ring masks */
  300. { WLAN_CFG_RX_MON_RING_MASK_0 |
  301. WLAN_CFG_RX_MON_RING_MASK_1 |
  302. WLAN_CFG_RX_MON_RING_MASK_2,
  303. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  304. /* host2rxdma ring masks */
  305. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  306. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  307. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  308. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  309. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  310. /* rxdma2host ring masks */
  311. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  312. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  313. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  314. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  315. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  316. /* host2rxdma mon ring masks */
  317. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  318. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  319. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  320. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  321. /* rxdma2host mon ring masks */
  322. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  323. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  324. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  325. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  326. /* rx err ring masks */
  327. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  328. WLAN_CFG_RX_ERR_RING_MASK_1 |
  329. WLAN_CFG_RX_ERR_RING_MASK_2 |
  330. WLAN_CFG_RX_ERR_RING_MASK_3,
  331. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  332. /* rx wbm rel ring masks */
  333. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  334. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  335. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  336. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  337. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  338. /* reo status ring masks */
  339. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  340. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  341. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  342. WLAN_CFG_REO_STATUS_RING_MASK_3,
  343. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  344. },
  345. /* Interrupt assignment for 2 MSI combination */
  346. {
  347. /* tx ring masks */
  348. { WLAN_CFG_TX_RING_MASK_0 |
  349. WLAN_CFG_TX_RING_MASK_1,
  350. WLAN_CFG_TX_RING_MASK_2 |
  351. WLAN_CFG_TX_RING_MASK_3,
  352. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  353. /* rx ring masks */
  354. { WLAN_CFG_RX_RING_MASK_0 |
  355. WLAN_CFG_RX_RING_MASK_1,
  356. WLAN_CFG_RX_RING_MASK_2 |
  357. WLAN_CFG_RX_RING_MASK_3,
  358. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  359. /* rx mon ring masks */
  360. { WLAN_CFG_RX_MON_RING_MASK_0 |
  361. WLAN_CFG_RX_MON_RING_MASK_1,
  362. WLAN_CFG_RX_MON_RING_MASK_2,
  363. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  364. /* host2rxdma ring masks */
  365. { WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  366. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  367. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  368. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  369. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  370. /* rxdma2host ring masks */
  371. { WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  372. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  373. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  374. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  375. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  376. /* host2rxdma mon ring masks */
  377. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  378. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  379. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  380. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  381. /* rxdma2host mon ring masks */
  382. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  383. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  384. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  385. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  386. /* rx err ring masks */
  387. { WLAN_CFG_RX_ERR_RING_MASK_0 |
  388. WLAN_CFG_RX_ERR_RING_MASK_1,
  389. WLAN_CFG_RX_ERR_RING_MASK_2 |
  390. WLAN_CFG_RX_ERR_RING_MASK_3,
  391. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  392. /* rx wbm rel ring masks */
  393. { WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  394. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  395. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  396. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  397. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  398. /* reo status ring masks */
  399. { WLAN_CFG_REO_STATUS_RING_MASK_0 |
  400. WLAN_CFG_REO_STATUS_RING_MASK_1,
  401. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  402. WLAN_CFG_REO_STATUS_RING_MASK_3,
  403. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  404. },
  405. /* Interrupt assignment for 3 MSI combination */
  406. {
  407. /* tx ring masks */
  408. { WLAN_CFG_TX_RING_MASK_0 |
  409. WLAN_CFG_TX_RING_MASK_1,
  410. WLAN_CFG_TX_RING_MASK_2 |
  411. WLAN_CFG_TX_RING_MASK_3,
  412. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  413. /* rx ring masks */
  414. { WLAN_CFG_RX_RING_MASK_0 |
  415. WLAN_CFG_RX_RING_MASK_1,
  416. WLAN_CFG_RX_RING_MASK_2 |
  417. WLAN_CFG_RX_RING_MASK_3,
  418. 0, 0, 0, 0, 0, 0, 0, 0, 0},
  419. /* rx mon ring masks */
  420. { 0, 0,
  421. WLAN_CFG_RX_MON_RING_MASK_0 |
  422. WLAN_CFG_RX_MON_RING_MASK_1 |
  423. WLAN_CFG_RX_MON_RING_MASK_2,
  424. 0, 0, 0, 0, 0, 0, 0, 0},
  425. /* host2rxdma ring masks */
  426. { 0, 0,
  427. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  428. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  429. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  430. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  431. 0, 0, 0, 0, 0, 0, 0, 0},
  432. /* rxdma2host ring masks */
  433. { 0, 0,
  434. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  435. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  436. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  437. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  438. 0, 0, 0, 0, 0, 0, 0, 0},
  439. /* host2rxdma mon ring masks */
  440. { 0, 0,
  441. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  442. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  443. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  444. 0, 0, 0, 0, 0, 0, 0, 0},
  445. /* rxdma2host mon ring masks */
  446. { 0, 0,
  447. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  448. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  449. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  450. 0, 0, 0, 0, 0, 0, 0, 0},
  451. /* rx err ring masks */
  452. { 0, 0,
  453. WLAN_CFG_RX_ERR_RING_MASK_0 |
  454. WLAN_CFG_RX_ERR_RING_MASK_1 |
  455. WLAN_CFG_RX_ERR_RING_MASK_2 |
  456. WLAN_CFG_RX_ERR_RING_MASK_3,
  457. 0, 0, 0, 0, 0, 0, 0, 0},
  458. /* rx wbm rel ring masks */
  459. { 0, 0,
  460. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  461. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  462. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  463. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  464. 0, 0, 0, 0, 0, 0, 0, 0},
  465. /* reo status ring masks */
  466. { 0, 0,
  467. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  468. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  469. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  470. WLAN_CFG_REO_STATUS_RING_MASK_3,
  471. 0, 0, 0, 0, 0, 0, 0, 0},
  472. },
  473. /* Interrupt assignment for 4 MSI combination */
  474. {
  475. /* tx ring masks */
  476. { WLAN_CFG_TX_RING_MASK_0,
  477. WLAN_CFG_TX_RING_MASK_1,
  478. WLAN_CFG_TX_RING_MASK_2,
  479. WLAN_CFG_TX_RING_MASK_3,
  480. 0, 0, 0, 0, 0, 0, 0},
  481. /* rx ring masks */
  482. { WLAN_CFG_RX_RING_MASK_0,
  483. WLAN_CFG_RX_RING_MASK_1,
  484. WLAN_CFG_RX_RING_MASK_2,
  485. WLAN_CFG_RX_RING_MASK_3,
  486. 0, 0, 0, 0, 0, 0, 0},
  487. /* rx mon ring masks */
  488. { WLAN_CFG_RX_MON_RING_MASK_0,
  489. WLAN_CFG_RX_MON_RING_MASK_1,
  490. WLAN_CFG_RX_MON_RING_MASK_2,
  491. 0, 0, 0, 0, 0, 0, 0, 0},
  492. /* host2rxdma ring masks */
  493. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  494. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  495. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  496. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  497. 0, 0, 0, 0, 0, 0, 0},
  498. /* rxdma2host ring masks */
  499. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  500. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  501. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  502. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  503. 0, 0, 0, 0, 0, 0, 0},
  504. /* host2rxdma mon ring masks */
  505. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  506. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  507. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  508. 0, 0, 0, 0, 0, 0, 0, 0},
  509. /* rxdma2host mon ring masks */
  510. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  511. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  512. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  513. 0, 0, 0, 0, 0, 0, 0, 0},
  514. /* rx err ring masks */
  515. { WLAN_CFG_RX_ERR_RING_MASK_0,
  516. WLAN_CFG_RX_ERR_RING_MASK_1,
  517. WLAN_CFG_RX_ERR_RING_MASK_2,
  518. WLAN_CFG_RX_ERR_RING_MASK_3,
  519. 0, 0, 0, 0, 0, 0, 0},
  520. /* rx wbm rel ring masks */
  521. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  522. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  523. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  524. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  525. 0, 0, 0, 0, 0, 0, 0},
  526. /* reo status ring masks */
  527. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  528. WLAN_CFG_REO_STATUS_RING_MASK_1,
  529. WLAN_CFG_REO_STATUS_RING_MASK_2,
  530. WLAN_CFG_REO_STATUS_RING_MASK_3,
  531. 0, 0, 0, 0, 0, 0, 0},
  532. },
  533. /* Interrupt assignment for 5 MSI combination */
  534. {
  535. /* tx ring masks */
  536. { WLAN_CFG_TX_RING_MASK_0,
  537. WLAN_CFG_TX_RING_MASK_1,
  538. WLAN_CFG_TX_RING_MASK_2,
  539. WLAN_CFG_TX_RING_MASK_3,
  540. 0, 0, 0, 0, 0, 0, 0},
  541. /* rx ring masks */
  542. { WLAN_CFG_RX_RING_MASK_0,
  543. WLAN_CFG_RX_RING_MASK_1,
  544. WLAN_CFG_RX_RING_MASK_2,
  545. WLAN_CFG_RX_RING_MASK_3,
  546. 0, 0, 0, 0, 0, 0, 0},
  547. /* rx mon ring masks */
  548. { 0, 0, 0, 0,
  549. WLAN_CFG_RX_MON_RING_MASK_0 |
  550. WLAN_CFG_RX_MON_RING_MASK_1 |
  551. WLAN_CFG_RX_MON_RING_MASK_2,
  552. 0, 0, 0, 0, 0, 0},
  553. /* host2rxdma ring masks */
  554. { 0, 0, 0, 0,
  555. WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
  556. WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
  557. WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
  558. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  559. 0, 0, 0, 0, 0, 0},
  560. /* rxdma2host ring masks */
  561. { 0, 0, 0, 0,
  562. WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
  563. WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
  564. WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
  565. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  566. 0, 0, 0, 0, 0, 0},
  567. /* host2rxdma mon ring masks */
  568. { 0, 0, 0, 0,
  569. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
  570. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
  571. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  572. 0, 0, 0, 0, 0, 0},
  573. /* rxdma2host mon ring masks */
  574. { 0, 0, 0, 0,
  575. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
  576. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
  577. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  578. 0, 0, 0, 0, 0, 0},
  579. /* rx err ring masks */
  580. { 0, 0, 0, 0,
  581. WLAN_CFG_RX_ERR_RING_MASK_0 |
  582. WLAN_CFG_RX_ERR_RING_MASK_1 |
  583. WLAN_CFG_RX_ERR_RING_MASK_2 |
  584. WLAN_CFG_RX_ERR_RING_MASK_3,
  585. 0, 0, 0, 0, 0, 0},
  586. /* rx wbm rel ring masks */
  587. { 0, 0, 0, 0,
  588. WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
  589. WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
  590. WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
  591. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  592. 0, 0, 0, 0, 0, 0},
  593. /* reo status ring masks */
  594. { 0, 0, 0, 0,
  595. WLAN_CFG_REO_STATUS_RING_MASK_0 |
  596. WLAN_CFG_REO_STATUS_RING_MASK_1 |
  597. WLAN_CFG_REO_STATUS_RING_MASK_2 |
  598. WLAN_CFG_REO_STATUS_RING_MASK_3,
  599. 0, 0, 0, 0, 0, 0},
  600. },
  601. /* Interrupt assignment for 6 MSI combination */
  602. {
  603. /* tx ring masks */
  604. { WLAN_CFG_TX_RING_MASK_0,
  605. WLAN_CFG_TX_RING_MASK_1,
  606. WLAN_CFG_TX_RING_MASK_2,
  607. WLAN_CFG_TX_RING_MASK_3,
  608. 0, 0, 0, 0, 0, 0, 0},
  609. /* rx ring masks */
  610. { 0, 0,
  611. WLAN_CFG_RX_RING_MASK_0,
  612. WLAN_CFG_RX_RING_MASK_1,
  613. WLAN_CFG_RX_RING_MASK_2,
  614. WLAN_CFG_RX_RING_MASK_3,
  615. 0, 0, 0, 0, 0},
  616. /* rx mon ring masks */
  617. { WLAN_CFG_RX_MON_RING_MASK_0,
  618. WLAN_CFG_RX_MON_RING_MASK_1,
  619. WLAN_CFG_RX_MON_RING_MASK_2,
  620. 0, 0, 0, 0, 0, 0, 0, 0},
  621. /* host2rxdma ring masks */
  622. { WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  623. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  624. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  625. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  626. 0, 0, 0, 0, 0, 0, 0},
  627. /* rxdma2host ring masks */
  628. { WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  629. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  630. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  631. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  632. 0, 0, 0, 0, 0, 0, 0},
  633. /* host2rxdma mon ring masks */
  634. { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  635. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  636. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  637. 0, 0, 0, 0, 0, 0, 0, 0},
  638. /* rxdma2host mon ring masks */
  639. { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  640. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  641. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  642. 0, 0, 0, 0, 0, 0, 0, 0},
  643. /* rx err ring masks */
  644. { WLAN_CFG_RX_ERR_RING_MASK_0,
  645. WLAN_CFG_RX_ERR_RING_MASK_1,
  646. WLAN_CFG_RX_ERR_RING_MASK_2,
  647. WLAN_CFG_RX_ERR_RING_MASK_3,
  648. 0, 0, 0, 0, 0, 0, 0},
  649. /* rx wbm rel ring masks */
  650. { WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  651. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  652. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  653. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  654. 0, 0, 0, 0, 0, 0, 0},
  655. /* reo status ring masks */
  656. { WLAN_CFG_REO_STATUS_RING_MASK_0,
  657. WLAN_CFG_REO_STATUS_RING_MASK_1,
  658. WLAN_CFG_REO_STATUS_RING_MASK_2,
  659. WLAN_CFG_REO_STATUS_RING_MASK_3,
  660. 0, 0, 0, 0, 0, 0, 0},
  661. },
  662. /* Interrupt assignment for 7 MSI combination */
  663. {
  664. /* tx ring masks */
  665. { WLAN_CFG_TX_RING_MASK_0,
  666. WLAN_CFG_TX_RING_MASK_1,
  667. WLAN_CFG_TX_RING_MASK_2,
  668. WLAN_CFG_TX_RING_MASK_3,
  669. 0, 0, 0, 0, 0, 0, 0},
  670. /* rx ring masks */
  671. { 0, 0, 0,
  672. WLAN_CFG_RX_RING_MASK_0,
  673. WLAN_CFG_RX_RING_MASK_1,
  674. WLAN_CFG_RX_RING_MASK_2,
  675. WLAN_CFG_RX_RING_MASK_3,
  676. 0, 0, 0},
  677. /* rx mon ring masks */
  678. { 0, 0, 0,
  679. WLAN_CFG_RX_MON_RING_MASK_0,
  680. WLAN_CFG_RX_MON_RING_MASK_1,
  681. WLAN_CFG_RX_MON_RING_MASK_2,
  682. 0, 0, 0, 0, 0},
  683. /* host2rxdma ring masks */
  684. { 0, 0, 0,
  685. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  686. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  687. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  688. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  689. 0, 0, 0, 0},
  690. /* rxdma2host ring masks */
  691. { 0, 0, 0,
  692. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  693. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  694. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  695. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  696. 0, 0, 0, 0},
  697. /* host2rxdma mon ring masks */
  698. { 0, 0, 0,
  699. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  700. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  701. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  702. 0, 0, 0, 0, 0},
  703. /* rxdma2host mon ring masks */
  704. { 0, 0, 0,
  705. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  706. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  707. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  708. 0, 0, 0, 0, 0},
  709. /* rx err ring masks */
  710. { 0, 0, 0,
  711. WLAN_CFG_RX_ERR_RING_MASK_0,
  712. WLAN_CFG_RX_ERR_RING_MASK_1,
  713. WLAN_CFG_RX_ERR_RING_MASK_2,
  714. WLAN_CFG_RX_ERR_RING_MASK_3,
  715. 0, 0, 0, 0},
  716. /* rx wbm rel ring masks */
  717. { 0, 0, 0,
  718. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  719. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  720. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  721. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  722. 0, 0, 0, 0},
  723. /* reo status ring masks */
  724. { 0, 0, 0,
  725. WLAN_CFG_REO_STATUS_RING_MASK_0,
  726. WLAN_CFG_REO_STATUS_RING_MASK_1,
  727. WLAN_CFG_REO_STATUS_RING_MASK_2,
  728. WLAN_CFG_REO_STATUS_RING_MASK_3,
  729. 0, 0, 0, 0},
  730. },
  731. /* Interrupt assignment for 8 MSI combination */
  732. {
  733. /* tx ring masks */
  734. { WLAN_CFG_TX_RING_MASK_0,
  735. WLAN_CFG_TX_RING_MASK_1,
  736. WLAN_CFG_TX_RING_MASK_2,
  737. WLAN_CFG_TX_RING_MASK_3,
  738. 0, 0, 0, 0, 0, 0, 0},
  739. /* rx ring masks */
  740. { 0, 0, 0, 0,
  741. WLAN_CFG_RX_RING_MASK_0,
  742. WLAN_CFG_RX_RING_MASK_1,
  743. WLAN_CFG_RX_RING_MASK_2,
  744. WLAN_CFG_RX_RING_MASK_3,
  745. 0, 0, 0},
  746. /* rx mon ring masks */
  747. { 0, 0, 0,
  748. WLAN_CFG_RX_MON_RING_MASK_0,
  749. WLAN_CFG_RX_MON_RING_MASK_1,
  750. WLAN_CFG_RX_MON_RING_MASK_2,
  751. 0, 0, 0, 0, 0},
  752. /* host2rxdma ring masks */
  753. { 0, 0, 0,
  754. WLAN_CFG_HOST2RXDMA_RING_MASK_0,
  755. WLAN_CFG_HOST2RXDMA_RING_MASK_1,
  756. WLAN_CFG_HOST2RXDMA_RING_MASK_2,
  757. WLAN_CFG_HOST2RXDMA_RING_MASK_3,
  758. 0, 0, 0, 0},
  759. /* rxdma2host ring masks */
  760. { 0, 0, 0,
  761. WLAN_CFG_RXDMA2HOST_RING_MASK_0,
  762. WLAN_CFG_RXDMA2HOST_RING_MASK_1,
  763. WLAN_CFG_RXDMA2HOST_RING_MASK_2,
  764. WLAN_CFG_RXDMA2HOST_RING_MASK_3,
  765. 0, 0, 0, 0},
  766. /* host2rxdma mon ring masks */
  767. { 0, 0, 0,
  768. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
  769. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
  770. WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
  771. 0, 0, 0, 0, 0},
  772. /* rxdma2host mon ring masks */
  773. { 0, 0, 0,
  774. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
  775. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
  776. WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
  777. 0, 0, 0, 0, 0},
  778. /* rx err ring masks */
  779. { 0, 0, 0,
  780. WLAN_CFG_RX_ERR_RING_MASK_0,
  781. WLAN_CFG_RX_ERR_RING_MASK_1,
  782. WLAN_CFG_RX_ERR_RING_MASK_2,
  783. WLAN_CFG_RX_ERR_RING_MASK_3,
  784. 0, 0, 0, 0},
  785. /* rx wbm rel ring masks */
  786. { 0, 0, 0,
  787. WLAN_CFG_RX_WBM_REL_RING_MASK_0,
  788. WLAN_CFG_RX_WBM_REL_RING_MASK_1,
  789. WLAN_CFG_RX_WBM_REL_RING_MASK_2,
  790. WLAN_CFG_RX_WBM_REL_RING_MASK_3,
  791. 0, 0, 0, 0},
  792. /* reo status ring masks */
  793. { 0, 0, 0,
  794. WLAN_CFG_REO_STATUS_RING_MASK_0,
  795. WLAN_CFG_REO_STATUS_RING_MASK_1,
  796. WLAN_CFG_REO_STATUS_RING_MASK_2,
  797. WLAN_CFG_REO_STATUS_RING_MASK_3,
  798. 0, 0, 0, 0},
  799. },
  800. };
  801. struct wlan_cfg_tcl_wbm_ring_num_map tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
  802. {0, 0, 0},
  803. {1, 1, 0},
  804. {2, 2, 0},
  805. {3, 3, 0},
  806. {4, 4, 0},
  807. };
  808. #endif
  809. /**
  810. * g_wlan_srng_cfg[] - Per ring_type specific configuration
  811. *
  812. */
  813. struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
  814. /* REO_DST ring configuration */
  815. struct wlan_srng_cfg wlan_srng_reo_cfg = {
  816. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
  817. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING,
  818. .low_threshold = 0,
  819. };
  820. /* WBM2SW_RELEASE ring configuration */
  821. struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
  822. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
  823. .batch_count_threshold = 0,
  824. .low_threshold = 0,
  825. };
  826. /* RXDMA_BUF ring configuration */
  827. struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
  828. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  829. .batch_count_threshold = 0,
  830. .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
  831. };
  832. /* RXDMA_MONITOR_BUF ring configuration */
  833. struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
  834. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  835. .batch_count_threshold = 0,
  836. .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
  837. };
  838. /* RXDMA_MONITOR_STATUS ring configuration */
  839. struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
  840. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
  841. .batch_count_threshold = 0,
  842. .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
  843. };
  844. /* DEFAULT_CONFIG ring configuration */
  845. struct wlan_srng_cfg wlan_srng_default_cfg = {
  846. .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
  847. .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
  848. .low_threshold = 0,
  849. };
  850. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
  851. {
  852. g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
  853. g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
  854. g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
  855. g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
  856. g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
  857. g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
  858. g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
  859. g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
  860. g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
  861. g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
  862. g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
  863. g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
  864. g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
  865. g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
  866. wlan_srng_rxdma_monitor_buf_cfg;
  867. g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
  868. wlan_srng_rxdma_monitor_status_cfg;
  869. g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
  870. g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
  871. g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
  872. #ifdef WLAN_FEATURE_CIF_CFR
  873. g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
  874. #endif
  875. *wlan_cfg = g_wlan_srng_cfg;
  876. }
  877. static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
  878. 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
  879. 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
  880. 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
  881. 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
  882. 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
  883. };
  884. #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  885. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  886. int num_dp_msi,
  887. int interrupt_mode,
  888. bool is_monitor_mode)
  889. { int i = 0;
  890. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  891. wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i];
  892. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  893. rx_mon_ring_mask_msi[i];
  894. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  895. rx_err_ring_mask_msi[i];
  896. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  897. rx_wbm_rel_ring_mask_msi[i];
  898. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  899. reo_status_ring_mask_msi[i];
  900. if (is_monitor_mode) {
  901. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  902. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  903. } else {
  904. wlan_cfg_ctx->int_rx_ring_mask[i] =
  905. rx_ring_mask_msi[i];
  906. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  907. rxdma2host_ring_mask_msi[i];
  908. }
  909. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  910. host2rxdma_ring_mask_msi[i];
  911. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  912. host2rxdma_mon_ring_mask_msi[i];
  913. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  914. rxdma2host_mon_ring_mask_msi[i];
  915. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  916. rx_ring_near_full_irq_1_mask_msi[i];
  917. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  918. rx_ring_near_full_irq_2_mask_msi[i];
  919. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  920. tx_ring_near_full_irq_mask_msi[i];
  921. }
  922. }
  923. #else
  924. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  925. int num_dp_msi,
  926. int interrupt_mode,
  927. bool is_monitor_mode)
  928. {
  929. int i = 0;
  930. int interrupt_index = 0;
  931. if(interrupt_mode == DP_INTR_INTEGRATED) {
  932. interrupt_index = 0;
  933. } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
  934. DP_INTR_POLL) {
  935. interrupt_index = num_dp_msi;
  936. } else {
  937. qdf_err("Interrupt mode %d", interrupt_mode);
  938. }
  939. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  940. wlan_cfg_ctx->int_tx_ring_mask[i] =
  941. dp_mask_assignment[interrupt_index].tx_ring_mask[i];
  942. wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
  943. dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
  944. wlan_cfg_ctx->int_rx_err_ring_mask[i] =
  945. dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
  946. wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
  947. dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
  948. wlan_cfg_ctx->int_reo_status_ring_mask[i] =
  949. dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
  950. if (is_monitor_mode) {
  951. wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
  952. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
  953. } else {
  954. wlan_cfg_ctx->int_rx_ring_mask[i] =
  955. dp_mask_assignment[interrupt_index].rx_ring_mask[i];
  956. wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
  957. dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
  958. }
  959. wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
  960. dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
  961. wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
  962. dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
  963. wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
  964. dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
  965. wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
  966. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
  967. wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
  968. dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
  969. wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
  970. dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
  971. }
  972. }
  973. #endif
  974. #ifdef IPA_OFFLOAD
  975. /**
  976. * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
  977. * cfg context
  978. * @psoc - Object manager psoc
  979. * @wlan_cfg_ctx - dp soc cfg ctx
  980. *
  981. * Return: None
  982. */
  983. static void
  984. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  985. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  986. {
  987. wlan_cfg_ctx->ipa_tx_ring_size =
  988. cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
  989. wlan_cfg_ctx->ipa_tx_comp_ring_size =
  990. cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
  991. }
  992. #else
  993. static inline void
  994. wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  995. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  996. {
  997. }
  998. #endif
  999. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  1000. static void
  1001. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1002. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1003. {
  1004. wlan_cfg_ctx->hw_cc_enabled =
  1005. cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
  1006. }
  1007. #else
  1008. static void
  1009. wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
  1010. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1011. {
  1012. wlan_cfg_ctx->hw_cc_enabled = true;
  1013. }
  1014. #endif
  1015. /**
  1016. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  1017. * @psoc - Object manager psoc
  1018. * Return: wlan_cfg_ctx - Handle to Configuration context
  1019. */
  1020. struct wlan_cfg_dp_soc_ctxt *
  1021. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1022. {
  1023. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  1024. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  1025. if (!wlan_cfg_ctx)
  1026. return NULL;
  1027. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  1028. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  1029. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  1030. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  1031. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  1032. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  1033. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  1034. wlan_cfg_ctx->num_nss_reo_dest_rings =
  1035. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  1036. wlan_cfg_ctx->num_nss_tcl_data_rings =
  1037. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  1038. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  1039. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  1040. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  1041. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  1042. CFG_DP_TX_EXT_DESC_POOLS);
  1043. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  1044. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  1045. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  1046. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  1047. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  1048. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  1049. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  1050. CFG_DP_TX_COMPL_RING_SIZE);
  1051. wlan_cfg_ctx->tx_comp_ring_size_nss =
  1052. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  1053. wlan_cfg_ctx->int_batch_threshold_tx =
  1054. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  1055. wlan_cfg_ctx->int_timer_threshold_tx =
  1056. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  1057. wlan_cfg_ctx->int_batch_threshold_rx =
  1058. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  1059. wlan_cfg_ctx->int_timer_threshold_rx =
  1060. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  1061. wlan_cfg_ctx->int_batch_threshold_other =
  1062. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  1063. wlan_cfg_ctx->int_timer_threshold_other =
  1064. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  1065. wlan_cfg_ctx->pktlog_buffer_size =
  1066. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  1067. /* This is default mapping and can be overridden by HW config
  1068. * received from FW */
  1069. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  1070. if (MAX_PDEV_CNT > 1)
  1071. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  1072. if (MAX_PDEV_CNT > 2)
  1073. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  1074. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  1075. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  1076. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  1077. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  1078. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  1079. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  1080. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  1081. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  1082. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  1083. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  1084. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  1085. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  1086. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  1087. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  1088. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  1089. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  1090. wlan_cfg_ctx->tcp_udp_checksumoffload =
  1091. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  1092. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  1093. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  1094. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  1095. wlan_cfg_ctx->defrag_timeout_check =
  1096. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  1097. wlan_cfg_ctx->rx_defrag_min_timeout =
  1098. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  1099. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  1100. CFG_DP_WBM_RELEASE_RING);
  1101. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  1102. CFG_DP_TCL_CMD_CREDIT_RING);
  1103. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  1104. CFG_DP_TCL_STATUS_RING);
  1105. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  1106. CFG_DP_REO_REINJECT_RING);
  1107. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  1108. CFG_DP_RX_RELEASE_RING);
  1109. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  1110. CFG_DP_REO_EXCEPTION_RING);
  1111. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  1112. CFG_DP_REO_CMD_RING);
  1113. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  1114. CFG_DP_REO_STATUS_RING);
  1115. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  1116. CFG_DP_RXDMA_REFILL_RING);
  1117. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  1118. CFG_DP_TX_DESC_LIMIT_0);
  1119. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  1120. CFG_DP_TX_DESC_LIMIT_1);
  1121. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  1122. CFG_DP_TX_DESC_LIMIT_2);
  1123. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  1124. CFG_DP_TX_DEVICE_LIMIT);
  1125. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  1126. CFG_DP_TX_SW_INTERNODE_QUEUE);
  1127. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  1128. CFG_DP_RXDMA_ERR_DST_RING);
  1129. wlan_cfg_ctx->enable_data_stall_detection =
  1130. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  1131. wlan_cfg_ctx->enable_force_rx_64_ba =
  1132. cfg_get(psoc, CFG_FORCE_RX_64_BA);
  1133. wlan_cfg_ctx->tx_flow_start_queue_offset =
  1134. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  1135. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  1136. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  1137. wlan_cfg_ctx->disable_intra_bss_fwd =
  1138. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  1139. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  1140. CFG_DP_RX_SW_DESC_WEIGHT);
  1141. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  1142. CFG_DP_RX_SW_DESC_NUM);
  1143. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  1144. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  1145. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  1146. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  1147. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  1148. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  1149. wlan_cfg_ctx->rx_flow_search_table_size =
  1150. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  1151. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  1152. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  1153. wlan_cfg_ctx->mon_drop_thresh =
  1154. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  1155. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1156. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1157. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1158. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1159. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1160. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1161. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1162. wlan_cfg_ctx->rx_pending_high_threshold =
  1163. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1164. wlan_cfg_ctx->rx_pending_low_threshold =
  1165. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1166. wlan_cfg_ctx->is_poll_mode_enabled =
  1167. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1168. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1169. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1170. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1171. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1172. wlan_cfg_ctx->radio0_rx_default_reo =
  1173. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1174. wlan_cfg_ctx->radio1_rx_default_reo =
  1175. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1176. wlan_cfg_ctx->radio2_rx_default_reo =
  1177. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1178. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1179. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1180. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1181. CFG_DP_DELAY_MON_REPLENISH);
  1182. wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
  1183. wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
  1184. return wlan_cfg_ctx;
  1185. }
  1186. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1187. {
  1188. qdf_mem_free(wlan_cfg_ctx);
  1189. }
  1190. struct wlan_cfg_dp_pdev_ctxt *
  1191. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1192. {
  1193. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1194. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1195. if (!wlan_cfg_ctx)
  1196. return NULL;
  1197. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1198. CFG_DP_RXDMA_BUF_RING);
  1199. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1200. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1201. wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
  1202. CFG_DP_RXDMA_MONITOR_DST_RING);
  1203. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1204. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1205. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1206. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1207. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1208. return wlan_cfg_ctx;
  1209. }
  1210. void wlan_cfg_set_mon_delayed_replenish_entries(
  1211. struct wlan_cfg_dp_soc_ctxt *cfg,
  1212. uint32_t val)
  1213. {
  1214. cfg->delayed_replenish_entries = val;
  1215. }
  1216. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1217. {
  1218. return cfg->delayed_replenish_entries;
  1219. }
  1220. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1221. {
  1222. if (wlan_cfg_ctx)
  1223. qdf_mem_free(wlan_cfg_ctx);
  1224. }
  1225. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1226. {
  1227. return cfg->mon_drop_thresh;
  1228. }
  1229. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1230. {
  1231. cfg->num_int_ctxts = num;
  1232. }
  1233. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1234. {
  1235. cfg->max_peer_id = val;
  1236. }
  1237. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1238. {
  1239. cfg->max_ast_idx = val;
  1240. }
  1241. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1242. {
  1243. return cfg->max_ast_idx;
  1244. }
  1245. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1246. int context, int mask)
  1247. {
  1248. cfg->int_tx_ring_mask[context] = mask;
  1249. }
  1250. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1251. int context, int mask)
  1252. {
  1253. cfg->int_rx_ring_mask[context] = mask;
  1254. }
  1255. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1256. int context, int mask)
  1257. {
  1258. cfg->int_rx_mon_ring_mask[context] = mask;
  1259. }
  1260. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1261. int context)
  1262. {
  1263. return cfg->int_host2rxdma_mon_ring_mask[context];
  1264. }
  1265. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1266. int context, int mask)
  1267. {
  1268. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  1269. }
  1270. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1271. int context)
  1272. {
  1273. return cfg->int_rxdma2host_mon_ring_mask[context];
  1274. }
  1275. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1276. int context, int mask)
  1277. {
  1278. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  1279. }
  1280. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1281. int context, int mask)
  1282. {
  1283. cfg->int_rxdma2host_ring_mask[context] = mask;
  1284. }
  1285. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1286. int context)
  1287. {
  1288. return cfg->int_rxdma2host_ring_mask[context];
  1289. }
  1290. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1291. int context, int mask)
  1292. {
  1293. cfg->int_host2rxdma_ring_mask[context] = mask;
  1294. }
  1295. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1296. int context)
  1297. {
  1298. return cfg->int_host2rxdma_ring_mask[context];
  1299. }
  1300. int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1301. int context)
  1302. {
  1303. return cfg->int_rx_ring_near_full_irq_1_mask[context];
  1304. }
  1305. int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1306. int context)
  1307. {
  1308. return cfg->int_rx_ring_near_full_irq_2_mask[context];
  1309. }
  1310. int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1311. int context)
  1312. {
  1313. return cfg->int_tx_ring_near_full_irq_mask[context];
  1314. }
  1315. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1316. int hw_macid)
  1317. {
  1318. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1319. cfg->hw_macid[pdev_idx] = hw_macid;
  1320. }
  1321. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  1322. {
  1323. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1324. return cfg->hw_macid[pdev_idx];
  1325. }
  1326. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1327. int hw_macid)
  1328. {
  1329. int idx;
  1330. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  1331. if (cfg->hw_macid[idx] == hw_macid)
  1332. return (idx + 1);
  1333. }
  1334. qdf_assert_always(idx < MAX_PDEV_CNT);
  1335. return WLAN_INVALID_PDEV_ID;
  1336. }
  1337. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1338. int hw_macid)
  1339. {
  1340. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  1341. (pdev_idx == INVALID_PDEV_ID));
  1342. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1343. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  1344. }
  1345. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  1346. {
  1347. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1348. return cfg->hw_macid_pdev_id_map[hw_macid];
  1349. }
  1350. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1351. int context, int mask)
  1352. {
  1353. cfg->int_ce_ring_mask[context] = mask;
  1354. }
  1355. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  1356. int mask)
  1357. {
  1358. cfg->int_rx_ring_mask[context] = mask;
  1359. }
  1360. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1361. int context, int mask)
  1362. {
  1363. return cfg->int_rx_err_ring_mask[context] = mask;
  1364. }
  1365. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1366. int context, int mask)
  1367. {
  1368. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  1369. }
  1370. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1371. int context, int mask)
  1372. {
  1373. return cfg->int_reo_status_ring_mask[context] = mask;
  1374. }
  1375. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  1376. {
  1377. return cfg->num_int_ctxts;
  1378. }
  1379. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1380. {
  1381. return cfg->int_tx_ring_mask[context];
  1382. }
  1383. void wlan_cfg_get_tcl_wbm_ring_num_for_index(int index, int *tcl, int *wbm)
  1384. {
  1385. *tcl = tcl_wbm_map_array[index].tcl_ring_num;
  1386. *wbm = tcl_wbm_map_array[index].wbm_ring_num;
  1387. }
  1388. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1389. {
  1390. return cfg->int_rx_ring_mask[context];
  1391. }
  1392. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1393. int context)
  1394. {
  1395. return cfg->int_rx_err_ring_mask[context];
  1396. }
  1397. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1398. int context)
  1399. {
  1400. return cfg->int_rx_wbm_rel_ring_mask[context];
  1401. }
  1402. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1403. int context)
  1404. {
  1405. return cfg->int_reo_status_ring_mask[context];
  1406. }
  1407. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1408. {
  1409. return cfg->int_rx_mon_ring_mask[context];
  1410. }
  1411. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1412. {
  1413. return cfg->int_ce_ring_mask[context];
  1414. }
  1415. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  1416. {
  1417. return cfg->max_clients;
  1418. }
  1419. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1420. {
  1421. return cfg->max_alloc_size;
  1422. }
  1423. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1424. {
  1425. return cfg->per_pdev_tx_ring;
  1426. }
  1427. uint32_t
  1428. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1429. {
  1430. return cfg->rx_pending_high_threshold;
  1431. }
  1432. uint32_t
  1433. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1434. {
  1435. return cfg->rx_pending_low_threshold;
  1436. }
  1437. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1438. {
  1439. return cfg->per_pdev_lmac_ring;
  1440. }
  1441. #ifdef DP_MEMORY_OPT
  1442. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1443. {
  1444. return 1;
  1445. }
  1446. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1447. {
  1448. return 1;
  1449. }
  1450. #else
  1451. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1452. {
  1453. return cfg->num_tcl_data_rings;
  1454. }
  1455. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1456. {
  1457. return cfg->num_nss_tcl_data_rings;
  1458. }
  1459. #endif
  1460. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1461. {
  1462. return cfg->tx_ring_size;
  1463. }
  1464. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1465. {
  1466. return cfg->tx_comp_ring_size;
  1467. }
  1468. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1469. {
  1470. return cfg->per_pdev_rx_ring;
  1471. }
  1472. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1473. {
  1474. return cfg->num_reo_dest_rings;
  1475. }
  1476. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1477. {
  1478. return cfg->num_nss_reo_dest_rings;
  1479. }
  1480. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  1481. {
  1482. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  1483. }
  1484. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1485. {
  1486. return cfg->num_tx_desc_pool;
  1487. }
  1488. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1489. {
  1490. cfg->num_tx_desc_pool = num_pool;
  1491. }
  1492. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1493. {
  1494. return cfg->num_tx_ext_desc_pool;
  1495. }
  1496. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1497. {
  1498. cfg->num_tx_ext_desc_pool = num_pool;
  1499. }
  1500. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1501. {
  1502. return cfg->reo_dst_ring_size;
  1503. }
  1504. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1505. int reo_dst_ring_size)
  1506. {
  1507. cfg->reo_dst_ring_size = reo_dst_ring_size;
  1508. }
  1509. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  1510. bool raw_mode_war)
  1511. {
  1512. cfg->raw_mode_war = raw_mode_war;
  1513. }
  1514. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  1515. {
  1516. return cfg->raw_mode_war;
  1517. }
  1518. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1519. {
  1520. return cfg->num_tx_desc;
  1521. }
  1522. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  1523. {
  1524. cfg->num_tx_desc = num_desc;
  1525. }
  1526. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1527. {
  1528. return cfg->min_tx_desc;
  1529. }
  1530. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1531. {
  1532. return cfg->num_tx_ext_desc;
  1533. }
  1534. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  1535. {
  1536. cfg->num_tx_ext_desc = num_ext_desc;
  1537. }
  1538. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  1539. {
  1540. /* TODO: This should be calculated based on target capabilities */
  1541. return cfg->max_peer_id;
  1542. }
  1543. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1544. {
  1545. return cfg->dma_mon_buf_ring_size;
  1546. }
  1547. int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1548. {
  1549. return cfg->dma_mon_dest_ring_size;
  1550. }
  1551. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1552. {
  1553. return cfg->dma_mon_status_ring_size;
  1554. }
  1555. int
  1556. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1557. {
  1558. return cfg->rxdma_monitor_desc_ring;
  1559. }
  1560. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1561. {
  1562. return cfg->rx_dma_buf_ring_size;
  1563. }
  1564. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1565. {
  1566. return cfg->num_mac_rings;
  1567. }
  1568. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1569. {
  1570. return cfg->gro_enabled;
  1571. }
  1572. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1573. {
  1574. return cfg->lro_enabled;
  1575. }
  1576. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1577. {
  1578. return cfg->ipa_enabled;
  1579. }
  1580. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  1581. {
  1582. cfg->rx_hash = val;
  1583. }
  1584. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1585. {
  1586. return cfg->rx_hash;
  1587. }
  1588. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1589. {
  1590. return cfg->nss_enabled;
  1591. }
  1592. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  1593. {
  1594. cfg->nss_enabled = nss_enabled;
  1595. }
  1596. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  1597. {
  1598. return cfg->nss_cfg;
  1599. }
  1600. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  1601. {
  1602. cfg->nss_cfg = nss_cfg;
  1603. if (cfg->nss_cfg)
  1604. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  1605. }
  1606. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1607. {
  1608. return cfg->int_batch_threshold_tx;
  1609. }
  1610. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1611. {
  1612. return cfg->int_timer_threshold_tx;
  1613. }
  1614. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1615. {
  1616. return cfg->int_batch_threshold_rx;
  1617. }
  1618. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1619. {
  1620. return cfg->int_timer_threshold_rx;
  1621. }
  1622. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1623. {
  1624. return cfg->int_batch_threshold_other;
  1625. }
  1626. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1627. {
  1628. return cfg->int_timer_threshold_other;
  1629. }
  1630. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  1631. {
  1632. return cfg->int_timer_threshold_mon;
  1633. }
  1634. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1635. {
  1636. return cfg->p2p_tcp_udp_checksumoffload;
  1637. }
  1638. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1639. {
  1640. return cfg->nan_tcp_udp_checksumoffload;
  1641. }
  1642. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1643. {
  1644. return cfg->tcp_udp_checksumoffload;
  1645. }
  1646. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  1647. {
  1648. return cfg->rx_defrag_min_timeout;
  1649. }
  1650. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  1651. {
  1652. return cfg->defrag_timeout_check;
  1653. }
  1654. int
  1655. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1656. {
  1657. return cfg->wbm_release_ring;
  1658. }
  1659. int
  1660. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1661. {
  1662. return cfg->tcl_cmd_credit_ring;
  1663. }
  1664. int
  1665. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1666. {
  1667. return cfg->tcl_status_ring;
  1668. }
  1669. int
  1670. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1671. {
  1672. return cfg->reo_reinject_ring;
  1673. }
  1674. int
  1675. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1676. {
  1677. return cfg->rx_release_ring;
  1678. }
  1679. int
  1680. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1681. {
  1682. return cfg->reo_exception_ring;
  1683. }
  1684. int
  1685. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1686. {
  1687. return cfg->reo_cmd_ring;
  1688. }
  1689. int
  1690. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1691. {
  1692. return cfg->reo_status_ring;
  1693. }
  1694. int
  1695. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1696. {
  1697. return cfg->rxdma_refill_ring;
  1698. }
  1699. int
  1700. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  1701. {
  1702. return cfg->tx_desc_limit_0;
  1703. }
  1704. int
  1705. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  1706. {
  1707. return cfg->tx_desc_limit_1;
  1708. }
  1709. int
  1710. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  1711. {
  1712. return cfg->tx_desc_limit_2;
  1713. }
  1714. int
  1715. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  1716. {
  1717. return cfg->tx_device_limit;
  1718. }
  1719. int
  1720. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  1721. {
  1722. return cfg->tx_sw_internode_queue;
  1723. }
  1724. int
  1725. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1726. {
  1727. return cfg->rxdma_err_dst_ring;
  1728. }
  1729. int
  1730. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  1731. {
  1732. return cfg->rx_sw_desc_weight;
  1733. }
  1734. int
  1735. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  1736. {
  1737. return cfg->rx_sw_desc_num;
  1738. }
  1739. uint32_t
  1740. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  1741. {
  1742. return cfg->reo_rings_mapping;
  1743. }
  1744. bool
  1745. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1746. enum cdp_capabilities dp_caps)
  1747. {
  1748. switch (dp_caps) {
  1749. case CDP_CFG_DP_TSO:
  1750. return cfg->tso_enabled;
  1751. case CDP_CFG_DP_LRO:
  1752. return cfg->lro_enabled;
  1753. case CDP_CFG_DP_SG:
  1754. return cfg->sg_enabled;
  1755. case CDP_CFG_DP_GRO:
  1756. return cfg->gro_enabled;
  1757. case CDP_CFG_DP_OL_TX_CSUM:
  1758. return cfg->ol_tx_csum_enabled;
  1759. case CDP_CFG_DP_OL_RX_CSUM:
  1760. return cfg->ol_rx_csum_enabled;
  1761. case CDP_CFG_DP_RAWMODE:
  1762. return cfg->rawmode_enabled;
  1763. case CDP_CFG_DP_PEER_FLOW_CTRL:
  1764. return cfg->peer_flow_ctrl_enabled;
  1765. default:
  1766. return false;
  1767. }
  1768. }
  1769. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1770. bool val)
  1771. {
  1772. cfg->is_tso_desc_attach_defer = val;
  1773. }
  1774. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  1775. {
  1776. return cfg->is_tso_desc_attach_defer;
  1777. }
  1778. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1779. /**
  1780. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  1781. * @cfg: config context
  1782. *
  1783. * Return: stop threshold
  1784. */
  1785. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  1786. {
  1787. return cfg->tx_flow_stop_queue_threshold;
  1788. }
  1789. /**
  1790. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  1791. * for TX to resume
  1792. * @cfg: config context
  1793. *
  1794. * Return: stop threshold
  1795. */
  1796. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  1797. {
  1798. return cfg->tx_flow_start_queue_offset;
  1799. }
  1800. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1801. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1802. bool val)
  1803. {
  1804. cfg->is_rx_flow_tag_enabled = val;
  1805. }
  1806. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  1807. {
  1808. return cfg->rx_toeplitz_hash_key;
  1809. }
  1810. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  1811. {
  1812. return cfg->rx_flow_max_search;
  1813. }
  1814. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1815. {
  1816. return cfg->is_rx_flow_tag_enabled;
  1817. }
  1818. #ifdef WLAN_SUPPORT_RX_FISA
  1819. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1820. {
  1821. return (bool)(cfg->is_rx_fisa_enabled);
  1822. }
  1823. #else
  1824. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1825. {
  1826. return false;
  1827. }
  1828. #endif
  1829. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1830. {
  1831. return (bool)(cfg->is_poll_mode_enabled);
  1832. }
  1833. void
  1834. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1835. bool val)
  1836. {
  1837. cfg->is_rx_flow_search_table_per_pdev = val;
  1838. }
  1839. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  1840. {
  1841. return cfg->is_rx_flow_search_table_per_pdev;
  1842. }
  1843. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1844. uint16_t val)
  1845. {
  1846. cfg->rx_flow_search_table_size = val;
  1847. }
  1848. uint16_t
  1849. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1850. {
  1851. return cfg->rx_flow_search_table_size;
  1852. }
  1853. void
  1854. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1855. bool val)
  1856. {
  1857. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  1858. }
  1859. bool
  1860. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1861. {
  1862. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  1863. }
  1864. void
  1865. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1866. bool val)
  1867. {
  1868. cfg->tx_per_pkt_vdev_id_check = val;
  1869. }
  1870. bool
  1871. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1872. {
  1873. return cfg->tx_per_pkt_vdev_id_check;
  1874. }
  1875. void
  1876. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1877. bool val)
  1878. {
  1879. cfg->pext_stats_enabled = val;
  1880. }
  1881. bool
  1882. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1883. {
  1884. return cfg->pext_stats_enabled;
  1885. }
  1886. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1887. {
  1888. return cfg->fst_in_cmem;
  1889. }
  1890. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1891. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1892. {
  1893. return cfg->is_rx_buff_pool_enabled;
  1894. }
  1895. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1896. {
  1897. return cfg->is_rx_refill_buff_pool_enabled;
  1898. }
  1899. #else
  1900. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1901. {
  1902. return false;
  1903. }
  1904. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  1905. struct wlan_cfg_dp_soc_ctxt *cfg)
  1906. {
  1907. return false;
  1908. }
  1909. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  1910. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  1911. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1912. {
  1913. return (bool)(cfg->is_swlm_enabled);
  1914. }
  1915. #else
  1916. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1917. {
  1918. return false;
  1919. }
  1920. #endif
  1921. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1922. {
  1923. return cfg->radio0_rx_default_reo;
  1924. }
  1925. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1926. {
  1927. return cfg->radio1_rx_default_reo;
  1928. }
  1929. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1930. {
  1931. return cfg->radio2_rx_default_reo;
  1932. }
  1933. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  1934. {
  1935. cfg->rxdma1_enable = true;
  1936. }
  1937. bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
  1938. {
  1939. return cfg->enable_force_rx_64_ba;
  1940. }
  1941. void
  1942. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  1943. bool val)
  1944. {
  1945. cfg->delay_mon_replenish = val;
  1946. }
  1947. bool
  1948. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  1949. {
  1950. return cfg->delay_mon_replenish;
  1951. }
  1952. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  1953. {
  1954. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  1955. cfg->delay_mon_replenish);
  1956. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  1957. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  1958. }
  1959. #ifdef IPA_OFFLOAD
  1960. uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1961. {
  1962. return cfg->ipa_tx_ring_size;
  1963. }
  1964. uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1965. {
  1966. return cfg->ipa_tx_comp_ring_size;
  1967. }
  1968. #endif