|
@@ -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(¶ms);
|
|
|
- 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)
|
|
|
{
|