wlan_cfg.h 37 KB

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