Browse Source

qcacld-3.0: Validate context for qdf transition check

cds_is_module_state_transitioning() is effectively a partial
re-implementation of wlan_hdd_validate_context(). Instead of having
multiple copies of this logic, register a new callback in QDF which
simply calls wlan_hdd_validate_context() instead.

Change-Id: If533d72725b4cc9dbe5e4b9c25e499657c8e1376
CRs-Fixed: 2308771
Dustin Brown 6 years ago
parent
commit
94ce20f5a4
3 changed files with 6 additions and 21 deletions
  1. 0 19
      core/cds/inc/cds_api.h
  2. 0 2
      core/cds/src/cds_api.c
  3. 6 0
      core/hdd/src/wlan_hdd_main.c

+ 0 - 19
core/cds/inc/cds_api.h

@@ -207,25 +207,6 @@ static inline bool cds_is_module_stop_in_progress(void)
 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_MODULE_STOPPING);
 }
 
-/**
- * cds_is_module_state_transitioning() - Is module state transitioning
- *
- * Return: true if module stop is in progress.
- */
-static inline int cds_is_module_state_transitioning(void)
-{
-	if (cds_is_load_or_unload_in_progress() || cds_is_driver_recovering() ||
-		cds_is_module_stop_in_progress()) {
-		pr_info("%s: Load/Unload %d or recovery %d or module_stop %d is in progress",
-			__func__, cds_is_load_or_unload_in_progress(),
-				cds_is_driver_recovering(),
-				cds_is_module_stop_in_progress());
-		return true;
-	} else {
-		return false;
-	}
-}
-
 /**
  * cds_is_fw_down() - Is FW down or not
  *

+ 0 - 2
core/cds/src/cds_api.c

@@ -190,8 +190,6 @@ QDF_STATUS cds_init(void)
 	qdf_register_fw_down_callback(cds_is_fw_down);
 	qdf_register_ssr_protect_callbacks(cds_ssr_protect,
 					   cds_ssr_unprotect);
-	qdf_register_module_state_query_callback(
-				cds_is_module_state_transitioning);
 
 	gp_cds_context = &g_cds_context;
 

+ 6 - 0
core/hdd/src/wlan_hdd_main.c

@@ -12356,6 +12356,11 @@ static void hdd_qdf_print_deinit(void)
 	qdf_print_ctrl_cleanup(qdf_print_idx);
 }
 
+static inline int hdd_state_query_cb(void)
+{
+	return !!wlan_hdd_validate_context(cds_get_context(QDF_MODULE_ID_HDD));
+}
+
 /**
  * hdd_init() - Initialize Driver
  *
@@ -12376,6 +12381,7 @@ int hdd_init(void)
 		ret = -ENOMEM;
 		goto err_out;
 	}
+	qdf_register_module_state_query_callback(hdd_state_query_cb);
 
 	wlan_init_bug_report_lock();