qcacld-3.0: Update correct vdev_id for vdev stats

Currently, while processing ml vdev chain rssi stats, vdev_id
is not updated properly resulting in populating invalid chain
rssi values.

So, to resolve this issue, update correct vdev_id based on vdev
stats request_info structure for both MLO and Legacy connections.

Change-Id: I37d4001c2dee46396019ca662f89066f73ad4895
CRs-Fixed: 3595057
This commit is contained in:
Aditya Kodukula
2023-08-22 03:49:51 -07:00
committed by Rahul Choudhary
parent d7e0780379
commit 87a4b8604b

View File

@@ -761,31 +761,34 @@ tgt_mc_cp_stats_extract_congestion_stats(struct wlan_objmgr_psoc *psoc,
#ifdef WLAN_FEATURE_11BE_MLO #ifdef WLAN_FEATURE_11BE_MLO
static void static void
update_ml_vdev_id_from_stats_event(struct wlan_objmgr_psoc *psoc, update_ml_vdev_id_from_stats_event(struct wlan_objmgr_psoc *psoc,
struct stats_event *ev,
struct request_info *req, struct request_info *req,
uint8_t *vdev_id) uint8_t *vdev_id)
{ {
uint8_t i, j, t_vdev_id; uint8_t j, t_vdev_id;
if (!wlan_vdev_mlme_get_is_mlo_vdev(psoc, req->vdev_id)) { if ((!wlan_vdev_mlme_get_is_mlo_vdev(psoc, req->vdev_id) &&
!wlan_vdev_mlme_get_is_mlo_link(psoc, req->vdev_id)) ||
!req->ml_vdev_info.ml_vdev_count) {
*vdev_id = req->vdev_id; *vdev_id = req->vdev_id;
return; return;
} }
for (i = 0; i < ev->num_summary_stats; i++) { t_vdev_id = *vdev_id;
t_vdev_id = ev->vdev_summary_stats[i].vdev_id; for (j = 0; j < req->ml_vdev_info.ml_vdev_count; j++) {
for (j = 0; j < req->ml_vdev_info.ml_vdev_count; j++) { if (t_vdev_id == req->ml_vdev_info.ml_vdev_id[j]) {
if (t_vdev_id == req->ml_vdev_info.ml_vdev_id[j]) { *vdev_id = req->ml_vdev_info.ml_vdev_id[j];
*vdev_id = req->ml_vdev_info.ml_vdev_id[j]; return;
break;
}
} }
} }
if (j == req->ml_vdev_info.ml_vdev_count) {
cp_stats_err("vdev[%u] not found", t_vdev_id);
*vdev_id = WLAN_UMAC_VDEV_ID_MAX;
}
} }
#else #else
static void static void
update_ml_vdev_id_from_stats_event(struct wlan_objmgr_psoc *psoc, update_ml_vdev_id_from_stats_event(struct wlan_objmgr_psoc *psoc,
struct stats_event *ev,
struct request_info *req, struct request_info *req,
uint8_t *vdev_id) uint8_t *vdev_id)
{ {
@@ -893,8 +896,9 @@ static void tgt_mc_cp_stats_extract_vdev_summary_stats(
} }
vdev_id = last_req.vdev_id; vdev_id = last_req.vdev_id;
update_ml_vdev_id_from_stats_event(psoc, ev, &last_req, &vdev_id);
for (i = 0; i < ev->num_summary_stats; i++) { for (i = 0; i < ev->num_summary_stats; i++) {
vdev_id = ev->vdev_summary_stats[i].vdev_id;
update_ml_vdev_id_from_stats_event(psoc, &last_req, &vdev_id);
if (ev->vdev_summary_stats[i].vdev_id == vdev_id) if (ev->vdev_summary_stats[i].vdev_id == vdev_id)
break; break;
} }
@@ -973,12 +977,11 @@ static void tgt_mc_cp_stats_extract_vdev_chain_rssi_stats(
} }
for (i = 0; i < ev->num_chain_rssi_stats; i++) { for (i = 0; i < ev->num_chain_rssi_stats; i++) {
vdev_id = last_req.vdev_id; vdev_id = ev->vdev_chain_rssi[i].vdev_id;
if (vdev_id != ev->vdev_chain_rssi[i].vdev_id) update_ml_vdev_id_from_stats_event(psoc, &last_req, &vdev_id);
if (ev->vdev_chain_rssi[i].vdev_id != vdev_id)
continue; continue;
update_ml_vdev_id_from_stats_event(psoc, ev,
&last_req, &vdev_id);
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_CP_STATS_ID); WLAN_CP_STATS_ID);
if (!vdev) { if (!vdev) {