wlan_cfg.h 20 KB

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