qcacld-3.0: Add support to get last available vdev info

FW sends vdev stats on vdev down, current host
implementation does not process this event as host is
only processing the stats events for which stats are
requested.
On vdev down FW sends the last available vdev stats and
based on that host updates it's RSSI on disconnect.
With CP stats infrastructure host is not processing
this event and is not updating rssi on disconnect.

To resolve this issue, add support to get last available
vdev stats from cp stats component with the help of a
callback registration.

Change-Id: If0741281140509624f6fdda4a270d99e2f58b61a
CRs-Fixed: 2493965
This commit is contained in:
Ashish Kumar Dhanotiya 2019-07-23 20:58:11 +05:30 committed by nshrivas
parent b0f0364ca5
commit 017e502efa
3 changed files with 65 additions and 0 deletions

View File

@ -12646,6 +12646,9 @@ int hdd_register_cb(struct hdd_context *hdd_ctx)
status = sme_set_lost_link_info_cb(mac_handle,
hdd_lost_link_info_cb);
wlan_hdd_register_cp_stats_cb(hdd_ctx);
/* print error and not block the startup process */
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("set lost link info callback failed");

View File

@ -37,6 +37,7 @@
#include "wlan_hdd_debugfs_llstat.h"
#include "wlan_reg_services_api.h"
#include <wlan_cfg80211_mc_cp_stats.h>
#include "wlan_cp_stats_mc_ucfg_api.h"
#include "wlan_mlme_ucfg_api.h"
#include "wlan_mlme_ucfg_api.h"
@ -5793,3 +5794,54 @@ void wlan_hdd_display_txrx_stats(struct hdd_context *ctx)
qdf_atomic_read(&ctx->disable_rx_ol_in_low_tput));
}
}
/**
* hdd_lost_link_cp_stats_info_cb() - callback function to get lost
* link information
* @stats_ev: Stats event pointer
* FW sends vdev stats on vdev down, this callback is registered
* with cp_stats component to get the last available vdev stats
* From the FW.
*
* Return: None
*/
static void hdd_lost_link_cp_stats_info_cb(void *stats_ev)
{
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
struct hdd_adapter *adapter;
struct stats_event *ev = stats_ev;
uint8_t i;
struct hdd_station_ctx *sta_ctx;
if (wlan_hdd_validate_context(hdd_ctx))
return;
for (i = 0; i < ev->num_summary_stats; i++) {
adapter = hdd_get_adapter_by_vdev(
hdd_ctx,
ev->vdev_summary_stats[i].vdev_id);
if (!adapter) {
hdd_debug("invalid adapter");
continue;
}
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if ((sta_ctx) &&
(eConnectionState_Associated !=
sta_ctx->conn_info.conn_state)) {
adapter->rssi_on_disconnect =
ev->vdev_summary_stats[i].stats.rssi;
hdd_debug("rssi on disconnect %d for " QDF_MAC_ADDR_STR,
adapter->rssi_on_disconnect,
QDF_MAC_ADDR_ARRAY(adapter->mac_addr.bytes));
}
}
}
void wlan_hdd_register_cp_stats_cb(struct hdd_context *hdd_ctx)
{
ucfg_mc_cp_stats_register_lost_link_info_cb(
hdd_ctx->psoc,
hdd_lost_link_cp_stats_info_cb);
}

View File

@ -461,4 +461,14 @@ bool hdd_report_max_rate(mac_handle_t mac_handle,
uint8_t mcs_index,
uint16_t fw_rate, uint8_t nss);
/**
* wlan_hdd_register_cp_stats_cb() - Register hdd stats specific
* callbacks to the cp stats component
* @hdd_ctx: hdd context
*
* Return: none
*/
void wlan_hdd_register_cp_stats_cb(struct hdd_context *hdd_ctx);
#endif /* end #if !defined(WLAN_HDD_STATS_H) */