wlan_cfg.h 18 KB

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