wlan_cfg.h 27 KB

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