wlan_cfg.h 22 KB

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