qcacmn: Process All the pdev stats events

There are 2 issues in the driver:
1. Currently host incorrectly fills the pdev id value as 0
   in stats request, If host sends the pdev id as 0 for
   stats request then FW sends the stats for all the pdevs.
2. If host requests pdev stats with pdev id as 0,
   FW can send multiple events for each pdev stats
   if one event buffer is not sufficient to fill the stats
   for all the pdevs. Curent host logic doesn't process
   multiple pdev stats events.

Address above 2 issues with below fixes:
1. Send correct pdev id to FW in the stats command.
2. Add a logic in host to process all the pdev stats events
   received as part of the pdev stats request.

Change-Id: I5b5bfcda2f30fb32749c653c6524ecbd2edc44a4
CRs-Fixed: 2503273
This commit is contained in:
Ashish Kumar Dhanotiya 2019-08-05 17:12:24 +05:30 • committed by nshrivas
commit 0cf77a56ea
3 changed files with 8 additions and 34 deletions

View file

@ -34,9 +34,6 @@
#include <wlan_cp_stats_utils_api.h>
#include <wlan_cp_stats_mc_tgt_api.h>
#include "../../../umac/cmn_services/utils/inc/wlan_utility.h"
#ifdef WLAN_POLICY_MGR_ENABLE
#include <wlan_policy_mgr_api.h>
#endif
static void target_if_cp_stats_free_stats_event(struct stats_event *ev)
{
@ -598,30 +595,6 @@ static uint32_t get_stats_id(enum stats_req_type type)
return 0;
}
#ifdef WLAN_POLICY_MGR_ENABLE
static void
target_if_cp_stats_update_pdev_id(struct stats_request_params *param,
struct wlan_objmgr_psoc *psoc,
uint32_t vdev_id)
{
uint8_t pdev_id;
QDF_STATUS status;
status = policy_mgr_get_mac_id_by_session_id(psoc, vdev_id, &pdev_id);
if (!QDF_IS_STATUS_ERROR(status))
param->pdev_id = pdev_id + 1;
cp_stats_debug("pdev id is %d", param->pdev_id);
}
#else
static void
target_if_cp_stats_update_pdev_id(struct stats_request_params *data,
struct wlan_objmgr_psoc *psoc,
uint32_t vdev_id)
{
}
#endif
/**
* target_if_cp_stats_send_stats_req() - API to send stats request to wmi
* @psoc: pointer to psoc object
@ -647,7 +620,6 @@ static QDF_STATUS target_if_cp_stats_send_stats_req(
param.stats_id = get_stats_id(type);
param.vdev_id = req->vdev_id;
param.pdev_id = req->pdev_id;
target_if_cp_stats_update_pdev_id(&param, psoc, req->vdev_id);
return wmi_unified_stats_request_send(wmi_handle, req->peer_mac_addr,
&param);

View file

@ -110,14 +110,15 @@ static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
pdev_mc_stats = pdev_cp_stats_priv->pdev_stats;
max_pwr = pdev_mc_stats->max_pwr = ev->pdev_stats[pdev_id].max_pwr;
wlan_cp_stats_pdev_obj_unlock(pdev_cp_stats_priv);
if (is_station_stats)
goto end;
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_CONNECTION_TX_POWER);
if (last_req.u.get_tx_power_cb)
last_req.u.get_tx_power_cb(max_pwr, last_req.cookie);
if (tgt_mc_cp_stats_is_last_event(ev)) {
ucfg_mc_cp_stats_reset_pending_req(psoc,
TYPE_CONNECTION_TX_POWER);
if (last_req.u.get_tx_power_cb)
last_req.u.get_tx_power_cb(max_pwr, last_req.cookie);
}
end:
if (vdev)
wlan_objmgr_vdev_release_ref(vdev, WLAN_CP_STATS_ID);

View file

@ -2040,8 +2040,9 @@ static QDF_STATUS send_stats_request_cmd_tlv(wmi_unified_t wmi_handle,
(wmi_request_stats_cmd_fixed_param));
cmd->stats_id = param->stats_id;
cmd->vdev_id = param->vdev_id;
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
cmd->pdev_id = wmi_handle->ops->convert_host_pdev_id_to_target(
param->pdev_id);
WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
WMI_LOGD("STATS REQ STATS_ID:%d VDEV_ID:%d PDEV_ID:%d-->",