qcacld-3.0: Get tx power value from each mac

When user space use "iw dev" to get tx power info,
driver send WMI_REQUEST_STATS_CMDID to fw,
fw update tx power info with two events, usually we
parse the last event, and maybe get invalid value.
Filter invalid value for each event, and get valid
tx power value from the mac which the AP/STA mode work.

Change-Id: I2411bb87e03fe385759852b028819e19a055b7f3
CRs-Fixed: 3474361
This commit is contained in:
chunquan luo
2023-04-16 19:36:48 -07:00
committed by Madan Koyyalamudi
parent 8d82bbedc1
commit 57696567aa
5 changed files with 53 additions and 1 deletions

View File

@@ -755,6 +755,7 @@ struct peer_stats_info_ext_event {
* @tx_rate_flags: tx rate flags, (enum tx_rate_info)
* @last_event: The LSB indicates if the event is the last event or not and the
* MSB indicates if this feature is supported by FW or not.
* @mac_seq_num: sequence number of event when fw update to host
* @num_peer_stats_info_ext: number of peer extended stats info
* @peer_stats_info_ext: peer extended stats info
* @bcn_protect_stats: pmf bcn protect stats
@@ -785,6 +786,7 @@ struct stats_event {
uint32_t rx_rate;
enum tx_rate_info tx_rate_flags;
uint32_t last_event;
uint8_t mac_seq_num;
uint32_t num_peer_stats_info_ext;
struct peer_stats_info_ext_event *peer_stats_info_ext;
struct pmf_bcn_protect_stats bcn_protect_stats;

View File

@@ -34,6 +34,7 @@
#include "../../core/src/wlan_cp_stats_defs.h"
#include "../../core/src/wlan_cp_stats_obj_mgr_handler.h"
#include "son_api.h"
#include "wlan_policy_mgr_api.h"
static bool tgt_mc_cp_stats_is_last_event(struct stats_event *ev,
enum stats_req_type stats_type)
@@ -176,7 +177,8 @@ static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
if (is_station_stats)
goto end;
if (tgt_mc_cp_stats_is_last_event(ev, TYPE_CONNECTION_TX_POWER)) {
if (policy_mgr_mode_get_macid_by_vdev_id(psoc, last_req.vdev_id) ==
ev->mac_seq_num) {
ucfg_mc_cp_stats_reset_pending_req(psoc,
TYPE_CONNECTION_TX_POWER,
&last_req,
@@ -184,6 +186,7 @@ static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
if (last_req.u.get_tx_power_cb && pending)
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);