|
@@ -10236,13 +10236,19 @@ QDF_STATUS sme_ll_stats_set_thresh(mac_handle_t mac_handle,
|
|
|
#endif
|
|
|
|
|
|
#ifdef WLAN_POWER_DEBUG
|
|
|
-
|
|
|
- * sme_power_debug_stats_req() - SME API to collect Power debug stats
|
|
|
- * @callback_fn: Pointer to the callback function for Power stats event
|
|
|
- * @power_stats_context: Pointer to context
|
|
|
- *
|
|
|
- * Return: QDF_STATUS
|
|
|
- */
|
|
|
+void sme_reset_power_debug_stats_cb(mac_handle_t mac_handle)
|
|
|
+{
|
|
|
+ struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
|
|
|
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
+
|
|
|
+ status = sme_acquire_global_lock(&mac_ctx->sme);
|
|
|
+ if (QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
+ mac_ctx->sme.power_debug_stats_context = NULL;
|
|
|
+ mac_ctx->sme.power_stats_resp_callback = NULL;
|
|
|
+ sme_release_global_lock(&mac_ctx->sme);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS sme_power_debug_stats_req(
|
|
|
mac_handle_t mac_handle,
|
|
|
void (*callback_fn)(struct power_stats_response *response,
|
|
@@ -10261,6 +10267,11 @@ QDF_STATUS sme_power_debug_stats_req(
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
+ if (mac_ctx->sme.power_debug_stats_context ||
|
|
|
+ mac_ctx->sme.power_stats_resp_callback) {
|
|
|
+ sme_err("Already one power stats req in progress");
|
|
|
+ return QDF_STATUS_E_ALREADY;
|
|
|
+ }
|
|
|
mac_ctx->sme.power_debug_stats_context = power_stats_context;
|
|
|
mac_ctx->sme.power_stats_resp_callback = callback_fn;
|
|
|
msg.bodyptr = NULL;
|