wlan_cfg.c 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973
  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. /**
  860. * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  861. * @psoc - Object manager psoc
  862. * Return: wlan_cfg_ctx - Handle to Configuration context
  863. */
  864. struct wlan_cfg_dp_soc_ctxt *
  865. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  866. {
  867. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
  868. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
  869. if (!wlan_cfg_ctx)
  870. return NULL;
  871. wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
  872. wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
  873. wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
  874. wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
  875. wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
  876. wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
  877. wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
  878. wlan_cfg_ctx->num_nss_reo_dest_rings =
  879. cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
  880. wlan_cfg_ctx->num_nss_tcl_data_rings =
  881. cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
  882. wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
  883. wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
  884. wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
  885. wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
  886. CFG_DP_TX_EXT_DESC_POOLS);
  887. wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
  888. wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
  889. wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
  890. wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
  891. wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
  892. wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
  893. wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
  894. CFG_DP_TX_COMPL_RING_SIZE);
  895. wlan_cfg_ctx->tx_comp_ring_size_nss =
  896. cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
  897. wlan_cfg_ctx->int_batch_threshold_tx =
  898. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
  899. wlan_cfg_ctx->int_timer_threshold_tx =
  900. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
  901. wlan_cfg_ctx->int_batch_threshold_rx =
  902. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
  903. wlan_cfg_ctx->int_timer_threshold_rx =
  904. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
  905. wlan_cfg_ctx->int_batch_threshold_other =
  906. cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
  907. wlan_cfg_ctx->int_timer_threshold_other =
  908. cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
  909. wlan_cfg_ctx->pktlog_buffer_size =
  910. cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
  911. /* This is default mapping and can be overridden by HW config
  912. * received from FW */
  913. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
  914. if (MAX_PDEV_CNT > 1)
  915. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
  916. if (MAX_PDEV_CNT > 2)
  917. wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
  918. wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
  919. wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
  920. wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
  921. wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
  922. wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
  923. wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
  924. wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
  925. wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
  926. wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
  927. wlan_cfg_ctx->peer_flow_ctrl_enabled =
  928. cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
  929. wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
  930. wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
  931. cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
  932. wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
  933. cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
  934. wlan_cfg_ctx->tcp_udp_checksumoffload =
  935. cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
  936. wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
  937. cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
  938. wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
  939. wlan_cfg_ctx->defrag_timeout_check =
  940. cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
  941. wlan_cfg_ctx->rx_defrag_min_timeout =
  942. cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
  943. wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
  944. CFG_DP_WBM_RELEASE_RING);
  945. wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
  946. CFG_DP_TCL_CMD_CREDIT_RING);
  947. wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
  948. CFG_DP_TCL_STATUS_RING);
  949. wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
  950. CFG_DP_REO_REINJECT_RING);
  951. wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
  952. CFG_DP_RX_RELEASE_RING);
  953. wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
  954. CFG_DP_REO_EXCEPTION_RING);
  955. wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
  956. CFG_DP_REO_CMD_RING);
  957. wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
  958. CFG_DP_REO_STATUS_RING);
  959. wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
  960. CFG_DP_RXDMA_REFILL_RING);
  961. wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
  962. CFG_DP_TX_DESC_LIMIT_0);
  963. wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
  964. CFG_DP_TX_DESC_LIMIT_1);
  965. wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
  966. CFG_DP_TX_DESC_LIMIT_2);
  967. wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
  968. CFG_DP_TX_DEVICE_LIMIT);
  969. wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
  970. CFG_DP_TX_SW_INTERNODE_QUEUE);
  971. wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
  972. CFG_DP_RXDMA_ERR_DST_RING);
  973. wlan_cfg_ctx->enable_data_stall_detection =
  974. cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
  975. wlan_cfg_ctx->enable_force_rx_64_ba =
  976. cfg_get(psoc, CFG_FORCE_RX_64_BA);
  977. wlan_cfg_ctx->tx_flow_start_queue_offset =
  978. cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
  979. wlan_cfg_ctx->tx_flow_stop_queue_threshold =
  980. cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
  981. wlan_cfg_ctx->disable_intra_bss_fwd =
  982. cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
  983. wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
  984. CFG_DP_RX_SW_DESC_WEIGHT);
  985. wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
  986. CFG_DP_RX_SW_DESC_NUM);
  987. wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
  988. wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
  989. wlan_cfg_ctx->is_rx_flow_tag_enabled =
  990. cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
  991. wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
  992. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
  993. wlan_cfg_ctx->rx_flow_search_table_size =
  994. cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
  995. wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
  996. cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
  997. wlan_cfg_ctx->mon_drop_thresh =
  998. cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
  999. wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
  1000. wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
  1001. wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
  1002. wlan_cfg_ctx->is_rx_buff_pool_enabled =
  1003. cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
  1004. wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
  1005. cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
  1006. wlan_cfg_ctx->rx_pending_high_threshold =
  1007. cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
  1008. wlan_cfg_ctx->rx_pending_low_threshold =
  1009. cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
  1010. wlan_cfg_ctx->is_poll_mode_enabled =
  1011. cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
  1012. wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
  1013. wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
  1014. wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
  1015. cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
  1016. wlan_cfg_ctx->radio0_rx_default_reo =
  1017. cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
  1018. wlan_cfg_ctx->radio1_rx_default_reo =
  1019. cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
  1020. wlan_cfg_ctx->radio2_rx_default_reo =
  1021. cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
  1022. wlan_cfg_ctx->wow_check_rx_pending_enable =
  1023. cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
  1024. wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
  1025. CFG_DP_DELAY_MON_REPLENISH);
  1026. return wlan_cfg_ctx;
  1027. }
  1028. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
  1029. {
  1030. qdf_mem_free(wlan_cfg_ctx);
  1031. }
  1032. struct wlan_cfg_dp_pdev_ctxt *
  1033. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
  1034. {
  1035. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
  1036. qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
  1037. if (!wlan_cfg_ctx)
  1038. return NULL;
  1039. wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
  1040. CFG_DP_RXDMA_BUF_RING);
  1041. wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
  1042. CFG_DP_RXDMA_MONITOR_BUF_RING);
  1043. wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
  1044. CFG_DP_RXDMA_MONITOR_DST_RING);
  1045. wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
  1046. CFG_DP_RXDMA_MONITOR_STATUS_RING);
  1047. wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
  1048. CFG_DP_RXDMA_MONITOR_DESC_RING);
  1049. wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
  1050. return wlan_cfg_ctx;
  1051. }
  1052. void wlan_cfg_set_mon_delayed_replenish_entries(
  1053. struct wlan_cfg_dp_soc_ctxt *cfg,
  1054. uint32_t val)
  1055. {
  1056. cfg->delayed_replenish_entries = val;
  1057. }
  1058. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
  1059. {
  1060. return cfg->delayed_replenish_entries;
  1061. }
  1062. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
  1063. {
  1064. if (wlan_cfg_ctx)
  1065. qdf_mem_free(wlan_cfg_ctx);
  1066. }
  1067. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
  1068. {
  1069. return cfg->mon_drop_thresh;
  1070. }
  1071. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
  1072. {
  1073. cfg->num_int_ctxts = num;
  1074. }
  1075. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1076. {
  1077. cfg->max_peer_id = val;
  1078. }
  1079. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
  1080. {
  1081. cfg->max_ast_idx = val;
  1082. }
  1083. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1084. {
  1085. return cfg->max_ast_idx;
  1086. }
  1087. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1088. int context, int mask)
  1089. {
  1090. cfg->int_tx_ring_mask[context] = mask;
  1091. }
  1092. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1093. int context, int mask)
  1094. {
  1095. cfg->int_rx_ring_mask[context] = mask;
  1096. }
  1097. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1098. int context, int mask)
  1099. {
  1100. cfg->int_rx_mon_ring_mask[context] = mask;
  1101. }
  1102. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1103. int context)
  1104. {
  1105. return cfg->int_host2rxdma_mon_ring_mask[context];
  1106. }
  1107. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1108. int context, int mask)
  1109. {
  1110. cfg->int_host2rxdma_mon_ring_mask[context] = mask;
  1111. }
  1112. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1113. int context)
  1114. {
  1115. return cfg->int_rxdma2host_mon_ring_mask[context];
  1116. }
  1117. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1118. int context, int mask)
  1119. {
  1120. cfg->int_rxdma2host_mon_ring_mask[context] = mask;
  1121. }
  1122. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1123. int context, int mask)
  1124. {
  1125. cfg->int_rxdma2host_ring_mask[context] = mask;
  1126. }
  1127. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1128. int context)
  1129. {
  1130. return cfg->int_rxdma2host_ring_mask[context];
  1131. }
  1132. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1133. int context, int mask)
  1134. {
  1135. cfg->int_host2rxdma_ring_mask[context] = mask;
  1136. }
  1137. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1138. int context)
  1139. {
  1140. return cfg->int_host2rxdma_ring_mask[context];
  1141. }
  1142. void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1143. int hw_macid)
  1144. {
  1145. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1146. cfg->hw_macid[pdev_idx] = hw_macid;
  1147. }
  1148. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
  1149. {
  1150. qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
  1151. return cfg->hw_macid[pdev_idx];
  1152. }
  1153. int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
  1154. int hw_macid)
  1155. {
  1156. int idx;
  1157. for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
  1158. if (cfg->hw_macid[idx] == hw_macid)
  1159. return (idx + 1);
  1160. }
  1161. qdf_assert_always(idx < MAX_PDEV_CNT);
  1162. return WLAN_INVALID_PDEV_ID;
  1163. }
  1164. void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  1165. int hw_macid)
  1166. {
  1167. qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
  1168. (pdev_idx == INVALID_PDEV_ID));
  1169. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1170. cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
  1171. }
  1172. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
  1173. {
  1174. qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
  1175. return cfg->hw_macid_pdev_id_map[hw_macid];
  1176. }
  1177. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1178. int context, int mask)
  1179. {
  1180. cfg->int_ce_ring_mask[context] = mask;
  1181. }
  1182. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  1183. int mask)
  1184. {
  1185. cfg->int_rx_ring_mask[context] = mask;
  1186. }
  1187. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1188. int context, int mask)
  1189. {
  1190. return cfg->int_rx_err_ring_mask[context] = mask;
  1191. }
  1192. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1193. int context, int mask)
  1194. {
  1195. return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
  1196. }
  1197. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1198. int context, int mask)
  1199. {
  1200. return cfg->int_reo_status_ring_mask[context] = mask;
  1201. }
  1202. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
  1203. {
  1204. return cfg->num_int_ctxts;
  1205. }
  1206. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1207. {
  1208. return cfg->int_tx_ring_mask[context];
  1209. }
  1210. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1211. {
  1212. return cfg->int_rx_ring_mask[context];
  1213. }
  1214. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1215. int context)
  1216. {
  1217. return cfg->int_rx_err_ring_mask[context];
  1218. }
  1219. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1220. int context)
  1221. {
  1222. return cfg->int_rx_wbm_rel_ring_mask[context];
  1223. }
  1224. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  1225. int context)
  1226. {
  1227. return cfg->int_reo_status_ring_mask[context];
  1228. }
  1229. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1230. {
  1231. return cfg->int_rx_mon_ring_mask[context];
  1232. }
  1233. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
  1234. {
  1235. return cfg->int_ce_ring_mask[context];
  1236. }
  1237. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
  1238. {
  1239. return cfg->max_clients;
  1240. }
  1241. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1242. {
  1243. return cfg->max_alloc_size;
  1244. }
  1245. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1246. {
  1247. return cfg->per_pdev_tx_ring;
  1248. }
  1249. uint32_t
  1250. wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1251. {
  1252. return cfg->rx_pending_high_threshold;
  1253. }
  1254. uint32_t
  1255. wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
  1256. {
  1257. return cfg->rx_pending_low_threshold;
  1258. }
  1259. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1260. {
  1261. return cfg->per_pdev_lmac_ring;
  1262. }
  1263. #ifdef DP_MEMORY_OPT
  1264. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1265. {
  1266. return 1;
  1267. }
  1268. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1269. {
  1270. return 1;
  1271. }
  1272. #else
  1273. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1274. {
  1275. return cfg->num_tcl_data_rings;
  1276. }
  1277. int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1278. {
  1279. return cfg->num_nss_tcl_data_rings;
  1280. }
  1281. #endif
  1282. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1283. {
  1284. return cfg->tx_ring_size;
  1285. }
  1286. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1287. {
  1288. return cfg->tx_comp_ring_size;
  1289. }
  1290. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
  1291. {
  1292. return cfg->per_pdev_rx_ring;
  1293. }
  1294. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1295. {
  1296. return cfg->num_reo_dest_rings;
  1297. }
  1298. int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
  1299. {
  1300. return cfg->num_nss_reo_dest_rings;
  1301. }
  1302. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
  1303. {
  1304. return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/
  1305. }
  1306. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1307. {
  1308. return cfg->num_tx_desc_pool;
  1309. }
  1310. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1311. {
  1312. cfg->num_tx_desc_pool = num_pool;
  1313. }
  1314. int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
  1315. {
  1316. return cfg->num_tx_ext_desc_pool;
  1317. }
  1318. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
  1319. {
  1320. cfg->num_tx_ext_desc_pool = num_pool;
  1321. }
  1322. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1323. {
  1324. return cfg->reo_dst_ring_size;
  1325. }
  1326. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1327. int reo_dst_ring_size)
  1328. {
  1329. cfg->reo_dst_ring_size = reo_dst_ring_size;
  1330. }
  1331. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  1332. bool raw_mode_war)
  1333. {
  1334. cfg->raw_mode_war = raw_mode_war;
  1335. }
  1336. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
  1337. {
  1338. return cfg->raw_mode_war;
  1339. }
  1340. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1341. {
  1342. return cfg->num_tx_desc;
  1343. }
  1344. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
  1345. {
  1346. cfg->num_tx_desc = num_desc;
  1347. }
  1348. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1349. {
  1350. return cfg->min_tx_desc;
  1351. }
  1352. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
  1353. {
  1354. return cfg->num_tx_ext_desc;
  1355. }
  1356. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
  1357. {
  1358. cfg->num_tx_ext_desc = num_ext_desc;
  1359. }
  1360. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
  1361. {
  1362. /* TODO: This should be calculated based on target capabilities */
  1363. return cfg->max_peer_id;
  1364. }
  1365. int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1366. {
  1367. return cfg->dma_mon_buf_ring_size;
  1368. }
  1369. int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1370. {
  1371. return cfg->dma_mon_dest_ring_size;
  1372. }
  1373. int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1374. {
  1375. return cfg->dma_mon_status_ring_size;
  1376. }
  1377. int
  1378. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1379. {
  1380. return cfg->rxdma_monitor_desc_ring;
  1381. }
  1382. int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1383. {
  1384. return cfg->rx_dma_buf_ring_size;
  1385. }
  1386. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1387. {
  1388. return cfg->num_mac_rings;
  1389. }
  1390. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1391. {
  1392. return cfg->gro_enabled;
  1393. }
  1394. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1395. {
  1396. return cfg->lro_enabled;
  1397. }
  1398. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1399. {
  1400. return cfg->ipa_enabled;
  1401. }
  1402. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
  1403. {
  1404. cfg->rx_hash = val;
  1405. }
  1406. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1407. {
  1408. return cfg->rx_hash;
  1409. }
  1410. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
  1411. {
  1412. return cfg->nss_enabled;
  1413. }
  1414. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
  1415. {
  1416. cfg->nss_enabled = nss_enabled;
  1417. }
  1418. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
  1419. {
  1420. return cfg->nss_cfg;
  1421. }
  1422. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
  1423. {
  1424. cfg->nss_cfg = nss_cfg;
  1425. if (cfg->nss_cfg)
  1426. cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
  1427. }
  1428. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1429. {
  1430. return cfg->int_batch_threshold_tx;
  1431. }
  1432. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1433. {
  1434. return cfg->int_timer_threshold_tx;
  1435. }
  1436. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1437. {
  1438. return cfg->int_batch_threshold_rx;
  1439. }
  1440. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
  1441. {
  1442. return cfg->int_timer_threshold_rx;
  1443. }
  1444. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1445. {
  1446. return cfg->int_batch_threshold_other;
  1447. }
  1448. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
  1449. {
  1450. return cfg->int_timer_threshold_other;
  1451. }
  1452. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
  1453. {
  1454. return cfg->int_timer_threshold_mon;
  1455. }
  1456. int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1457. {
  1458. return cfg->p2p_tcp_udp_checksumoffload;
  1459. }
  1460. int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1461. {
  1462. return cfg->nan_tcp_udp_checksumoffload;
  1463. }
  1464. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
  1465. {
  1466. return cfg->tcp_udp_checksumoffload;
  1467. }
  1468. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
  1469. {
  1470. return cfg->rx_defrag_min_timeout;
  1471. }
  1472. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
  1473. {
  1474. return cfg->defrag_timeout_check;
  1475. }
  1476. int
  1477. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1478. {
  1479. return cfg->wbm_release_ring;
  1480. }
  1481. int
  1482. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1483. {
  1484. return cfg->tcl_cmd_credit_ring;
  1485. }
  1486. int
  1487. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1488. {
  1489. return cfg->tcl_status_ring;
  1490. }
  1491. int
  1492. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1493. {
  1494. return cfg->reo_reinject_ring;
  1495. }
  1496. int
  1497. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1498. {
  1499. return cfg->rx_release_ring;
  1500. }
  1501. int
  1502. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1503. {
  1504. return cfg->reo_exception_ring;
  1505. }
  1506. int
  1507. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1508. {
  1509. return cfg->reo_cmd_ring;
  1510. }
  1511. int
  1512. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1513. {
  1514. return cfg->reo_status_ring;
  1515. }
  1516. int
  1517. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1518. {
  1519. return cfg->rxdma_refill_ring;
  1520. }
  1521. int
  1522. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
  1523. {
  1524. return cfg->tx_desc_limit_0;
  1525. }
  1526. int
  1527. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
  1528. {
  1529. return cfg->tx_desc_limit_1;
  1530. }
  1531. int
  1532. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
  1533. {
  1534. return cfg->tx_desc_limit_2;
  1535. }
  1536. int
  1537. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
  1538. {
  1539. return cfg->tx_device_limit;
  1540. }
  1541. int
  1542. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
  1543. {
  1544. return cfg->tx_sw_internode_queue;
  1545. }
  1546. int
  1547. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1548. {
  1549. return cfg->rxdma_err_dst_ring;
  1550. }
  1551. int
  1552. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
  1553. {
  1554. return cfg->rx_sw_desc_weight;
  1555. }
  1556. int
  1557. wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
  1558. {
  1559. return cfg->rx_sw_desc_num;
  1560. }
  1561. uint32_t
  1562. wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
  1563. {
  1564. return cfg->reo_rings_mapping;
  1565. }
  1566. bool
  1567. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1568. enum cdp_capabilities dp_caps)
  1569. {
  1570. switch (dp_caps) {
  1571. case CDP_CFG_DP_TSO:
  1572. return cfg->tso_enabled;
  1573. case CDP_CFG_DP_LRO:
  1574. return cfg->lro_enabled;
  1575. case CDP_CFG_DP_SG:
  1576. return cfg->sg_enabled;
  1577. case CDP_CFG_DP_GRO:
  1578. return cfg->gro_enabled;
  1579. case CDP_CFG_DP_OL_TX_CSUM:
  1580. return cfg->ol_tx_csum_enabled;
  1581. case CDP_CFG_DP_OL_RX_CSUM:
  1582. return cfg->ol_rx_csum_enabled;
  1583. case CDP_CFG_DP_RAWMODE:
  1584. return cfg->rawmode_enabled;
  1585. case CDP_CFG_DP_PEER_FLOW_CTRL:
  1586. return cfg->peer_flow_ctrl_enabled;
  1587. default:
  1588. return false;
  1589. }
  1590. }
  1591. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1592. bool val)
  1593. {
  1594. cfg->is_tso_desc_attach_defer = val;
  1595. }
  1596. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
  1597. {
  1598. return cfg->is_tso_desc_attach_defer;
  1599. }
  1600. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1601. /**
  1602. * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
  1603. * @cfg: config context
  1604. *
  1605. * Return: stop threshold
  1606. */
  1607. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
  1608. {
  1609. return cfg->tx_flow_stop_queue_threshold;
  1610. }
  1611. /**
  1612. * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
  1613. * for TX to resume
  1614. * @cfg: config context
  1615. *
  1616. * Return: stop threshold
  1617. */
  1618. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
  1619. {
  1620. return cfg->tx_flow_start_queue_offset;
  1621. }
  1622. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1623. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1624. bool val)
  1625. {
  1626. cfg->is_rx_flow_tag_enabled = val;
  1627. }
  1628. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
  1629. {
  1630. return cfg->rx_toeplitz_hash_key;
  1631. }
  1632. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
  1633. {
  1634. return cfg->rx_flow_max_search;
  1635. }
  1636. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1637. {
  1638. return cfg->is_rx_flow_tag_enabled;
  1639. }
  1640. #ifdef WLAN_SUPPORT_RX_FISA
  1641. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1642. {
  1643. return (bool)(cfg->is_rx_fisa_enabled);
  1644. }
  1645. #else
  1646. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1647. {
  1648. return false;
  1649. }
  1650. #endif
  1651. bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1652. {
  1653. return (bool)(cfg->is_poll_mode_enabled);
  1654. }
  1655. void
  1656. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1657. bool val)
  1658. {
  1659. cfg->is_rx_flow_search_table_per_pdev = val;
  1660. }
  1661. bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
  1662. {
  1663. return cfg->is_rx_flow_search_table_per_pdev;
  1664. }
  1665. void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1666. uint16_t val)
  1667. {
  1668. cfg->rx_flow_search_table_size = val;
  1669. }
  1670. uint16_t
  1671. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
  1672. {
  1673. return cfg->rx_flow_search_table_size;
  1674. }
  1675. void
  1676. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1677. bool val)
  1678. {
  1679. cfg->is_rx_mon_protocol_flow_tag_enabled = val;
  1680. }
  1681. bool
  1682. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1683. {
  1684. return cfg->is_rx_mon_protocol_flow_tag_enabled;
  1685. }
  1686. void
  1687. wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
  1688. bool val)
  1689. {
  1690. cfg->tx_per_pkt_vdev_id_check = val;
  1691. }
  1692. bool
  1693. wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1694. {
  1695. return cfg->tx_per_pkt_vdev_id_check;
  1696. }
  1697. void
  1698. wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  1699. bool val)
  1700. {
  1701. cfg->pext_stats_enabled = val;
  1702. }
  1703. bool
  1704. wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1705. {
  1706. return cfg->pext_stats_enabled;
  1707. }
  1708. bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1709. {
  1710. return cfg->fst_in_cmem;
  1711. }
  1712. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1713. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1714. {
  1715. return cfg->is_rx_buff_pool_enabled;
  1716. }
  1717. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1718. {
  1719. return cfg->is_rx_refill_buff_pool_enabled;
  1720. }
  1721. #else
  1722. bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1723. {
  1724. return false;
  1725. }
  1726. bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
  1727. struct wlan_cfg_dp_soc_ctxt *cfg)
  1728. {
  1729. return false;
  1730. }
  1731. #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
  1732. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  1733. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1734. {
  1735. return (bool)(cfg->is_swlm_enabled);
  1736. }
  1737. #else
  1738. bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
  1739. {
  1740. return false;
  1741. }
  1742. #endif
  1743. uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1744. {
  1745. return cfg->radio0_rx_default_reo;
  1746. }
  1747. uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1748. {
  1749. return cfg->radio1_rx_default_reo;
  1750. }
  1751. uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
  1752. {
  1753. return cfg->radio2_rx_default_reo;
  1754. }
  1755. void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
  1756. {
  1757. cfg->rxdma1_enable = true;
  1758. }
  1759. bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
  1760. {
  1761. return cfg->enable_force_rx_64_ba;
  1762. }
  1763. void
  1764. wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
  1765. bool val)
  1766. {
  1767. cfg->delay_mon_replenish = val;
  1768. }
  1769. bool
  1770. wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
  1771. {
  1772. return cfg->delay_mon_replenish;
  1773. }
  1774. void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
  1775. {
  1776. dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
  1777. cfg->delay_mon_replenish);
  1778. dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
  1779. cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
  1780. }