From 506c4d60f5ef003b3df2ddd0aec31cf5bf4c8f62 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Wed, 25 Apr 2018 16:59:19 +0530 Subject: [PATCH] qcacmn: Add new members to 'struct cdp_lflowctl_ops' for HL flow control Add new function pointers type to 'struct cdp_lflowctl_ops' to set tx desc limit and update OS queue status. Also add cdp_hl_fc_set_os_queue_status() Change-Id: I18dab34c31a5d8f459179358e16ef124a13f5742 CRs-fixed: 2236466 --- dp/inc/cdp_txrx_flow_ctrl_legacy.h | 34 ++++++++++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 3 +++ 2 files changed, 37 insertions(+) diff --git a/dp/inc/cdp_txrx_flow_ctrl_legacy.h b/dp/inc/cdp_txrx_flow_ctrl_legacy.h index 70b7d2f254..f1c6fbfef5 100644 --- a/dp/inc/cdp_txrx_flow_ctrl_legacy.h +++ b/dp/inc/cdp_txrx_flow_ctrl_legacy.h @@ -52,12 +52,46 @@ cdp_hl_fc_register(ol_txrx_soc_handle soc, tx_pause_callback flowcontrol) return soc->ops->l_flowctl_ops->register_tx_flow_control(soc, flowcontrol); } + +static inline int cdp_hl_fc_set_td_limit(ol_txrx_soc_handle soc, + u8 vdev_id, u8 chan) +{ + if (!soc->ops->l_flowctl_ops->set_vdev_tx_desc_limit) + return 0; + + return soc->ops->l_flowctl_ops->set_vdev_tx_desc_limit(vdev_id, chan); +} + +static inline int cdp_hl_fc_set_os_queue_status(ol_txrx_soc_handle soc, + u8 vdev_id, + enum netif_action_type action) +{ + if (!soc->ops->l_flowctl_ops->set_vdev_os_queue_status) + return -EINVAL; + + return soc->ops->l_flowctl_ops->set_vdev_os_queue_status(vdev_id, + action); +} #else static inline int cdp_hl_fc_register(ol_txrx_soc_handle soc, tx_pause_callback flowcontrol) { return 0; } + +static inline int cdp_hl_fc_set_td_limit(ol_txrx_soc_handle soc, + u8 vdev_id, u8 chan) +{ + return 0; +} + +static inline int cdp_hl_fc_set_os_queue_status(ol_txrx_soc_handle soc, + u8 vdev_id, + enum netif_action_type action) +{ + return 0; +} + #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index b845a2cb81..8dfaf6a987 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -900,6 +900,9 @@ struct cdp_lflowctl_ops { #ifdef QCA_HL_NETDEV_FLOW_CONTROL int (*register_tx_flow_control)(struct cdp_soc_t *soc, tx_pause_callback flowcontrol); + int (*set_vdev_tx_desc_limit)(u8 vdev_id, u8 chan); + int (*set_vdev_os_queue_status)(u8 vdev_id, + enum netif_action_type action); #else int (*register_tx_flow_control)(uint8_t vdev_id, ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,