Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75cc5139 authored by Jianmin Zhu's avatar Jianmin Zhu Committed by Madan Koyyalamudi
Browse files

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
parent 11854614
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2020 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
@@ -230,12 +231,12 @@ 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;

	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 &&
		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);

@@ -244,6 +245,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
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2020 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
@@ -270,11 +271,12 @@ 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 &&
		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);

@@ -283,6 +285,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: