wlan_cfg.h 20 KB

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