wlan_cfg.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. /*
  2. * * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef __WLAN_CFG_H
  19. #define __WLAN_CFG_H
  20. /*
  21. * Temporary place holders. These should come either from target config
  22. * or platform configuration
  23. */
  24. #if defined(CONFIG_MCL)
  25. #define MAX_PDEV_CNT 1
  26. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  27. /*
  28. * This mask defines how many transmit frames account for 1 NAPI work unit
  29. * 0 means each tx completion is 1 unit
  30. */
  31. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  32. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  33. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
  34. #define NUM_RXDMA_RINGS_PER_PDEV 2
  35. #else
  36. #define MAX_PDEV_CNT 3
  37. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  38. /*
  39. * This mask defines how many transmit frames account for 1 NAPI work unit
  40. * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
  41. */
  42. #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
  43. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  44. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
  45. #define NUM_RXDMA_RINGS_PER_PDEV 1
  46. #endif
  47. /* Tx configuration */
  48. #define MAX_LINK_DESC_BANKS 8
  49. #define MAX_TXDESC_POOLS 4
  50. #define MAX_TCL_DATA_RINGS 4
  51. /* Rx configuration */
  52. #define MAX_RXDESC_POOLS 4
  53. #define MAX_REO_DEST_RINGS 4
  54. #define MAX_RX_MAC_RINGS 2
  55. /* DP process status */
  56. #ifdef CONFIG_MCL
  57. #define CONFIG_PROCESS_RX_STATUS 1
  58. #define CONFIG_PROCESS_TX_STATUS 1
  59. #else
  60. #define CONFIG_PROCESS_RX_STATUS 0
  61. #define CONFIG_PROCESS_TX_STATUS 0
  62. #endif
  63. /* Miscellaneous configuration */
  64. #define MAX_IDLE_SCATTER_BUFS 16
  65. #define DP_MAX_IRQ_PER_CONTEXT 12
  66. #define DP_MAX_INTERRUPT_CONTEXTS 8
  67. #define DP_MAX_INTERRUPT_CONTEXTS 8
  68. #define MAX_HTT_METADATA_LEN 32
  69. #define MAX_NUM_PEER_ID_PER_PEER 8
  70. #define DP_MAX_TIDS 17
  71. #define DP_NON_QOS_TID 16
  72. struct wlan_cfg_dp_pdev_ctxt;
  73. /**
  74. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  75. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  76. * @max_clients: Maximum number of peers/stations supported by device
  77. * @max_alloc_size: Maximum allocation size for any dynamic memory
  78. * allocation request for this device
  79. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  80. * 1: Each TCL ring is mapped to one radio/pdev
  81. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  82. * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
  83. * 1: Each REO ring is mapped to one radio/pdev
  84. * @num_tx_desc_pool: Number of Tx Descriptor pools
  85. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  86. * @num_tx_desc: Number of Tx Descriptors per pool
  87. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  88. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  89. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  90. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  91. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  92. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  93. * NAPI/Intr context
  94. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  95. * NAPI/Intr context
  96. * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  97. * NAPI/Intr context
  98. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  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. };
  195. /**
  196. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  197. * @ctrl_obj - PSOC object
  198. *
  199. * Allocates context for Soc configuration parameters,
  200. * Read configuration information from device tree/ini file and
  201. * returns back handle
  202. *
  203. * Return: Handle to configuration context
  204. */
  205. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj);
  206. /**
  207. * wlan_cfg_soc_detach() - Detach soc configuration handle
  208. * @wlan_cfg_ctx: soc configuration handle
  209. *
  210. * De-allocates memory allocated for SoC configuration
  211. *
  212. * Return:none
  213. */
  214. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  215. /**
  216. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  217. * @ctrl_obj - PSOC object
  218. *
  219. * Allocates context for pdev configuration parameters,
  220. * Read configuration information from device tree/ini file and
  221. * returns back handle
  222. *
  223. * Return: Handle to configuration context
  224. */
  225. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj);
  226. /**
  227. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  228. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  229. *
  230. * Return: void
  231. */
  232. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  233. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  234. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  235. int context, int mask);
  236. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  237. int context, int mask);
  238. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  239. int context, int mask);
  240. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  241. int context, int mask);
  242. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  243. int mask);
  244. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  245. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  246. int context, int mask);
  247. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  248. int context, int mask);
  249. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  250. int context, int mask);
  251. /**
  252. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  253. * @wlan_cfg_ctx - Configuration Handle
  254. *
  255. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  256. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  257. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  258. * that are processed by the handler.
  259. *
  260. * Return: num_contexts
  261. */
  262. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  263. /**
  264. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  265. * interrupt context
  266. * @wlan_cfg_ctx - Configuration Handle
  267. * @context - Numerical ID identifying the Interrupt/NAPI context
  268. *
  269. * Return: int_tx_ring_mask[context]
  270. */
  271. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  272. int context);
  273. /**
  274. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  275. * interrupt context
  276. * @wlan_cfg_ctx - Configuration Handle
  277. * @context - Numerical ID identifying the Interrupt/NAPI context
  278. *
  279. * Return: int_rx_ring_mask[context]
  280. */
  281. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  282. int context);
  283. /**
  284. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  285. * mapped to an interrupt context
  286. * @wlan_cfg_ctx - Configuration Handle
  287. * @context - Numerical ID identifying the Interrupt/NAPI context
  288. *
  289. * Return: int_rx_mon_ring_mask[context]
  290. */
  291. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  292. int context);
  293. /**
  294. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  295. * for the given interrupt context
  296. * @wlan_cfg_ctx - Configuration Handle
  297. * @context - Numerical ID identifying the Interrupt/NAPI context
  298. *
  299. */
  300. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  301. int context, int mask);
  302. /**
  303. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  304. * mapped to an interrupt context
  305. * @wlan_cfg_ctx - Configuration Handle
  306. * @context - Numerical ID identifying the Interrupt/NAPI context
  307. *
  308. * Return: int_rxdma2host_ring_mask[context]
  309. */
  310. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  311. int context);
  312. /**
  313. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  314. * for the given interrupt context
  315. * @wlan_cfg_ctx - Configuration Handle
  316. * @context - Numerical ID identifying the Interrupt/NAPI context
  317. *
  318. */
  319. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  320. int context, int mask);
  321. /**
  322. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  323. * mapped to an interrupt context
  324. * @wlan_cfg_ctx - Configuration Handle
  325. * @context - Numerical ID identifying the Interrupt/NAPI context
  326. *
  327. * Return: int_host2rxdma_ring_mask[context]
  328. */
  329. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  330. int context);
  331. /**
  332. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  333. *
  334. * @wlan_cfg_ctx - Configuration Handle
  335. * @pdev_idx - Index of SW PDEV
  336. * @hw_macid - HW MAC Id
  337. *
  338. */
  339. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  340. int hw_macid);
  341. /**
  342. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  343. *
  344. * @wlan_cfg_ctx - Configuration Handle
  345. * @pdev_idx - Index of SW PDEV
  346. *
  347. * Return: HW MAC Id
  348. */
  349. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  350. /**
  351. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  352. * PDEV index
  353. *
  354. * @wlan_cfg_ctx - Configuration Handle
  355. * @pdev_idx - Index of SW PDEV
  356. *
  357. * Return: HW MAC index
  358. */
  359. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  360. /**
  361. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  362. * mapped to an interrupt context
  363. * @wlan_cfg_ctx - Configuration Handle
  364. * @context - Numerical ID identifying the Interrupt/NAPI context
  365. *
  366. * Return: int_rx_err_ring_mask[context]
  367. */
  368. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  369. context);
  370. /**
  371. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  372. * mapped to an interrupt context
  373. * @wlan_cfg_ctx - Configuration Handle
  374. * @context - Numerical ID identifying the Interrupt/NAPI context
  375. *
  376. * Return: int_wbm_rel_ring_mask[context]
  377. */
  378. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  379. context);
  380. /**
  381. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  382. * mapped to an interrupt context
  383. * @wlan_cfg_ctx - Configuration Handle
  384. * @context - Numerical ID identifying the Interrupt/NAPI context
  385. *
  386. * Return: int_reo_status_ring_mask[context]
  387. */
  388. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  389. context);
  390. /**
  391. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  392. * mapped to an interrupt context
  393. * @wlan_cfg_ctx - Configuration Handle
  394. * @context - Numerical ID identifying the Interrupt/NAPI context
  395. *
  396. * Return: int_ce_ring_mask[context]
  397. */
  398. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  399. int context);
  400. /**
  401. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  402. * supported by device
  403. * @wlan_cfg_ctx - Configuration Handle
  404. *
  405. * Return: max_clients
  406. */
  407. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  408. /**
  409. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  410. * memory allocation request for this device
  411. * @wlan_cfg_ctx - Configuration Handle
  412. *
  413. * Return: max_alloc_size
  414. */
  415. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  416. /*
  417. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  418. * one per radio
  419. * @wlan_cfg_ctx - Configuration Handle
  420. *
  421. * Return: per_pdev_tx_ring
  422. */
  423. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  424. /*
  425. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  426. * @wlan_cfg_ctx
  427. *
  428. * Return: num_tcl_data_rings
  429. */
  430. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  431. /*
  432. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  433. * one per radio
  434. * @wlan_cfg_ctx
  435. *
  436. * Return: per_pdev_rx_ring
  437. */
  438. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  439. /*
  440. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  441. * one per radio
  442. * @wlan_cfg_ctx
  443. *
  444. * Return: return 1 if per pdev error ring else 0
  445. */
  446. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  447. /*
  448. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  449. * @wlan_cfg_ctx - Configuration Handle
  450. *
  451. * Return: num_reo_dest_rings
  452. */
  453. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  454. /*
  455. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  456. * @wlan_cfg_ctx - Configuration Handle
  457. *
  458. * Return: htt_pkt_type_ethernet
  459. */
  460. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  461. /*
  462. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  463. * device
  464. * @wlan_cfg_ctx - Configuration Handle
  465. *
  466. * Return: num_tx_desc_pool
  467. */
  468. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  469. /*
  470. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  471. * device
  472. * @wlan_cfg_ctx - Configuration Handle
  473. * @num_pool - Number of pool
  474. */
  475. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  476. /*
  477. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  478. * pools
  479. * @wlan_cfg_ctx - Configuration Handle
  480. *
  481. * Return: num_tx_ext_desc_pool
  482. */
  483. int wlan_cfg_get_num_tx_ext_desc_pool(
  484. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  485. /*
  486. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  487. *
  488. * @wlan_cfg_ctx - Configuration Handle
  489. *
  490. * Return: reo_dst_ring_size
  491. */
  492. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  493. /*
  494. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  495. *
  496. * @wlan_cfg_ctx - Configuration Handle
  497. * @reo_dst_ring_size - REO Destination ring size
  498. */
  499. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  500. int reo_dst_ring_size);
  501. /*
  502. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  503. *
  504. * @wlan_cfg_ctx - Configuration Handle
  505. * @raw_mode_war - raw mode war configuration
  506. */
  507. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  508. bool raw_mode_war);
  509. /*
  510. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  511. *
  512. * @wlan_cfg_ctx - Configuration Handle
  513. *
  514. * Return: reo_dst_ring_size
  515. */
  516. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  517. /*
  518. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  519. * pools
  520. * @wlan_cfg_ctx - Configuration Handle
  521. * @num_pool - Number of pool
  522. */
  523. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  524. /*
  525. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  526. * @wlan_cfg_ctx - Configuration Handle
  527. *
  528. * Return: num_tx_desc
  529. */
  530. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  531. /*
  532. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  533. *
  534. * @wlan_cfg_ctx - Configuration Handle
  535. * @num_desc: Number of descriptor
  536. */
  537. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  538. /*
  539. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  540. * per pool
  541. * @wlan_cfg_ctx - Configuration Handle
  542. *
  543. * Return: num_tx_ext_desc
  544. */
  545. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  546. /*
  547. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  548. * per pool
  549. * @wlan_cfg_ctx - Configuration Handle
  550. * @num_desc: Number of descriptor
  551. */
  552. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  553. /*
  554. * wlan_cfg_max_peer_id() - Get maximum peer ID
  555. * @cfg: Configuration Handle
  556. *
  557. * Return: maximum peer ID
  558. */
  559. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  560. /*
  561. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  562. * @wlan_cfg_pdev_ctx
  563. *
  564. * Return: dma_mon_buf_ring_size
  565. */
  566. int wlan_cfg_get_dma_mon_buf_ring_size(
  567. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  568. /*
  569. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  570. * Destination ring
  571. * @wlan_cfg_pdev_ctx
  572. *
  573. * Return: dma_mon_dest_size
  574. */
  575. int wlan_cfg_get_dma_mon_dest_ring_size(
  576. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  577. /*
  578. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  579. * @wlan_cfg_pdev_ctx
  580. *
  581. * Return: dma_mon_stat_ring_size
  582. */
  583. int wlan_cfg_get_dma_mon_stat_ring_size(
  584. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  585. /*
  586. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  587. * @wlan_cfg_soc_ctx
  588. *
  589. * Return: rxdma monitor desc ring size
  590. */
  591. int
  592. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  593. /*
  594. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  595. * @wlan_cfg_pdev_ctx
  596. *
  597. * Return: rx_dma_buf_ring_size
  598. */
  599. int wlan_cfg_get_rx_dma_buf_ring_size(
  600. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  601. /*
  602. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  603. * per pdev
  604. * @wlan_cfg_pdev_ctx
  605. *
  606. * Return: number of mac DMA rings per pdev
  607. */
  608. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  609. /*
  610. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  611. * @wlan_cfg_dp_soc_ctxt
  612. *
  613. * Return: true - LRO enabled false - LRO disabled
  614. */
  615. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  616. /*
  617. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  618. * @wlan_cfg_dp_soc_ctxt
  619. *
  620. * Return: true - enabled false - disabled
  621. */
  622. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  623. /*
  624. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  625. * @wlan_cfg_dp_soc_ctxt
  626. *
  627. * Return: true - enabled false - disabled
  628. */
  629. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  630. /*
  631. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  632. * @wlan_cfg_soc_ctx
  633. * @rx_hash
  634. */
  635. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  636. /*
  637. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  638. * @wlan_cfg_pdev_ctx
  639. *
  640. * Return: 1 - enabled 0 - disabled
  641. */
  642. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  643. /*
  644. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  645. * @wlan_cfg_pdev_ctx
  646. */
  647. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  648. /*
  649. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  650. * @wlan_cfg_pdev_ctx
  651. *
  652. * Return: nss_cfg
  653. */
  654. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  655. /*
  656. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  657. * @wlan_cfg_pdev_ctx
  658. *
  659. */
  660. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  661. /*
  662. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  663. * @wlan_cfg_soc_ctx
  664. *
  665. * Return: Batch threshold
  666. */
  667. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  668. /*
  669. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  670. * @wlan_cfg_soc_ctx
  671. *
  672. * Return: Timer threshold
  673. */
  674. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  675. /*
  676. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  677. * @wlan_cfg_soc_ctx
  678. *
  679. * Return: Batch threshold
  680. */
  681. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  682. /*
  683. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  684. * @wlan_cfg_soc_ctx
  685. *
  686. * Return: Timer threshold
  687. */
  688. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  689. /*
  690. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  691. * @wlan_cfg_soc_ctx
  692. *
  693. * Return: Batch threshold
  694. */
  695. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  696. /*
  697. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  698. * @wlan_cfg_soc_ctx
  699. *
  700. * Return: Timer threshold
  701. */
  702. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  703. /*
  704. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  705. * @wlan_cfg_soc_ctx
  706. *
  707. * Return: Checksum offload enable or disable
  708. */
  709. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  710. /*
  711. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  712. * @wlan_cfg_soc_ctx
  713. *
  714. * Return: Tx Ring Size
  715. */
  716. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  717. /*
  718. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  719. * @wlan_cfg_soc_ctx
  720. *
  721. * Return: Tx Completion ring size
  722. */
  723. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  724. /*
  725. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  726. * @wlan_cfg_soc_ctx
  727. *
  728. * Return: wbm_release_ring size
  729. */
  730. int
  731. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  732. /*
  733. * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
  734. * @wlan_cfg_soc_ctx
  735. *
  736. * Return: tcl_cmd_ring size
  737. */
  738. int
  739. wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  740. /*
  741. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  742. * @wlan_cfg_soc_ctx
  743. *
  744. * Return: tcl_status_ring size
  745. */
  746. int
  747. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  748. /*
  749. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  750. * @wlan_cfg_soc_ctx
  751. *
  752. * Return: reo_reinject_ring size
  753. */
  754. int
  755. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  756. /*
  757. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  758. * @wlan_cfg_soc_ctx
  759. *
  760. * Return: rx_release_ring size
  761. */
  762. int
  763. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  764. /*
  765. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  766. * @wlan_cfg_soc_ctx
  767. *
  768. * Return: reo_exception_ring size
  769. */
  770. int
  771. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  772. /*
  773. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  774. * @wlan_cfg_soc_ctx
  775. *
  776. * Return: reo_cmd_ring size
  777. */
  778. int
  779. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  780. /*
  781. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  782. * @wlan_cfg_soc_ctx
  783. *
  784. * Return: reo_status_ring size
  785. */
  786. int
  787. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  788. /*
  789. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  790. * @wlan_cfg_soc_ctx
  791. *
  792. * Return: rxdma refill ring size
  793. */
  794. int
  795. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  796. /*
  797. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  798. * @wlan_cfg_soc_ctx
  799. *
  800. * Return: rxdma error dst ring size
  801. */
  802. int
  803. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  804. /*
  805. * wlan_cfg_get_dp_caps - Get dp capablities
  806. * @wlan_cfg_soc_ctx
  807. * @dp_caps: enum for dp capablities
  808. *
  809. * Return: bool if a dp capabilities is enabled
  810. */
  811. bool
  812. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  813. enum cdp_capabilities dp_caps);
  814. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  815. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  816. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  817. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  818. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  819. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  820. #endif