Browse Source

qcacld-3.0: Register hif shutdown notifier for qca6750

For qca6750, register hif shutdown notifier to update the
firmware recovery state in case of SSR

Change-Id: Ie6d6e9c909df292c62f89612c08b583321703cfc
CRs-Fixed: 2688921
Alok Kumar 5 years ago
parent
commit
bdad41a539
1 changed files with 24 additions and 2 deletions
  1. 24 2
      core/hdd/src/wlan_hdd_driver_ops.c

+ 24 - 2
core/hdd/src/wlan_hdd_driver_ops.c

@@ -198,6 +198,20 @@ static void hdd_hif_set_attribute(struct hif_opaque_softc *hif_ctx)
 {}
 #endif
 
+/**
+ * hdd_hif_register_shutdown_notifier() - Register HIF shutdown notifier
+ * @hif_ctx: HIF Context
+ *
+ * Return: success/failure
+ */
+static QDF_STATUS
+hdd_hif_register_shutdown_notifier(struct hif_opaque_softc *hif_ctx)
+{
+	return cds_shutdown_notifier_register(
+					hif_shutdown_notifier_cb,
+					hif_ctx);
+}
+
 /**
  * hdd_init_cds_hif_context() - API to set CDS HIF Context
  * @hif: HIF Context
@@ -290,6 +304,12 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
 		goto err_hif_close;
 	}
 
+	status = hdd_hif_register_shutdown_notifier(hif_ctx);
+	if (status != QDF_STATUS_SUCCESS) {
+		hdd_err("Shutdown notifier register failed: %d", status);
+		goto err_deinit_hif_context;
+	}
+
 	hdd_hif_set_attribute(hif_ctx);
 
 	status = hif_enable(hif_ctx, dev, bdev, bid, bus_type,
@@ -300,7 +320,7 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
 			status, reinit);
 
 		ret = qdf_status_to_os_return(status);
-		goto err_hif_close;
+		goto err_deinit_hif_context;
 	} else {
 		cds_set_target_ready(true);
 		ret = hdd_napi_create();
@@ -330,8 +350,10 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
 mark_target_not_ready:
 	cds_set_target_ready(false);
 
-err_hif_close:
+err_deinit_hif_context:
 	hdd_deinit_cds_hif_context();
+
+err_hif_close:
 	hif_close(hif_ctx);
 	return ret;
 }