qcacld-3.0: Cache and tx power as part of cp station stats

In the driver, if CLUB_LL_STATS_AND_GET_STATION feature is
enabled, host requests Link Layer stats and station stats
from firmware periodically using a single WMI command.

Host then sends LL_STATS to userspace and caches station stats
in the adapter. Whenever userspace queries station stats, based
on the sta_stats_cached_timestamp, host returns cached stats
from adapter instead of sending a new WMI request.

The current issue, as part of station stats firmware also sends
connection_tx_power stats, which aren't cached into the adapter.
So, whenever userspace queries get_tx_power via nl commands,
host sends a WMI request to firmware for tx_power leading to
platform wakeups and power impacts.

To resolve this issue, cache the tx_power sent by firmware into
the adapter during station stats and return the cached value to
the user space.

Change-Id: Iaefc5629872431cbc6c24090b1edb6cebdad995a
CRs-Fixed: 3439323
Esse commit está contido em:
Aditya Kodukula
2023-03-23 13:48:07 -07:00
commit de Madan Koyyalamudi
commit 3336cc1673
4 arquivos alterados com 99 adições e 10 exclusões

Ver arquivo

@@ -1100,6 +1100,58 @@ tgt_send_peer_mc_cp_stats(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS
tgt_send_pdev_mc_cp_stats(struct wlan_objmgr_psoc *psoc,
struct stats_event *ev,
struct request_info *last_req)
{
struct wlan_objmgr_pdev *pdev;
struct wlan_objmgr_vdev *vdev = NULL;
struct pdev_mc_cp_stats *pdev_mc_stats;
struct pdev_cp_stats *pdev_cp_stats_priv;
int pdev_id;
if (!ev || !last_req)
return QDF_STATUS_E_NULL_VALUE;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, last_req->vdev_id,
WLAN_CP_STATS_ID);
if (!vdev) {
cp_stats_err("vdev is null");
return QDF_STATUS_E_NULL_VALUE;
}
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev) {
cp_stats_err("pdev is null");
goto end;
}
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
if (pdev_id != last_req->pdev_id) {
cp_stats_err("pdev_id: %d invalid", pdev_id);
goto end;
}
pdev_cp_stats_priv = wlan_cp_stats_get_pdev_stats_obj(pdev);
if (!pdev_cp_stats_priv) {
cp_stats_err("pdev_cp_stats_priv is null");
goto end;
}
wlan_cp_stats_pdev_obj_lock(pdev_cp_stats_priv);
pdev_mc_stats = pdev_cp_stats_priv->pdev_stats;
ev->pdev_stats->max_pwr = pdev_mc_stats->max_pwr;
wlan_cp_stats_pdev_obj_unlock(pdev_cp_stats_priv);
wlan_objmgr_vdev_release_ref(vdev, WLAN_CP_STATS_ID);
return QDF_STATUS_SUCCESS;
end:
wlan_objmgr_vdev_release_ref(vdev, WLAN_CP_STATS_ID);
return QDF_STATUS_E_NULL_VALUE;
}
static void
tgt_mc_cp_stats_send_raw_station_stats(struct wlan_objmgr_psoc *psoc,
struct request_info *last_req)
@@ -1138,6 +1190,17 @@ tgt_mc_cp_stats_send_raw_station_stats(struct wlan_objmgr_psoc *psoc,
cp_stats_err("tgt_send_peer_mc_cp_stats failed");
goto end;
}
info.num_pdev_stats = 1;
info.pdev_stats = qdf_mem_malloc(sizeof(*info.pdev_stats));
if (!info.pdev_stats)
goto end;
status = tgt_send_pdev_mc_cp_stats(psoc, &info, last_req);
if (QDF_IS_STATUS_ERROR(status)) {
cp_stats_err("tgt_send_pdev_mc_cp_stats failed");
goto end;
}
end:
get_station_stats_cb(&info, last_req->cookie);