qcacld-3.0: Remove legacy get tx power command

Driver has a stats infrastructure and all the stats related
commands are using this infrastructure.

Remove legacy implementation for get tx power command
as part of cleanup.

Change-Id: Iabe21f09fb6621bf81bf0b0b2864e68f78a68f2a
CRs-Fixed: 2480244
This commit is contained in:
Ashish Kumar Dhanotiya 2019-06-04 17:31:35 +05:30 • committed by nshrivas
commit 0929b96172
3 changed files with 1 additions and 122 deletions

View file

@ -2125,18 +2125,11 @@ int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
return errno;
}
#ifdef QCA_SUPPORT_CP_STATS
static void wlan_hdd_get_tx_power(struct hdd_adapter *adapter, int *dbm)
{
wlan_cfg80211_mc_cp_stats_get_tx_power(adapter->vdev, dbm);
}
#else
static void wlan_hdd_get_tx_power(struct hdd_adapter *adapter, int *dbm)
{
wlan_hdd_get_class_astats(adapter);
*dbm = adapter->hdd_stats.class_a_stat.max_pwr;
}
#endif
/**
* __wlan_hdd_cfg80211_get_txpower() - get TX power
* @wiphy: Pointer to wiphy

View file

@ -5583,109 +5583,6 @@ int wlan_hdd_get_peer_info(struct hdd_adapter *adapter,
return ret;
}
#ifndef QCA_SUPPORT_CP_STATS
struct class_a_stats {
tCsrGlobalClassAStatsInfo class_a_stats;
};
/**
* hdd_get_class_a_statistics_cb() - Get Class A stats callback function
* @stats: pointer to Class A stats
* @context: user context originally registered with SME (always the
* cookie from the request context)
*
* Return: None
*/
static void hdd_get_class_a_statistics_cb(void *stats, void *context)
{
struct osif_request *request;
struct class_a_stats *priv;
tCsrGlobalClassAStatsInfo *returned_stats;
hdd_enter();
if (!stats) {
hdd_err("Bad param, stats");
return;
}
request = osif_request_get(context);
if (!request) {
hdd_err("Obsolete request");
return;
}
returned_stats = stats;
priv = osif_request_priv(request);
priv->class_a_stats = *returned_stats;
osif_request_complete(request);
osif_request_put(request);
hdd_exit();
}
QDF_STATUS wlan_hdd_get_class_astats(struct hdd_adapter *adapter)
{
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
QDF_STATUS status;
int ret;
void *cookie;
struct osif_request *request;
struct class_a_stats *priv;
static const struct osif_request_params params = {
.priv_size = sizeof(*priv),
.timeout_ms = WLAN_WAIT_TIME_STATS,
};
if (!adapter) {
hdd_err("adapter is NULL");
return QDF_STATUS_E_FAULT;
}
if (cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
hdd_debug("Recovery in Progress. State: 0x%x Ignore!!!",
cds_get_driver_state());
return QDF_STATUS_SUCCESS;
}
request = osif_request_alloc(&params);
if (!request) {
hdd_err("Request allocation failure");
return QDF_STATUS_E_NOMEM;
}
cookie = osif_request_cookie(request);
/* query only for Class A statistics (which include link speed) */
status = sme_get_statistics(adapter->hdd_ctx->mac_handle,
eCSR_HDD, SME_GLOBAL_CLASSA_STATS,
hdd_get_class_a_statistics_cb,
sta_ctx->conn_info.sta_id[0],
cookie, adapter->vdev_id);
if (QDF_STATUS_SUCCESS != status) {
hdd_warn("Unable to retrieve Class A statistics");
goto return_cached_results;
}
/* request was sent -- wait for the response */
ret = osif_request_wait_for_response(request);
if (ret) {
hdd_warn("SME timed out while retrieving Class A statistics");
goto return_cached_results;
}
/* update the adapter with the fresh results */
priv = osif_request_priv(request);
adapter->hdd_stats.class_a_stat = priv->class_a_stats;
return_cached_results:
/*
* either we never sent a request, we sent a request and
* received a response or we sent a request and timed out.
* regardless we are done with the request.
*/
osif_request_put(request);
return QDF_STATUS_SUCCESS;
}
#endif
#ifdef QCA_SUPPORT_CP_STATS
int wlan_hdd_get_station_stats(struct hdd_adapter *adapter)
{

View file

@ -411,17 +411,6 @@ int wlan_hdd_get_link_speed(struct hdd_adapter *adapter, uint32_t *link_speed);
int wlan_hdd_get_peer_info(struct hdd_adapter *adapter,
struct qdf_mac_addr macaddress,
struct sir_peer_info_ext *peer_info_ext);
#ifndef QCA_SUPPORT_CP_STATS
/**
* wlan_hdd_get_class_astats() - Get Class A statistics
* @adapter: adapter for which statistics are desired
*
* Return: QDF_STATUS_SUCCESS if adapter's Class A statistics were updated
*/
QDF_STATUS wlan_hdd_get_class_astats(struct hdd_adapter *adapter);
#endif
/**
* wlan_hdd_get_station_stats() - Get station statistics
* @adapter: adapter for which statistics are desired