qcacld-3.0: Add sanity check when get STA stats

If macro WLAN_FEATURE_11BE_MLO is enable, get_station_stats_cb for
TYPE_STATION_STATS is called only if last_req->ml_vdev_info.ml_vdev_count
none zero when WMI_UPDATE_STATS_EVENTID event comes back.

This causes timeout and fail to get station stats for legacy device or for
MLO device which does not set last_req->ml_vdev_info.ml_vdev_count.

To resolve this issue, add sanity check legacy device before invoking the
callback and set last_req->ml_vdev_info.ml_vdev_count if it is MLO device.

Change-Id: I8ca325482fc32de87cbedcba7d4af17d3876cbbc
CRs-Fixed: 3202588
This commit is contained in:
Paul Zhang
2022-05-20 09:35:25 +08:00
committed by Madan Koyyalamudi
parent 71fc4f3fd4
commit adc7c05154
2 changed files with 46 additions and 0 deletions

View File

@@ -1103,8 +1103,13 @@ static void
tgt_mc_cp_stats_prepare_n_send_raw_station_stats(struct wlan_objmgr_psoc *psoc, tgt_mc_cp_stats_prepare_n_send_raw_station_stats(struct wlan_objmgr_psoc *psoc,
struct request_info *last_req) struct request_info *last_req)
{ {
bool is_mlo_vdev;
uint8_t i; uint8_t i;
is_mlo_vdev = wlan_vdev_mlme_get_is_mlo_vdev(psoc, last_req->vdev_id);
if (!is_mlo_vdev)
return tgt_mc_cp_stats_send_raw_station_stats(psoc, last_req);
for (i = 0; i < last_req->ml_vdev_info.ml_vdev_count; i++) { for (i = 0; i < last_req->ml_vdev_info.ml_vdev_count; i++) {
last_req->vdev_id = last_req->ml_vdev_info.ml_vdev_id[i]; last_req->vdev_id = last_req->ml_vdev_info.ml_vdev_id[i];
tgt_mc_cp_stats_send_raw_station_stats(psoc, last_req); tgt_mc_cp_stats_send_raw_station_stats(psoc, last_req);

View File

@@ -1370,6 +1370,40 @@ station_adv_stats_cb_fail:
osif_request_put(request); osif_request_put(request);
} }
#ifdef WLAN_FEATURE_11BE_MLO
static QDF_STATUS
wlan_cfg80211_get_mlstats_vdev_params(struct wlan_objmgr_vdev *vdev,
struct request_info *info)
{
struct wlan_objmgr_psoc *psoc;
bool is_mlo_vdev;
QDF_STATUS status;
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc)
return QDF_STATUS_E_INVAL;
is_mlo_vdev = wlan_vdev_mlme_get_is_mlo_vdev(psoc, info->vdev_id);
if (is_mlo_vdev) {
status = mlo_get_mlstats_vdev_params(psoc, &info->ml_vdev_info,
info->vdev_id);
if (QDF_IS_STATUS_ERROR(status)) {
osif_err("unable to get vdev params for mlo stats");
return status;
}
}
return QDF_STATUS_SUCCESS;
}
#else
static QDF_STATUS
wlan_cfg80211_get_mlstats_vdev_params(struct wlan_objmgr_vdev *vdev,
struct request_info *info)
{
return QDF_STATUS_SUCCESS;
}
#endif
struct stats_event * struct stats_event *
wlan_cfg80211_mc_cp_stats_get_peer_stats(struct wlan_objmgr_vdev *vdev, wlan_cfg80211_mc_cp_stats_get_peer_stats(struct wlan_objmgr_vdev *vdev,
const uint8_t *mac_addr, const uint8_t *mac_addr,
@@ -1448,6 +1482,13 @@ wlan_cfg80211_mc_cp_stats_get_peer_stats(struct wlan_objmgr_vdev *vdev,
priv = osif_request_priv(request); priv = osif_request_priv(request);
info.cookie = cookie; info.cookie = cookie;
info.u.get_station_stats_cb = get_station_adv_stats_cb; info.u.get_station_stats_cb = get_station_adv_stats_cb;
status = wlan_cfg80211_get_mlstats_vdev_params(vdev, &info);
if (QDF_IS_STATUS_ERROR(status)) {
*errno = qdf_status_to_os_return(status);
goto get_peer_stats_fail;
}
status = ucfg_mc_cp_stats_send_stats_request(vdev, TYPE_STATION_STATS, status = ucfg_mc_cp_stats_send_stats_request(vdev, TYPE_STATION_STATS,
&info); &info);
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {