|
@@ -1042,17 +1042,23 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
|
|
|
hdd_info("starting bus suspend");
|
|
|
|
|
|
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
- err = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (err) {
|
|
|
- hdd_err("Invalid hdd context: %d", err);
|
|
|
- return err;
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err_rl("hdd context is NULL");
|
|
|
+ return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ /* If Wifi is off, return success for system suspend */
|
|
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
|
hdd_debug("Driver Module closed; skipping suspend");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ err = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (err) {
|
|
|
+ hdd_err("Invalid hdd context: %d", err);
|
|
|
+ return err;
|
|
|
+ }
|
|
|
+
|
|
|
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
|
|
|
if (!hif_ctx) {
|
|
|
hdd_err("Failed to get hif context");
|
|
@@ -1167,17 +1173,24 @@ int wlan_hdd_bus_suspend_noirq(void)
|
|
|
uint32_t pending_events;
|
|
|
|
|
|
hdd_debug("start bus_suspend_noirq");
|
|
|
- errno = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (errno) {
|
|
|
- hdd_err("Invalid HDD context: errno %d", errno);
|
|
|
- return errno;
|
|
|
+
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err_rl("hdd context is NULL");
|
|
|
+ return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ /* If Wifi is off, return success for system suspend */
|
|
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
|
hdd_debug("Driver module closed; skip bus-noirq suspend");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ errno = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (errno) {
|
|
|
+ hdd_err("Invalid HDD context: errno %d", errno);
|
|
|
+ return errno;
|
|
|
+ }
|
|
|
+
|
|
|
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
|
|
|
if (!hif_ctx) {
|
|
|
hdd_err("hif_ctx is null");
|
|
@@ -1245,17 +1258,23 @@ int wlan_hdd_bus_resume(void)
|
|
|
|
|
|
hdd_info("starting bus resume");
|
|
|
|
|
|
- status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (status) {
|
|
|
- hdd_err("Invalid hdd context");
|
|
|
- return status;
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err_rl("hdd context is NULL");
|
|
|
+ return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ /* If Wifi is off, return success for system resume */
|
|
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
|
hdd_debug("Driver Module closed; return success");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (status) {
|
|
|
+ hdd_err("Invalid hdd context");
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
|
|
|
if (!hif_ctx) {
|
|
|
hdd_err("Failed to get hif context");
|
|
@@ -1335,17 +1354,23 @@ int wlan_hdd_bus_resume_noirq(void)
|
|
|
if (cds_is_driver_recovering())
|
|
|
return 0;
|
|
|
|
|
|
- status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (status) {
|
|
|
- hdd_err("Invalid HDD context: %d", status);
|
|
|
- return status;
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err_rl("hdd context is NULL");
|
|
|
+ return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ /* If Wifi is off, return success for system resume */
|
|
|
if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
|
hdd_debug("Driver Module closed return success");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ status = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (status) {
|
|
|
+ hdd_err("Invalid HDD context: %d", status);
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
|
|
|
if (!hif_ctx)
|
|
|
return -EINVAL;
|