qcacmn: Refine the Link Layer Stats Unified API

There are multiple issues with the Link Layer Stats Unified API:
- struct ll_stats_clear_params and struct ll_stats_get_params both
  incorrectly use the identifier "sta_id" to refer to a vdev_id.
- struct ll_stats_set_params has an unused "sta_id" field.
- Functions wmi_unified_process_ll_stats_clear_cmd() and
  wmi_unified_process_ll_stats_get_cmd() pass the MAC address as a
  separate parameter rather than adhering to the commonly used
  unified signature: func(handle, param).
- Not all of the functions and data structures are correctly protected
  by the WLAN_FEATURE_LINK_LAYER_STATS feature flag.

Refine the Link Layer Stats Unified API to address these issues.

This is co-dependent with Ifd7c8de2358121dae4752525ff57021a32be85d3
("qcacld-3.0: Use the refined Link Layer Stats Unified API").

Change-Id: Ifdc1fada55a559f3b3d0837ec20cceb653c45c40
CRs-Fixed: 2409293
This commit is contained in:
Jeff Johnson
2019-03-04 14:25:10 -08:00
committed by nshrivas
parent b276eea5e7
commit 012467b128
5 changed files with 81 additions and 95 deletions

View File

@@ -1292,43 +1292,32 @@ QDF_STATUS wmi_unified_nlo_mawc_cmd(void *wmi_hdl,
}
#ifdef WLAN_FEATURE_LINK_LAYER_STATS
/**
* wmi_unified_process_ll_stats_clear_cmd() - clear link layer stats
* @wmi_hdl: wmi handle
* @clear_req: ll stats clear request command params
* @addr: mac address
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(void *wmi_hdl,
const struct ll_stats_clear_params *clear_req,
uint8_t addr[IEEE80211_ADDR_LEN])
QDF_STATUS wmi_unified_process_ll_stats_clear_cmd(wmi_unified_t wmi_handle,
const struct ll_stats_clear_params *clear_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_ll_stats_clear_cmd)
return wmi_handle->ops->send_process_ll_stats_clear_cmd(wmi_handle,
clear_req, addr);
clear_req);
return QDF_STATUS_E_FAILURE;
}
/**
* wmi_unified_process_ll_stats_get_cmd() - link layer stats get request
* @wmi_hdl:wmi handle
* @get_req:ll stats get request command params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_ll_stats_get_cmd(void *wmi_hdl,
const struct ll_stats_get_params *get_req,
uint8_t addr[IEEE80211_ADDR_LEN])
QDF_STATUS wmi_unified_process_ll_stats_set_cmd(wmi_unified_t wmi_handle,
const struct ll_stats_set_params *set_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_ll_stats_set_cmd)
return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle,
set_req);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_process_ll_stats_get_cmd(wmi_unified_t wmi_handle,
const struct ll_stats_get_params *get_req)
{
if (wmi_handle->ops->send_process_ll_stats_get_cmd)
return wmi_handle->ops->send_process_ll_stats_get_cmd(wmi_handle,
get_req, addr);
get_req);
return QDF_STATUS_E_FAILURE;
}
@@ -1353,27 +1342,6 @@ QDF_STATUS wmi_unified_congestion_request_cmd(void *wmi_hdl,
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_FEATURE_LINK_LAYER_STATS
/**
* wmi_unified_process_ll_stats_set_cmd() - link layer stats set request
* @wmi_handle: wmi handle
* @set_req: ll stats set request command params
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS wmi_unified_process_ll_stats_set_cmd(void *wmi_hdl,
const struct ll_stats_set_params *set_req)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_process_ll_stats_set_cmd)
return wmi_handle->ops->send_process_ll_stats_set_cmd(wmi_handle,
set_req);
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
/**
* wmi_unified_snr_request_cmd() - send request to fw to get RSSI stats
* @wmi_handle: wmi handle