mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacld-3.0: Add support to request for hardware stats
As part of the vendor extended stats, add API to request Rx hardware stats for a given vdev id. Change-Id: I46d73de21724c4c5ebf4a78075b7b2c1d02fe92a CRs-Fixed: 2605729
This commit is contained in:
parent
06e6767f2b
commit
de8bea9272
5 changed files with 102 additions and 19 deletions
1
Kbuild
1
Kbuild
|
|
@ -2857,6 +2857,7 @@ cppflags-$(CONFIG_LITHIUM) += -DSERIALIZE_QUEUE_SETUP
|
|||
cppflags-$(CONFIG_LITHIUM) += -DDP_RX_PKT_NO_PEER_DELIVER
|
||||
cppflags-$(CONFIG_LITHIUM) += -DFEATURE_ALIGN_STATS_FROM_DP
|
||||
cppflags-$(CONFIG_LITHIUM) += -DDROP_RXDMA_DECRYPT_ERR
|
||||
cppflags-$(CONFIG_LITHIUM) += -DFEATURE_STATS_EXT_V2
|
||||
cppflags-$(CONFIG_VERBOSE_DEBUG) += -DENABLE_VERBOSE_DEBUG
|
||||
cppflags-$(CONFIG_RX_DESC_DEBUG_CHECK) += -DRX_DESC_DEBUG_CHECK
|
||||
cppflags-$(CONFIG_REGISTER_OP_DEBUG) += -DHAL_REGISTER_WRITE_DEBUG
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "wlan_mlme_ucfg_api.h"
|
||||
#include "wlan_mlme_ucfg_api.h"
|
||||
#include "wlan_hdd_sta_info.h"
|
||||
#include "cdp_txrx_misc.h"
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && !defined(WITH_BACKPORTS)
|
||||
#define HDD_INFO_SIGNAL STATION_INFO_SIGNAL
|
||||
|
|
@ -2892,6 +2893,7 @@ static int __wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
|
|||
int ret_val;
|
||||
QDF_STATUS status;
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
|
||||
hdd_enter_dev(dev);
|
||||
|
||||
|
|
@ -2907,10 +2909,19 @@ static int __wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
|
|||
stats_ext_req.request_data_len = data_len;
|
||||
stats_ext_req.request_data = (void *)data;
|
||||
|
||||
status = cdp_request_rx_hw_stats(soc, adapter->vdev_id);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
hdd_err_rl("Failed to get hw stats: %u", status);
|
||||
ret_val = -EINVAL;
|
||||
}
|
||||
|
||||
status = sme_stats_ext_request(adapter->vdev_id, &stats_ext_req);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status)
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
hdd_err_rl("Failed to get fw stats: %u", status);
|
||||
ret_val = -EINVAL;
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1205,6 +1205,14 @@ int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data,
|
|||
*/
|
||||
|
||||
#ifdef WLAN_FEATURE_STATS_EXT
|
||||
/**
|
||||
* wma_stats_ext_event_handler() - extended stats event handler
|
||||
* @handle: wma handle
|
||||
* @event_buf: event buffer received from fw
|
||||
* @len: length of data
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
||||
uint32_t len);
|
||||
#endif
|
||||
|
|
@ -1457,6 +1465,13 @@ QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
|
|||
pDelPeriodicTxPtrnParams);
|
||||
|
||||
#ifdef WLAN_FEATURE_STATS_EXT
|
||||
/**
|
||||
* wma_stats_ext_req() - request ext stats from fw
|
||||
* @wma_ptr: wma handle
|
||||
* @preq: stats ext params
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -3388,13 +3388,6 @@ QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
|
|||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_STATS_EXT
|
||||
/**
|
||||
* wma_stats_ext_req() - request ext stats from fw
|
||||
* @wma_ptr: wma handle
|
||||
* @preq: stats ext params
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq)
|
||||
{
|
||||
tp_wma_handle wma = (tp_wma_handle) wma_ptr;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
#include "host_diag_core_log.h"
|
||||
#include <wlan_mlme_api.h>
|
||||
#include <../../core/src/vdev_mgr_ops.h>
|
||||
#include "cdp_txrx_misc.h"
|
||||
|
||||
/* MCS Based rate table */
|
||||
/* HT MCS parameters with Nss = 1 */
|
||||
|
|
@ -658,14 +659,76 @@ int wma_smps_mode_to_force_mode_param(uint8_t smps_mode)
|
|||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_STATS_EXT
|
||||
/**
|
||||
* wma_stats_ext_event_handler() - extended stats event handler
|
||||
* @handle: wma handle
|
||||
* @event_buf: event buffer received from fw
|
||||
* @len: length of data
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
#ifdef FEATURE_STATS_EXT_V2
|
||||
int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
WMI_STATS_EXT_EVENTID_param_tlvs *param_buf;
|
||||
tSirStatsExtEvent *stats_ext_event;
|
||||
wmi_stats_ext_event_fixed_param *stats_ext_info;
|
||||
QDF_STATUS status;
|
||||
struct scheduler_msg cds_msg = {0};
|
||||
uint8_t *buf_ptr;
|
||||
uint32_t alloc_len;
|
||||
struct cdp_txrx_ext_stats ext_stats = {0};
|
||||
struct cdp_soc_t *soc_hdl = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
|
||||
wma_debug("%s: Posting stats ext event to SME", __func__);
|
||||
|
||||
param_buf = (WMI_STATS_EXT_EVENTID_param_tlvs *)event_buf;
|
||||
if (!param_buf) {
|
||||
wma_err("%s: Invalid stats ext event buf", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
stats_ext_info = param_buf->fixed_param;
|
||||
buf_ptr = (uint8_t *)stats_ext_info;
|
||||
|
||||
alloc_len = sizeof(tSirStatsExtEvent);
|
||||
alloc_len += stats_ext_info->data_len;
|
||||
alloc_len += sizeof(struct cdp_txrx_ext_stats);
|
||||
|
||||
if (stats_ext_info->data_len > (WMI_SVC_MSG_MAX_SIZE -
|
||||
WMI_TLV_HDR_SIZE - sizeof(*stats_ext_info)) ||
|
||||
stats_ext_info->data_len > param_buf->num_data) {
|
||||
wma_err("Excess data_len:%d, num_data:%d",
|
||||
stats_ext_info->data_len, param_buf->num_data);
|
||||
return -EINVAL;
|
||||
}
|
||||
stats_ext_event = qdf_mem_malloc(alloc_len);
|
||||
if (!stats_ext_event)
|
||||
return -ENOMEM;
|
||||
|
||||
buf_ptr += sizeof(wmi_stats_ext_event_fixed_param) + WMI_TLV_HDR_SIZE;
|
||||
|
||||
stats_ext_event->vdev_id = stats_ext_info->vdev_id;
|
||||
stats_ext_event->event_data_len = stats_ext_info->data_len;
|
||||
qdf_mem_copy(stats_ext_event->event_data,
|
||||
buf_ptr, stats_ext_event->event_data_len);
|
||||
|
||||
cdp_txrx_ext_stats_request(soc_hdl, OL_TXRX_PDEV_ID, &ext_stats);
|
||||
qdf_mem_copy(stats_ext_event->event_data +
|
||||
stats_ext_event->event_data_len,
|
||||
&ext_stats, sizeof(struct cdp_txrx_ext_stats));
|
||||
|
||||
stats_ext_event->event_data_len += sizeof(struct cdp_txrx_ext_stats);
|
||||
|
||||
cds_msg.type = eWNI_SME_STATS_EXT_EVENT;
|
||||
cds_msg.bodyptr = (void *)stats_ext_event;
|
||||
cds_msg.bodyval = 0;
|
||||
|
||||
status = scheduler_post_message(QDF_MODULE_ID_WMA,
|
||||
QDF_MODULE_ID_SME,
|
||||
QDF_MODULE_ID_SME, &cds_msg);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
qdf_mem_free(stats_ext_event);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
wma_debug("%s: stats ext event Posted to SME", __func__);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
||||
uint32_t len)
|
||||
{
|
||||
|
|
@ -679,14 +742,14 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
|||
|
||||
WMA_LOGD("%s: Posting stats ext event to SME", __func__);
|
||||
|
||||
param_buf = (WMI_STATS_EXT_EVENTID_param_tlvs *) event_buf;
|
||||
param_buf = (WMI_STATS_EXT_EVENTID_param_tlvs *)event_buf;
|
||||
if (!param_buf) {
|
||||
WMA_LOGE("%s: Invalid stats ext event buf", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
stats_ext_info = param_buf->fixed_param;
|
||||
buf_ptr = (uint8_t *) stats_ext_info;
|
||||
buf_ptr = (uint8_t *)stats_ext_info;
|
||||
|
||||
alloc_len = sizeof(tSirStatsExtEvent);
|
||||
alloc_len += stats_ext_info->data_len;
|
||||
|
|
@ -724,9 +787,9 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf,
|
|||
WMA_LOGD("%s: stats ext event Posted to SME", __func__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* WLAN_FEATURE_STATS_EXT */
|
||||
|
||||
|
||||
/**
|
||||
* wma_profile_data_report_event_handler() - fw profiling handler
|
||||
* @handle: wma handle
|
||||
|
|
|
|||
Loading…
Reference in a new issue