qcacmn: Add CDP API to get peer wlanstats ctx

Peer wlanstats context was accessed directly from
PPDU cookie, with this approach the cookie pointer
may become stale if peer goes for deletion

Hence access the wlanstats context using CDP API
with stats context protection

CRs-Fixed: 2740261
Change-Id: I54c785325f8852ad422f05527b98ebca6e4d6cf0
Tento commit je obsažen v:
phadiman
2020-08-11 15:13:44 +05:30
odevzdal snandini
rodič d4b5e25e98
revize 3df84438dd
6 změnil soubory, kde provedl 60 přidání a 6 odebrání

Zobrazit soubor

@@ -2482,6 +2482,32 @@ cdp_peer_flush_rate_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
soc->ops->cmn_drv_ops->txrx_peer_flush_rate_stats(soc, pdev_id, buf);
}
/**
* cdp_peer_get_wlanstats_ctx() - get wlanstats context
* @soc: opaque soc handle
* @vdev_id: id of vdev handle
* @mac: peer mac address
*/
static inline void
*cdp_peer_get_wlanstats_ctx(ol_txrx_soc_handle soc, uint8_t vdev_id,
uint8_t *mac_addr)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
"%s: Invalid Instance:", __func__);
QDF_BUG(0);
return NULL;
}
if (!soc->ops->cmn_drv_ops ||
!soc->ops->cmn_drv_ops->txrx_peer_get_wlan_stats_ctx)
return NULL;
return soc->ops->cmn_drv_ops->txrx_peer_get_wlan_stats_ctx(soc,
vdev_id,
mac_addr);
}
/**
* cdp_flush_rate_stats_request() - request flush rate statistics
* @soc: opaque soc handle