wlan_cfg.h 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321
  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 DP_MAX_TIDS 17
  68. #define DP_NON_QOS_TID 16
  69. #define DP_NULL_DATA_TID 17
  70. #define WLAN_CFG_RX_FST_MAX_SEARCH 2
  71. #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
  72. #define INVALID_PDEV_ID 0xFF
  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_NUM_LMAC_HW];
  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. bool is_tso_desc_attach_defer;
  267. uint32_t delayed_replenish_entries;
  268. };
  269. /**
  270. * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
  271. * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
  272. * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
  273. * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
  274. * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
  275. * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
  276. */
  277. struct wlan_cfg_dp_pdev_ctxt {
  278. int rx_dma_buf_ring_size;
  279. int dma_mon_buf_ring_size;
  280. int dma_mon_dest_ring_size;
  281. int dma_mon_status_ring_size;
  282. int rxdma_monitor_desc_ring;
  283. int num_mac_rings;
  284. int nss_enabled;
  285. };
  286. /**
  287. * wlan_cfg_soc_attach() - Attach configuration interface for SoC
  288. * @ctrl_obj - PSOC object
  289. *
  290. * Allocates context for Soc configuration parameters,
  291. * Read configuration information from device tree/ini file and
  292. * returns back handle
  293. *
  294. * Return: Handle to configuration context
  295. */
  296. struct wlan_cfg_dp_soc_ctxt *
  297. wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  298. /**
  299. * wlan_cfg_soc_detach() - Detach soc configuration handle
  300. * @wlan_cfg_ctx: soc configuration handle
  301. *
  302. * De-allocates memory allocated for SoC configuration
  303. *
  304. * Return:none
  305. */
  306. void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  307. /**
  308. * wlan_cfg_pdev_attach() Attach configuration interface for pdev
  309. * @ctrl_obj - PSOC object
  310. *
  311. * Allocates context for pdev configuration parameters,
  312. * Read configuration information from device tree/ini file and
  313. * returns back handle
  314. *
  315. * Return: Handle to configuration context
  316. */
  317. struct wlan_cfg_dp_pdev_ctxt *
  318. wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
  319. /**
  320. * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
  321. * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
  322. *
  323. * Return: void
  324. */
  325. void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  326. void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
  327. void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  328. int context, int mask);
  329. void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  330. int context, int mask);
  331. void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  332. int context, int mask);
  333. void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  334. int context, int mask);
  335. void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
  336. int mask);
  337. void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  338. void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
  339. int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
  340. int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
  341. int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  342. int context, int mask);
  343. int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  344. int context, int mask);
  345. int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  346. int context, int mask);
  347. /**
  348. * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
  349. * for monitor buffer ring at initialization
  350. * @wlan_cfg_ctx - Configuration Handle
  351. * @replenish_entries - number of entries to replenish at initialization
  352. *
  353. */
  354. void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  355. *wlan_cfg_ctx,
  356. uint32_t replenish_entries);
  357. /**
  358. * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
  359. * for monitor buffer ring at initialization
  360. * @wlan_cfg_ctx - Configuration Handle
  361. * @replenish_entries - number of entries to replenish at initialization
  362. *
  363. * Return: delayed_replenish_entries;
  364. */
  365. int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
  366. *wlan_cfg_ctx);
  367. /**
  368. * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
  369. * @wlan_cfg_ctx - Configuration Handle
  370. *
  371. * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores.
  372. * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
  373. * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings
  374. * that are processed by the handler.
  375. *
  376. * Return: num_contexts
  377. */
  378. int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  379. /**
  380. * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
  381. * interrupt context
  382. * @wlan_cfg_ctx - Configuration Handle
  383. * @context - Numerical ID identifying the Interrupt/NAPI context
  384. *
  385. * Return: int_tx_ring_mask[context]
  386. */
  387. int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  388. int context);
  389. /**
  390. * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
  391. * interrupt context
  392. * @wlan_cfg_ctx - Configuration Handle
  393. * @context - Numerical ID identifying the Interrupt/NAPI context
  394. *
  395. * Return: int_rx_ring_mask[context]
  396. */
  397. int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  398. int context);
  399. /**
  400. * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
  401. * mapped to an interrupt context
  402. * @wlan_cfg_ctx - Configuration Handle
  403. * @context - Numerical ID identifying the Interrupt/NAPI context
  404. *
  405. * Return: int_rx_mon_ring_mask[context]
  406. */
  407. int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  408. int context);
  409. /**
  410. * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  411. * for the given interrupt context
  412. * @wlan_cfg_ctx - Configuration Handle
  413. * @context - Numerical ID identifying the Interrupt/NAPI context
  414. *
  415. */
  416. void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  417. int context, int mask);
  418. /**
  419. * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
  420. * mapped to an interrupt context
  421. * @wlan_cfg_ctx - Configuration Handle
  422. * @context - Numerical ID identifying the Interrupt/NAPI context
  423. *
  424. * Return: int_rxdma2host_ring_mask[context]
  425. */
  426. int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  427. int context);
  428. /**
  429. * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
  430. * for the given interrupt context
  431. * @wlan_cfg_ctx - Configuration Handle
  432. * @context - Numerical ID identifying the Interrupt/NAPI context
  433. *
  434. */
  435. void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  436. int context, int mask);
  437. /**
  438. * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
  439. * mapped to an interrupt context
  440. * @wlan_cfg_ctx - Configuration Handle
  441. * @context - Numerical ID identifying the Interrupt/NAPI context
  442. *
  443. * Return: int_host2rxdma_ring_mask[context]
  444. */
  445. int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  446. int context);
  447. /**
  448. * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
  449. * interrupt mask for the given interrupt context
  450. * @wlan_cfg_ctx - Configuration Handle
  451. * @context - Numerical ID identifying the Interrupt/NAPI context
  452. *
  453. */
  454. void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  455. int context, int mask);
  456. /**
  457. * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
  458. * interrupt mask mapped to an interrupt context
  459. * @wlan_cfg_ctx - Configuration Handle
  460. * @context - Numerical ID identifying the Interrupt/NAPI context
  461. *
  462. * Return: int_host2rxdma_mon_ring_mask[context]
  463. */
  464. int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  465. int context);
  466. /**
  467. * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
  468. * destination ring interrupt mask
  469. * for the given interrupt context
  470. * @wlan_cfg_ctx - Configuration Handle
  471. * @context - Numerical ID identifying the Interrupt/NAPI context
  472. *
  473. */
  474. void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  475. int context, int mask);
  476. /**
  477. * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
  478. * destination ring interrupt mask
  479. * mapped to an interrupt context
  480. * @wlan_cfg_ctx - Configuration Handle
  481. * @context - Numerical ID identifying the Interrupt/NAPI context
  482. *
  483. * Return: int_rxdma2host_mon_ring_mask[context]
  484. */
  485. int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
  486. int context);
  487. /**
  488. * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
  489. *
  490. * @wlan_cfg_ctx - Configuration Handle
  491. * @pdev_idx - Index of SW PDEV
  492. * @hw_macid - HW MAC Id
  493. *
  494. */
  495. void wlan_cfg_set_hw_mac_idx
  496. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  497. /**
  498. * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
  499. * PDEV index
  500. *
  501. * @wlan_cfg_ctx - Configuration Handle
  502. * @pdev_idx - Index of SW PDEV
  503. *
  504. * Return: HW MAC index
  505. */
  506. int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
  507. /**
  508. * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
  509. *
  510. * @wlan_cfg_ctx - Configuration Handle
  511. * @hw_macid - Index of hw mac
  512. *
  513. * Return: PDEV ID
  514. */
  515. int
  516. wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  517. /**
  518. * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
  519. * hw mac index
  520. *
  521. * @wlan_cfg_ctx - Configuration Handle
  522. * @pdev_idx - Index of SW PDEV
  523. * @hw_macid - Index of hw mac
  524. *
  525. * Return: PDEV index
  526. */
  527. void wlan_cfg_set_pdev_idx
  528. (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
  529. /**
  530. * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
  531. * hw mac index
  532. *
  533. * @wlan_cfg_ctx - Configuration Handle
  534. * @hw_macid - Index of hw mac
  535. *
  536. * Return: PDEV index
  537. */
  538. int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
  539. /**
  540. * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
  541. * mapped to an interrupt context
  542. * @wlan_cfg_ctx - Configuration Handle
  543. * @context - Numerical ID identifying the Interrupt/NAPI context
  544. *
  545. * Return: int_rx_err_ring_mask[context]
  546. */
  547. int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  548. context);
  549. /**
  550. * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
  551. * mapped to an interrupt context
  552. * @wlan_cfg_ctx - Configuration Handle
  553. * @context - Numerical ID identifying the Interrupt/NAPI context
  554. *
  555. * Return: int_wbm_rel_ring_mask[context]
  556. */
  557. int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  558. context);
  559. /**
  560. * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
  561. * mapped to an interrupt context
  562. * @wlan_cfg_ctx - Configuration Handle
  563. * @context - Numerical ID identifying the Interrupt/NAPI context
  564. *
  565. * Return: int_reo_status_ring_mask[context]
  566. */
  567. int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
  568. context);
  569. /**
  570. * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
  571. * mapped to an interrupt context
  572. * @wlan_cfg_ctx - Configuration Handle
  573. * @context - Numerical ID identifying the Interrupt/NAPI context
  574. *
  575. * Return: int_ce_ring_mask[context]
  576. */
  577. int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  578. int context);
  579. /**
  580. * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
  581. * supported by device
  582. * @wlan_cfg_ctx - Configuration Handle
  583. *
  584. * Return: max_clients
  585. */
  586. uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  587. /**
  588. * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
  589. * memory allocation request for this device
  590. * @wlan_cfg_ctx - Configuration Handle
  591. *
  592. * Return: max_alloc_size
  593. */
  594. uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  595. /*
  596. * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
  597. * one per radio
  598. * @wlan_cfg_ctx - Configuration Handle
  599. *
  600. * Return: per_pdev_tx_ring
  601. */
  602. int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  603. /*
  604. * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
  605. * @wlan_cfg_ctx
  606. *
  607. * Return: num_tcl_data_rings
  608. */
  609. int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  610. /*
  611. * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
  612. * one per radio
  613. * @wlan_cfg_ctx
  614. *
  615. * Return: per_pdev_rx_ring
  616. */
  617. int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  618. /*
  619. * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
  620. * one per radio
  621. * @wlan_cfg_ctx
  622. *
  623. * Return: return 1 if per pdev error ring else 0
  624. */
  625. int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  626. /*
  627. * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
  628. * @wlan_cfg_ctx - Configuration Handle
  629. *
  630. * Return: num_reo_dest_rings
  631. */
  632. int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  633. /*
  634. * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
  635. * @wlan_cfg_ctx - Configuration Handle
  636. *
  637. * Return: htt_pkt_type_ethernet
  638. */
  639. int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  640. /*
  641. * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
  642. * device
  643. * @wlan_cfg_ctx - Configuration Handle
  644. *
  645. * Return: num_tx_desc_pool
  646. */
  647. int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  648. /*
  649. * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
  650. * device
  651. * @wlan_cfg_ctx - Configuration Handle
  652. * @num_pool - Number of pool
  653. */
  654. void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  655. /*
  656. * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor
  657. * pools
  658. * @wlan_cfg_ctx - Configuration Handle
  659. *
  660. * Return: num_tx_ext_desc_pool
  661. */
  662. int wlan_cfg_get_num_tx_ext_desc_pool(
  663. struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  664. /*
  665. * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
  666. *
  667. * @wlan_cfg_ctx - Configuration Handle
  668. *
  669. * Return: reo_dst_ring_size
  670. */
  671. int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  672. /*
  673. * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
  674. *
  675. * @wlan_cfg_ctx - Configuration Handle
  676. * @reo_dst_ring_size - REO Destination ring size
  677. */
  678. void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  679. int reo_dst_ring_size);
  680. /*
  681. * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
  682. *
  683. * @wlan_cfg_ctx - Configuration Handle
  684. * @raw_mode_war - raw mode war configuration
  685. */
  686. void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
  687. bool raw_mode_war);
  688. /*
  689. * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
  690. *
  691. * @wlan_cfg_ctx - Configuration Handle
  692. *
  693. * Return: reo_dst_ring_size
  694. */
  695. bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
  696. /*
  697. * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
  698. * pools
  699. * @wlan_cfg_ctx - Configuration Handle
  700. * @num_pool - Number of pool
  701. */
  702. void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
  703. /*
  704. * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
  705. * @wlan_cfg_ctx - Configuration Handle
  706. *
  707. * Return: num_tx_desc
  708. */
  709. int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  710. /*
  711. * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
  712. * @wlan_cfg_ctx - Configuration Handle
  713. *
  714. * Return: num_tx_desc
  715. */
  716. int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  717. /*
  718. * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
  719. *
  720. * @wlan_cfg_ctx - Configuration Handle
  721. * @num_desc: Number of descriptor
  722. */
  723. void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
  724. /*
  725. * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
  726. * per pool
  727. * @wlan_cfg_ctx - Configuration Handle
  728. *
  729. * Return: num_tx_ext_desc
  730. */
  731. int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
  732. /*
  733. * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
  734. * per pool
  735. * @wlan_cfg_ctx - Configuration Handle
  736. * @num_desc: Number of descriptor
  737. */
  738. void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
  739. /*
  740. * wlan_cfg_max_peer_id() - Get maximum peer ID
  741. * @cfg: Configuration Handle
  742. *
  743. * Return: maximum peer ID
  744. */
  745. uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
  746. /*
  747. * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
  748. * @wlan_cfg_pdev_ctx
  749. *
  750. * Return: dma_mon_buf_ring_size
  751. */
  752. int wlan_cfg_get_dma_mon_buf_ring_size(
  753. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  754. /*
  755. * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
  756. * Destination ring
  757. * @wlan_cfg_pdev_ctx
  758. *
  759. * Return: dma_mon_dest_size
  760. */
  761. int wlan_cfg_get_dma_mon_dest_ring_size(
  762. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  763. /*
  764. * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
  765. * @wlan_cfg_pdev_ctx
  766. *
  767. * Return: dma_mon_stat_ring_size
  768. */
  769. int wlan_cfg_get_dma_mon_stat_ring_size(
  770. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  771. /*
  772. * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
  773. * @wlan_cfg_soc_ctx
  774. *
  775. * Return: rxdma monitor desc ring size
  776. */
  777. int
  778. wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
  779. /*
  780. * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
  781. * @wlan_cfg_pdev_ctx
  782. *
  783. * Return: rx_dma_buf_ring_size
  784. */
  785. int wlan_cfg_get_rx_dma_buf_ring_size(
  786. struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
  787. /*
  788. * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
  789. * per pdev
  790. * @wlan_cfg_pdev_ctx
  791. *
  792. * Return: number of mac DMA rings per pdev
  793. */
  794. int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
  795. /*
  796. * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
  797. * @wlan_cfg_dp_soc_ctxt
  798. *
  799. * Return: true - LRO enabled false - LRO disabled
  800. */
  801. bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  802. /*
  803. * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
  804. * @wlan_cfg_dp_soc_ctxt
  805. *
  806. * Return: true - GRO enabled false - GRO disabled
  807. */
  808. bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  809. /*
  810. * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
  811. * @wlan_cfg_dp_soc_ctxt
  812. *
  813. * Return: true - enabled false - disabled
  814. */
  815. bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  816. /*
  817. * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
  818. * @wlan_cfg_dp_soc_ctxt
  819. *
  820. * Return: true - enabled false - disabled
  821. */
  822. bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  823. /*
  824. * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
  825. * @wlan_cfg_soc_ctx
  826. * @rx_hash
  827. */
  828. void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
  829. /*
  830. * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
  831. * @wlan_cfg_pdev_ctx
  832. *
  833. * Return: 1 - enabled 0 - disabled
  834. */
  835. int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
  836. /*
  837. * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
  838. * @wlan_cfg_pdev_ctx
  839. */
  840. void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
  841. /*
  842. * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
  843. * @wlan_cfg_pdev_ctx
  844. *
  845. * Return: nss_cfg
  846. */
  847. int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
  848. /*
  849. * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
  850. * @wlan_cfg_pdev_ctx
  851. *
  852. */
  853. void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
  854. /*
  855. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
  856. * @wlan_cfg_soc_ctx
  857. *
  858. * Return: Batch threshold
  859. */
  860. int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  861. /*
  862. * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
  863. * @wlan_cfg_soc_ctx
  864. *
  865. * Return: Timer threshold
  866. */
  867. int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
  868. /*
  869. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  870. * @wlan_cfg_soc_ctx
  871. *
  872. * Return: Batch threshold
  873. */
  874. int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  875. /*
  876. * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
  877. * @wlan_cfg_soc_ctx
  878. *
  879. * Return: Timer threshold
  880. */
  881. int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
  882. /*
  883. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  884. * @wlan_cfg_soc_ctx
  885. *
  886. * Return: Batch threshold
  887. */
  888. int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  889. /*
  890. * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
  891. * @wlan_cfg_soc_ctx
  892. *
  893. * Return: Timer threshold
  894. */
  895. int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
  896. /*
  897. * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
  898. * @wlan_cfg_soc_ctx
  899. *
  900. * Return: Timer threshold
  901. */
  902. int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
  903. /*
  904. * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
  905. * @wlan_cfg_soc_ctx
  906. *
  907. * Return: Checksum offload enable or disable
  908. */
  909. int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
  910. /*
  911. * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
  912. * @wlan_cfg_soc_ctx
  913. *
  914. * Return: Tx Ring Size
  915. */
  916. int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  917. /*
  918. * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
  919. * @wlan_cfg_soc_ctx
  920. *
  921. * Return: Tx Completion ring size
  922. */
  923. int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  924. /*
  925. * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
  926. * @wlan_cfg_soc_ctx
  927. *
  928. * Return: wbm_release_ring size
  929. */
  930. int
  931. wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  932. /*
  933. * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
  934. * @wlan_cfg_soc_ctx
  935. *
  936. * Return: tcl_cmd_credit_ring size
  937. */
  938. int
  939. wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  940. /*
  941. * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
  942. * @wlan_cfg_soc_ctx
  943. *
  944. * Return: tcl_status_ring size
  945. */
  946. int
  947. wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  948. /*
  949. * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
  950. * @wlan_cfg_soc_ctx
  951. *
  952. * Return: reo_reinject_ring size
  953. */
  954. int
  955. wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  956. /*
  957. * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
  958. * @wlan_cfg_soc_ctx
  959. *
  960. * Return: rx_release_ring size
  961. */
  962. int
  963. wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  964. /*
  965. * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
  966. * @wlan_cfg_soc_ctx
  967. *
  968. * Return: reo_exception_ring size
  969. */
  970. int
  971. wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  972. /*
  973. * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
  974. * @wlan_cfg_soc_ctx
  975. *
  976. * Return: reo_cmd_ring size
  977. */
  978. int
  979. wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  980. /*
  981. * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
  982. * @wlan_cfg_soc_ctx
  983. *
  984. * Return: reo_status_ring size
  985. */
  986. int
  987. wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  988. /*
  989. * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
  990. * @wlan_cfg_soc_ctx
  991. *
  992. * Return: tx desc limit for 5G H
  993. */
  994. int
  995. wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
  996. /*
  997. * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
  998. * @wlan_cfg_soc_ctx
  999. *
  1000. * Return: tx desc limit for 2G
  1001. */
  1002. int
  1003. wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
  1004. /*
  1005. * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
  1006. * @wlan_cfg_soc_ctx
  1007. *
  1008. * Return: tx desc limit for 5G L
  1009. */
  1010. int
  1011. wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
  1012. /*
  1013. * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
  1014. * @wlan_cfg_soc_ctx
  1015. *
  1016. * Return: tx device limit
  1017. */
  1018. int
  1019. wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
  1020. /*
  1021. * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
  1022. * @wlan_cfg_soc_ctx
  1023. *
  1024. * Return: tx sw internode queue
  1025. */
  1026. int
  1027. wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
  1028. /*
  1029. * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  1030. * @wlan_cfg_soc_ctx
  1031. *
  1032. * Return: rxdma refill ring size
  1033. */
  1034. int
  1035. wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1036. /*
  1037. * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  1038. * @wlan_cfg_soc_ctx
  1039. *
  1040. * Return: rxdma error dst ring size
  1041. */
  1042. int
  1043. wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1044. /*
  1045. * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
  1046. * @wlan_cfg_soc_ctx
  1047. *
  1048. * Return: rx_sw_desc_weight
  1049. */
  1050. int
  1051. wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
  1052. /*
  1053. * wlan_cfg_get_dp_caps - Get dp capablities
  1054. * @wlan_cfg_soc_ctx
  1055. * @dp_caps: enum for dp capablities
  1056. *
  1057. * Return: bool if a dp capabilities is enabled
  1058. */
  1059. bool
  1060. wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
  1061. enum cdp_capabilities dp_caps);
  1062. /**
  1063. * wlan_set_srng_cfg() - Fill per ring specific
  1064. * configuration parameters
  1065. * @wlan_cfg: global srng configuration table
  1066. *
  1067. * Return: None
  1068. */
  1069. void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
  1070. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  1071. int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
  1072. int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
  1073. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  1074. int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
  1075. int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
  1076. /**
  1077. * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
  1078. * in number of entries
  1079. *
  1080. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1081. *
  1082. * Return: rx_fst_size
  1083. */
  1084. uint16_t
  1085. wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
  1086. /**
  1087. * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
  1088. *
  1089. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1090. *
  1091. * Return: max_search
  1092. */
  1093. uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
  1094. /**
  1095. * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
  1096. * search
  1097. *
  1098. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1099. *
  1100. * Return: 320-bit Hash Key
  1101. */
  1102. uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
  1103. /**
  1104. * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
  1105. * DP soc context
  1106. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1107. * @val: Rx flow tag feature flag value
  1108. *
  1109. * Return: None
  1110. */
  1111. void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1112. bool val);
  1113. /**
  1114. * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
  1115. * DP soc context
  1116. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1117. *
  1118. * Return: true if feature is enabled, else false
  1119. */
  1120. bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1121. /**
  1122. * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
  1123. * Rx FST is per pdev
  1124. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1125. * @val: boolean flag indicating Rx FST per pdev or per SOC
  1126. *
  1127. * Return: None
  1128. */
  1129. void
  1130. wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
  1131. bool val);
  1132. /**
  1133. * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
  1134. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1135. *
  1136. * Return: true if Rx FST is per pdev, else false
  1137. */
  1138. bool
  1139. wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
  1140. /**
  1141. * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
  1142. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1143. * @val: Rx FST size in number of entries
  1144. *
  1145. * Return: None
  1146. */
  1147. void
  1148. wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
  1149. uint16_t val);
  1150. /**
  1151. * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
  1152. * in DP soc context
  1153. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1154. * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
  1155. *
  1156. * Return: None
  1157. */
  1158. void
  1159. wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
  1160. bool val);
  1161. /**
  1162. * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
  1163. * from DP soc context
  1164. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1165. *
  1166. * Return: true if feature is enabled in monitor mode for protocol or flow
  1167. * tagging in INI, false otherwise
  1168. */
  1169. bool
  1170. wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1171. /**
  1172. * wlan_cfg_fill_interrupt_mask() - set interrupt mask
  1173. *
  1174. * @wlan_cfg_dp_soc_ctxt: soc configuration context
  1175. * @interrupt_mode: interrupt_mode: MSI/LEGACY
  1176. * @is_monitor_mode: is monitor mode enabled
  1177. *
  1178. * Return: void
  1179. */
  1180. void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
  1181. int interrupt_mode, bool is_monitor_mode);
  1182. /**
  1183. * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
  1184. *
  1185. *
  1186. * @cfg: soc configuration context
  1187. *
  1188. * Return: true if enabled, false otherwise.
  1189. */
  1190. bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  1191. #endif
  1192. void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
  1193. bool val);
  1194. bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);