qcacmn: Add CDP ops for SAWF telemetry config

Add the following CDP ops for SAWF telemetry config

txrx_sawf_set_mov_avg_params
txrx_sawf_set_sla_params
txrx_sawf_init_telemtery_params

Change-Id: Ifb52df6745ba0b6869cb87301a85d7a8b87b4cb6
CRs-Fixed: 3194181
This commit is contained in:
Vivek
2022-05-11 17:56:14 +05:30
committed by Madan Koyyalamudi
parent 7740da08ad
commit 68d53d1631
3 changed files with 83 additions and 0 deletions

View File

@@ -2006,6 +2006,12 @@ struct cdp_sawf_ops {
(*txrx_get_peer_sawf_tx_stats)(struct cdp_soc_t *soc, (*txrx_get_peer_sawf_tx_stats)(struct cdp_soc_t *soc,
uint32_t svc_id, uint8_t *mac, uint32_t svc_id, uint8_t *mac,
void *data); void *data);
QDF_STATUS
(*txrx_sawf_set_mov_avg_params)(uint32_t num_pkt, uint32_t num_win);
QDF_STATUS
(*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs);
QDF_STATUS
(*txrx_sawf_init_telemtery_params)(void);
#endif #endif
}; };
#endif #endif

View File

@@ -127,6 +127,80 @@ cdp_get_peer_sawf_tx_stats(ol_txrx_soc_handle soc, uint32_t svc_id,
return soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats(soc, svc_id, return soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats(soc, svc_id,
mac, data); mac, data);
} }
/**
* cdp_sawf_set_mov_avg_params - Set moving average pararms
* @num_pkt: No of packets per window to calucalte moving average
* @num_win: No of windows to calucalte moving average
*
* Return: QDF_STATUS
*/
static inline QDF_STATUS
cdp_sawf_set_mov_avg_params(ol_txrx_soc_handle soc,
uint32_t num_pkt,
uint32_t num_win)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->sawf_ops ||
!soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats)
return QDF_STATUS_E_FAILURE;
return soc->ops->sawf_ops->txrx_sawf_set_mov_avg_params(num_pkt,
num_win);
}
/**
* cdp_sawf_set_sla_params - Set SLA pararms
* @num_pkt: No of packets to detect SLA breach
* @time_secs: Time ins secs to detect breach
*
* Return: QDF_STATUS
*/
static inline QDF_STATUS
cdp_sawf_set_sla_params(ol_txrx_soc_handle soc,
uint32_t num_pkt,
uint32_t time_secs)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->sawf_ops ||
!soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats)
return QDF_STATUS_E_FAILURE;
return soc->ops->sawf_ops->txrx_sawf_set_sla_params(num_pkt,
time_secs);
}
/**
* cdp_sawf_init_telemetry_param - Initialize telemetry pararms
*
* Return: none
*/
static inline QDF_STATUS
cdp_sawf_init_telemtery_params(ol_txrx_soc_handle soc)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->sawf_ops ||
!soc->ops->sawf_ops->txrx_get_peer_sawf_tx_stats)
return QDF_STATUS_E_FAILURE;
return soc->ops->sawf_ops->txrx_sawf_init_telemtery_params();
}
#else #else
static inline QDF_STATUS static inline QDF_STATUS
cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id, cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id,

View File

@@ -12718,6 +12718,9 @@ static struct cdp_sawf_ops dp_ops_sawf = {
#ifdef CONFIG_SAWF #ifdef CONFIG_SAWF
.txrx_get_peer_sawf_delay_stats = dp_sawf_get_peer_delay_stats, .txrx_get_peer_sawf_delay_stats = dp_sawf_get_peer_delay_stats,
.txrx_get_peer_sawf_tx_stats = dp_sawf_get_peer_tx_stats, .txrx_get_peer_sawf_tx_stats = dp_sawf_get_peer_tx_stats,
.txrx_sawf_set_mov_avg_params = dp_sawf_set_mov_avg_params,
.txrx_sawf_set_sla_params = dp_sawf_set_sla_params,
.txrx_sawf_init_telemtery_params = dp_sawf_init_telemetry_params,
#endif #endif
}; };
#endif #endif