123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888 |
- /*
- * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
- #ifndef _DP_RINGS_H_
- #define _DP_RINGS_H_
- #include <dp_types.h>
- #include <dp_internal.h>
- #ifdef WIFI_MONITOR_SUPPORT
- #include <dp_mon.h>
- #endif
- #ifdef WLAN_FEATURE_DP_EVENT_HISTORY
- static inline bool dp_is_mon_mask_valid(struct dp_soc *soc,
- struct dp_intr *intr_ctx)
- {
- if (intr_ctx->rx_mon_ring_mask)
- return true;
- return false;
- }
- #else
- static inline bool dp_is_mon_mask_valid(struct dp_soc *soc,
- struct dp_intr *intr_ctx)
- {
- return false;
- }
- #endif
- #ifndef QCA_HOST_MODE_WIFI_DISABLED
- /**
- * dp_srng_get_cpu() - Get the smp processor id for srng processing
- *
- * Return: smp processor id
- */
- static inline int dp_srng_get_cpu(void)
- {
- return qdf_get_cpu();
- }
- #else /* QCA_HOST_MODE_WIFI_DISABLED */
- /**
- * dp_srng_get_cpu() - Get the smp processor id for srng processing
- *
- * Return: smp processor id
- */
- static inline int dp_srng_get_cpu(void)
- {
- return 0;
- }
- #endif /* QCA_HOST_MODE_WIFI_DISABLED */
- /**
- * dp_interrupt_timer() - timer poll for interrupts
- * @arg: SoC Handle
- *
- * Return:
- *
- */
- void dp_interrupt_timer(void *arg);
- /**
- * dp_soc_print_inactive_objects() - prints inactive peer and vdev list
- * @soc: DP SOC handle
- *
- */
- void dp_soc_print_inactive_objects(struct dp_soc *soc);
- /**
- * dp_get_tx_pending() - read pending tx
- * @pdev_handle: Datapath PDEV handle
- *
- * Return: outstanding tx
- */
- int32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle);
- /**
- * dp_find_missing_tx_comp() - check for leaked descriptor in tx path
- * @soc: DP SOC context
- *
- * Parse through descriptors in all pools and validate magic number and
- * completion time. Trigger self recovery if magic value is corrupted.
- *
- * Return: None.
- */
- void dp_find_missing_tx_comp(struct dp_soc *soc);
- void dp_enable_verbose_debug(struct dp_soc *soc);
- QDF_STATUS dp_peer_legacy_setup(struct dp_soc *soc, struct dp_peer *peer);
- uint32_t dp_service_srngs_wrapper(void *dp_ctx, uint32_t dp_budget, int cpu);
- void dp_soc_interrupt_map_calculate(struct dp_soc *soc, int intr_ctx_num,
- int *irq_id_map, int *num_irq);
- void dp_srng_msi_setup(struct dp_soc *soc, struct dp_srng *srng,
- struct hal_srng_params *ring_params,
- int ring_type, int ring_num);
- void
- dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- int ring_type, int ring_num,
- int num_entries);
- int dp_process_lmac_rings(struct dp_intr *int_ctx, int total_budget);
- /**
- * dp_service_lmac_rings()- timer to reap lmac rings
- * @arg: SoC Handle
- *
- * Return:
- *
- */
- void dp_service_lmac_rings(void *arg);
- /**
- * dp_service_srngs() - Top level interrupt handler for DP Ring interrupts
- * @dp_ctx: DP SOC handle
- * @dp_budget: Number of frames/descriptors that can be processed in one shot
- * @cpu: CPU on which this instance is running
- *
- * Return: remaining budget/quota for the soc device
- */
- uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu);
- /**
- * dp_soc_set_interrupt_mode() - Set the interrupt mode in soc
- * @soc: DP soc handle
- *
- * Set the appropriate interrupt mode flag in the soc
- */
- void dp_soc_set_interrupt_mode(struct dp_soc *soc);
- /**
- * dp_srng_find_ring_in_mask() - find which ext_group a ring belongs
- * @ring_num: ring num of the ring being queried
- * @grp_mask: the grp_mask array for the ring type in question.
- *
- * The grp_mask array is indexed by group number and the bit fields correspond
- * to ring numbers. We are finding which interrupt group a ring belongs to.
- *
- * Return: the index in the grp_mask array with the ring number.
- * -QDF_STATUS_E_NOENT if no entry is found
- */
- static inline int dp_srng_find_ring_in_mask(int ring_num, uint8_t *grp_mask)
- {
- int ext_group_num;
- uint8_t mask = 1 << ring_num;
- for (ext_group_num = 0; ext_group_num < WLAN_CFG_INT_NUM_CONTEXTS;
- ext_group_num++) {
- if (mask & grp_mask[ext_group_num])
- return ext_group_num;
- }
- return -QDF_STATUS_E_NOENT;
- }
- /* MCL specific functions */
- #if defined(DP_CON_MON)
- #ifdef DP_CON_MON_MSI_ENABLED
- /**
- * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
- * @soc: pointer to dp_soc handle
- * @intr_ctx_num: interrupt context number for which mon mask is needed
- *
- * For MCL, monitor mode rings are being processed in timer contexts (polled).
- * This function is returning 0, since in interrupt mode(softirq based RX),
- * we donot want to process monitor mode rings in a softirq.
- *
- * So, in case packet log is enabled for SAP/STA/P2P modes,
- * regular interrupt processing will not process monitor mode rings. It would be
- * done in a separate timer context.
- *
- * Return: 0
- */
- static inline uint32_t
- dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx_num)
- {
- return wlan_cfg_get_rx_mon_ring_mask(soc->wlan_cfg_ctx, intr_ctx_num);
- }
- #else
- /**
- * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
- * @soc: pointer to dp_soc handle
- * @intr_ctx_num: interrupt context number for which mon mask is needed
- *
- * For MCL, monitor mode rings are being processed in timer contexts (polled).
- * This function is returning 0, since in interrupt mode(softirq based RX),
- * we donot want to process monitor mode rings in a softirq.
- *
- * So, in case packet log is enabled for SAP/STA/P2P modes,
- * regular interrupt processing will not process monitor mode rings. It would be
- * done in a separate timer context.
- *
- * Return: 0
- */
- static inline uint32_t
- dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx_num)
- {
- return 0;
- }
- #endif
- #else
- /**
- * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
- * @soc: pointer to dp_soc handle
- * @intr_ctx_num: interrupt context number for which mon mask is needed
- *
- * Return: mon mask value
- */
- static inline
- uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc,
- int intr_ctx_num)
- {
- return wlan_cfg_get_rx_mon_ring_mask(soc->wlan_cfg_ctx, intr_ctx_num);
- }
- #endif
- #ifdef DISABLE_MON_RING_MSI_CFG
- /**
- * dp_skip_msi_cfg() - Check if msi cfg has to be skipped for ring_type
- * @soc: DP SoC context
- * @ring_type: sring type
- *
- * Return: True if msi cfg should be skipped for srng type else false
- */
- static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
- {
- if (ring_type == RXDMA_MONITOR_STATUS)
- return true;
- return false;
- }
- #else
- #ifdef DP_CON_MON_MSI_ENABLED
- #ifdef WLAN_SOFTUMAC_SUPPORT
- static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
- {
- if (soc->cdp_soc.ol_ops->get_con_mode &&
- soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) {
- if (ring_type != RXDMA_MONITOR_STATUS)
- return true;
- } else if (ring_type == RXDMA_MONITOR_STATUS &&
- !dp_mon_mode_local_pkt_capture(soc)) {
- return true;
- }
- return false;
- }
- #else
- static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
- {
- if (soc->cdp_soc.ol_ops->get_con_mode &&
- soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) {
- if (ring_type == REO_DST || ring_type == RXDMA_DST)
- return true;
- } else if (ring_type == RXDMA_MONITOR_STATUS &&
- !dp_mon_mode_local_pkt_capture(soc)) {
- return true;
- }
- return false;
- }
- #endif
- #else
- static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
- {
- return false;
- }
- #endif /* DP_CON_MON_MSI_ENABLED */
- #endif /* DISABLE_MON_RING_MSI_CFG */
- /**
- * dp_is_msi_group_number_invalid() - check msi_group_number valid or not
- * @soc: dp_soc
- * @msi_group_number: MSI group number.
- * @msi_data_count: MSI data count.
- *
- * Return: true if msi_group_number is invalid.
- */
- static inline bool dp_is_msi_group_number_invalid(struct dp_soc *soc,
- int msi_group_number,
- int msi_data_count)
- {
- if (soc && soc->osdev && soc->osdev->dev &&
- pld_is_one_msi(soc->osdev->dev))
- return false;
- return msi_group_number > msi_data_count;
- }
- #ifndef WLAN_SOFTUMAC_SUPPORT
- /**
- * dp_soc_attach_poll() - Register handlers for DP interrupts
- * @txrx_soc: DP SOC handle
- *
- * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
- * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
- * rx_monitor_ring mask to indicate the rings that are processed by the handler.
- *
- * Return: 0 for success, nonzero for failure.
- */
- QDF_STATUS dp_soc_attach_poll(struct cdp_soc_t *txrx_soc);
- /**
- * dp_soc_interrupt_attach() - Register handlers for DP interrupts
- * @txrx_soc: DP SOC handle
- *
- * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
- * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
- * rx_monitor_ring mask to indicate the rings that are processed by the handler.
- *
- * Return: 0 for success. nonzero for failure.
- */
- QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc);
- /**
- * dp_hw_link_desc_ring_free() - Free h/w link desc rings
- * @soc: DP SOC handle
- *
- * Return: none
- */
- void dp_hw_link_desc_ring_free(struct dp_soc *soc);
- /**
- * dp_hw_link_desc_ring_alloc() - Allocate hw link desc rings
- * @soc: DP SOC handle
- *
- * Allocate memory for WBM_IDLE_LINK srng ring if the number of
- * link descriptors is less then the max_allocated size. else
- * allocate memory for wbm_idle_scatter_buffer.
- *
- * Return: QDF_STATUS_SUCCESS: success
- * QDF_STATUS_E_NO_MEM: No memory (Failure)
- */
- QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc);
- /**
- * dp_hw_link_desc_ring_init() - Initialize hw link desc rings
- * @soc: DP SOC handle
- *
- * Return: QDF_STATUS_SUCCESS: success
- * QDF_STATUS_E_FAILURE: failure
- */
- QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc);
- /**
- * dp_hw_link_desc_ring_deinit() - Reset hw link desc rings
- * @soc: DP SOC handle
- *
- * Return: None
- */
- void dp_hw_link_desc_ring_deinit(struct dp_soc *soc);
- /**
- * dp_ipa_hal_tx_init_alt_data_ring() - IPA hal init data rings
- * @soc: DP SOC handle
- *
- * Return: None
- */
- void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc);
- /*
- * dp_soc_reset_ring_map() - Reset cpu ring map
- * @soc: Datapath soc handler
- *
- * This api resets the default cpu ring map
- */
- void dp_soc_reset_cpu_ring_map(struct dp_soc *soc);
- /*
- * dp_soc_reset_ipa_vlan_intr_mask() - reset interrupt mask for IPA offloaded
- * ring for vlan tagged traffic
- * @dp_soc - DP Soc handle
- *
- * Return: Return void
- */
- void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc);
- /*
- * dp_soc_reset_intr_mask() - reset interrupt mask
- * @dp_soc - DP Soc handle
- *
- * Return: Return void
- */
- void dp_soc_reset_intr_mask(struct dp_soc *soc);
- /*
- * dp_reo_frag_dst_set() - configure reo register to set the
- * fragment destination ring
- * @soc : Datapath soc
- * @frag_dst_ring : output parameter to set fragment destination ring
- *
- * Based on offload_radio below fragment destination rings is selected
- * 0 - TCL
- * 1 - SW1
- * 2 - SW2
- * 3 - SW3
- * 4 - SW4
- * 5 - Release
- * 6 - FW
- * 7 - alternate select
- *
- * return: void
- */
- void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring);
- /**
- * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
- * @pdev: DP_PDEV handle
- *
- * Return: void
- */
- void
- dp_dscp_tid_map_setup(struct dp_pdev *pdev);
- /**
- * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
- * @pdev: DP_PDEV handle
- *
- * Return: void
- */
- void
- dp_pcp_tid_map_setup(struct dp_pdev *pdev);
- /**
- * dp_soc_deinit() - Deinitialize txrx SOC
- * @txrx_soc: Opaque DP SOC handle
- *
- * Return: None
- */
- void dp_soc_deinit(void *txrx_soc);
- #ifdef QCA_HOST2FW_RXBUF_RING
- void
- dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
- int lmac_id);
- #endif
- /*
- * dp_peer_setup_wifi3() - initialize the peer
- * @soc_hdl: soc handle object
- * @vdev_id : vdev_id of vdev object
- * @peer_mac: Peer's mac address
- * @peer_setup_info: peer setup info for MLO
- *
- * Return: QDF_STATUS
- */
- QDF_STATUS
- dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
- uint8_t *peer_mac,
- struct cdp_peer_setup_info *setup_info);
- uint32_t dp_get_tx_rings_grp_bitmap(struct cdp_soc_t *soc_hdl);
- /*
- * dp_set_ba_aging_timeout() - set ba aging timeout per AC
- * @txrx_soc: cdp soc handle
- * @ac: Access category
- * @value: timeout value in millisec
- *
- * Return: void
- */
- void dp_set_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
- uint8_t ac, uint32_t value);
- /*
- * dp_get_ba_aging_timeout() - get ba aging timeout per AC
- * @txrx_soc: cdp soc handle
- * @ac: access category
- * @value: timeout value in millisec
- *
- * Return: void
- */
- void dp_get_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
- uint8_t ac, uint32_t *value);
- /*
- * dp_set_pdev_reo_dest() - set the reo destination ring for this pdev
- * @txrx_soc: cdp soc handle
- * @pdev_id: id of physical device object
- * @val: reo destination ring index (1 - 4)
- *
- * Return: QDF_STATUS
- */
- QDF_STATUS
- dp_set_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id,
- enum cdp_host_reo_dest_ring val);
- /*
- * dp_get_pdev_reo_dest() - get the reo destination for this pdev
- * @txrx_soc: cdp soc handle
- * @pdev_id: id of physical device object
- *
- * Return: reo destination ring index
- */
- enum cdp_host_reo_dest_ring
- dp_get_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id);
- /**
- * dp_set_pdev_pcp_tid_map_wifi3(): update pcp tid map in pdev
- * @psoc: dp soc handle
- * @pdev_id: id of DP_PDEV handle
- * @pcp: pcp value
- * @tid: tid value passed by the user
- *
- * Return: QDF_STATUS_SUCCESS on success
- */
- QDF_STATUS dp_set_pdev_pcp_tid_map_wifi3(ol_txrx_soc_handle psoc,
- uint8_t pdev_id,
- uint8_t pcp, uint8_t tid);
- /**
- * dp_set_vdev_pcp_tid_map_wifi3(): update pcp tid map in vdev
- * @soc_hdl: DP soc handle
- * @vdev_id: id of DP_VDEV handle
- * @pcp: pcp value
- * @tid: tid value passed by the user
- *
- * Return: QDF_STATUS_SUCCESS on success
- */
- QDF_STATUS dp_set_vdev_pcp_tid_map_wifi3(struct cdp_soc_t *soc_hdl,
- uint8_t vdev_id,
- uint8_t pcp, uint8_t tid);
- /* *
- * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
- * @soc: dp soc.
- * @pdev: dp pdev.
- *
- * Return: None.
- */
- void
- dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev);
- /**
- * dp_display_srng_info() - Dump the srng HP TP info
- * @soc_hdl: CDP Soc handle
- *
- * This function dumps the SW hp/tp values for the important rings.
- * HW hp/tp values are not being dumped, since it can lead to
- * READ NOC error when UMAC is in low power state. MCC does not have
- * device force wake working yet.
- *
- * Return: rings are empty
- */
- bool dp_display_srng_info(struct cdp_soc_t *soc_hdl);
- #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
- QDF_STATUS dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only);
- /*
- * dp_update_ring_hptp() - update dp rings hptp
- * @soc: dp soc handler
- * @force_flush_tx: force flush the Tx ring hp
- */
- void dp_update_ring_hptp(struct dp_soc *soc, bool force_flush_tx);
- #endif
- /*
- * dp_flush_tcl_ring() - flush TCL ring hp
- * @pdev: dp pdev
- * @ring_id: TCL ring id
- *
- * Return: 0 on success and error code on failure
- */
- int dp_flush_tcl_ring(struct dp_pdev *pdev, int ring_id);
- #ifdef WLAN_FEATURE_STATS_EXT
- /**
- * dp_request_rx_hw_stats - request rx hardware stats
- * @soc_hdl: soc handle
- * @vdev_id: vdev id
- *
- * Return: None
- */
- QDF_STATUS
- dp_request_rx_hw_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
- #endif
- /**
- * dp_reset_rx_hw_ext_stats - Reset rx hardware ext stats
- * @soc_hdl: soc handle
- *
- * Return: None
- */
- void dp_reset_rx_hw_ext_stats(struct cdp_soc_t *soc_hdl);
- void dp_pdev_set_default_reo(struct dp_pdev *pdev);
- /**
- * dp_soc_init() - Initialize txrx SOC
- * @soc: Opaque DP SOC handle
- * @htc_handle: Opaque HTC handle
- * @hif_handle: Opaque HIF handle
- *
- * Return: DP SOC handle on success, NULL on failure
- */
- void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
- struct hif_opaque_softc *hif_handle);
- void dp_tx_init_cmd_credit_ring(struct dp_soc *soc);
- /**
- * dp_soc_srng_deinit() - de-initialize soc srng rings
- * @soc: Datapath soc handle
- *
- */
- void dp_soc_srng_deinit(struct dp_soc *soc);
- /**
- * dp_soc_srng_init() - Initialize soc level srng rings
- * @soc: Datapath soc handle
- *
- * return: QDF_STATUS_SUCCESS on success
- * QDF_STATUS_E_FAILURE on failure
- */
- QDF_STATUS dp_soc_srng_init(struct dp_soc *soc);
- /**
- * dp_soc_srng_free() - free soc level srng rings
- * @soc: Datapath soc handle
- *
- */
- void dp_soc_srng_free(struct dp_soc *soc);
- /**
- * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
- * @soc: Datapath soc handle
- *
- * return: QDF_STATUS_SUCCESS on success
- * QDF_STATUS_E_NOMEM on failure
- */
- QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc);
- /**
- * dp_soc_cfg_attach() - set target specific configuration in
- * dp soc cfg.
- * @soc: dp soc handle
- */
- void dp_soc_cfg_attach(struct dp_soc *soc);
- #else /* WLAN_SOFTUMAC_SUPPORT */
- static inline void dp_hw_link_desc_ring_free(struct dp_soc *soc)
- {
- }
- static inline QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc)
- {
- return QDF_STATUS_SUCCESS;
- }
- static inline QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc)
- {
- return QDF_STATUS_SUCCESS;
- }
- static inline void dp_hw_link_desc_ring_deinit(struct dp_soc *soc)
- {
- }
- static inline void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc)
- {
- }
- static inline void dp_soc_reset_cpu_ring_map(struct dp_soc *soc)
- {
- }
- static inline void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc)
- {
- }
- static inline void dp_soc_reset_intr_mask(struct dp_soc *soc)
- {
- }
- static inline
- void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring)
- {
- }
- /**
- * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
- * @pdev: DP_PDEV handle
- *
- * Return: void
- */
- static inline void
- dp_dscp_tid_map_setup(struct dp_pdev *pdev)
- {
- }
- /**
- * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
- * @pdev: DP_PDEV handle
- *
- * Return: void
- */
- static inline void
- dp_pcp_tid_map_setup(struct dp_pdev *pdev)
- {
- }
- #ifdef QCA_HOST2FW_RXBUF_RING
- static inline void
- dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
- int lmac_id)
- {
- if ((soc->cdp_soc.ol_ops->get_con_mode &&
- soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) &&
- soc->rxdma_err_dst_ring[lmac_id].hal_srng)
- htt_srng_setup(soc->htt_handle, mac_id,
- soc->rxdma_err_dst_ring[lmac_id].hal_srng,
- RXDMA_DST);
- }
- #endif
- /* *
- * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
- * @soc: dp soc.
- * @pdev: dp pdev.
- *
- * Return: None.
- */
- static inline void
- dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev)
- {
- }
- static inline void dp_pdev_set_default_reo(struct dp_pdev *pdev)
- {
- }
- static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
- {
- }
- /**
- * dp_soc_srng_deinit() - de-initialize soc srng rings
- * @soc: Datapath soc handle
- *
- */
- static inline void dp_soc_srng_deinit(struct dp_soc *soc)
- {
- }
- /**
- * dp_soc_srng_init() - Initialize soc level srng rings
- * @soc: Datapath soc handle
- *
- * return: QDF_STATUS_SUCCESS on success
- * QDF_STATUS_E_FAILURE on failure
- */
- static inline QDF_STATUS dp_soc_srng_init(struct dp_soc *soc)
- {
- dp_enable_verbose_debug(soc);
- return QDF_STATUS_SUCCESS;
- }
- /**
- * dp_soc_srng_free() - free soc level srng rings
- * @soc: Datapath soc handle
- *
- */
- static inline void dp_soc_srng_free(struct dp_soc *soc)
- {
- }
- /**
- * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
- * @soc: Datapath soc handle
- *
- * return: QDF_STATUS_SUCCESS on success
- * QDF_STATUS_E_NOMEM on failure
- */
- static inline QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
- {
- return QDF_STATUS_SUCCESS;
- }
- /**
- * dp_display_srng_info() - Dump the ring Read/Write idx info
- * @soc_hdl: CDP Soc handle
- *
- * This function dumps the SW Read/Write idx for the important rings.
- *
- * Return: rings are empty
- */
- static inline bool dp_display_srng_info(struct cdp_soc_t *soc_hdl)
- {
- /*TODO add support display SOFTUMAC data rings info*/
- return true;
- }
- #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
- static inline QDF_STATUS dp_drain_txrx(struct cdp_soc_t *soc_handle,
- uint8_t rx_only)
- {
- return QDF_STATUS_SUCCESS;
- }
- #endif
- #endif /* WLAN_SOFTUMAC_SUPPORT */
- #if defined(WLAN_FEATURE_NEAR_FULL_IRQ) && !defined(WLAN_SOFTUMAC_SUPPORT)
- void dp_srng_msi2_setup(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- int ring_type, int ring_num, int nf_msi_grp_num);
- void dp_srng_set_msi2_ring_params(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- qdf_dma_addr_t msi2_addr,
- uint32_t msi2_data);
- uint8_t *dp_srng_get_near_full_irq_mask(struct dp_soc *soc,
- enum hal_ring_type ring_type,
- int ring_num);
- void
- dp_srng_configure_nf_interrupt_thresholds(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- int ring_type);
- #else
- static inline void
- dp_srng_msi2_setup(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- int ring_type, int ring_num, int nf_msi_grp_num)
- {
- }
- static inline void
- dp_srng_set_msi2_ring_params(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- qdf_dma_addr_t msi2_addr,
- uint32_t msi2_data)
- {
- }
- static inline
- uint8_t *dp_srng_get_near_full_irq_mask(struct dp_soc *soc,
- enum hal_ring_type ring_type,
- int ring_num)
- {
- return NULL;
- }
- static inline void
- dp_srng_configure_nf_interrupt_thresholds(struct dp_soc *soc,
- struct hal_srng_params *ring_params,
- int ring_type)
- {
- }
- #endif
- #ifdef WLAN_SUPPORT_DPDK
- /*
- * dp_soc_reset_dpdk_intr_mask() - reset interrupt mask
- * @dp_soc - DP Soc handle
- *
- * Return: Return void
- */
- void dp_soc_reset_dpdk_intr_mask(struct dp_soc *soc);
- #else
- static inline void dp_soc_reset_dpdk_intr_mask(struct dp_soc *soc)
- { }
- #endif
- #endif /* _DP_RINGS_H_ */
|