Selaa lähdekoodia

qcacld-3.0: block all wmi cmds if wow enable ack failed

If wow enable failed, block all the wmi cmds until
sub system recovery.

Change-Id: I0920b0ef304719f40f5ca7e61a2beb3687e16707
CRs-Fixed: 3471908
Jingxiang Ge 2 vuotta sitten
vanhempi
sitoutus
5cfbcd0347

+ 4 - 2
components/pmo/core/src/wlan_pmo_suspend_resume.c

@@ -842,9 +842,11 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc,
 		pmo_err("Credits:%d; Pending_Cmds: %d",
 			pmo_tgt_psoc_get_host_credits(psoc),
 			pmo_tgt_psoc_get_pending_cmnds(psoc));
-		pmo_tgt_update_target_suspend_flag(psoc, false);
-		if (!psoc_ctx->wow.target_suspend.force_set)
+		if (!psoc_ctx->wow.target_suspend.force_set) {
+			pmo_tgt_psoc_set_wow_enable_ack_failed(psoc);
 			qdf_trigger_self_recovery(psoc, QDF_SUSPEND_TIMEOUT);
+		}
+		pmo_tgt_update_target_suspend_flag(psoc, false);
 		goto out;
 	}
 

+ 2 - 0
components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h

@@ -162,6 +162,7 @@ typedef int (*pmo_pld_auto_resume_cb)(void);
  * @psoc_send_idle_roam_suspend_mode: fp to send suspend mode for
  * idle roam  trigger to firmware.
  * @send_icmp_offload_req: fp to send icmp offload request
+ * @psoc_set_wow_enable_ack_failed: fp to set wow enable ack failure status
  */
 struct wlan_pmo_tx_ops {
 	QDF_STATUS (*send_arp_offload_req)(struct wlan_objmgr_vdev *vdev,
@@ -277,6 +278,7 @@ struct wlan_pmo_tx_ops {
 			struct wlan_objmgr_psoc *psoc,
 			struct pmo_icmp_offload *pmo_icmp_req);
 #endif
+	void (*psoc_set_wow_enable_ack_failed)(struct wlan_objmgr_psoc *psoc);
 };
 
 #endif /* end  of _WLAN_PMO_OBJ_MGMT_PUBLIC_STRUCT_H_ */

+ 10 - 0
components/pmo/dispatcher/inc/wlan_pmo_tgt_api.h

@@ -500,4 +500,14 @@ QDF_STATUS
 pmo_tgt_config_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
 				struct pmo_icmp_offload *pmo_icmp_req);
 #endif
+
+/**
+ * pmo_tgt_psoc_set_wow_enable_ack_failed() -set wow enable ack failure status
+ * @psoc: objmgr psoc
+ *
+ * Return: none
+ */
+QDF_STATUS
+pmo_tgt_psoc_set_wow_enable_ack_failed(struct wlan_objmgr_psoc *psoc);
+
 #endif /* end  of _WLAN_PMO_TGT_API_H_ */

+ 15 - 0
components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c

@@ -294,3 +294,18 @@ QDF_STATUS pmo_tgt_psoc_send_idle_roam_monitor(struct wlan_objmgr_psoc *psoc,
 	}
 	return pmo_tx_ops.psoc_send_idle_roam_suspend_mode(psoc, val);
 }
+
+QDF_STATUS pmo_tgt_psoc_set_wow_enable_ack_failed(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_pmo_tx_ops pmo_tx_ops;
+
+	pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
+	if (!pmo_tx_ops.psoc_set_wow_enable_ack_failed) {
+		pmo_err("pmo ops is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	pmo_tx_ops.psoc_set_wow_enable_ack_failed(psoc);
+
+	return QDF_STATUS_SUCCESS;
+}

+ 7 - 0
components/target_if/pmo/inc/target_if_pmo.h

@@ -536,4 +536,11 @@ target_if_pmo_send_icmp_offload_req(struct wlan_objmgr_psoc *psoc,
 				    struct pmo_icmp_offload *pmo_icmp_req);
 #endif
 
+/**
+ * target_if_pmo_set_wow_enable_ack_failed() - set wow enable ack failure status
+ * @psoc: objmgr psoc
+ *
+ * Return: none
+ */
+void target_if_pmo_set_wow_enable_ack_failed(struct wlan_objmgr_psoc *psoc);
 #endif

+ 4 - 0
components/target_if/pmo/src/target_if_pmo_main.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -151,5 +152,8 @@ void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
 		target_if_pmo_psoc_send_idle_monitor_cmd;
 	tgt_if_pmo_reg_pkt_filter_ops(pmo_tx_ops);
 	tgt_if_pmo_icmp_tx_ops(pmo_tx_ops);
+	pmo_tx_ops->psoc_set_wow_enable_ack_failed =
+		target_if_pmo_set_wow_enable_ack_failed;
+
 }
 

+ 15 - 1
components/target_if/pmo/src/target_if_pmo_suspend_resume.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -441,3 +441,17 @@ QDF_STATUS target_if_pmo_psoc_send_d0wow_disable_req(
 	return QDF_STATUS_E_INVAL;
 }
 #endif
+
+void target_if_pmo_set_wow_enable_ack_failed(struct wlan_objmgr_psoc *psoc)
+{
+	wmi_unified_t wmi_handle;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("Invalid wmi handle");
+		return;
+	}
+
+	return wmi_set_wow_enable_ack_failed(wmi_handle);
+}
+