瀏覽代碼

qcacld-3.0: Fix arp offload not sent when suspend

When host resume, check arp offload status wrongly, so arp offload
disable cmd isn't sent to F/W. when next suspend comes, arp offload
enable cmd isn't sent too.

Change-Id: I06ea617df49287ee87e7b5bf8b20971b581dedf1
CRs-Fixed: 3106172
Jianmin Zhu 3 年之前
父節點
當前提交
d79afa8020
共有 2 個文件被更改,包括 37 次插入8 次删除
  1. 18 5
      components/pmo/core/src/wlan_pmo_arp.c
  2. 19 3
      components/pmo/core/src/wlan_pmo_ns.c

+ 18 - 5
components/pmo/core/src/wlan_pmo_arp.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 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
@@ -232,13 +233,13 @@ QDF_STATUS pmo_core_arp_check_offload(struct wlan_objmgr_psoc *psoc,
 
 	vdev_ctx = pmo_vdev_get_priv(vdev);
 	psoc_ctx = vdev_ctx->pmo_psoc_ctx;
+	active_offload_cond = psoc_ctx->psoc_cfg.active_mode_offload;
 
-	if (trigger == pmo_apps_suspend || trigger == pmo_apps_resume) {
-		active_offload_cond = psoc_ctx->psoc_cfg.active_mode_offload;
-
+	if (trigger == pmo_apps_suspend) {
 		qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
-		is_applied_cond = vdev_ctx->vdev_arp_req.enable &&
-				  vdev_ctx->vdev_arp_req.is_offload_applied;
+		is_applied_cond =
+			vdev_ctx->vdev_arp_req.enable == PMO_OFFLOAD_ENABLE &&
+			vdev_ctx->vdev_arp_req.is_offload_applied;
 		qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
 
 		if (active_offload_cond && is_applied_cond) {
@@ -246,6 +247,18 @@ QDF_STATUS pmo_core_arp_check_offload(struct wlan_objmgr_psoc *psoc,
 			wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
 			return QDF_STATUS_E_INVAL;
 		}
+	} else if (trigger == pmo_apps_resume) {
+		qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
+		is_applied_cond =
+			vdev_ctx->vdev_arp_req.enable == PMO_OFFLOAD_DISABLE &&
+			!vdev_ctx->vdev_arp_req.is_offload_applied;
+		qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
+
+		if (active_offload_cond && is_applied_cond) {
+			pmo_debug("active offload is enabled and offload already disabled");
+			wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
+			return QDF_STATUS_E_INVAL;
+		}
 	}
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
 out:

+ 19 - 3
components/pmo/core/src/wlan_pmo_ns.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 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
@@ -276,12 +277,13 @@ QDF_STATUS pmo_core_ns_check_offload(struct wlan_objmgr_psoc *psoc,
 	vdev_ctx = pmo_vdev_get_priv(vdev);
 	psoc_ctx = vdev_ctx->pmo_psoc_ctx;
 
-	if (trigger == pmo_apps_suspend || trigger == pmo_apps_resume) {
+	if (trigger == pmo_apps_suspend) {
 		active_offload_cond = psoc_ctx->psoc_cfg.active_mode_offload;
 
 		qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
-		is_applied_cond = vdev_ctx->vdev_ns_req.enable &&
-			       vdev_ctx->vdev_ns_req.is_offload_applied;
+		is_applied_cond =
+			vdev_ctx->vdev_ns_req.enable == PMO_OFFLOAD_ENABLE &&
+			vdev_ctx->vdev_ns_req.is_offload_applied;
 		qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
 
 		if (active_offload_cond && is_applied_cond) {
@@ -289,6 +291,20 @@ QDF_STATUS pmo_core_ns_check_offload(struct wlan_objmgr_psoc *psoc,
 			wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
 			return QDF_STATUS_E_INVAL;
 		}
+	} else if (trigger == pmo_apps_resume) {
+		active_offload_cond = psoc_ctx->psoc_cfg.active_mode_offload;
+
+		qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
+		is_applied_cond =
+			vdev_ctx->vdev_ns_req.enable == PMO_OFFLOAD_DISABLE &&
+			!vdev_ctx->vdev_ns_req.is_offload_applied;
+		qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
+
+		if (active_offload_cond && is_applied_cond) {
+			pmo_debug("active offload is enabled and offload already disabled");
+			wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
+			return QDF_STATUS_E_INVAL;
+		}
 	}
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_PMO_ID);
 out: