wlan_cfg.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230
  1. /*
  2. * Copyright (c) 2013-2019 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(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
  25. #define WLAN_CFG_DST_RING_CACHED_DESC 0
  26. #define MAX_PDEV_CNT 1
  27. #define WLAN_CFG_INT_NUM_CONTEXTS 7
  28. #define WLAN_CFG_RXDMA1_ENABLE 1
  29. /*
  30. * This mask defines how many transmit frames account for 1 NAPI work unit
  31. * 0 means each tx completion is 1 unit
  32. */
  33. #define DP_TX_NAPI_BUDGET_DIV_MASK 0
  34. /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
  35. #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
  36. #define NUM_RXDMA_RINGS_PER_PDEV 2
  37. #else
  38. #define WLAN_CFG_DST_RING_CACHED_DESC 1
  39. #define MAX_PDEV_CNT 3
  40. #define WLAN_CFG_INT_NUM_CONTEXTS 11
  41. #define NUM_RXDMA_RINGS_PER_PDEV 1
  42. #endif
  43. #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
  44. /* Tx configuration */
  45. #define MAX_LINK_DESC_BANKS 8
  46. #define MAX_TXDESC_POOLS 4
  47. #define MAX_TCL_DATA_RINGS 4
  48. /* Rx configuration */
  49. #define MAX_RXDESC_POOLS 4
  50. #define MAX_REO_DEST_RINGS 4
  51. #define MAX_RX_MAC_RINGS 2
  52. /* DP process status */
  53. #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
  54. #define CONFIG_PROCESS_RX_STATUS 1
  55. #define CONFIG_PROCESS_TX_STATUS 1
  56. #else
  57. #define CONFIG_PROCESS_RX_STATUS 0
  58. #define CONFIG_PROCESS_TX_STATUS 0
  59. #endif
  60. /* Miscellaneous configuration */
  61. #define MAX_IDLE_SCATTER_BUFS 16
  62. #define DP_MAX_IRQ_PER_CONTEXT 12
  63. #define MAX_HTT_METADATA_LEN 32
  64. #define MAX_NUM_PEER_ID_PER_PEER 8
  65. #define DP_MAX_TIDS 17
  66. #define DP_NON_QOS_TID 16
  67. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  68. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  69. struct wlan_cfg_dp_pdev_ctxt;
  70. /**
  71. * struct wlan_srng_cfg - Per ring configuration parameters
  72. * @timer_threshold: Config to control interrupts based on timer duration
  73. * @batch_count_threshold: Config to control interrupts based on
  74. * number of packets in the ring
  75. * @low_threshold: Config to control low threshold interrupts for SRC rings
  76. */
  77. struct wlan_srng_cfg {
  78. uint32_t timer_threshold;
  79. uint32_t batch_count_threshold;
  80. uint32_t low_threshold;
  81. };
  82. /**
  83. * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
  84. * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
  85. * @max_clients: Maximum number of peers/stations supported by device
  86. * @max_alloc_size: Maximum allocation size for any dynamic memory
  87. * allocation request for this device
  88. * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
  89. * 1: Each TCL ring is mapped to one radio/pdev
  90. * @num_tcl_data_rings: Number of TCL Data rings supported by device
  91. * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
  92. * 1: Each REO ring is mapped to one radio/pdev
  93. * @num_tx_desc_pool: Number of Tx Descriptor pools
  94. * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
  95. * @num_tx_desc: Number of Tx Descriptors per pool
  96. * @min_tx_desc: Minimum number of Tx Descriptors per pool
  97. * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
  98. * @max_peer_id: Maximum value of peer id that FW can assign for a client
  99. * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
  100. * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
  101. * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  102. * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  103. * NAPI/Intr context
  104. * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  105. * NAPI/Intr context
  106. * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
  107. * NAPI/Intr context
  108. * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
  109. * each NAPI/Intr context
  110. * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
  111. * @lro_enabled: enable/disable lro feature
  112. * @rx_hash: Enable hash based steering of rx packets
  113. * @tso_enabled: enable/disable tso feature
  114. * @lro_enabled: enable/disable LRO feature
  115. * @sg_enabled: enable disable scatter gather feature
  116. * @gro_enabled: enable disable GRO feature
  117. * @ipa_enabled: Flag indicating if IPA is enabled
  118. * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
  119. * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
  120. * @rawmode_enabled: Flag indicating if RAW mode is enabled
  121. * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
  122. * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
  123. * @tcp_udp_checksumoffload: enable/disable checksum offload
  124. * @nss_cfg: nss configuration
  125. * @rx_defrag_min_timeout: rx defrag minimum timeout
  126. * @wbm_release_ring: wbm release ring size
  127. * @tcl_cmd_ring: tcl cmd ring size
  128. * @tcl_status_ring: tcl status ring size
  129. * @reo_reinject_ring: reo reinject ring
  130. * @rx_release_ring: rx release ring size
  131. * @reo_exception_ring: reo exception ring size
  132. * @reo_cmd_ring: reo cmd ring size
  133. * @reo_status_ring: reo status ting size
  134. * @rxdma_refill_ring: rxdma refill ring size
  135. * @rxdma_err_dst_ring: rxdma error detination ring size
  136. * @raw_mode_war: enable/disable raw mode war
  137. * @enable_data_stall_detection: flag to enable data stall detection
  138. * @disable_intra_bss_fwd: flag to disable intra bss forwarding
  139. * @rxdma1_enable: flag to indicate if rxdma1 is enabled
  140. * @tx_desc_limit_0: tx_desc limit for 5G H
  141. * @tx_desc_limit_1: tx_desc limit for 2G
  142. * @tx_desc_limit_2: tx_desc limit for 5G L
  143. * @tx_device_limit: tx device limit
  144. * @tx_sw_internode_queue: tx sw internode queue
  145. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  146. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  147. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  148. * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
  149. * dp_rx_process loop
  150. * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
  151. * at end of tx_comp_handler loop.
  152. * @rx_sw_desc_weight: rx sw descriptor weight configuration
  153. * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
  154. * flow tagging in monitor/mon-lite mode
  155. * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
  156. * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
  157. * table should be used
  158. * @rx_flow_search_table_size: indicates the number of flows in the flow search
  159. * table
  160. * @rx_flow_max_search: max skid length for each hash entry
  161. * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
  162. * 5 tuple flow entry
  163. */
  164. struct wlan_cfg_dp_soc_ctxt {
  165. int num_int_ctxts;
  166. int max_clients;
  167. int max_alloc_size;
  168. int per_pdev_tx_ring;
  169. int num_tcl_data_rings;
  170. int per_pdev_rx_ring;
  171. int per_pdev_lmac_ring;
  172. int num_reo_dest_rings;
  173. int num_tx_desc_pool;
  174. int num_tx_ext_desc_pool;
  175. int num_tx_desc;
  176. int min_tx_desc;
  177. int num_tx_ext_desc;
  178. int max_peer_id;
  179. int htt_packet_type;
  180. int int_batch_threshold_tx;
  181. int int_timer_threshold_tx;
  182. int int_batch_threshold_rx;
  183. int int_timer_threshold_rx;
  184. int int_batch_threshold_other;
  185. int int_timer_threshold_other;
  186. int int_timer_threshold_mon;
  187. int tx_ring_size;
  188. int tx_comp_ring_size;
  189. int tx_comp_ring_size_nss;
  190. int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  191. int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  192. int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  193. int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  194. int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  195. int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  196. int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  197. int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  198. int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  199. int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  200. int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
  201. int hw_macid[MAX_PDEV_CNT];
  202. int base_hw_macid;
  203. bool rx_hash;
  204. bool tso_enabled;
  205. bool lro_enabled;
  206. bool sg_enabled;
  207. bool gro_enabled;
  208. bool ipa_enabled;
  209. bool ol_tx_csum_enabled;
  210. bool ol_rx_csum_enabled;
  211. bool rawmode_enabled;
  212. bool peer_flow_ctrl_enabled;
  213. bool napi_enabled;
  214. bool tcp_udp_checksumoffload;
  215. bool defrag_timeout_check;
  216. int nss_cfg;
  217. uint32_t tx_flow_stop_queue_threshold;
  218. uint32_t tx_flow_start_queue_offset;
  219. int rx_defrag_min_timeout;
  220. int reo_dst_ring_size;
  221. int wbm_release_ring;
  222. int tcl_cmd_ring;
  223. int tcl_status_ring;
  224. int reo_reinject_ring;
  225. int rx_release_ring;
  226. int reo_exception_ring;
  227. int reo_cmd_ring;
  228. int reo_status_ring;
  229. int rxdma_refill_ring;
  230. int rxdma_err_dst_ring;
  231. uint32_t per_pkt_trace;
  232. bool raw_mode_war;
  233. bool enable_data_stall_detection;
  234. bool disable_intra_bss_fwd;
  235. bool rxdma1_enable;
  236. int max_ast_idx;
  237. int tx_desc_limit_0;
  238. int tx_desc_limit_1;
  239. int tx_desc_limit_2;
  240. int tx_device_limit;
  241. int tx_sw_internode_queue;
  242. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  243. uint32_t tx_comp_loop_pkt_limit;
  244. uint32_t rx_reap_loop_pkt_limit;
  245. uint32_t rx_hp_oos_update_limit;
  246. bool rx_enable_eol_data_check;
  247. bool tx_comp_enable_eol_data_check;
  248. #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
  249. int rx_sw_desc_weight;
  250. bool is_rx_mon_protocol_flow_tag_enabled;
  251. bool is_rx_flow_tag_enabled;
  252. bool is_rx_flow_search_table_per_pdev;
  253. uint16_t rx_flow_search_table_size;
  254. uint16_t rx_flow_max_search;
  255. uint8_t *rx_toeplitz_hash_key;
  256. };
  257. /**
  258. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  259. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  260. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  261. * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  262. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  263. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  264. */
  265. struct wlan_cfg_dp_pdev_ctxt {
  266. int rx_dma_buf_ring_size;
  267. int dma_mon_buf_ring_size;
  268. int dma_mon_dest_ring_size;
  269. int dma_mon_status_ring_size;
  270. int rxdma_monitor_desc_ring;
  271. int num_mac_rings;
  272. int nss_enabled;
  273. };
  274. /**
  275. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  276. * @ctrl_obj - PSOC object
  277. *
  278. * Allocates context for Soc configuration parameters,
  279. * Read configuration information from device tree/ini file and
  280. * returns back handle
  281. *
  282. * Return: Handle to configuration context
  283. */
  284. struct wlan_cfg_dp_soc_ctxt *
  285. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  286. /**
  287. * wlan_cfg_soc_detach() - Detach soc configuration handle
  288. * @wlan_cfg_ctx: soc configuration handle
  289. *
  290. * De-allocates memory allocated for SoC configuration
  291. *
  292. * Return:none
  293. */
  294. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  295. /**
  296. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  297. * @ctrl_obj - PSOC object
  298. *
  299. * Allocates context for pdev configuration parameters,
  300. * Read configuration information from device tree/ini file and
  301. * returns back handle
  302. *
  303. * Return: Handle to configuration context
  304. */
  305. struct wlan_cfg_dp_pdev_ctxt *
  306. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  307. /**
  308. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  309. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  310. *
  311. * Return: void
  312. */
  313. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  314. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  315. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  316. int context, int mask);
  317. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  318. int context, int mask);
  319. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  320. int context, int mask);
  321. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  322. int context, int mask);
  323. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  324. int mask);
  325. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  326. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  327. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  328. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  329. int context, int mask);
  330. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  331. int context, int mask);
  332. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  333. int context, int mask);
  334. /**
  335. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  336. * @wlan_cfg_ctx - Configuration Handle
  337. *
  338. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  339. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  340. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  341. * that are processed by the handler.
  342. *
  343. * Return: num_contexts
  344. */
  345. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  346. /**
  347. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  348. * interrupt context
  349. * @wlan_cfg_ctx - Configuration Handle
  350. * @context - Numerical ID identifying the Interrupt/NAPI context
  351. *
  352. * Return: int_tx_ring_mask[context]
  353. */
  354. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  355. int context);
  356. /**
  357. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  358. * interrupt context
  359. * @wlan_cfg_ctx - Configuration Handle
  360. * @context - Numerical ID identifying the Interrupt/NAPI context
  361. *
  362. * Return: int_rx_ring_mask[context]
  363. */
  364. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  365. int context);
  366. /**
  367. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  368. * mapped to an interrupt context
  369. * @wlan_cfg_ctx - Configuration Handle
  370. * @context - Numerical ID identifying the Interrupt/NAPI context
  371. *
  372. * Return: int_rx_mon_ring_mask[context]
  373. */
  374. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  375. int context);
  376. /**
  377. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  378. * for the given interrupt context
  379. * @wlan_cfg_ctx - Configuration Handle
  380. * @context - Numerical ID identifying the Interrupt/NAPI context
  381. *
  382. */
  383. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  384. int context, int mask);
  385. /**
  386. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  387. * mapped to an interrupt context
  388. * @wlan_cfg_ctx - Configuration Handle
  389. * @context - Numerical ID identifying the Interrupt/NAPI context
  390. *
  391. * Return: int_rxdma2host_ring_mask[context]
  392. */
  393. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  394. int context);
  395. /**
  396. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  397. * for the given interrupt context
  398. * @wlan_cfg_ctx - Configuration Handle
  399. * @context - Numerical ID identifying the Interrupt/NAPI context
  400. *
  401. */
  402. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  403. int context, int mask);
  404. /**
  405. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  406. * mapped to an interrupt context
  407. * @wlan_cfg_ctx - Configuration Handle
  408. * @context - Numerical ID identifying the Interrupt/NAPI context
  409. *
  410. * Return: int_host2rxdma_ring_mask[context]
  411. */
  412. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  413. int context);
  414. /**
  415. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  416. * interrupt mask for the given interrupt context
  417. * @wlan_cfg_ctx - Configuration Handle
  418. * @context - Numerical ID identifying the Interrupt/NAPI context
  419. *
  420. */
  421. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  422. int context, int mask);
  423. /**
  424. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  425. * interrupt mask mapped to an interrupt context
  426. * @wlan_cfg_ctx - Configuration Handle
  427. * @context - Numerical ID identifying the Interrupt/NAPI context
  428. *
  429. * Return: int_host2rxdma_mon_ring_mask[context]
  430. */
  431. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  432. int context);
  433. /**
  434. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  435. * destination ring interrupt mask
  436. * for the given interrupt context
  437. * @wlan_cfg_ctx - Configuration Handle
  438. * @context - Numerical ID identifying the Interrupt/NAPI context
  439. *
  440. */
  441. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  442. int context, int mask);
  443. /**
  444. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  445. * destination ring interrupt mask
  446. * mapped to an interrupt context
  447. * @wlan_cfg_ctx - Configuration Handle
  448. * @context - Numerical ID identifying the Interrupt/NAPI context
  449. *
  450. * Return: int_rxdma2host_mon_ring_mask[context]
  451. */
  452. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  453. int context);
  454. /**
  455. * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
  456. *
  457. * @wlan_cfg_ctx - Configuration Handle
  458. * @pdev_idx - Index of SW PDEV
  459. * @hw_macid - HW MAC Id
  460. *
  461. */
  462. void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
  463. int hw_macid);
  464. /**
  465. * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
  466. *
  467. * @wlan_cfg_ctx - Configuration Handle
  468. * @pdev_idx - Index of SW PDEV
  469. *
  470. * Return: HW MAC Id
  471. */
  472. int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  473. /**
  474. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  475. * PDEV index
  476. *
  477. * @wlan_cfg_ctx - Configuration Handle
  478. * @pdev_idx - Index of SW PDEV
  479. *
  480. * Return: HW MAC index
  481. */
  482. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  483. /**
  484. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  485. * mapped to an interrupt context
  486. * @wlan_cfg_ctx - Configuration Handle
  487. * @context - Numerical ID identifying the Interrupt/NAPI context
  488. *
  489. * Return: int_rx_err_ring_mask[context]
  490. */
  491. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  492. context);
  493. /**
  494. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  495. * mapped to an interrupt context
  496. * @wlan_cfg_ctx - Configuration Handle
  497. * @context - Numerical ID identifying the Interrupt/NAPI context
  498. *
  499. * Return: int_wbm_rel_ring_mask[context]
  500. */
  501. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  502. context);
  503. /**
  504. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  505. * mapped to an interrupt context
  506. * @wlan_cfg_ctx - Configuration Handle
  507. * @context - Numerical ID identifying the Interrupt/NAPI context
  508. *
  509. * Return: int_reo_status_ring_mask[context]
  510. */
  511. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  512. context);
  513. /**
  514. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  515. * mapped to an interrupt context
  516. * @wlan_cfg_ctx - Configuration Handle
  517. * @context - Numerical ID identifying the Interrupt/NAPI context
  518. *
  519. * Return: int_ce_ring_mask[context]
  520. */
  521. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  522. int context);
  523. /**
  524. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  525. * supported by device
  526. * @wlan_cfg_ctx - Configuration Handle
  527. *
  528. * Return: max_clients
  529. */
  530. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  531. /**
  532. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  533. * memory allocation request for this device
  534. * @wlan_cfg_ctx - Configuration Handle
  535. *
  536. * Return: max_alloc_size
  537. */
  538. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  539. /*
  540. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  541. * one per radio
  542. * @wlan_cfg_ctx - Configuration Handle
  543. *
  544. * Return: per_pdev_tx_ring
  545. */
  546. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  547. /*
  548. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  549. * @wlan_cfg_ctx
  550. *
  551. * Return: num_tcl_data_rings
  552. */
  553. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  554. /*
  555. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  556. * one per radio
  557. * @wlan_cfg_ctx
  558. *
  559. * Return: per_pdev_rx_ring
  560. */
  561. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  562. /*
  563. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  564. * one per radio
  565. * @wlan_cfg_ctx
  566. *
  567. * Return: return 1 if per pdev error ring else 0
  568. */
  569. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  570. /*
  571. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  572. * @wlan_cfg_ctx - Configuration Handle
  573. *
  574. * Return: num_reo_dest_rings
  575. */
  576. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  577. /*
  578. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  579. * @wlan_cfg_ctx - Configuration Handle
  580. *
  581. * Return: htt_pkt_type_ethernet
  582. */
  583. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  584. /*
  585. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  586. * device
  587. * @wlan_cfg_ctx - Configuration Handle
  588. *
  589. * Return: num_tx_desc_pool
  590. */
  591. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  592. /*
  593. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  594. * device
  595. * @wlan_cfg_ctx - Configuration Handle
  596. * @num_pool - Number of pool
  597. */
  598. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  599. /*
  600. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  601. * pools
  602. * @wlan_cfg_ctx - Configuration Handle
  603. *
  604. * Return: num_tx_ext_desc_pool
  605. */
  606. int wlan_cfg_get_num_tx_ext_desc_pool(
  607. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  608. /*
  609. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  610. *
  611. * @wlan_cfg_ctx - Configuration Handle
  612. *
  613. * Return: reo_dst_ring_size
  614. */
  615. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  616. /*
  617. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  618. *
  619. * @wlan_cfg_ctx - Configuration Handle
  620. * @reo_dst_ring_size - REO Destination ring size
  621. */
  622. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  623. int reo_dst_ring_size);
  624. /*
  625. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  626. *
  627. * @wlan_cfg_ctx - Configuration Handle
  628. * @raw_mode_war - raw mode war configuration
  629. */
  630. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  631. bool raw_mode_war);
  632. /*
  633. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  634. *
  635. * @wlan_cfg_ctx - Configuration Handle
  636. *
  637. * Return: reo_dst_ring_size
  638. */
  639. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  640. /*
  641. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  642. * pools
  643. * @wlan_cfg_ctx - Configuration Handle
  644. * @num_pool - Number of pool
  645. */
  646. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  647. /*
  648. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  649. * @wlan_cfg_ctx - Configuration Handle
  650. *
  651. * Return: num_tx_desc
  652. */
  653. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  654. /*
  655. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  656. * @wlan_cfg_ctx - Configuration Handle
  657. *
  658. * Return: num_tx_desc
  659. */
  660. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  661. /*
  662. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  663. *
  664. * @wlan_cfg_ctx - Configuration Handle
  665. * @num_desc: Number of descriptor
  666. */
  667. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  668. /*
  669. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  670. * per pool
  671. * @wlan_cfg_ctx - Configuration Handle
  672. *
  673. * Return: num_tx_ext_desc
  674. */
  675. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  676. /*
  677. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  678. * per pool
  679. * @wlan_cfg_ctx - Configuration Handle
  680. * @num_desc: Number of descriptor
  681. */
  682. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  683. /*
  684. * wlan_cfg_max_peer_id() - Get maximum peer ID
  685. * @cfg: Configuration Handle
  686. *
  687. * Return: maximum peer ID
  688. */
  689. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  690. /*
  691. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  692. * @wlan_cfg_pdev_ctx
  693. *
  694. * Return: dma_mon_buf_ring_size
  695. */
  696. int wlan_cfg_get_dma_mon_buf_ring_size(
  697. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  698. /*
  699. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  700. * Destination ring
  701. * @wlan_cfg_pdev_ctx
  702. *
  703. * Return: dma_mon_dest_size
  704. */
  705. int wlan_cfg_get_dma_mon_dest_ring_size(
  706. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  707. /*
  708. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  709. * @wlan_cfg_pdev_ctx
  710. *
  711. * Return: dma_mon_stat_ring_size
  712. */
  713. int wlan_cfg_get_dma_mon_stat_ring_size(
  714. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  715. /*
  716. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  717. * @wlan_cfg_soc_ctx
  718. *
  719. * Return: rxdma monitor desc ring size
  720. */
  721. int
  722. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  723. /*
  724. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  725. * @wlan_cfg_pdev_ctx
  726. *
  727. * Return: rx_dma_buf_ring_size
  728. */
  729. int wlan_cfg_get_rx_dma_buf_ring_size(
  730. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  731. /*
  732. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  733. * per pdev
  734. * @wlan_cfg_pdev_ctx
  735. *
  736. * Return: number of mac DMA rings per pdev
  737. */
  738. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  739. /*
  740. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  741. * @wlan_cfg_dp_soc_ctxt
  742. *
  743. * Return: true - LRO enabled false - LRO disabled
  744. */
  745. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  746. /*
  747. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  748. * @wlan_cfg_dp_soc_ctxt
  749. *
  750. * Return: true - GRO enabled false - GRO disabled
  751. */
  752. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  753. /*
  754. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  755. * @wlan_cfg_dp_soc_ctxt
  756. *
  757. * Return: true - enabled false - disabled
  758. */
  759. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  760. /*
  761. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  762. * @wlan_cfg_dp_soc_ctxt
  763. *
  764. * Return: true - enabled false - disabled
  765. */
  766. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  767. /*
  768. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  769. * @wlan_cfg_soc_ctx
  770. * @rx_hash
  771. */
  772. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  773. /*
  774. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  775. * @wlan_cfg_pdev_ctx
  776. *
  777. * Return: 1 - enabled 0 - disabled
  778. */
  779. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  780. /*
  781. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  782. * @wlan_cfg_pdev_ctx
  783. */
  784. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  785. /*
  786. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  787. * @wlan_cfg_pdev_ctx
  788. *
  789. * Return: nss_cfg
  790. */
  791. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  792. /*
  793. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  794. * @wlan_cfg_pdev_ctx
  795. *
  796. */
  797. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  798. /*
  799. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  800. * @wlan_cfg_soc_ctx
  801. *
  802. * Return: Batch threshold
  803. */
  804. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  805. /*
  806. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  807. * @wlan_cfg_soc_ctx
  808. *
  809. * Return: Timer threshold
  810. */
  811. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  812. /*
  813. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  814. * @wlan_cfg_soc_ctx
  815. *
  816. * Return: Batch threshold
  817. */
  818. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  819. /*
  820. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  821. * @wlan_cfg_soc_ctx
  822. *
  823. * Return: Timer threshold
  824. */
  825. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  826. /*
  827. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  828. * @wlan_cfg_soc_ctx
  829. *
  830. * Return: Batch threshold
  831. */
  832. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  833. /*
  834. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  835. * @wlan_cfg_soc_ctx
  836. *
  837. * Return: Timer threshold
  838. */
  839. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  840. /*
  841. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  842. * @wlan_cfg_soc_ctx
  843. *
  844. * Return: Timer threshold
  845. */
  846. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  847. /*
  848. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  849. * @wlan_cfg_soc_ctx
  850. *
  851. * Return: Checksum offload enable or disable
  852. */
  853. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  854. /*
  855. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  856. * @wlan_cfg_soc_ctx
  857. *
  858. * Return: Tx Ring Size
  859. */
  860. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  861. /*
  862. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  863. * @wlan_cfg_soc_ctx
  864. *
  865. * Return: Tx Completion ring size
  866. */
  867. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  868. /*
  869. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  870. * @wlan_cfg_soc_ctx
  871. *
  872. * Return: wbm_release_ring size
  873. */
  874. int
  875. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  876. /*
  877. * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
  878. * @wlan_cfg_soc_ctx
  879. *
  880. * Return: tcl_cmd_ring size
  881. */
  882. int
  883. wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  884. /*
  885. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  886. * @wlan_cfg_soc_ctx
  887. *
  888. * Return: tcl_status_ring size
  889. */
  890. int
  891. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  892. /*
  893. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  894. * @wlan_cfg_soc_ctx
  895. *
  896. * Return: reo_reinject_ring size
  897. */
  898. int
  899. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  900. /*
  901. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  902. * @wlan_cfg_soc_ctx
  903. *
  904. * Return: rx_release_ring size
  905. */
  906. int
  907. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  908. /*
  909. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  910. * @wlan_cfg_soc_ctx
  911. *
  912. * Return: reo_exception_ring size
  913. */
  914. int
  915. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  916. /*
  917. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  918. * @wlan_cfg_soc_ctx
  919. *
  920. * Return: reo_cmd_ring size
  921. */
  922. int
  923. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  924. /*
  925. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  926. * @wlan_cfg_soc_ctx
  927. *
  928. * Return: reo_status_ring size
  929. */
  930. int
  931. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  932. /*
  933. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  934. * @wlan_cfg_soc_ctx
  935. *
  936. * Return: tx desc limit for 5G H
  937. */
  938. int
  939. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  940. /*
  941. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  942. * @wlan_cfg_soc_ctx
  943. *
  944. * Return: tx desc limit for 2G
  945. */
  946. int
  947. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  948. /*
  949. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  950. * @wlan_cfg_soc_ctx
  951. *
  952. * Return: tx desc limit for 5G L
  953. */
  954. int
  955. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  956. /*
  957. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  958. * @wlan_cfg_soc_ctx
  959. *
  960. * Return: tx device limit
  961. */
  962. int
  963. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  964. /*
  965. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  966. * @wlan_cfg_soc_ctx
  967. *
  968. * Return: tx sw internode queue
  969. */
  970. int
  971. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  972. /*
  973. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  974. * @wlan_cfg_soc_ctx
  975. *
  976. * Return: rxdma refill ring size
  977. */
  978. int
  979. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  980. /*
  981. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  982. * @wlan_cfg_soc_ctx
  983. *
  984. * Return: rxdma error dst ring size
  985. */
  986. int
  987. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  988. /*
  989. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  990. * @wlan_cfg_soc_ctx
  991. *
  992. * Return: rx_sw_desc_weight
  993. */
  994. int
  995. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  996. /*
  997. * wlan_cfg_get_dp_caps - Get dp capablities
  998. * @wlan_cfg_soc_ctx
  999. * @dp_caps: enum for dp capablities
  1000. *
  1001. * Return: bool if a dp capabilities is enabled
  1002. */
  1003. bool
  1004. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1005. enum cdp_capabilities dp_caps);
  1006. /**
  1007. * wlan_set_srng_cfg() - Fill per ring specific
  1008. * configuration parameters
  1009. * @wlan_cfg: global srng configuration table
  1010. *
  1011. * Return: None
  1012. */
  1013. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1014. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1015. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1016. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1017. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1018. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1019. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1020. /**
  1021. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1022. * in number of entries
  1023. *
  1024. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1025. *
  1026. * Return: rx_fst_size
  1027. */
  1028. uint16_t
  1029. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1030. /**
  1031. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1032. *
  1033. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1034. *
  1035. * Return: max_search
  1036. */
  1037. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1038. /**
  1039. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1040. * search
  1041. *
  1042. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1043. *
  1044. * Return: 320-bit Hash Key
  1045. */
  1046. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1047. /**
  1048. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1049. * DP soc context
  1050. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1051. * @val: Rx flow tag feature flag value
  1052. *
  1053. * Return: None
  1054. */
  1055. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1056. bool val);
  1057. /**
  1058. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1059. * DP soc context
  1060. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1061. *
  1062. * Return: true if feature is enabled, else false
  1063. */
  1064. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1065. /**
  1066. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1067. * Rx FST is per pdev
  1068. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1069. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1070. *
  1071. * Return: None
  1072. */
  1073. void
  1074. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1075. bool val);
  1076. /**
  1077. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1078. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1079. *
  1080. * Return: true if Rx FST is per pdev, else false
  1081. */
  1082. bool
  1083. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1084. /**
  1085. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1086. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1087. * @val: Rx FST size in number of entries
  1088. *
  1089. * Return: None
  1090. */
  1091. void
  1092. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1093. uint16_t val);
  1094. /**
  1095. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1096. * in DP soc context
  1097. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1098. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1099. *
  1100. * Return: None
  1101. */
  1102. void
  1103. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1104. bool val);
  1105. /**
  1106. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1107. * from DP soc context
  1108. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1109. *
  1110. * Return: true if feature is enabled in monitor mode for protocol or flow
  1111. * tagging in INI, false otherwise
  1112. */
  1113. bool
  1114. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1115. #endif