|
@@ -605,6 +605,36 @@ int hdd_qdf_trace_enable(QDF_MODULE_ID module_id, uint32_t bitmask)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * wlan_hdd_validate_context_in_loading() - check the HDD context in loading
|
|
|
+ * @hdd_ctx: HDD context pointer
|
|
|
+ *
|
|
|
+ * Return: 0 if the context is valid. Error code otherwise
|
|
|
+ */
|
|
|
+int wlan_hdd_validate_context_in_loading(hdd_context_t *hdd_ctx)
|
|
|
+{
|
|
|
+ if (NULL == hdd_ctx || NULL == hdd_ctx->config) {
|
|
|
+ hdd_info("%pS HDD context is Null", (void *)_RET_IP_);
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cds_is_driver_recovering()) {
|
|
|
+ hdd_info("%pS Recovery in Progress. State: 0x%x Ignore!!!",
|
|
|
+ (void *)_RET_IP_, cds_get_driver_state());
|
|
|
+ return -EAGAIN;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hdd_ctx->start_modules_in_progress ||
|
|
|
+ hdd_ctx->stop_modules_in_progress) {
|
|
|
+ hdd_info("%pS Start/Stop Modules in progress. Ignore!!!",
|
|
|
+ (void *)_RET_IP_);
|
|
|
+ return -EAGAIN;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* wlan_hdd_validate_context() - check the HDD context
|
|
|
* @hdd_ctx: HDD context pointer
|