Просмотр исходного кода

qcacld-3.0: Add vdev check for ARP/NS offload in NaN mode

ARP/NS offload cannot be executed in NaN mode, but currently there is no
check on vdev for opmode so it is still trying to execute. Add an if
check for opmode of vdev and return QDF_STATUS_E_INVAL if in NaN mode.

Change-Id: I89accfef625c2a1eae944662acdff5d3fdd6ea9d
CRs-Fixed: 2630329
Alan Chen 5 лет назад
Родитель
Сommit
01c969852b
2 измененных файлов с 17 добавлено и 1 удалено
  1. 8 0
      components/pmo/core/src/wlan_pmo_arp.c
  2. 9 1
      components/pmo/core/src/wlan_pmo_ns.c

+ 8 - 0
components/pmo/core/src/wlan_pmo_arp.c

@@ -213,6 +213,7 @@ QDF_STATUS pmo_core_arp_check_offload(struct wlan_objmgr_psoc *psoc,
 	struct pmo_vdev_priv_obj *vdev_ctx;
 	struct wlan_objmgr_vdev *vdev;
 	bool active_offload_cond, is_applied_cond;
+	enum QDF_OPMODE opmode;
 
 	vdev = pmo_psoc_get_vdev(psoc, vdev_id);
 	if (!vdev) {
@@ -225,6 +226,13 @@ QDF_STATUS pmo_core_arp_check_offload(struct wlan_objmgr_psoc *psoc,
 	if (QDF_IS_STATUS_ERROR(status))
 		goto out;
 
+	opmode = pmo_get_vdev_opmode(vdev);
+	if (opmode == QDF_NDI_MODE) {
+		pmo_debug("ARP offload is not supported in NaN mode");
+		pmo_vdev_put_ref(vdev);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	vdev_ctx = pmo_vdev_get_priv(vdev);
 	psoc_ctx = vdev_ctx->pmo_psoc_ctx;
 

+ 9 - 1
components/pmo/core/src/wlan_pmo_ns.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. 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
@@ -257,6 +257,7 @@ QDF_STATUS pmo_core_ns_check_offload(struct wlan_objmgr_psoc *psoc,
 	struct pmo_vdev_priv_obj *vdev_ctx;
 	struct wlan_objmgr_vdev *vdev;
 	bool active_offload_cond, is_applied_cond;
+	enum QDF_OPMODE opmode;
 
 	pmo_enter();
 
@@ -271,6 +272,13 @@ QDF_STATUS pmo_core_ns_check_offload(struct wlan_objmgr_psoc *psoc,
 	if (QDF_IS_STATUS_ERROR(status))
 		goto out;
 
+	opmode = pmo_get_vdev_opmode(vdev);
+	if (opmode == QDF_NDI_MODE) {
+		pmo_debug("NS offload not supported in NaN mode");
+		pmo_vdev_put_ref(vdev);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	vdev_ctx = pmo_vdev_get_priv(vdev);
 	psoc_ctx = vdev_ctx->pmo_psoc_ctx;