wlan_cfg.h 22 KB

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