Browse Source

qcacmn: Allow peer create only when VDEV is in UP state

Replace the state check logic with the existing implementation
that is used to check if VDEV can allow peer create.

Change-Id: I7141ef4ace73e3aacee27e423b42c6c59c509b13
CRs-Fixed: 3075987
Santosh Anbu 3 years ago
parent
commit
cd43975f65
1 changed files with 5 additions and 4 deletions
  1. 5 4
      umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c

+ 5 - 4
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c

@@ -1,5 +1,6 @@
 /*
 /*
  * Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  * purpose with or without fee is hereby granted, provided that the above
@@ -238,10 +239,10 @@ QDF_STATUS wlan_vdev_is_peer_create_allowed(struct wlan_objmgr_vdev *vdev)
 
 
 	state = wlan_vdev_mlme_get_state(vdev);
 	state = wlan_vdev_mlme_get_state(vdev);
 	substate = wlan_vdev_mlme_get_substate(vdev);
 	substate = wlan_vdev_mlme_get_substate(vdev);
-	if (!((state == WLAN_VDEV_S_INIT) ||
-	     (state == WLAN_VDEV_S_STOP) ||
-	     ((state == WLAN_VDEV_S_SUSPEND) &&
-	      (substate == WLAN_VDEV_SS_SUSPEND_SUSPEND_DOWN))))
+	if ((state == WLAN_VDEV_S_UP) ||
+	    ((state == WLAN_VDEV_S_SUSPEND) &&
+	     (substate == WLAN_VDEV_SS_SUSPEND_CSA_RESTART)) ||
+	    (state == WLAN_VDEV_S_DFS_CAC_WAIT))
 		return QDF_STATUS_SUCCESS;
 		return QDF_STATUS_SUCCESS;
 
 
 	return QDF_STATUS_E_FAILURE;
 	return QDF_STATUS_E_FAILURE;