Prechádzať zdrojové kódy

qcacmn: Mark SRNG initialized when mem allocation is done

Mark srng_initialized to true when the DBR ring memory
allocation is completed.

Change-Id: Iacb4d5ac884bb575ad4b98201280527521906e63
CRs-Fixed: 3355169
Jhalak Naik 2 rokov pred
rodič
commit
602db0a0df

+ 5 - 5
target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c

@@ -1684,6 +1684,8 @@ static QDF_STATUS target_if_init_dbr_ring(struct wlan_objmgr_pdev *pdev,
 		return status;
 	}
 
+	mod_param->srng_initialized = true;
+
 	/* Send CFG request command to firmware */
 	status = target_if_dbr_cfg_tgt(pdev, mod_param);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -1758,8 +1760,6 @@ QDF_STATUS target_if_direct_buf_rx_module_register(
 		if (QDF_IS_STATUS_ERROR(status))
 			direct_buf_rx_err("init dbr ring fail, srng_id %d, status %d",
 					  srng_id, status);
-		else
-			mod_param->registered = true;
 	}
 
 	return status;
@@ -2337,8 +2337,8 @@ QDF_STATUS target_if_deinit_dbr_ring(struct wlan_objmgr_pdev *pdev,
 	direct_buf_rx_debug("mod_param %pK, dbr_ring_cap %pK",
 			    mod_param, mod_param->dbr_ring_cap);
 
-	if (!mod_param->registered) {
-		direct_buf_rx_err("module(%d) srng(%d) was not registered",
+	if (!mod_param->srng_initialized) {
+		direct_buf_rx_err("module(%d) srng(%d) was not initialized",
 				  mod_id, srng_id);
 		return QDF_STATUS_SUCCESS;
 	}
@@ -2351,7 +2351,7 @@ QDF_STATUS target_if_deinit_dbr_ring(struct wlan_objmgr_pdev *pdev,
 		qdf_mem_free(mod_param->dbr_ring_cfg);
 	mod_param->dbr_ring_cfg = NULL;
 
-	mod_param->registered = false;
+	mod_param->srng_initialized = false;
 
 	return QDF_STATUS_SUCCESS;
 }

+ 2 - 2
target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h

@@ -176,7 +176,7 @@ struct direct_buf_rx_module_debug {
  * @dbr_ring_cfg: Pointer to direct buf rx ring config struct
  * @dbr_buf_pool: Pointer to direct buf rx buffer pool struct
  * @dbr_rsp_handler: Pointer to direct buf rx response handler for the module
- * @registered: Whether the module @mod_id has successfully registered for this
+ * @srng_initialized: Whether the DBR ring is successfully initialized for this
  * @pdev_id @srng_id
  */
 struct direct_buf_rx_module_param {
@@ -189,7 +189,7 @@ struct direct_buf_rx_module_param {
 	struct direct_buf_rx_buf_info *dbr_buf_pool;
 	bool (*dbr_rsp_handler)(struct wlan_objmgr_pdev *pdev,
 				struct direct_buf_rx_data *dbr_data);
-	bool registered;
+	bool srng_initialized;
 };
 
 /**