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
此提交包含在:
phadiman
2020-08-11 15:13:44 +05:30
提交者 snandini
父節點 d4b5e25e98
當前提交 3df84438dd
共有 6 個檔案被更改,包括 60 行新增6 行删除

查看文件

@@ -9820,6 +9820,33 @@ dp_flush_rate_stats_req(struct cdp_soc_t *soc_hdl,
}
#endif
static void *dp_peer_get_wlan_stats_ctx(struct cdp_soc_t *soc_hdl,
uint8_t vdev_id,
uint8_t *mac_addr)
{
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
struct dp_peer *peer;
void *wlanstats_ctx = NULL;
if (mac_addr) {
peer = dp_peer_find_hash_find(soc, mac_addr,
0, vdev_id);
if (!peer)
return NULL;
if (peer->delete_in_progress) {
dp_peer_unref_delete(peer);
return NULL;
}
wlanstats_ctx = peer->wlanstats_ctx;
dp_peer_unref_delete(peer);
}
return wlanstats_ctx;
}
#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
static QDF_STATUS dp_peer_flush_rate_stats(struct cdp_soc_t *soc,
uint8_t pdev_id,
@@ -10128,6 +10155,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
.get_rate_stats_ctx = dp_soc_get_rate_stats_ctx,
.txrx_peer_flush_rate_stats = dp_peer_flush_rate_stats,
.txrx_flush_rate_stats_request = dp_flush_rate_stats_req,
.txrx_peer_get_wlan_stats_ctx = dp_peer_get_wlan_stats_ctx,
.set_pdev_pcp_tid_map = dp_set_pdev_pcp_tid_map_wifi3,
.set_vdev_pcp_tid_map = dp_set_vdev_pcp_tid_map_wifi3,