wlan_cfg.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * * Copyright (c) 2013-2017 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. #ifndef __WLAN_CFG_H
  19. #define __WLAN_CFG_H
  20. /*
  21. * Temporary place holders. These should come either from target config
  22. * or platform configuration
  23. */
  24. #if defined(CONFIG_MCL)
  25. #define MAX_PDEV_CNT 1
  26. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  27. /*
  28. * This mask defines how many transmit frames account for 1 NAPI work unit
  29. * 0 means each tx completion is 1 unit
  30. */
  31. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  32. #else
  33. #define MAX_PDEV_CNT 3
  34. #define WLAN_CFG_INT_NUM_CONTEXTS 4
  35. /*
  36. * This mask defines how many transmit frames account for 1 NAPI work unit
  37. * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
  38. */
  39. #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
  40. #endif
  41. /* Tx configuration */
  42. #define MAX_LINK_DESC_BANKS 8
  43. #define MAX_TXDESC_POOLS 4
  44. #define MAX_TCL_DATA_RINGS 4
  45. /* Rx configuration */
  46. #define MAX_RXDESC_POOLS 4
  47. #define MAX_REO_DEST_RINGS 4
  48. #define MAX_RX_MAC_RINGS 2
  49. /* Miscellaneous configuration */
  50. #define MAX_IDLE_SCATTER_BUFS 16
  51. #define DP_MAX_IRQ_PER_CONTEXT 12
  52. #define DP_MAX_INTERRUPT_CONTEXTS 8
  53. #define DP_MAX_INTERRUPT_CONTEXTS 8
  54. #define MAX_HTT_METADATA_LEN 32
  55. #define MAX_NUM_PEER_ID_PER_PEER 8
  56. #define DP_MAX_TIDS 17
  57. #define DP_NON_QOS_TID 16
  58. struct wlan_cfg_dp_pdev_ctxt;
  59. /**
  60. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  61. * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
  62. * @max_clients - Maximum number of peers/stations supported by device
  63. * @max_alloc_size - Maximum allocation size for any dynamic memory
  64. * allocation request for this device
  65. * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio
  66. * 1 - Each TCL ring is mapped to one radio/pdev
  67. * @num_tcl_data_rings - Number of TCL Data rings supported by device
  68. * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio
  69. * 1 - Each REO ring is mapped to one radio/pdev
  70. * @num_tx_desc_pool - Number of Tx Descriptor pools
  71. * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools
  72. * @num_tx_desc - Number of Tx Descriptors per pool
  73. * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool
  74. * @max_peer_id - Maximum value of peer id that FW can assign for a client
  75. * @htt_packet_type - Default 802.11 encapsulation type for any VAP created
  76. * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context
  77. * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context
  78. * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each
  79. * NAPI/Intr context
  80. * @int_rx_err_ring_mask - Bitmap of Rx err ring interrupts mapped to each
  81. * NAPI/Intr context
  82. * @int_wbm_rel_ring_mask - Bitmap of wbm rel ring interrupts mapped to each
  83. * NAPI/Intr context
  84. * @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
  85. * NAPI/Intr context
  86. * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
  87. * @lro_enabled - enable/disable lro feature
  88. * @rx_hash - Enable hash based steering of rx packets
  89. * @tso_enabled - enable/disable tso feature
  90. * @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets
  91. * @tcp_Udp_Checksumoffload - enable/disable checksum offload
  92. * @nss_cfg - nss configuration
  93. */
  94. struct wlan_cfg_dp_soc_ctxt {
  95. int num_int_ctxts;
  96. int max_clients;
  97. int max_alloc_size;
  98. int per_pdev_tx_ring;
  99. int num_tcl_data_rings;
  100. int per_pdev_rx_ring;
  101. int num_reo_dest_rings;
  102. int num_tx_desc_pool;
  103. int num_tx_ext_desc_pool;
  104. int num_tx_desc;
  105. int num_tx_ext_desc;
  106. int max_peer_id;
  107. int htt_packet_type;
  108. int int_batch_threshold_tx;
  109. int int_timer_threshold_tx;
  110. int int_batch_threshold_rx;
  111. int int_timer_threshold_rx;
  112. int int_batch_threshold_other;
  113. int int_timer_threshold_other;
  114. int tx_ring_size;
  115. int tx_comp_ring_size;
  116. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  117. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  118. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  119. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  120. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  121. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  122. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  123. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  124. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  125. int hw_macid[MAX_PDEV_CNT];
  126. int base_hw_macid;
  127. bool lro_enabled;
  128. bool rx_hash;
  129. bool tso_enabled;
  130. bool napi_enabled;
  131. bool tcp_udp_checksumoffload;
  132. int nss_cfg;
  133. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  134. uint32_t tx_flow_stop_queue_threshold;
  135. uint32_t tx_flow_start_queue_offset;
  136. #endif
  137. };
  138. /**
  139. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  140. *
  141. * Allocates context for Soc configuration parameters,
  142. * Read configuration information from device tree/ini file and
  143. * returns back handle
  144. *
  145. * Return: Handle to configuration context
  146. */
  147. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void);
  148. /**
  149. * wlan_cfg_soc_detach() - Detach soc configuration handle
  150. * @wlan_cfg_ctx: soc configuration handle
  151. *
  152. * De-allocates memory allocated for SoC configuration
  153. *
  154. * Return:none
  155. */
  156. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  157. /**
  158. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  159. *
  160. * Allocates context for pdev configuration parameters,
  161. * Read configuration information from device tree/ini file and
  162. * returns back handle
  163. *
  164. * Return: Handle to configuration context
  165. */
  166. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void);
  167. /**
  168. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  169. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  170. *
  171. * Return: void
  172. */
  173. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  174. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  175. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  176. int context, int mask);
  177. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  178. int context, int mask);
  179. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  180. int context, int mask);
  181. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  182. int context, int mask);
  183. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  184. int mask);
  185. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  186. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  187. int context, int mask);
  188. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  189. int context, int mask);
  190. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  191. int context, int mask);
  192. /**
  193. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  194. * @wlan_cfg_ctx - Configuration Handle
  195. *
  196. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  197. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  198. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  199. * that are processed by the handler.
  200. *
  201. * Return: num_contexts
  202. */
  203. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  204. /**
  205. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  206. * interrupt context
  207. * @wlan_cfg_ctx - Configuration Handle
  208. * @context - Numerical ID identifying the Interrupt/NAPI context
  209. *
  210. * Return: int_tx_ring_mask[context]
  211. */
  212. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  213. int context);
  214. /**
  215. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  216. * interrupt context
  217. * @wlan_cfg_ctx - Configuration Handle
  218. * @context - Numerical ID identifying the Interrupt/NAPI context
  219. *
  220. * Return: int_rx_ring_mask[context]
  221. */
  222. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  223. int context);
  224. /**
  225. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  226. * mapped to an interrupt context
  227. * @wlan_cfg_ctx - Configuration Handle
  228. * @context - Numerical ID identifying the Interrupt/NAPI context
  229. *
  230. * Return: int_rx_mon_ring_mask[context]
  231. */
  232. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  233. int context);
  234. /**
  235. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  236. * for the given interrupt context
  237. * @wlan_cfg_ctx - Configuration Handle
  238. * @context - Numerical ID identifying the Interrupt/NAPI context
  239. *
  240. */
  241. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  242. int context, int mask);
  243. /**
  244. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  245. * mapped to an interrupt context
  246. * @wlan_cfg_ctx - Configuration Handle
  247. * @context - Numerical ID identifying the Interrupt/NAPI context
  248. *
  249. * Return: int_rxdma2host_ring_mask[context]
  250. */
  251. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  252. int context);
  253. /**
  254. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  255. * for the given interrupt context
  256. * @wlan_cfg_ctx - Configuration Handle
  257. * @context - Numerical ID identifying the Interrupt/NAPI context
  258. *
  259. */
  260. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  261. int context, int mask);
  262. /**
  263. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  264. * mapped to an interrupt context
  265. * @wlan_cfg_ctx - Configuration Handle
  266. * @context - Numerical ID identifying the Interrupt/NAPI context
  267. *
  268. * Return: int_host2rxdma_ring_mask[context]
  269. */
  270. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  271. int context);
  272. /**
  273. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  274. *
  275. * @wlan_cfg_ctx - Configuration Handle
  276. * @pdev_idx - Index of SW PDEV
  277. * @hw_macid - HW MAC Id
  278. *
  279. */
  280. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  281. int hw_macid);
  282. /**
  283. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  284. *
  285. * @wlan_cfg_ctx - Configuration Handle
  286. * @pdev_idx - Index of SW PDEV
  287. *
  288. * Return: HW MAC Id
  289. */
  290. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  291. /**
  292. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  293. * PDEV index
  294. *
  295. * @wlan_cfg_ctx - Configuration Handle
  296. * @pdev_idx - Index of SW PDEV
  297. *
  298. * Return: HW MAC index
  299. */
  300. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  301. /**
  302. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  303. * mapped to an interrupt context
  304. * @wlan_cfg_ctx - Configuration Handle
  305. * @context - Numerical ID identifying the Interrupt/NAPI context
  306. *
  307. * Return: int_rx_err_ring_mask[context]
  308. */
  309. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  310. context);
  311. /**
  312. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  313. * mapped to an interrupt context
  314. * @wlan_cfg_ctx - Configuration Handle
  315. * @context - Numerical ID identifying the Interrupt/NAPI context
  316. *
  317. * Return: int_wbm_rel_ring_mask[context]
  318. */
  319. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  320. context);
  321. /**
  322. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  323. * mapped to an interrupt context
  324. * @wlan_cfg_ctx - Configuration Handle
  325. * @context - Numerical ID identifying the Interrupt/NAPI context
  326. *
  327. * Return: int_reo_status_ring_mask[context]
  328. */
  329. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  330. context);
  331. /**
  332. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  333. * mapped to an interrupt context
  334. * @wlan_cfg_ctx - Configuration Handle
  335. * @context - Numerical ID identifying the Interrupt/NAPI context
  336. *
  337. * Return: int_ce_ring_mask[context]
  338. */
  339. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  340. int context);
  341. /**
  342. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  343. * supported by device
  344. * @wlan_cfg_ctx - Configuration Handle
  345. *
  346. * Return: max_clients
  347. */
  348. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  349. /**
  350. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  351. * memory allocation request for this device
  352. * @wlan_cfg_ctx - Configuration Handle
  353. *
  354. * Return: max_alloc_size
  355. */
  356. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  357. /*
  358. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  359. * one per radio
  360. * @wlan_cfg_ctx - Configuration Handle
  361. *
  362. * Return: per_pdev_tx_ring
  363. */
  364. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  365. /*
  366. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  367. * @wlan_cfg_ctx
  368. *
  369. * Return: num_tcl_data_rings
  370. */
  371. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  372. /*
  373. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  374. * one per radio
  375. * @wlan_cfg_ctx
  376. *
  377. * Return: per_pdev_rx_ring
  378. */
  379. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  380. /*
  381. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  382. * @wlan_cfg_ctx - Configuration Handle
  383. *
  384. * Return: num_reo_dest_rings
  385. */
  386. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  387. /*
  388. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  389. * @wlan_cfg_ctx - Configuration Handle
  390. *
  391. * Return: htt_pkt_type_ethernet
  392. */
  393. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  394. /*
  395. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  396. * device
  397. * @wlan_cfg_ctx - Configuration Handle
  398. *
  399. * Return: num_tx_desc_pool
  400. */
  401. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  402. /*
  403. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  404. * pools
  405. * @wlan_cfg_ctx - Configuration Handle
  406. *
  407. * Return: num_tx_ext_desc_pool
  408. */
  409. int wlan_cfg_get_num_tx_ext_desc_pool(
  410. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  411. /*
  412. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  413. * @wlan_cfg_ctx - Configuration Handle
  414. *
  415. * Return: num_tx_desc
  416. */
  417. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  418. /*
  419. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  420. * per pool
  421. * @wlan_cfg_ctx - Configuration Handle
  422. *
  423. * Return: num_tx_ext_desc
  424. */
  425. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  426. /*
  427. * wlan_cfg_max_peer_id() - Get maximum peer ID
  428. * @cfg: Configuration Handle
  429. *
  430. * Return: maximum peer ID
  431. */
  432. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  433. /*
  434. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  435. * @wlan_cfg_pdev_ctx
  436. *
  437. * Return: dma_mon_buf_ring_size
  438. */
  439. int wlan_cfg_get_dma_mon_buf_ring_size(
  440. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  441. /*
  442. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  443. * Destination ring
  444. * @wlan_cfg_pdev_ctx
  445. *
  446. * Return: dma_mon_dest_size
  447. */
  448. int wlan_cfg_get_dma_mon_dest_ring_size(
  449. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  450. /*
  451. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  452. * @wlan_cfg_pdev_ctx
  453. *
  454. * Return: dma_mon_stat_ring_size
  455. */
  456. int wlan_cfg_get_dma_mon_stat_ring_size(
  457. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  458. /*
  459. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  460. * @wlan_cfg_pdev_ctx
  461. *
  462. * Return: rx_dma_buf_ring_size
  463. */
  464. int wlan_cfg_get_rx_dma_buf_ring_size(
  465. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  466. /*
  467. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  468. * per pdev
  469. * @wlan_cfg_pdev_ctx
  470. *
  471. * Return: number of mac DMA rings per pdev
  472. */
  473. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  474. /*
  475. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  476. * @wlan_cfg_pdev_ctx
  477. *
  478. * Return: true - LRO enabled false - LRO disabled
  479. */
  480. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  481. /*
  482. * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled
  483. * @wlan_cfg_pdev_ctx
  484. *
  485. * Return: true - enabled false - disabled
  486. */
  487. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  488. /*
  489. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  490. * @wlan_cfg_soc_ctx
  491. * @rx_hash
  492. */
  493. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  494. /*
  495. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  496. * @wlan_cfg_pdev_ctx
  497. *
  498. * Return: 1 - enabled 0 - disabled
  499. */
  500. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  501. /*
  502. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  503. * @wlan_cfg_pdev_ctx
  504. */
  505. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  506. /*
  507. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  508. * @wlan_cfg_pdev_ctx
  509. *
  510. * Return: nss_cfg
  511. */
  512. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  513. /*
  514. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  515. * @wlan_cfg_pdev_ctx
  516. *
  517. */
  518. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  519. /*
  520. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  521. * @wlan_cfg_soc_ctx
  522. *
  523. * Return: Batch threshold
  524. */
  525. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  526. /*
  527. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  528. * @wlan_cfg_soc_ctx
  529. *
  530. * Return: Timer threshold
  531. */
  532. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  533. /*
  534. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  535. * @wlan_cfg_soc_ctx
  536. *
  537. * Return: Batch threshold
  538. */
  539. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  540. /*
  541. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  542. * @wlan_cfg_soc_ctx
  543. *
  544. * Return: Timer threshold
  545. */
  546. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  547. /*
  548. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  549. * @wlan_cfg_soc_ctx
  550. *
  551. * Return: Batch threshold
  552. */
  553. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  554. /*
  555. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  556. * @wlan_cfg_soc_ctx
  557. *
  558. * Return: Timer threshold
  559. */
  560. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  561. /*
  562. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  563. * @wlan_cfg_soc_ctx
  564. *
  565. * Return: Tx Ring Size
  566. */
  567. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  568. /*
  569. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  570. * @wlan_cfg_soc_ctx
  571. *
  572. * Return: Tx Completion ring size
  573. */
  574. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  575. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  576. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  577. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  578. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  579. #endif