wlan_cfg.c 57 KB

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