wlan_cfg.h 39 KB

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