qcacmn: add wrapper function to dp_txrx_get_peer_stats

add wrapper function to dp_txrx_get_peer_stats to handle
identical mlo and link peer case

Change-Id: Ia2d05eca143dd2759c6765c54f26da7f73210271
CRs-Fixed: 3595756
This commit is contained in:
Mukul Dhiman
2023-08-29 15:39:41 +05:30
committed by Rahul Choudhary
parent 667450308d
commit 8f9aadc071
3 changed files with 96 additions and 10 deletions

View File

@@ -541,6 +541,41 @@ cdp_host_get_peer_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
peer_stats); peer_stats);
} }
/**
* cdp_host_get_peer_stats_based_on_peer_type() - Fetch peer stats based on the
* peer type
* @soc: soc handle
* @vdev_id: vdev_id of vdev object
* @peer_mac: mac address of the peer
* @peer_stats: destination buffer
* @peer_type: type of peer
*
* Return: QDF_STATUS
*/
static inline QDF_STATUS
cdp_host_get_peer_stats_based_on_peer_type(ol_txrx_soc_handle soc, uint8_t vdev_id,
uint8_t *peer_mac,
struct cdp_peer_stats *peer_stats,
enum cdp_peer_type peer_type)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->host_stats_ops ||
!soc->ops->host_stats_ops->txrx_get_peer_stats_based_on_peer_type)
return QDF_STATUS_E_FAILURE;
return soc->ops->host_stats_ops->txrx_get_peer_stats_based_on_peer_type(
soc, vdev_id,
peer_mac,
peer_stats,
peer_type);
}
/** /**
* cdp_host_get_per_link_peer_stats() - Call to get peer stats * cdp_host_get_per_link_peer_stats() - Call to get peer stats
* @soc: soc handle * @soc: soc handle

View File

@@ -1163,6 +1163,7 @@ struct cdp_mon_ops {
* @txrx_update_pdev_stats: * @txrx_update_pdev_stats:
* @txrx_get_peer_stats_param: * @txrx_get_peer_stats_param:
* @txrx_get_peer_stats: * @txrx_get_peer_stats:
* @txrx_get_peer_stats_based_on_peer_type:
* @txrx_get_per_link_stats: * @txrx_get_per_link_stats:
* @txrx_get_soc_stats: * @txrx_get_soc_stats:
* @txrx_reset_peer_ald_stats: * @txrx_reset_peer_ald_stats:
@@ -1264,6 +1265,12 @@ struct cdp_host_stats_ops {
(*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
uint8_t *peer_mac, uint8_t *peer_mac,
struct cdp_peer_stats *peer_stats); struct cdp_peer_stats *peer_stats);
QDF_STATUS
(*txrx_get_peer_stats_based_on_peer_type)(struct cdp_soc_t *soc,
uint8_t vdev_id,
uint8_t *peer_mac,
struct cdp_peer_stats *peer_stats,
enum cdp_peer_type peer_type);
QDF_STATUS QDF_STATUS
(*txrx_get_per_link_stats)(struct cdp_soc_t *soc, (*txrx_get_per_link_stats)(struct cdp_soc_t *soc,
uint8_t vdev_id, uint8_t *peer_mac, uint8_t vdev_id, uint8_t *peer_mac,

View File

@@ -9272,23 +9272,19 @@ static QDF_STATUS dp_txrx_update_vdev_host_stats(struct cdp_soc_t *soc_hdl,
} }
/** /**
* dp_txrx_get_peer_stats() - will return cdp_peer_stats * dp_txrx_get_peer_stats_wrapper() - will get cdp_peer_stats
* @soc: soc handle * @soc: soc handle
* @vdev_id: id of vdev handle * @peer_stats: destination buffer to copy to
* @peer_mac: mac of DP_PEER handle * @peer_info: peer info
* @peer_stats: buffer to copy to
* *
* Return: status success/failure * Return: status success/failure
*/ */
static QDF_STATUS static QDF_STATUS
dp_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id, dp_txrx_get_peer_stats_wrapper(struct cdp_soc_t *soc,
uint8_t *peer_mac, struct cdp_peer_stats *peer_stats) struct cdp_peer_stats *peer_stats,
struct cdp_peer_info peer_info)
{ {
struct dp_peer *peer = NULL; struct dp_peer *peer = NULL;
struct cdp_peer_info peer_info = { 0 };
DP_PEER_INFO_PARAMS_INIT(&peer_info, vdev_id, peer_mac, false,
CDP_WILD_PEER_TYPE);
peer = dp_peer_hash_find_wrapper((struct dp_soc *)soc, &peer_info, peer = dp_peer_hash_find_wrapper((struct dp_soc *)soc, &peer_info,
DP_MOD_ID_CDP); DP_MOD_ID_CDP);
@@ -9305,6 +9301,52 @@ dp_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
/**
* dp_txrx_get_peer_stats() - will get cdp_peer_stats
* @soc: soc handle
* @vdev_id: id of vdev handle
* @peer_mac: peer mac address of DP_PEER handle
* @peer_stats: destination buffer to copy to
*
* Return: status success/failure
*/
static QDF_STATUS
dp_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
uint8_t *peer_mac, struct cdp_peer_stats *peer_stats)
{
struct cdp_peer_info peer_info = { 0 };
DP_PEER_INFO_PARAMS_INIT(&peer_info, vdev_id, peer_mac, false,
CDP_WILD_PEER_TYPE);
return dp_txrx_get_peer_stats_wrapper(soc, peer_stats, peer_info);
}
/**
* dp_txrx_get_peer_stats_based_on_peer_type() - get peer stats based on the
* peer type
* @soc: soc handle
* @vdev_id: id of vdev handle
* @peer_mac: mac of DP_PEER handle
* @peer_stats: buffer to copy to
* @peer_type: type of peer
*
* Return: status success/failure
*/
static QDF_STATUS
dp_txrx_get_peer_stats_based_on_peer_type(struct cdp_soc_t *soc, uint8_t vdev_id,
uint8_t *peer_mac,
struct cdp_peer_stats *peer_stats,
enum cdp_peer_type peer_type)
{
struct cdp_peer_info peer_info = { 0 };
DP_PEER_INFO_PARAMS_INIT(&peer_info, vdev_id, peer_mac, false,
peer_type);
return dp_txrx_get_peer_stats_wrapper(soc, peer_stats, peer_info);
}
#if defined WLAN_FEATURE_11BE_MLO && defined DP_MLO_LINK_STATS_SUPPORT #if defined WLAN_FEATURE_11BE_MLO && defined DP_MLO_LINK_STATS_SUPPORT
/** /**
* dp_get_per_link_peer_stats() - Get per link stats * dp_get_per_link_peer_stats() - Get per link stats
@@ -12261,6 +12303,8 @@ static struct cdp_host_stats_ops dp_ops_host_stats = {
.txrx_stats_publish = dp_txrx_stats_publish, .txrx_stats_publish = dp_txrx_stats_publish,
.txrx_get_vdev_stats = dp_txrx_get_vdev_stats, .txrx_get_vdev_stats = dp_txrx_get_vdev_stats,
.txrx_get_peer_stats = dp_txrx_get_peer_stats, .txrx_get_peer_stats = dp_txrx_get_peer_stats,
.txrx_get_peer_stats_based_on_peer_type =
dp_txrx_get_peer_stats_based_on_peer_type,
.txrx_get_soc_stats = dp_txrx_get_soc_stats, .txrx_get_soc_stats = dp_txrx_get_soc_stats,
.txrx_get_peer_stats_param = dp_txrx_get_peer_stats_param, .txrx_get_peer_stats_param = dp_txrx_get_peer_stats_param,
.txrx_get_per_link_stats = dp_txrx_get_per_link_peer_stats, .txrx_get_per_link_stats = dp_txrx_get_per_link_peer_stats,