wlan_cfg.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  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. #define WLAN_CFG_RXDMA1_ENABLE 1
  28. /*
  29. * This mask defines how many transmit frames account for 1 NAPI work unit
  30. * 0 means each tx completion is 1 unit
  31. */
  32. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  33. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  34. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
  35. #define NUM_RXDMA_RINGS_PER_PDEV 2
  36. #else
  37. #define MAX_PDEV_CNT 3
  38. #define WLAN_CFG_INT_NUM_CONTEXTS 11
  39. #define WLAN_CFG_RXDMA1_ENABLE 1
  40. /*
  41. * This mask defines how many transmit frames account for 1 NAPI work unit
  42. * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
  43. */
  44. #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
  45. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  46. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
  47. #define NUM_RXDMA_RINGS_PER_PDEV 1
  48. #endif
  49. /* Tx configuration */
  50. #define MAX_LINK_DESC_BANKS 8
  51. #define MAX_TXDESC_POOLS 4
  52. #define MAX_TCL_DATA_RINGS 4
  53. /* Rx configuration */
  54. #define MAX_RXDESC_POOLS 4
  55. #define MAX_REO_DEST_RINGS 4
  56. #define MAX_RX_MAC_RINGS 2
  57. /* DP process status */
  58. #ifdef CONFIG_MCL
  59. #define CONFIG_PROCESS_RX_STATUS 1
  60. #define CONFIG_PROCESS_TX_STATUS 1
  61. #else
  62. #define CONFIG_PROCESS_RX_STATUS 0
  63. #define CONFIG_PROCESS_TX_STATUS 0
  64. #endif
  65. /* Miscellaneous configuration */
  66. #define MAX_IDLE_SCATTER_BUFS 16
  67. #define DP_MAX_IRQ_PER_CONTEXT 12
  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
  99. * each 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. * @lro_enabled: enable/disable LRO feature
  105. * @sg_enabled: enable disable scatter gather feature
  106. * @gro_enabled: enable disable GRO feature
  107. * @ipa_enabled: Flag indicating if IPA is enabled
  108. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  109. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  110. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  111. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  112. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  113. * @tcp_udp_checksumoffload: enable/disable checksum offload
  114. * @nss_cfg: nss configuration
  115. * @rx_defrag_min_timeout: rx defrag minimum timeout
  116. * @wbm_release_ring: wbm release ring size
  117. * @tcl_cmd_ring: tcl cmd ring size
  118. * @tcl_status_ring: tcl status ring size
  119. * @reo_reinject_ring: reo reinject ring
  120. * @rx_release_ring: rx release ring size
  121. * @reo_exception_ring: reo exception ring size
  122. * @reo_cmd_ring: reo cmd ring size
  123. * @reo_status_ring: reo status ting size
  124. * @rxdma_refill_ring: rxdma refill ring size
  125. * @rxdma_err_dst_ring: rxdma error detination ring size
  126. * @raw_mode_war: enable/disable raw mode war
  127. */
  128. struct wlan_cfg_dp_soc_ctxt {
  129. int num_int_ctxts;
  130. int max_clients;
  131. int max_alloc_size;
  132. int per_pdev_tx_ring;
  133. int num_tcl_data_rings;
  134. int per_pdev_rx_ring;
  135. int per_pdev_lmac_ring;
  136. int num_reo_dest_rings;
  137. int num_tx_desc_pool;
  138. int num_tx_ext_desc_pool;
  139. int num_tx_desc;
  140. int num_tx_ext_desc;
  141. int max_peer_id;
  142. int htt_packet_type;
  143. int int_batch_threshold_tx;
  144. int int_timer_threshold_tx;
  145. int int_batch_threshold_rx;
  146. int int_timer_threshold_rx;
  147. int int_batch_threshold_other;
  148. int int_timer_threshold_other;
  149. int tx_ring_size;
  150. int tx_comp_ring_size;
  151. int tx_comp_ring_size_nss;
  152. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  153. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  154. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  155. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  156. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  157. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  158. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  159. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  160. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  161. int hw_macid[MAX_PDEV_CNT];
  162. int base_hw_macid;
  163. bool rx_hash;
  164. bool tso_enabled;
  165. bool lro_enabled;
  166. bool sg_enabled;
  167. bool gro_enabled;
  168. bool ipa_enabled;
  169. bool ol_tx_csum_enabled;
  170. bool ol_rx_csum_enabled;
  171. bool rawmode_enabled;
  172. bool peer_flow_ctrl_enabled;
  173. bool napi_enabled;
  174. bool tcp_udp_checksumoffload;
  175. bool defrag_timeout_check;
  176. int nss_cfg;
  177. uint32_t tx_flow_stop_queue_threshold;
  178. uint32_t tx_flow_start_queue_offset;
  179. int rx_defrag_min_timeout;
  180. int reo_dst_ring_size;
  181. int wbm_release_ring;
  182. int tcl_cmd_ring;
  183. int tcl_status_ring;
  184. int reo_reinject_ring;
  185. int rx_release_ring;
  186. int reo_exception_ring;
  187. int reo_cmd_ring;
  188. int reo_status_ring;
  189. int rxdma_refill_ring;
  190. int rxdma_err_dst_ring;
  191. bool raw_mode_war;
  192. bool enable_data_stall_detection;
  193. bool disable_intra_bss_fwd;
  194. bool rxdma1_enable;
  195. };
  196. /**
  197. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  198. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  199. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  200. * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  201. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  202. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  203. */
  204. struct wlan_cfg_dp_pdev_ctxt {
  205. int rx_dma_buf_ring_size;
  206. int dma_mon_buf_ring_size;
  207. int dma_mon_dest_ring_size;
  208. int dma_mon_status_ring_size;
  209. int rxdma_monitor_desc_ring;
  210. int num_mac_rings;
  211. int nss_enabled;
  212. };
  213. /**
  214. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  215. * @ctrl_obj - PSOC object
  216. *
  217. * Allocates context for Soc configuration parameters,
  218. * Read configuration information from device tree/ini file and
  219. * returns back handle
  220. *
  221. * Return: Handle to configuration context
  222. */
  223. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj);
  224. /**
  225. * wlan_cfg_soc_detach() - Detach soc configuration handle
  226. * @wlan_cfg_ctx: soc configuration handle
  227. *
  228. * De-allocates memory allocated for SoC configuration
  229. *
  230. * Return:none
  231. */
  232. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  233. /**
  234. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  235. * @ctrl_obj - PSOC object
  236. *
  237. * Allocates context for pdev configuration parameters,
  238. * Read configuration information from device tree/ini file and
  239. * returns back handle
  240. *
  241. * Return: Handle to configuration context
  242. */
  243. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj);
  244. /**
  245. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  246. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  247. *
  248. * Return: void
  249. */
  250. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  251. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  252. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  253. int context, int mask);
  254. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  255. int context, int mask);
  256. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  257. int context, int mask);
  258. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  259. int context, int mask);
  260. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  261. int mask);
  262. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  263. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  264. int context, int mask);
  265. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  266. int context, int mask);
  267. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  268. int context, int mask);
  269. /**
  270. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  271. * @wlan_cfg_ctx - Configuration Handle
  272. *
  273. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  274. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  275. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  276. * that are processed by the handler.
  277. *
  278. * Return: num_contexts
  279. */
  280. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  281. /**
  282. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  283. * interrupt context
  284. * @wlan_cfg_ctx - Configuration Handle
  285. * @context - Numerical ID identifying the Interrupt/NAPI context
  286. *
  287. * Return: int_tx_ring_mask[context]
  288. */
  289. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  290. int context);
  291. /**
  292. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  293. * interrupt context
  294. * @wlan_cfg_ctx - Configuration Handle
  295. * @context - Numerical ID identifying the Interrupt/NAPI context
  296. *
  297. * Return: int_rx_ring_mask[context]
  298. */
  299. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  300. int context);
  301. /**
  302. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  303. * mapped to an interrupt context
  304. * @wlan_cfg_ctx - Configuration Handle
  305. * @context - Numerical ID identifying the Interrupt/NAPI context
  306. *
  307. * Return: int_rx_mon_ring_mask[context]
  308. */
  309. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  310. int context);
  311. /**
  312. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  313. * for the given interrupt context
  314. * @wlan_cfg_ctx - Configuration Handle
  315. * @context - Numerical ID identifying the Interrupt/NAPI context
  316. *
  317. */
  318. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  319. int context, int mask);
  320. /**
  321. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host 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_rxdma2host_ring_mask[context]
  327. */
  328. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  329. int context);
  330. /**
  331. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  332. * for the given interrupt context
  333. * @wlan_cfg_ctx - Configuration Handle
  334. * @context - Numerical ID identifying the Interrupt/NAPI context
  335. *
  336. */
  337. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  338. int context, int mask);
  339. /**
  340. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  341. * mapped to an interrupt context
  342. * @wlan_cfg_ctx - Configuration Handle
  343. * @context - Numerical ID identifying the Interrupt/NAPI context
  344. *
  345. * Return: int_host2rxdma_ring_mask[context]
  346. */
  347. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  348. int context);
  349. /**
  350. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  351. *
  352. * @wlan_cfg_ctx - Configuration Handle
  353. * @pdev_idx - Index of SW PDEV
  354. * @hw_macid - HW MAC Id
  355. *
  356. */
  357. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  358. int hw_macid);
  359. /**
  360. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  361. *
  362. * @wlan_cfg_ctx - Configuration Handle
  363. * @pdev_idx - Index of SW PDEV
  364. *
  365. * Return: HW MAC Id
  366. */
  367. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  368. /**
  369. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  370. * PDEV index
  371. *
  372. * @wlan_cfg_ctx - Configuration Handle
  373. * @pdev_idx - Index of SW PDEV
  374. *
  375. * Return: HW MAC index
  376. */
  377. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  378. /**
  379. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  380. * mapped to an interrupt context
  381. * @wlan_cfg_ctx - Configuration Handle
  382. * @context - Numerical ID identifying the Interrupt/NAPI context
  383. *
  384. * Return: int_rx_err_ring_mask[context]
  385. */
  386. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  387. context);
  388. /**
  389. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  390. * mapped to an interrupt context
  391. * @wlan_cfg_ctx - Configuration Handle
  392. * @context - Numerical ID identifying the Interrupt/NAPI context
  393. *
  394. * Return: int_wbm_rel_ring_mask[context]
  395. */
  396. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  397. context);
  398. /**
  399. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  400. * mapped to an interrupt context
  401. * @wlan_cfg_ctx - Configuration Handle
  402. * @context - Numerical ID identifying the Interrupt/NAPI context
  403. *
  404. * Return: int_reo_status_ring_mask[context]
  405. */
  406. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  407. context);
  408. /**
  409. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  410. * mapped to an interrupt context
  411. * @wlan_cfg_ctx - Configuration Handle
  412. * @context - Numerical ID identifying the Interrupt/NAPI context
  413. *
  414. * Return: int_ce_ring_mask[context]
  415. */
  416. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  417. int context);
  418. /**
  419. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  420. * supported by device
  421. * @wlan_cfg_ctx - Configuration Handle
  422. *
  423. * Return: max_clients
  424. */
  425. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  426. /**
  427. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  428. * memory allocation request for this device
  429. * @wlan_cfg_ctx - Configuration Handle
  430. *
  431. * Return: max_alloc_size
  432. */
  433. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  434. /*
  435. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  436. * one per radio
  437. * @wlan_cfg_ctx - Configuration Handle
  438. *
  439. * Return: per_pdev_tx_ring
  440. */
  441. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  442. /*
  443. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  444. * @wlan_cfg_ctx
  445. *
  446. * Return: num_tcl_data_rings
  447. */
  448. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  449. /*
  450. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  451. * one per radio
  452. * @wlan_cfg_ctx
  453. *
  454. * Return: per_pdev_rx_ring
  455. */
  456. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  457. /*
  458. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  459. * one per radio
  460. * @wlan_cfg_ctx
  461. *
  462. * Return: return 1 if per pdev error ring else 0
  463. */
  464. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  465. /*
  466. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  467. * @wlan_cfg_ctx - Configuration Handle
  468. *
  469. * Return: num_reo_dest_rings
  470. */
  471. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  472. /*
  473. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  474. * @wlan_cfg_ctx - Configuration Handle
  475. *
  476. * Return: htt_pkt_type_ethernet
  477. */
  478. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  479. /*
  480. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  481. * device
  482. * @wlan_cfg_ctx - Configuration Handle
  483. *
  484. * Return: num_tx_desc_pool
  485. */
  486. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  487. /*
  488. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  489. * device
  490. * @wlan_cfg_ctx - Configuration Handle
  491. * @num_pool - Number of pool
  492. */
  493. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  494. /*
  495. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  496. * pools
  497. * @wlan_cfg_ctx - Configuration Handle
  498. *
  499. * Return: num_tx_ext_desc_pool
  500. */
  501. int wlan_cfg_get_num_tx_ext_desc_pool(
  502. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  503. /*
  504. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  505. *
  506. * @wlan_cfg_ctx - Configuration Handle
  507. *
  508. * Return: reo_dst_ring_size
  509. */
  510. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  511. /*
  512. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  513. *
  514. * @wlan_cfg_ctx - Configuration Handle
  515. * @reo_dst_ring_size - REO Destination ring size
  516. */
  517. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  518. int reo_dst_ring_size);
  519. /*
  520. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  521. *
  522. * @wlan_cfg_ctx - Configuration Handle
  523. * @raw_mode_war - raw mode war configuration
  524. */
  525. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  526. bool raw_mode_war);
  527. /*
  528. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  529. *
  530. * @wlan_cfg_ctx - Configuration Handle
  531. *
  532. * Return: reo_dst_ring_size
  533. */
  534. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  535. /*
  536. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  537. * pools
  538. * @wlan_cfg_ctx - Configuration Handle
  539. * @num_pool - Number of pool
  540. */
  541. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  542. /*
  543. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  544. * @wlan_cfg_ctx - Configuration Handle
  545. *
  546. * Return: num_tx_desc
  547. */
  548. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  549. /*
  550. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  551. *
  552. * @wlan_cfg_ctx - Configuration Handle
  553. * @num_desc: Number of descriptor
  554. */
  555. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  556. /*
  557. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  558. * per pool
  559. * @wlan_cfg_ctx - Configuration Handle
  560. *
  561. * Return: num_tx_ext_desc
  562. */
  563. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  564. /*
  565. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  566. * per pool
  567. * @wlan_cfg_ctx - Configuration Handle
  568. * @num_desc: Number of descriptor
  569. */
  570. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  571. /*
  572. * wlan_cfg_max_peer_id() - Get maximum peer ID
  573. * @cfg: Configuration Handle
  574. *
  575. * Return: maximum peer ID
  576. */
  577. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  578. /*
  579. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  580. * @wlan_cfg_pdev_ctx
  581. *
  582. * Return: dma_mon_buf_ring_size
  583. */
  584. int wlan_cfg_get_dma_mon_buf_ring_size(
  585. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  586. /*
  587. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  588. * Destination ring
  589. * @wlan_cfg_pdev_ctx
  590. *
  591. * Return: dma_mon_dest_size
  592. */
  593. int wlan_cfg_get_dma_mon_dest_ring_size(
  594. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  595. /*
  596. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  597. * @wlan_cfg_pdev_ctx
  598. *
  599. * Return: dma_mon_stat_ring_size
  600. */
  601. int wlan_cfg_get_dma_mon_stat_ring_size(
  602. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  603. /*
  604. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  605. * @wlan_cfg_soc_ctx
  606. *
  607. * Return: rxdma monitor desc ring size
  608. */
  609. int
  610. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  611. /*
  612. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  613. * @wlan_cfg_pdev_ctx
  614. *
  615. * Return: rx_dma_buf_ring_size
  616. */
  617. int wlan_cfg_get_rx_dma_buf_ring_size(
  618. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  619. /*
  620. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  621. * per pdev
  622. * @wlan_cfg_pdev_ctx
  623. *
  624. * Return: number of mac DMA rings per pdev
  625. */
  626. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  627. /*
  628. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  629. * @wlan_cfg_dp_soc_ctxt
  630. *
  631. * Return: true - LRO enabled false - LRO disabled
  632. */
  633. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  634. /*
  635. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  636. * @wlan_cfg_dp_soc_ctxt
  637. *
  638. * Return: true - enabled false - disabled
  639. */
  640. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  641. /*
  642. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  643. * @wlan_cfg_dp_soc_ctxt
  644. *
  645. * Return: true - enabled false - disabled
  646. */
  647. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  648. /*
  649. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  650. * @wlan_cfg_soc_ctx
  651. * @rx_hash
  652. */
  653. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  654. /*
  655. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  656. * @wlan_cfg_pdev_ctx
  657. *
  658. * Return: 1 - enabled 0 - disabled
  659. */
  660. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  661. /*
  662. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  663. * @wlan_cfg_pdev_ctx
  664. */
  665. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  666. /*
  667. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  668. * @wlan_cfg_pdev_ctx
  669. *
  670. * Return: nss_cfg
  671. */
  672. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  673. /*
  674. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  675. * @wlan_cfg_pdev_ctx
  676. *
  677. */
  678. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  679. /*
  680. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  681. * @wlan_cfg_soc_ctx
  682. *
  683. * Return: Batch threshold
  684. */
  685. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  686. /*
  687. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  688. * @wlan_cfg_soc_ctx
  689. *
  690. * Return: Timer threshold
  691. */
  692. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  693. /*
  694. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  695. * @wlan_cfg_soc_ctx
  696. *
  697. * Return: Batch threshold
  698. */
  699. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  700. /*
  701. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  702. * @wlan_cfg_soc_ctx
  703. *
  704. * Return: Timer threshold
  705. */
  706. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  707. /*
  708. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  709. * @wlan_cfg_soc_ctx
  710. *
  711. * Return: Batch threshold
  712. */
  713. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  714. /*
  715. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  716. * @wlan_cfg_soc_ctx
  717. *
  718. * Return: Timer threshold
  719. */
  720. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  721. /*
  722. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  723. * @wlan_cfg_soc_ctx
  724. *
  725. * Return: Checksum offload enable or disable
  726. */
  727. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  728. /*
  729. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  730. * @wlan_cfg_soc_ctx
  731. *
  732. * Return: Tx Ring Size
  733. */
  734. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  735. /*
  736. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  737. * @wlan_cfg_soc_ctx
  738. *
  739. * Return: Tx Completion ring size
  740. */
  741. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  742. /*
  743. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  744. * @wlan_cfg_soc_ctx
  745. *
  746. * Return: wbm_release_ring size
  747. */
  748. int
  749. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  750. /*
  751. * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
  752. * @wlan_cfg_soc_ctx
  753. *
  754. * Return: tcl_cmd_ring size
  755. */
  756. int
  757. wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  758. /*
  759. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  760. * @wlan_cfg_soc_ctx
  761. *
  762. * Return: tcl_status_ring size
  763. */
  764. int
  765. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  766. /*
  767. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  768. * @wlan_cfg_soc_ctx
  769. *
  770. * Return: reo_reinject_ring size
  771. */
  772. int
  773. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  774. /*
  775. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  776. * @wlan_cfg_soc_ctx
  777. *
  778. * Return: rx_release_ring size
  779. */
  780. int
  781. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  782. /*
  783. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  784. * @wlan_cfg_soc_ctx
  785. *
  786. * Return: reo_exception_ring size
  787. */
  788. int
  789. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  790. /*
  791. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  792. * @wlan_cfg_soc_ctx
  793. *
  794. * Return: reo_cmd_ring size
  795. */
  796. int
  797. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  798. /*
  799. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  800. * @wlan_cfg_soc_ctx
  801. *
  802. * Return: reo_status_ring size
  803. */
  804. int
  805. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  806. /*
  807. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  808. * @wlan_cfg_soc_ctx
  809. *
  810. * Return: rxdma refill ring size
  811. */
  812. int
  813. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  814. /*
  815. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  816. * @wlan_cfg_soc_ctx
  817. *
  818. * Return: rxdma error dst ring size
  819. */
  820. int
  821. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  822. /*
  823. * wlan_cfg_get_dp_caps - Get dp capablities
  824. * @wlan_cfg_soc_ctx
  825. * @dp_caps: enum for dp capablities
  826. *
  827. * Return: bool if a dp capabilities is enabled
  828. */
  829. bool
  830. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  831. enum cdp_capabilities dp_caps);
  832. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  833. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  834. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  835. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  836. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  837. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  838. #endif