wlan_cfg.c 56 KB

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