qcacmn: Add cdp API to enable/disable SWLM

Add CDP APIs to enable or disable the Software
latency manager.

Change-Id: I1ec182e97a245ec5848660fa912eebe83cfba2fc
CRs-Fixed: 2769030
This commit is contained in:
Rakesh Pillai
2020-08-30 00:40:37 -07:00
committed by snandini
parent 02723d3bc2
commit 08e5f5bf9d
3 changed files with 90 additions and 0 deletions

View File

@@ -819,4 +819,48 @@ cdp_vdev_inform_ll_conn(ol_txrx_soc_handle soc, uint8_t vdev_id,
return QDF_STATUS_SUCCESS;
}
/**
* cdp_soc_set_swlm_enable() - Enable or disable software latency manager
* @soc: soc handle
* @value: value (enable/disable)
*
* Returns: QDF_STATUS
*/
static inline QDF_STATUS
cdp_soc_set_swlm_enable(ol_txrx_soc_handle soc, uint8_t value)
{
if (!soc || !soc->ops || !soc->ops->misc_ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
return QDF_STATUS_E_INVAL;
}
if (soc->ops->misc_ops->set_swlm_enable)
return soc->ops->misc_ops->set_swlm_enable(soc, value);
return QDF_STATUS_SUCCESS;
}
/**
* cdp_soc_is_swlm_enabled() - Check if the software latency manager is
* enabled or not
* @soc: soc handle
*
* Returns: 1 if enabled, 0 if disabled
*/
static inline uint8_t
cdp_soc_is_swlm_enabled(ol_txrx_soc_handle soc)
{
if (!soc || !soc->ops || !soc->ops->misc_ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
return 0;
}
if (soc->ops->misc_ops->is_swlm_enabled)
return soc->ops->misc_ops->is_swlm_enabled(soc);
return 0;
}
#endif /* _CDP_TXRX_MISC_H_ */

View File

@@ -1166,6 +1166,8 @@ struct ol_if_ops {
*
* @vdev_inform_ll_conn: inform DP to add/delete a latency critical connection
* for this particular vdev.
* @set_swlm_enable: Enable or Disable Software Latency Manager.
* @is_swlm_enabled: Check if Software latency manager is enabled or not.
*
* Function pointers for miscellaneous soc/pdev/vdev related operations.
*/
@@ -1251,6 +1253,9 @@ struct cdp_misc_ops {
QDF_STATUS (*vdev_inform_ll_conn)(struct cdp_soc_t *soc_hdl,
uint8_t vdev_id,
enum vdev_ll_conn_actions action);
QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl,
uint8_t val);
uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl);
};
/**

View File

@@ -9855,6 +9855,43 @@ dp_vdev_inform_ll_conn(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
/**
* dp_soc_set_swlm_enable() - Enable/Disable SWLM if initialized.
* @soc_hdl: CDP Soc handle
* @value: Enable/Disable value
*
* Returns: QDF_STATUS
*/
static QDF_STATUS dp_soc_set_swlm_enable(struct cdp_soc_t *soc_hdl,
uint8_t value)
{
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
if (!soc->swlm.is_init) {
dp_err("SWLM is not initialized");
return QDF_STATUS_E_FAILURE;
}
soc->swlm.is_enabled = !!value;
return QDF_STATUS_SUCCESS;
}
/**
* dp_soc_is_swlm_enabled() - Check if SWLM is enabled.
* @soc_hdl: CDP Soc handle
*
* Returns: QDF_STATUS
*/
static uint8_t dp_soc_is_swlm_enabled(struct cdp_soc_t *soc_hdl)
{
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
return soc->swlm.is_enabled;
}
#endif
/**
* dp_soc_get_dp_txrx_handle() - get context for external-dp from dp soc
* @soc_handle: datapath soc handle
@@ -11224,6 +11261,10 @@ static struct cdp_misc_ops dp_ops_misc = {
.request_rx_hw_stats = dp_request_rx_hw_stats,
#endif /* WLAN_FEATURE_STATS_EXT */
.vdev_inform_ll_conn = dp_vdev_inform_ll_conn,
#ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
.set_swlm_enable = dp_soc_set_swlm_enable,
.is_swlm_enabled = dp_soc_is_swlm_enabled,
#endif
};
#endif